-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: palantir-cassandra-2.2.18
Are you sure you want to change the base?
Conversation
if (Schema.instance.getKeyspaceInstance(SystemPalantir.NAME) != null) | ||
{ | ||
keyspace = SystemPalantir.NAME; | ||
} |
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.
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.
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.
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
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.
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 |
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.
Nice!
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.