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


##########
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 now calls writeUnlock() instead of writeLock again in 
removeAll, which previously leaked the write lock on every call.



##########
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 is null when info logging is disabled; all uses in this method are 
guarded. Please verify every overload of filterNullValueAndMeasurement changed 
in this PR uses the same pattern.



##########
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 caches merged deletion ranges per device via 
putIfAbsent, avoiding repeated sortAndMerge in isDeviceTimeDeleted. If this 
handle can be used from multiple threads, document single-thread use or use a 
concurrent map.



-- 
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