-
Notifications
You must be signed in to change notification settings - Fork 88
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
toppartitions: Fix toppartitions to only jmx once #250
Conversation
@@ -673,7 +673,7 @@ | |||
/** Sets the hinted handoff throttle in kb per second, per delivery thread. */ | |||
public void setHintedHandoffThrottleInKB(int throttleInKB); | |||
|
|||
public CompositeData getToppartitions(String sampler, List<String> keyspaceFilters, List<String> tableFilters, int duration, int capacity, int count) throws OpenDataException; | |||
public Map<String, CompositeData> getToppartitions(List<String> keyspaceFilters, List<String> tableFilters, int duration, int capacity, int count) throws OpenDataException; |
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.
How does this work? You changed the interface, but not the implementation?
Maybe the implementation is autogenerated, but it has to be generated from some IDL?
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.
Implementation is in the jmx PR
meant to mark it as draft, sorry
the whole fix is composed of three PRs, we'll link them here once I describe the commits in the third one
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.
But to answer the question more thoroughly, nodetool uses this interface which searches for the implementation of it in the jmx package
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.
Then how do upgrades work? We'll need to make the old/new versions interoperate.
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've updated the PR desc
scylladb/scylla-jmx#165 has to be merged first into scylla-jmx, only then this can be merged as well
@@ -482,11 +482,12 @@ public void repairAsync(final PrintStream out, final String keyspace, Map<String | |||
|
|||
public Map<Sampler, CompositeData> getToppartitions(List<String> keyspaceFilters, List<String> tableFilters, int capacity, int duration, int count, List<Sampler> samplers) throws OpenDataException | |||
{ | |||
Map<Sampler, CompositeData> result = Maps.newHashMap(); | |||
Map<String, CompositeData> toppartitions = ssProxy.getToppartitions(keyspaceFilters, tableFilters, duration, capacity, count); |
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 call here doesn't mention samplers
. So I assume it uses all possible samplers (what are they, read/write?)? If so, if the user asks for just one sampler, won't we do extra work, which is then discarded?
Maybe we need to pass the list of samplers down the stack.
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 samplers are passed into this method, but not propagated further, contrary to how it worked before. The reason is we want to only call the jmx and therefore the scylla backend once (since it always gives us info for all samplers anyway) and only here, in the NodeProbe code, extract counters for the samplers the caller requested
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.
Ok. If Scylla always samples everything, we can use the new approach without losing anything.
24aea19
to
c6aa4b0
Compare
@avikivity You wanted me to make this work with older version of the JMX call. Asked how old under the previous PR, but maybe it went unnoticed so reposting here I already made it detect the absence of the new method, just have to know which method to redirect to - before this set of PRs or before the generic toppartitions API |
I am quite lossy, ping when needed. It's annoying and I apologize. by "older" I meant the previous version before your change.
Isn't that sufficient? It will use the new API is present and fall back to the old one if not. |
no worries
That's what I wanted to know, great, will post the change soon |
In line with previous API, nodetool called jmx's toppartitions for each sampler separately. A better way to do this is to call it once and then pick results for the samplers we need.
c6aa4b0
to
a40e1f3
Compare
@avikivity done, it falls back successfully when the new method is not found |
@StarostaGit I still see 2 calls in the scylla log, e.g.:
I'm not exactly sure what this PR was trying to achieve but the second calls overrides the first one, i.e. nodetool toppartitions returns the stats only from the 2nd period as far as I can tell from the dtest. |
Cc @haaawk let's get the toppartitions dtests pass. |
It had a wrong Class parameter passed for lists in the older/newer method call dispatch, hence for new ones it was still 2 calls to the method. There was a followup for that in #256 and it should be ok once it went in |
fwiw, they pass for me locally with #256 |
thanks |
it works locally for me as well, the PR with updated dtests is also just waiting for #256 so that the BYO job passes |
what PR updating dtests? https://github.com/scylladb/scylla-dtest/pull/2147? |
Yes, this one |
In line with previous API, nodetool called jmx's toppartitions
for each sampler separately. A better way to do this is to call
it once and then pick results for the samplers we need.
This is part of the fix for #243 and scylladb/scylladb#8459. It should be merged after scylladb/scylla-jmx#165