diff --git a/src/traft/failover.rs b/src/traft/failover.rs index 2d76a3835f54bbd9fb1bb319ab502a26765d433f..dc88821bf39dbcaef4b663be1a895ec868ea8391 100644 --- a/src/traft/failover.rs +++ b/src/traft/failover.rs @@ -77,8 +77,8 @@ fn raft_set_active(req: SetActiveRequest) -> Result<SetActiveResponse, Box<dyn s })); } - let peer = node.handle_topology_request(req.into())?; - Ok(SetActiveResponse { peer }) + node.handle_topology_request(req.into())?; + Ok(SetActiveResponse {}) } pub fn voters_needed(voters: usize, total: usize) -> i64 { diff --git a/src/traft/mod.rs b/src/traft/mod.rs index ded5a0d517c71c1fdbb8e894f72d6ba33c04dd73..8a34cf42961a55faa8ba130f1d967439cd2d58ad 100644 --- a/src/traft/mod.rs +++ b/src/traft/mod.rs @@ -490,7 +490,7 @@ impl SetActiveRequest { /// Response to a [`SetActiveRequest`] #[derive(Clone, Debug, Serialize, Deserialize)] pub struct SetActiveResponse { - pub peer: Peer, + // It's empty now, but it may be extended in future } impl AsTuple for SetActiveResponse {} diff --git a/test/int/test_couple.py b/test/int/test_couple.py index 27d757b02c3d1f6af2a32da95ea7fb1b9513a8ce..402facc7522fe6a044cbc25203d95c807124bc5b 100644 --- a/test/int/test_couple.py +++ b/test/int/test_couple.py @@ -169,14 +169,13 @@ def test_deactivation(cluster2: Cluster): host: Instance, target: Instance, is_active: bool ) -> list[bool]: kind = "Online" if is_active else "Offline" - resps = host.call( + return host.call( ".raft_set_active", kind, target.instance_id, target.cluster_id ) - return [resp["peer"]["health"] == "Online" for resp in resps] # check idempotency - assert raft_set_active(i2, target=i1, is_active=False) == [False] - assert raft_set_active(i2, target=i1, is_active=False) == [False] + assert raft_set_active(i2, target=i1, is_active=False) == [{}] + assert raft_set_active(i2, target=i1, is_active=False) == [{}] - assert raft_set_active(i2, target=i2, is_active=True) == [True] - assert raft_set_active(i2, target=i2, is_active=True) == [True] + assert raft_set_active(i2, target=i2, is_active=True) == [{}] + assert raft_set_active(i2, target=i2, is_active=True) == [{}]