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

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


The following commit(s) were added to refs/heads/ml_0808_test_exp1_parallel by 
this push:
     new 3466fb0985 fix the bug that the response cannot be returned for async 
rpc
3466fb0985 is described below

commit 3466fb09853ccde0d6daf371854567d6ce819ac0
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Mon Aug 8 17:04:38 2022 +0800

    fix the bug that the response cannot be returned for async rpc
---
 .../consensus/multileader/service/MultiLeaderRPCServiceProcessor.java   | 2 ++
 .../apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java  | 1 +
 2 files changed, 3 insertions(+)

diff --git 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
index 2e00442e37..86b926ab4f 100644
--- 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
+++ 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
@@ -100,6 +100,8 @@ public class MultiLeaderRPCServiceProcessor implements 
MultiLeaderConsensusIServ
                           currentSearchIndex, consensusRequests)));
         }
       }
+      logger.debug("Execute TSyncLogReq for {} with result {}", 
req.consensusGroupId, statuses);
+      resultHandler.onComplete(new TSyncLogRes(statuses));
     } catch (Exception e) {
       resultHandler.onError(e);
     } finally {
diff --git 
a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
 
b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
index 8380cf50c3..c26c711cb0 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
@@ -149,6 +149,7 @@ public class DataRegionStateMachine extends 
BaseStateMachine {
       StepTracker.trace("cacheAndQueueRequest", cacheRequestStartTime, 
System.nanoTime());
       logger.info("queue size {}, syncIndex = {}", requestCache.size(), 
insertNode.getSyncIndex());
       TSStatus tsStatus = write(insertNode);
+      // TODO: think about notifying until processing the last request in this 
batch
       requestCache.notifyAll();
       return tsStatus;
     }

Reply via email to