Skip to content

Commit

Permalink
RATIS-2236 Fixed bug where manual triggerSnapshot would never finish (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
OneSizeFitsQuorum authored and SzyWilliam committed Jan 9, 2025
1 parent 1e37121 commit f3353f6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ private void waitForCommit() throws InterruptedException {
// Thus it is possible to have applied > committed initially.
final long applied = getLastAppliedIndex();
for(; applied >= raftLog.getLastCommittedIndex() && state == State.RUNNING && !shouldStop(); ) {
if (server.getSnapshotRequestHandler().shouldTriggerTakingSnapshot()) {
takeSnapshot();
}
if (awaitForSignal.await(100, TimeUnit.MILLISECONDS)) {
return;
}
Expand Down

0 comments on commit f3353f6

Please sign in to comment.