Skip to content
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

CandidateSet address books are not disjoint #1707

Closed
teor2345 opened this issue Feb 8, 2021 · 0 comments · Fixed by #1709
Closed

CandidateSet address books are not disjoint #1707

teor2345 opened this issue Feb 8, 2021 · 0 comments · Fixed by #1709
Assignees
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug C-cleanup Category: This is a cleanup I-hang A Zebra component stops responding to requests
Milestone

Comments

@teor2345
Copy link
Contributor

teor2345 commented Feb 8, 2021

Description

The CandidateSet address books: disconnected, gossiped, and failed, are not disjoint. But the module documentation says they should be.

Analysis

Peers are not removed from the other sets when they are added to the failed set in report_failed. So the sets can not possibly be disjoint.

Suggested Solution

Core changes:

  1. add a PeerState enum field to the MetaAddr
  2. implement the time-based state as a MetaAddr method, rather than an enum variant
  3. delete the disconnected, gossiped, and failed peer sets, and replace them with lookups into the single peer set

Optional improvements:
4. delete unused code

After these changes, there is only one copy of each peer, and it can only be in one state.

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code C-cleanup Category: This is a cleanup P-High labels Feb 8, 2021
@teor2345 teor2345 added this to the 2021 Sprint 2 milestone Feb 8, 2021
@teor2345 teor2345 self-assigned this Feb 8, 2021
@mpguerra mpguerra modified the milestones: 2021 Sprint 2, 2021 Sprint 3 Feb 8, 2021
@mpguerra mpguerra modified the milestones: 2021 Sprint 3, 2021 Sprint 2 Feb 8, 2021
@teor2345 teor2345 added the I-hang A Zebra component stops responding to requests label Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug C-cleanup Category: This is a cleanup I-hang A Zebra component stops responding to requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants