diff --git a/curp/src/client_new/tests.rs b/curp/src/client_new/tests.rs index 8b4a003ab..0a65ea2d3 100644 --- a/curp/src/client_new/tests.rs +++ b/curp/src/client_new/tests.rs @@ -130,8 +130,8 @@ async fn test_unary_fetch_clusters_linearizable() { cluster_version: 1, }, 2 => FetchClusterResponse { - leader_id: None, // imagine this node is a disconnected candidate - term: 23, // with a high term + leader_id: None, + term: 23, // abnormal term cluster_id: 123, members: vec![], cluster_version: 1, diff --git a/curp/src/client_new/unary.rs b/curp/src/client_new/unary.rs index a434a3156..3e85c32e6 100644 --- a/curp/src/client_new/unary.rs +++ b/curp/src/client_new/unary.rs @@ -238,9 +238,9 @@ impl Unary { if !Self::check_and_update_leader(&mut state, res.leader_id, res.term) { return Ok(()); } - if state.cluster_version >= res.cluster_version { + if state.cluster_version == res.cluster_version { debug!( - "ignore old cluster version({}) from server", + "ignore cluster version({}) from server", res.cluster_version ); return Ok(()); @@ -644,7 +644,6 @@ impl ClientApi for Unary { } }; // Ignore the response of a node that doesn't know who the leader is. - // some disconnected candidates may continue to increase term, disrupting the process below. if inner.leader_id.is_some() { #[allow(clippy::integer_arithmetic)] match max_term.cmp(&inner.term) { diff --git a/xlineapi/proto b/xlineapi/proto index 2331b11cf..e8696c7c5 160000 --- a/xlineapi/proto +++ b/xlineapi/proto @@ -1 +1 @@ -Subproject commit 2331b11cf35d9528fad3e3d9abe4837d93cd04cc +Subproject commit e8696c7c53b44e7096f621d48b607d40d7a8bed3