szetszwo commented on code in PR #973:
URL: https://github.com/apache/ratis/pull/973#discussion_r1409838512
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -356,6 +357,7 @@ boolean isApplied(LogEntryProto logEntry) {
private final PendingStepDown pendingStepDown;
private final ReadIndexHeartbeats readIndexHeartbeats;
+ private final ConcurrentLinkedQueue<CompletableFuture<Long>>
pendingReadIndexRequests;
Review Comment:
We may reuse `startupLogEntry`.
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -424,6 +427,7 @@ void checkReady(LogEntryProto entry) {
Preconditions.assertTrue(startupLogEntry.isInitialized());
if (entry.getTerm() == getCurrentTerm() &&
startupLogEntry.get().isApplied(entry)) {
server.getStateMachine().leaderEvent().notifyLeaderReady();
+ releasePendingRequests(entry.getIndex(), null);
Review Comment:
`startupLogEntry.get().isApplied(..)` above will take care this.
--
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]