neuyilan commented on a change in pull request #1827:
URL: https://github.com/apache/iotdb/pull/1827#discussion_r505994733



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/log/LogDispatcher.java
##########
@@ -244,25 +244,20 @@ private void appendEntriesAsync(List<ByteBuffer> logList, 
AppendEntriesRequest r
     private void appendEntriesSync(List<ByteBuffer> logList, 
AppendEntriesRequest request,
         List<SendLogRequest> currBatch) {
 
-      long start;
-      if (Timer.ENABLE_INSTRUMENTING) {
-        start = System.nanoTime();
-      }
+      Timer.Statistic.RAFT_SENDER_WAIT_FOR_PREV_LOG.setStartTime();
       if (!member.waitForPrevLog(peer, currBatch.get(0).getLog())) {
         logger.warn("{}: node {} timed out when appending {}", 
member.getName(), receiver,
             currBatch.get(0).getLog());
         return;
       }
-      Timer.Statistic.RAFT_SENDER_WAIT_FOR_PREV_LOG.addNanoFromStart(start);
+      Timer.Statistic.RAFT_SENDER_WAIT_FOR_PREV_LOG.calCostTime();

Review comment:
       you're right, its indeed cause concurrent problem, I'll fix it. thanks!




----------------------------------------------------------------
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:
[email protected]


Reply via email to