fanhualta commented on a change in pull request #3191:
URL: https://github.com/apache/iotdb/pull/3191#discussion_r640814498
##########
File path:
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
##########
@@ -919,10 +948,18 @@ protected boolean waitUntilCatchUp(CheckConsistency
checkConsistency)
* @param leaderCommitId leader commit id
* @return true if leaderCommitId <= localAppliedId
*/
- private boolean syncLocalApply(long leaderCommitId) {
+ public boolean syncLocalApply(long leaderCommitId) {
long startTime = System.currentTimeMillis();
long waitedTime = 0;
long localAppliedId = 0;
+
+ // If the leader and follower logs differ too much, local query is not
allowed
+ if (leaderCommitId - logManager.getMaxHaveAppliedCommitIndex() > 1000) {
+ logger.info(
+ "{}: The raft log of this member is too backward to provide service
directly.", name);
+ return false;
+ }
Review comment:
fixed
--
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]