From bcc566ed997f12ff598fa130056453df714c6d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Wed, 24 Jul 2024 22:18:17 +0800 Subject: [PATCH] Doc: "learners" in the `change_membership()` doc shoudl be "nodes", which represent both voters and learners --- openraft/src/raft/impl_raft_blocking_write.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openraft/src/raft/impl_raft_blocking_write.rs b/openraft/src/raft/impl_raft_blocking_write.rs index a24b524b4..845cb1e09 100644 --- a/openraft/src/raft/impl_raft_blocking_write.rs +++ b/openraft/src/raft/impl_raft_blocking_write.rs @@ -36,13 +36,14 @@ where C: RaftTypeConfig> /// Existing learners will not be affected. /// /// Example of `retain` usage: - /// If the original membership is `{"voter":{1,2,3}, "learners":{1,2,3,4,5}}`, - /// and call `change_membership` with `voters={2,3,4}`, then: + /// If the original membership is `{"voter":{1,2,3}, "nodes":{1,2,3,4,5}}`, where `nodes` + /// includes node information of both voters and learners. In this case, `4,5` are learners. + /// Call `change_membership` with `voters={2,3,4}`, then: /// - If `retain` is `true`, the committed new membership is - /// `{"voters":{2,3,4}, "learners":{1,2,3,4,5}}`. + /// `{"voters":{2,3,4}, "nodes":{1,2,3,4,5}}`, node `1` is turned into a learner. /// - Otherwise if `retain` is `false`, then the new membership is `{"voters":{2,3,4}, - /// "learners":{2,3,4,5}}`, in which the removed voters `1` are removed from the cluster. - /// `5` is not affected. + /// "nodes":{2,3,4,5}}`, in which the removed voters `1` are removed from the cluster. `5` + /// is not affected. /// /// If it loses leadership or crashed before committing the second **uniform** config log, the /// cluster is left in the **joint** config.