From 1191bec8196b12ba76937505fbdda09dde3a3cd0 Mon Sep 17 00:00:00 2001 From: Muhamad Awad Date: Wed, 20 Nov 2024 14:51:26 +0100 Subject: [PATCH] Follow Up: Stale Metadata #2325 --- .../admin/src/cluster_controller/cluster_state_refresher.rs | 2 +- crates/admin/src/cluster_controller/observed_cluster_state.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/admin/src/cluster_controller/cluster_state_refresher.rs b/crates/admin/src/cluster_controller/cluster_state_refresher.rs index 792cf602b..05b8f0557 100644 --- a/crates/admin/src/cluster_controller/cluster_state_refresher.rs +++ b/crates/admin/src/cluster_controller/cluster_state_refresher.rs @@ -201,7 +201,7 @@ impl ClusterStateRefresher { // todo: implement a more robust failure detector // This is a naive mechanism for failure detection and is just a stop-gap measure. // A single connection error or timeout will cause a node to be marked as dead. - trace!("Node {node_id} is marked dead {node_id}: {err}"); + trace!("Node {node_id} is marked dead: {err}"); let last_seen_alive = last_state.nodes.get(&node_id.as_plain()).and_then( |state| match state { NodeState::Alive(AliveNode { diff --git a/crates/admin/src/cluster_controller/observed_cluster_state.rs b/crates/admin/src/cluster_controller/observed_cluster_state.rs index 260b9f569..05104b1b3 100644 --- a/crates/admin/src/cluster_controller/observed_cluster_state.rs +++ b/crates/admin/src/cluster_controller/observed_cluster_state.rs @@ -44,6 +44,10 @@ impl ObservedClusterState { self.update_partitions(cluster_state); } + /// Update observed cluster state with given [`ClusterState`] + /// Nodes in [`NodeState::Suspect`] state are treated as [`NodeState::Alive`]. + /// This means that their `last know` state will not be cleared up yet + /// until they are marked as dead by the [`ClusterState`]. fn update_nodes(&mut self, cluster_state: &ClusterState) { for (node_id, node_state) in &cluster_state.nodes { match node_state {