Make sure system.peers and peers_v2 match cluster metadata #4630
Open
minal-kyada wants to merge 3 commits intoapache:trunkfrom
Open
Make sure system.peers and peers_v2 match cluster metadata #4630minal-kyada wants to merge 3 commits intoapache:trunkfrom
minal-kyada wants to merge 3 commits intoapache:trunkfrom
Conversation
ifesdjeen
reviewed
Feb 25, 2026
ifesdjeen
reviewed
Feb 25, 2026
f9e0982 to
a23e2b7
Compare
beobal
requested changes
Mar 5, 2026
test/unit/org/apache/cassandra/db/SystemPeersValidatorTest.java
Outdated
Show resolved
Hide resolved
beobal
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
system.peersandsystem.peers_v2can drift out of sync withClusterMetadata, causing clients who use older C* version and tools that read these legacy tables to observe incorrect cluster topology.Adds
SystemPeersValidatorwhich reconciles both peer tables against ClusterMetadata on startup- removing stale entries for nodes no longer in the cluster, repairing missing entries for joined nodes and updating the stale fields of nodes if present in both. Also exposes this as a JMX operation viaStorageServiceMBeanso operators can trigger it on demand without restarting.Quick diagram of what the patch is about:

patch by @minal-kyada; reviewed by @beobal @ifesdjeen for CASSANDRA-21187