-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-32958 Roxie dynamic priority #19300
base: candidate-9.8.x
Are you sure you want to change the base?
HPCC-32958 Roxie dynamic priority #19300
Conversation
NOTE: this PR is an extension of existing PR: |
5238e32
to
0e96a35
Compare
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32958 Jirabot Action Result: |
1d71248
to
3e1e54b
Compare
aa08cb1
to
d3f5445
Compare
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.
Broadly looks great. Some fairly minor comments to improve readability.
roxie/ccd/ccdquery.cpp
Outdated
if (tmpPriority < (int)priority) | ||
{ | ||
dynPriority = tmpPriority; | ||
if (dynPriority < 0) |
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.
probably not worth it, but this could be commoned up with the code in setFromWorkunit e.g. a setDynamicPriority() function.
roxie/ccd/ccdserver.cpp
Outdated
int dynPriority = ctx->queryOptions().dynPriority; | ||
if (dynPriority < origPriority) | ||
{ | ||
unsigned newPri = ROXIE_SLA_PRIORITY + ROXIE_HIGH_PRIORITY; |
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.
minor: Introduce a function to map from a priority level to a mask - this code would then be simpler, and can reuse in createActivityFactory().
{ | ||
ctx->queryOptions().dynPriority = -1; | ||
UWARNLOG("WARNING: %d msec dynamic adjustment threshold reached, shifting query to BG queue", dynPriorityAdjustTime); | ||
p->queryHeader().activityId |= (ROXIE_SLA_PRIORITY + ROXIE_HIGH_PRIORITY); |
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.
Here and elsewhere - see comments in other PR about a new constant.
roxie/ccd/ccdquery.cpp
Outdated
// dynamically adj priority in the header activityId before sending | ||
int tmpPriority; | ||
updateFromContext(tmpPriority, ctx, "@priority", "_Priority"); | ||
if (tmpPriority > 1) |
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.
Would be clearer to have some constants for MinQueryPriority and MaxQueryPriority and compare against those. (Comparing > 1 would be clearer to compare with > 2, since that is leaking the next test into the bounds test).
roxie/ccd/ccdquery.hpp
Outdated
unsigned priority; | ||
mutable int dynPriority; |
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.
technically should be an atomic, but unlikely to cause any grief.
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.
Would it be better as an unsigned so consistent with priority.
abef643
to
fdfe231
Compare
Updated for re-review. |
fdfe231
to
a5521cc
Compare
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 did not spot anything beyond what has already been mentioned
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.
Thaks @mckellyln it looks good. One minor comment, but no need to change before merging. Please squash.
ctx->queryOptions().dynPriority = QUERY_BG_PRIORITY_VALUE; | ||
unsigned dynAdjustMsec = (dynPriorityAdjustCycles * 1000ULL) / queryOneSecCycles(); | ||
UWARNLOG("WARNING: %d msec dynamic adjustment threshold reached, shifting query to BG queue", dynAdjustMsec); | ||
p->queryHeader().activityId |= ROXIE_BG_PRIORITY; |
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.
To be truly correct if the constants change value this should remove ROXIE_PRIORITY_MASK first. Would it be better if this block was moved before the if() above?
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 agree, I can add a line so its -
+ p->queryHeader().activityId &= ~ROXIE_PRIORITY_MASK;
p->queryHeader().activityId |= ROXIE_BG_PRIORITY;
@mckellyln please rebase ontop of the latest - which includes your first set of changes. |
a5521cc
to
302d17b
Compare
Signed-off-by: M Kelly <[email protected]>
Signed-off-by: M Kelly <[email protected]>
302d17b
to
e5c65f2
Compare
Squashed and rebased to latest. I can add that extra line to clear the priority mask also to make it more readable and correct no matter what the constants are. |
Type of change:
Checklist:
Smoketest:
Testing: