From eb7b62a6a0e933e2a93072e60939ece30cc5603b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Sun, 29 Oct 2023 22:50:08 +0800 Subject: [PATCH] Doc: add FAQ: can not survive incorrectly configured cluster - Related issue: #918 --- openraft/src/docs/faq/faq.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/openraft/src/docs/faq/faq.md b/openraft/src/docs/faq/faq.md index ee62e2297..7ad1d5089 100644 --- a/openraft/src/docs/faq/faq.md +++ b/openraft/src/docs/faq/faq.md @@ -17,7 +17,7 @@

-- **🤔 Can I wipe out the data of **one** node and wait for the leader to replicate all data to it again**? +- **🤔 Can I wipe out the data of ONE node and wait for the leader to replicate all data to it again**? 💡 Avoid doing this. Doing so will panic the leader. But it is permitted if [`loosen-follower-log-revert`] feature flag is enabled. @@ -49,4 +49,28 @@

+- **🤔 Is Openraft resilient to incorrectly configured clusters?** + + 💡 No, Openraft, like standard raft, cannot identify errors in cluster configuration. + + A common error is the assigning a wrong network addresses to a node. In such + a scenario, if this node becomes the leader, it will attempt to replicate + logs to itself. This will cause Openraft to panic because replication + messages can only be received by a follower. + + ```text + thread 'main' panicked at openraft/src/engine/engine_impl.rs:793:9: + assertion failed: self.internal_server_state.is_following() + ``` + + ```ignore + // openraft/src/engine/engine_impl.rs:793 + pub(crate) fn following_handler(&mut self) -> FollowingHandler { + debug_assert!(self.internal_server_state.is_following()); + // ... + } + ``` + +

+ [`loosen-follower-log-revert`]: `crate::docs::feature_flags#loosen_follower_log_revert`