HxpSerein commented on code in PR #13995:
URL: https://github.com/apache/iotdb/pull/13995#discussion_r1832576915


##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java:
##########
@@ -844,8 +844,7 @@ public long getSearchIndex() {
   }
 
   public long getSyncLag() {
-    long minSyncIndex = getMinSyncIndex();
-    return getSearchIndex() - minSyncIndex;
+    return getSearchIndex() - getMinFlushedSyncIndex();

Review Comment:
   It is recommended to use a local variable as before. Because the two get 
operation is not an atomic operation, subtracting the two function may result 
in a negative number.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to