You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/08/28 01:27:26 UTC

[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request #1635: [Distributed] Emend the async applier

jt2594838 commented on a change in pull request #1635:
URL: https://github.com/apache/incubator-iotdb/pull/1635#discussion_r478780874



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/log/manage/FilePartitionedSnapshotLogManager.java
##########
@@ -47,22 +52,47 @@
       .getLogger(FilePartitionedSnapshotLogManager.class);
 
   public FilePartitionedSnapshotLogManager(LogApplier logApplier, PartitionTable partitionTable,
-      Node header, Node thisNode) {
-    super(logApplier, partitionTable, header, thisNode, FileSnapshot::new);
+      Node header, Node thisNode, DataGroupMember dataGroupMember) {
+    super(logApplier, partitionTable, header, thisNode, FileSnapshot::new, dataGroupMember);
+  }
+
+  /**
+   * send FlushPlan to all nodes in one dataGroup
+   */
+  public void syncFlushAllProcessor() {
+    logger.info("{}: Start flush all storage group processor in one data group", getName());
+    ConcurrentHashMap<String, StorageGroupProcessor> processorMap = StorageEngine.getInstance()
+        .getProcessorMap();
+    if (processorMap.size() == 0) {
+      logger.info("{}: no need to flush processor", getName());
+      return;
+    }
+    List<Path> storageGroups = new ArrayList<>();
+    for (Map.Entry<String, StorageGroupProcessor> entry : processorMap.entrySet()) {
+      Path path = new Path(entry.getKey());
+      storageGroups.add(path);
+    }
+    FlushPlan plan = new FlushPlan(null, true, storageGroups);
+    dataGroupMember.flushFileWhenDoSnapshot(plan);

Review comment:
       I am afraid that we cannot flush the whole storage group when time partitioning is enabled. Because in that case, a storage group will be managed by several data groups, if you flush one storage group without notifying other data groups, the file integrity of other data groups will be broken.
   So you should either flush other related groups (which is rather hard to find), or only flush partitions that belong to the data group.




----------------------------------------------------------------
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:
users@infra.apache.org