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

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


The following commit(s) were added to refs/heads/ml_0729_test_exp1 by this push:
     new bb3c4d8acd change log postition
bb3c4d8acd is described below

commit bb3c4d8acd398b92506a3a8b357f4626e968264f
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Mon Aug 1 20:35:04 2022 +0800

    change log postition
---
 .../db/consensus/statemachine/DataRegionStateMachine.java | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

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 ca9628b28c..819fcf2422 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
@@ -120,16 +120,11 @@ public class DataRegionStateMachine extends 
BaseStateMachine {
       List<InsertNode> insertNodes,
       AsyncMethodCallback<TSyncLogRes> resultHandler) {
     synchronized (requestCache) {
-      long startTime = System.nanoTime();
-      try {
-        requestCache.add(new InsertNodeWrapper(syncIndex, insertNodes, 
resultHandler));
-        if (requestCache.size() == MAX_REQUEST_CACHE_SIZE) {
-          return requestCache.poll();
-        }
-        return null;
-      } finally {
-        StepTracker.trace("cacheAndGet", startTime, System.nanoTime());
+      requestCache.add(new InsertNodeWrapper(syncIndex, insertNodes, 
resultHandler));
+      if (requestCache.size() == MAX_REQUEST_CACHE_SIZE) {
+        return requestCache.poll();
       }
+      return null;
     }
   }
 
@@ -181,9 +176,11 @@ public class DataRegionStateMachine extends 
BaseStateMachine {
         }
         
insertNodesInAllRequests.add(mergeInsertNodes(insertNodesInOneRequest));
       }
+      long startTime = System.nanoTime();
       InsertNodeWrapper insertNodeWrapper =
           cacheAndGetLatestInsertNode(
               requests.get(0).getSyncIndex(), insertNodesInAllRequests, 
resultHandler);
+      StepTracker.trace("cacheAndGet", startTime, System.nanoTime());
       if (insertNodeWrapper != null) {
         for (InsertNode insertNode : insertNodeWrapper.getInsertNodes()) {
           statuses.add(write(insertNode));

Reply via email to