From 404c7a2fb0a0781b421b77e41d19f1308587ee12 Mon Sep 17 00:00:00 2001 From: Bharath Vissapragada Date: Mon, 2 Dec 2024 16:21:45 -0800 Subject: [PATCH 1/2] raft/recovery: log line with more context --- src/v/raft/recovery_stm.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v/raft/recovery_stm.cc b/src/v/raft/recovery_stm.cc index 692c661c693ef..4efe0e54c878c 100644 --- a/src/v/raft/recovery_stm.cc +++ b/src/v/raft/recovery_stm.cc @@ -48,8 +48,9 @@ recovery_stm::recovery_stm( , _ctxlog( raftlog, ssx::sformat( - "[follower: {}] [group_id:{}, {}]", + "[follower: {}, term: {}] [group_id:{}, {}]", _node_id, + _term, _ptr->group(), _ptr->ntp())) , _memory_quota(quota) {} From d0a562be9d4341bcb100a070efa4ef890c16cdf7 Mon Sep 17 00:00:00 2001 From: Bharath Vissapragada Date: Tue, 3 Dec 2024 14:18:56 -0800 Subject: [PATCH 2/2] raft/c: notify waiters on follower state reset This typically happens when there is a stepdown and the downstream consumers like recovery need to know about it. --- src/v/raft/types.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/v/raft/types.cc b/src/v/raft/types.cc index 3ec57a6bd5766..e5c675e01b9e6 100644 --- a/src/v/raft/types.cc +++ b/src/v/raft/types.cc @@ -142,6 +142,7 @@ void follower_index_metadata::reset() { last_successful_received_seq = follower_req_seq{0}; inflight_append_request_count = 0; last_sent_protocol_meta.reset(); + follower_state_change.broadcast(); } std::ostream& operator<<(std::ostream& o, const vnode& id) {