Skip to content

Commit ac5c6e8

Browse files
OneSizeFitsQuorumSzyWilliam
authored andcommitted
RATIS-2236 Fixed bug where manual triggerSnapshot would never finish (#1207)
1 parent 722bb3a commit ac5c6e8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ratis-server/src/main/java/org/apache/ratis/server/impl/StateMachineUpdater.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ private void waitForCommit() throws InterruptedException {
216216
// Thus it is possible to have applied > committed initially.
217217
final long applied = getLastAppliedIndex();
218218
for(; applied >= raftLog.getLastCommittedIndex() && state == State.RUNNING && !shouldStop(); ) {
219+
if (server.getSnapshotRequestHandler().shouldTriggerTakingSnapshot()) {
220+
takeSnapshot();
221+
}
219222
if (awaitForSignal.await(100, TimeUnit.MILLISECONDS)) {
220223
return;
221224
}

0 commit comments

Comments
 (0)