-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-16095 - Nodetool tablestats WriteLatency error #831
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
Conversation
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.
Pulled from https://issues.apache.org/jira/browse/CASSANDRA-16213, was going to add them there but need them in this patch as well, so copy/pasted from there (but added docs for the ones missing)
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.
The get with overrideDefaultValue methods are not used. Not a big problem if the other patch referenced is to be merged.
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.
renamed to all caps so its more clear this is global and not local to the table; seems that this naming convention caused all to be confused with local table names rather than global metrics, so switch to java naming convention to help to prevent this next time.
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.
did this in https://issues.apache.org/jira/browse/CASSANDRA-16213 as its useful for debugging.
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.
this was a regressions... when not using gossip we didn't register the distributed tables, and we tried to force trace regardless...
right before we gossip tokens around we call this method, so adding it here makes sure the distributed tables work with and without gossip.
jonmeredith
left a comment
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.
LGTM.
Is it worth also checking the KeyspaceMetrics are created and removed and that dropping a Keyspace removes all contained table metrics?
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.
Could you use org.apache.cassandra.db.SystemKeyspace#ALL_TABLE_NAMES here? and similarly create ALL_TABLE_NAMES for the other keyspaces where they're missing?
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 didn't want to as that would load the whole DB, I could refactor to avoid that but felt simplest to just fork.
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 don't see that in 3.0 or trunk...
$ grep -r ALL_TABLE_NAMES src/java/
$
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.
My mistake :)
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 it is better to load the tables programmatically. So compiler prompts when code changes. It can be done via
Map<String, Collection<String>> systemTables = new HashMap<>();
Consumer<KeyspaceMetadata> loader = meta ->
{
Set<String> tables = meta.tables.stream().map(t -> t.name).collect(Collectors.toSet());
systemTables.put(meta.name, tables);
};
Arrays.asList(SystemKeyspace.metadata(), AuthKeyspace.metadata(), SystemDistributedKeyspace.metadata(),
SchemaKeyspace.metadata(), TraceKeyspace.metadata())
.forEach(loader);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.
that has the same issue, we load the whole DB into the app space, so was trying to avoid that.
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 switched to doing this, I do this by loading all tables in the first instance.
I thought about that but was lazy! |
|
I updated to also check the keyspace metric, there isn't a keyspace mbean to validate, so only look for the keyspace version of the metrics list |
jonmeredith
left a comment
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.
Thanks for the extra tests.
yifan-c
left a comment
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.
Looks good overall.
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.
The get with overrideDefaultValue methods are not used. Not a big problem if the other patch referenced is to be merged.
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.
great to group the static variable together.
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.
nit: maybe also create constants for the metrics names? since this patch is doing some code cleanup already.
(Maybe too much work. your call)
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 it is better to load the tables programmatically. So compiler prompts when code changes. It can be done via
Map<String, Collection<String>> systemTables = new HashMap<>();
Consumer<KeyspaceMetadata> loader = meta ->
{
Set<String> tables = meta.tables.stream().map(t -> t.name).collect(Collectors.toSet());
systemTables.put(meta.name, tables);
};
Arrays.asList(SystemKeyspace.metadata(), AuthKeyspace.metadata(), SystemDistributedKeyspace.metadata(),
SchemaKeyspace.metadata(), TraceKeyspace.metadata())
.forEach(loader);…leaning up all global table metrics
11b0946 to
d85c192
Compare
…caught exception (apache#831)
No description provided.