From ec15dcdeb35bd48602f6a902247d947020f7bb35 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 (cherry picked from commit 404c7a2fb0a0781b421b77e41d19f1308587ee12) --- 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 1a098638b04ce..b95e656528602 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 6235a51880ea4344d938730539dd63380c091c6e 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. (cherry picked from commit d0a562be9d4341bcb100a070efa4ef890c16cdf7) --- 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 9adfb2722b5e5..32eea4283dd6d 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) {