Description
GrpcLogAppender call `resetClient` when error accors in appending entries.
In `resetClient`, the new next index `nextIndex` may be match index + 1 when `request` is null.
This will make `getFollower().decreaseNextIndex(nextIndex);` have chance to decrease next index to the value of match index, which is against that Next index should be larger than match index.
// GrpcLogAppender.java:resetClient() line 134 final long nextIndex = 1 + Optional.ofNullable(request) .map(AppendEntriesRequest::getPreviousLog) .map(TermIndex::getIndex) .orElseGet(f::getMatchIndex); if (onError && request == null) { LOG.warn("{}: Follower failed and request == null, " + " keep nextIndex ({}) unchanged and retry.", this, f.getNextIndex()); return; } if (request != null && request.isHeartbeat()) { return; } // new next index will be min(old-1, nextIndex) getFollower().decreaseNextIndex(nextIndex);
Attachments
Attachments
Issue Links
- links to