This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push:
new bdde3ae9a RATIS-2236 Fixed bug where manual triggerSnapshot would
never finish (#1207)
bdde3ae9a is described below
commit bdde3ae9a20c0546f0ca268e5e9d94efd8f784a5
Author: Potato <[email protected]>
AuthorDate: Thu Jan 9 01:17:10 2025 +0800
RATIS-2236 Fixed bug where manual triggerSnapshot would never finish (#1207)
---
.../main/java/org/apache/ratis/server/impl/StateMachineUpdater.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/ratis-server/src/main/java/org/apache/ratis/server/impl/StateMachineUpdater.java
b/ratis-server/src/main/java/org/apache/ratis/server/impl/StateMachineUpdater.java
index f13ee0d6d..64fabfa2b 100644
---
a/ratis-server/src/main/java/org/apache/ratis/server/impl/StateMachineUpdater.java
+++
b/ratis-server/src/main/java/org/apache/ratis/server/impl/StateMachineUpdater.java
@@ -216,6 +216,9 @@ class StateMachineUpdater implements Runnable {
// 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;
}