From b835a4ae2cc4c682809decb773743db9496c2ba7 Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Tue, 5 Nov 2024 17:40:10 -0800 Subject: [PATCH] add tracing for marking members confirmed Signed-off-by: Matt Wrock --- components/butterfly/src/member.rs | 8 ++++++-- components/butterfly/src/server/expire.rs | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/butterfly/src/member.rs b/components/butterfly/src/member.rs index 260c68cd1e8..56b9a48b2ac 100644 --- a/components/butterfly/src/member.rs +++ b/components/butterfly/src/member.rs @@ -513,12 +513,13 @@ impl MemberList { incoming: Membership, ignore_incarnation_and_health: bool) -> bool { + let member_id = incoming.member.id.clone(); // Is this clone necessary, or can a key be a reference to a field contained in the value? // Maybe the members we store should not contain the ID to reduce the duplication? trace!("insert_membership_mlw: Member: {}, Health: {}", - incoming.member.id, + member_id, incoming.health); - let modified = match self.write_entries().entry(incoming.member.id.clone()) { + let modified = match self.write_entries().entry(member_id.clone()) { hash_map::Entry::Occupied(mut entry) => { let val = entry.get_mut(); if incoming.newer_or_less_healthy_than(val.member.incarnation, val.health) @@ -551,6 +552,9 @@ impl MemberList { }; if modified { + if incoming.health == Health::Confirmed { + trace!("inserting confirmed member: {}", member_id); + } self.increment_update_counter(); self.calculate_peer_health_metrics_mlr(); } diff --git a/components/butterfly/src/server/expire.rs b/components/butterfly/src/server/expire.rs index 5eeb3737410..a7d8edb8088 100644 --- a/components/butterfly/src/server/expire.rs +++ b/components/butterfly/src/server/expire.rs @@ -7,6 +7,7 @@ use crate::{rumor::{RumorKey, server::{timing::Timing, Server}}; use habitat_common::liveliness_checker; +use log::trace; use std::{thread, time::Duration}; @@ -26,6 +27,7 @@ fn run_loop(server: &Server, timing: &Timing) -> ! { .members_expired_to_confirmed_mlw(timing.confirm()); for id in newly_confirmed_members { + trace!("inserting confirmed member: {}", id); server.rumor_heat .lock_rhw() .start_hot_rumor(RumorKey::new(RumorType::Member, &id, ""));