luoluoyuyu commented on code in PR #17664:
URL: https://github.com/apache/iotdb/pull/17664#discussion_r3309342167


##########
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java:
##########
@@ -1865,18 +1817,22 @@ private void 
filterNullValueAndMeasurementWithStringType(
    */
   private boolean filterNullValueAndMeasurementWithStringType(
       List<String> valuesList, String deviceId, List<String> measurementsList) 
{
-    Map<String, Object> nullMap = new HashMap<>();
+    Map<String, Object> nullMap = logger.isInfoEnabled() ? new HashMap<>() : 
null;

Review Comment:
   nullMap 在 info 关闭时为 null,循环内与 L1831/L1835 的 guard 正确。
   
   请确认本 PR 修改的所有 overload(diff 中另一处 filterNullValueAndMeasurement)同样完整 
guard,避免遗漏路径在 logger.isInfoEnabled()==false 时 NPE。



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileManager.java:
##########
@@ -223,10 +216,18 @@ public void removeAll(List<TsFileResource> 
tsFileResourceList, boolean sequence)
     writeLock("removeAll");
     try {
       for (TsFileResource resource : tsFileResourceList) {
-        remove(resource, sequence);
+        removeFromPartitionFileList(resource, sequence);
       }
     } finally {
-      writeLock("removeAll");
+      writeUnlock();

Review Comment:
   Critical fix:原 finally 中误调 writeLock("removeAll") 导致写锁泄漏。改为 writeUnlock() 正确。
   
   建议单独 commit/PR 先行合入,便于 bisect。



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/read/filescan/impl/ClosedFileScanHandleImpl.java:
##########
@@ -87,10 +90,24 @@ public boolean isDeviceTimeDeleted(IDeviceID deviceID, long 
timestamp)
         curFileModEntries != null
             ? curFileModEntries
             : queryContext.loadAllModificationsFromDisk(tsFileResource);
-    List<ModEntry> modifications = 
queryContext.getPathModifications(curFileModEntries, deviceID);
-    List<TimeRange> timeRangeList =
-        
modifications.stream().map(ModEntry::getTimeRange).collect(Collectors.toList());
-    return ModificationUtils.isPointDeletedWithoutOrderedRange(timestamp, 
timeRangeList);
+    List<TimeRange> timeRangeList = deviceToDeletionRanges.get(deviceID);

Review Comment:
   deviceToDeletionRanges + putIfAbsent 缓存 device 级 deletion ranges,避免 
isDeviceTimeDeleted 重复 sortAndMerge。
   
   若 scan handle 多线程访问,HashMap 需 thread-safe 或注明单线程约束。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to