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

Fix effective ownership in Nodetool Status and Ring #609

Open
wants to merge 1 commit into
base: palantir-cassandra-2.2.18
Choose a base branch
from

Conversation

rhuffy
Copy link
Contributor

@rhuffy rhuffy commented Jan 29, 2025

Nodetool Status and Ring can display effective ownership information if a keyspace is provided, or if the non-system keyspaces all use the same replication strategy.

In our case, we can assume that the system_palantir keyspace is always present, and use its replication strategy by default, if present.

@rhuffy rhuffy marked this pull request as ready for review January 29, 2025 22:17
if (Schema.instance.getKeyspaceInstance(SystemPalantir.NAME) != null)
{
keyspace = SystemPalantir.NAME;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of modifying it here (I feel it might be confusing if we use this functions in other pieces of the code), wanna add to theStatus class instead: ownerships = probe.effectiveOwnership(keyspace != null ? keyspace: SystemPalantir.NAME); and add a small comment on why we are doing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is the correct place for this logic because this method already contains logic to auto resolve a keyspace if none is provided

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, adding the system_palantir keyspace name as the argument to effectiveOwnership isn't great because then the method would throw in the case that system_palantir is not present, whereas in my patch it would instead fall back to the existing behavior.


package com.palantir.cassandra.db;

final public class SystemPalantir
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

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.

2 participants