SilverNarcissus commented on a change in pull request #2405:
URL: https://github.com/apache/iotdb/pull/2405#discussion_r557182351



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
##########
@@ -513,31 +613,37 @@ public void closeStorageGroupProcessor(PartialPath 
storageGroupPath, long partit
       boolean isSeq,
       boolean isSync)
       throws StorageGroupNotSetException {
-    StorageGroupProcessor processor = processorMap.get(storageGroupPath);
-    if (processor == null) {
-      throw new StorageGroupNotSetException(storageGroupPath.getFullPath(), 
true);
-    }
-
-    logger.info("async closing sg processor is called for closing {}, seq = 
{}, partitionId = {}",
-        storageGroupPath, isSeq, partitionId);
-    processor.writeLock();
-    // to avoid concurrent modification problem, we need a new array list
-    List<TsFileProcessor> processors = isSeq ?
-        new ArrayList<>(processor.getWorkSequenceTsFileProcessors()) :
-        new ArrayList<>(processor.getWorkUnsequenceTsFileProcessors());
-    try {
-      for (TsFileProcessor tsfileProcessor : processors) {
-        if (tsfileProcessor.getTimeRangeId() == partitionId) {
-          if (isSync) {
-            processor.syncCloseOneTsFileProcessor(isSeq, tsfileProcessor);
-          } else {
-            processor.asyncCloseOneTsFileProcessor(isSeq, tsfileProcessor);
+    if (!processorMap.containsKey(storageGroupPath)) {
+      throw new StorageGroupNotSetException(storageGroupPath.getFullPath());
+    }
+
+    VirtualStorageGroupManager virtualStorageGroupManager = 
processorMap.get(storageGroupPath);
+    for (StorageGroupProcessor processor : virtualStorageGroupManager
+        .getAllVirutalStorageGroupProcessor()) {
+      if (processor != null) {
+        logger
+            .info("async closing sg processor is called for closing {}, seq = 
{}, partitionId = {}",
+                storageGroupPath, isSeq, partitionId);

Review comment:
       fixed~




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

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


Reply via email to