You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openraft/src/docs/faq/faq.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,23 @@ See: [`leader-id`](`crate::docs::data::leader_id`) for details.
86
86
Excessive error logging, like `ERROR openraft::replication: 248: RPCError err=NetworkError: ...`, occurs when a follower node becomes unresponsive. To alleviate this, implement a mechanism within [`RaftNetwork`][] that returns a [`Unreachable`][] error instead of a [`NetworkError`][] when immediate replication retries to the affected node are not advised.
87
87
88
88
89
+
## Node management
90
+
91
+
92
+
### How to customize snapshot building policy?
93
+
94
+
OpenRaft provides a default snapshot building policy that triggers snapshots
95
+
when the log count exceeds a threshold. Configure this via [`Config::snapshot_policy`]
96
+
set to [`SnapshotPolicy::LogsSinceLast(n)`][`SnapshotPolicy::LogsSinceLast`].
97
+
98
+
To customize snapshot behavior:
99
+
100
+
-**Disable automatic snapshots**: Set [`Config::snapshot_policy`] to [`SnapshotPolicy::Never`]
101
+
-**Manual snapshot triggers**: Use [`Raft::trigger().snapshot()`][`Trigger::snapshot`] to build snapshots on demand
102
+
103
+
This allows full control over when snapshots are created based on your application's specific requirements.
104
+
105
+
89
106
## Cluster management
90
107
91
108
@@ -305,6 +322,10 @@ OpenRaft intentionally supports this behavior because:
0 commit comments