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 2022/06/20 04:01:57 UTC

[GitHub] [iotdb] OneSizeFitsQuorum commented on a diff in pull request #6336: [IOTDB-3513] Avoid double-writing of the write ahead log for data under RatisConsensus

OneSizeFitsQuorum commented on code in PR #6336:
URL: https://github.com/apache/iotdb/pull/6336#discussion_r901235129


##########
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java:
##########
@@ -304,8 +304,17 @@ public DataRegion(
     } else {
       lastFlushTimeManager = new LastFlushTimeManager();
     }
-    // recover tsfiles
-    recover();
+
+    // recover tsfiles unless consensus protocol is ratis and storage engine is not ready
+    if (config.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.RatisConsensus)

Review Comment:
   same



##########
server/src/main/java/org/apache/iotdb/db/service/DataNode.java:
##########
@@ -281,6 +281,11 @@ private void setUp() throws StartupException, QueryProcessException {
     registerManager.register(CacheHitRatioMonitor.getInstance());
     registerManager.register(CompactionTaskManager.getInstance());
     JMXService.registerMBean(getInstance(), mbeanName);
+
+    // close wal when using ratis consensus
+    if (!config.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.RatisConsensus)) {

Review Comment:
   ?



##########
server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java:
##########
@@ -223,10 +224,12 @@ public void recover() {
     asyncRecover(recoveryThreadPool, futures);
 
     // wait until wal is recovered
-    try {
-      WALRecoverManager.getInstance().recover();
-    } catch (WALException e) {
-      logger.error("Fail to recover wal.", e);
+    if (!config.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.RatisConsensus)) {

Review Comment:
   Will this special judgment affect the standalone version? We also have an iOTDB.isClusterMode () to distinguish between standalone and cluster



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org