-
Notifications
You must be signed in to change notification settings - Fork 68
Add membership id for cluster membership #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8c8e41c
af8b684
1ec476b
57966a5
74a7d2f
4002156
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,6 +221,7 @@ pub fn spawn_swim_announcer(agent: &Agent, gossip_addr: SocketAddr, mut tripwire | |
| _ = timer.as_mut() => {} | ||
| } | ||
|
|
||
| // TODO: find way to find and filter out addrs with a different membership id | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So different peers which share a IP?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we keep sending out Announce messages even to peers that we learn have a different membership id. We could pass this information around, and exclude the peer's ip when we want to announce. But it is mostly an optimization so I left it out of this pr |
||
| match bootstrap::generate_bootstrap( | ||
| agent.config().gossip.bootstrap.as_slice(), | ||
| gossip_addr, | ||
|
|
@@ -301,9 +302,14 @@ pub async fn handle_notifications( | |
| info!("Member Up {actor:?} (result: {member_added_res:?})"); | ||
|
|
||
| match member_added_res { | ||
| MemberAddedResult::NewMember => { | ||
| debug!("Member Added {actor:?}"); | ||
| counter!("corro.gossip.member.added", "id" => actor.id().0.to_string(), "addr" => actor.addr().to_string()).increment(1); | ||
| MemberAddedResult::NewMember | MemberAddedResult::Removed => { | ||
| if matches!(member_added_res, MemberAddedResult::Removed) { | ||
| debug!("Member Removed {actor:?} due to member id mismatch"); | ||
| counter!("corro.gossip.member.removed", "id" => actor.id().0.to_string(), "addr" => actor.addr().to_string()).increment(1); | ||
| } else { | ||
| debug!("Member Added {actor:?}"); | ||
| counter!("corro.gossip.member.added", "id" => actor.id().0.to_string(), "addr" => actor.addr().to_string()).increment(1); | ||
| } | ||
|
|
||
| let members_len = { agent.members().read().states.len() as u32 }; | ||
|
|
||
|
|
@@ -832,7 +838,9 @@ pub async fn handle_sync( | |
| .iter() | ||
| // Filter out self | ||
| .filter(|(id, state)| { | ||
| **id != agent.actor_id() && state.cluster_id == agent.cluster_id() | ||
| **id != agent.actor_id() | ||
| && state.cluster_id == agent.cluster_id() | ||
| && state.member_id == agent.member_id() | ||
| }) | ||
| // Grab a ring-buffer index to the member RTT range | ||
| .map(|(id, state)| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so generally don't dump all peers we how about but only the ones we are connected to directly.