This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 20bf8290e6 [IOTDB-3807] fix the value of  safelyDeletedIndex when 
single replica. (#6651)
20bf8290e6 is described below

commit 20bf8290e68ad7cb0cd2a44250f3cb2aa6ea28ac
Author: ZhangHongYin <[email protected]>
AuthorDate: Tue Jul 19 14:37:18 2022 +0800

    [IOTDB-3807] fix the value of  safelyDeletedIndex when single replica. 
(#6651)
---
 .../org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
index 76023e6814..2c21beba3e 100644
--- 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
+++ 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
@@ -84,6 +84,10 @@ public class MultiLeaderServerImpl {
     ConsensusReqReader reader =
         (ConsensusReqReader) stateMachine.read(new 
GetConsensusReqReaderPlan());
     long currentSearchIndex = reader.getCurrentSearchIndex();
+    if (1 == configuration.size()) {
+      // only one configuration means single replica.
+      reader.setSafelyDeletedSearchIndex(Long.MAX_VALUE);
+    }
     this.index = new AtomicLong(currentSearchIndex);
   }
 

Reply via email to