SincereXIA commented on a change in pull request #616:
URL: https://github.com/apache/ratis/pull/616#discussion_r819381124
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
##########
@@ -371,21 +372,32 @@ private void flushIfNecessary() throws IOException {
if (stateMachineDataPolicy.isSync()) {
stateMachineDataPolicy.getFromFuture(f, () -> this +
"-flushStateMachineData");
}
- final Timer.Context logSyncTimerContext = raftLogSyncTimer.time();
flushBatchSize = (int)(lastWrittenIndex - flushIndex.get());
- out.flush();
- logSyncTimerContext.stop();
+ if (flushExecutorWorkQueue.isEmpty()) {
Review comment:
I think adding another flush work isn't necessary if there are already
flush tasks in the queue that haven't been executed yet.
--
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]