Skip to content

Commit

Permalink
Fix marking self confirmed & no ping to probe pinged
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Wrock <[email protected]>
  • Loading branch information
mwrock authored and agadgil-progress committed Nov 7, 2024
1 parent 246ab5f commit 84cb153
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
17 changes: 10 additions & 7 deletions components/butterfly/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ impl Server {
/// * `Server::member` (write)
/// * `RumorHeat::inner` (write)
fn insert_member_from_rumor_mlw_smw_rhw(&self, member: Member, mut health: Health) {
trace!("insert_member_from_rumor_mlw_smw_rhw");
trace!("insert_member_from_rumor_mlw_smw_rhw for {}", member.id);
let rk: RumorKey = RumorKey::from(&member);

if member.id != self.member_id() {
Expand Down Expand Up @@ -730,13 +730,16 @@ impl Server {
debug!("Member: {} Does not exist in the Member List.", member.id);
}
}
} else if health != Health::Alive
&& member.incarnation >= self.myself.lock_smr().incarnation()
{
self.myself
.lock_smw()
.refute_incarnation(member.incarnation);
} else if health != Health::Alive {
trace!("member incarnation is {}. my incarnation is {}",
member.incarnation,
self.myself.lock_smr().incarnation());
health = Health::Alive;
if member.incarnation >= self.myself.lock_smr().incarnation() {
self.myself
.lock_smw()
.refute_incarnation(member.incarnation);
}
}

let member_id = member.id.clone();
Expand Down
5 changes: 2 additions & 3 deletions components/butterfly/src/server/outbound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ fn run_loop(server: &Server, socket: &UdpSocket, rx_inbound: &AckReceiver, timin
.members_write()
.drain()
.collect::<Vec<_>>();

let mut check_list = server.member_list.check_list_mlr(&server.member_id);
if !members_to_probe.is_empty() {
debug!("Probing {} members in the Probe List.",
members_to_probe.len());

for member in members_to_probe {
trace!("Probing member: {}", member.id);
check_list.retain(|mem| mem.id != member.id);
let addr = member.swim_socket_address();
ping_mlr_smr_rhw(server,
socket,
Expand All @@ -154,8 +155,6 @@ fn run_loop(server: &Server, socket: &UdpSocket, rx_inbound: &AckReceiver, timin
debug!("Zero members in probe_list");
}

let check_list = server.member_list.check_list_mlr(&server.member_id);

let probe_iteration_start = Instant::now();
for member in check_list {
if server.member_list.pingable_mlr(&member) {
Expand Down

0 comments on commit 84cb153

Please sign in to comment.