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 szetszwo committed Jan 9, 2025
1 parent a6da706 commit dd8486a
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 dd8486a

Please sign in to comment.