Skip to content

Remove peer metadata from Raft state, when removing peer#5796

Merged
timvisee merged 6 commits intodevfrom
remove-peer-metadata-on-remove-peer
Jan 15, 2025
Merged

Remove peer metadata from Raft state, when removing peer#5796
timvisee merged 6 commits intodevfrom
remove-peer-metadata-on-remove-peer

Conversation

@ffuugoo
Copy link
Copy Markdown
Contributor

@ffuugoo ffuugoo commented Jan 14, 2025

Currently, if we continuously add and remove peers to the cluster, raft_metadata.json will keep growing. This PR fixes it.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?

@ffuugoo ffuugoo changed the base branch from master to dev January 14, 2025 13:31
@ffuugoo ffuugoo changed the title Remove peer metadata on remove peer Remove peer metadata from Raft state, when removing peer Jan 14, 2025
@ffuugoo ffuugoo marked this pull request as ready for review January 14, 2025 13:34
Copy link
Copy Markdown
Member

@KShivendu KShivendu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much needed improvement!

Comment thread lib/storage/src/content_manager/consensus/persistent.rs Outdated
Automatically save Raft state in `remove_unknown_peer_metadata`
Copy link
Copy Markdown
Member

@timvisee timvisee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 🧹 🧹

@timvisee timvisee merged commit 1af6d07 into dev Jan 15, 2025
@timvisee timvisee deleted the remove-peer-metadata-on-remove-peer branch January 15, 2025 08:18
timvisee pushed a commit that referenced this pull request Jan 16, 2025
* Remove peer metadata from Raft state, when removing peer

* Trigger CI 🙄

* Remove unknown peer metadata, when loading Raft state

* Remove uknown peer metadata, when applying Raft snapshot

* fixup! Remove unknown peer metadata, when loading Raft state

Fix clippy 🙄

* fixup! Remove unknown peer metadata, when loading Raft state

Automatically save Raft state in `remove_unknown_peer_metadata`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants