diff --git a/src/v/cluster/tests/serialization_rt_test.cc b/src/v/cluster/tests/serialization_rt_test.cc index 1af76e6a755d..99d34637f639 100644 --- a/src/v/cluster/tests/serialization_rt_test.cc +++ b/src/v/cluster/tests/serialization_rt_test.cc @@ -2078,6 +2078,16 @@ SEASTAR_THREAD_TEST_CASE(serde_reflection_roundtrip) { }; roundtrip_test(data); } + { + raft::vote_reply data{ + .target_node_id = raft:: + vnode{tests::random_named_int(), tests::random_named_int()}, + .term = tests::random_named_int(), + .granted = tests::random_bool(), + .log_ok = tests::random_bool(), + }; + roundtrip_test(data); + } } SEASTAR_THREAD_TEST_CASE(cluster_property_kv_exchangable_with_pair) { diff --git a/src/v/raft/types.h b/src/v/raft/types.h index bbe125858bc2..a017935fbb3d 100644 --- a/src/v/raft/types.h +++ b/src/v/raft/types.h @@ -310,7 +310,7 @@ struct vote_request : serde::envelope> { } }; -struct vote_reply { +struct vote_reply : serde::envelope> { // node id to validate on receiver vnode target_node_id; /// \brief callee's term, for the caller to upate itself @@ -325,6 +325,12 @@ struct vote_reply { bool log_ok = false; friend std::ostream& operator<<(std::ostream& o, const vote_reply& r); + + friend bool operator==(const vote_reply&, const vote_reply&) = default; + + auto serde_fields() { + return std::tie(target_node_id, term, granted, log_ok); + } }; /// This structure is used by consensus to notify other systems about group