You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by sz...@apache.org on 2025/01/09 20:21:27 UTC
(ratis) 26/26: RATIS-2236 Fixed bug where manual triggerSnapshot would never finish (#1207)
This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch release-3.1.3_review
in repository https://gitbox.apache.org/repos/asf/ratis.git
commit dd8486aafafc80846ce68a92dca16b52fa162659
Author: Potato <ta...@apache.org>
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 c1db1fd3c..a919ca732 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;
}