Skip to content

Commit

Permalink
add tracing for marking members confirmed
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Wrock <[email protected]>
  • Loading branch information
mwrock committed Nov 6, 2024
1 parent 8db167a commit b835a4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/butterfly/src/member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions components/butterfly/src/server/expire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand All @@ -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, ""));
Expand Down

0 comments on commit b835a4a

Please sign in to comment.