-
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-32856 CKeyCursor should link parent nodes as well as current node #19228
base: master
Are you sure you want to change the base?
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32856 Jirabot Action Result: |
7a1caea
to
90d15b0
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.
Generally looks good. A couple of issues.
@@ -1762,9 +1769,26 @@ bool CKeyCursor::_next(IContextLogger *ctx) | |||
if (node != NULL) | |||
{ | |||
nodeKey = 0; | |||
unsigned depth = key.getBranchDepth(); |
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 benefit from a comment about what this code is doing....
system/jhtree/jhtree.cpp
Outdated
unsigned parentNodeKey = parentNodeKeys[depth]; | ||
if (parentNodeKey < numParentKeys-1) | ||
{ | ||
parentNodeKeys[depth] = parentNodeKey; |
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 should be parentNodeKey+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.
I think you are right. Would be a no-op without the +1
system/jhtree/jhtree.cpp
Outdated
depth--; | ||
if (depth < maxParentNodes) | ||
{ | ||
node.set(parents[depth]); |
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.
move node.set to line 1905? to avoid the link (+release) if it does not match. (Still assign it to a temporary.)
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, have to be careful to set to null properly too...
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.
Actually, I suppose you don't really.... lwm remaining 0 means it will get set to root
system/jhtree/jhtree.cpp
Outdated
if (rc < 0) | ||
{ | ||
lwm = parentNodeKey+1; | ||
printf("Still in parent node at level %u %u\n", depth, numParentKeys); |
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.
needs removing or putting on a trace flag that disables off (same for other tracing 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 will remove all the printf lines whether commented out or not.
system/jhtree/jhtree.cpp
Outdated
depth--; | ||
if (depth < maxParentNodes) | ||
{ | ||
node.set(parents[depth]); |
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.
similar comment to above about setting this later - e.g. move to line 2008
parentNodeKeys[depth] = a; | ||
parents[depth].swap(node); | ||
} | ||
lwm = 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.
Is this a lurking bug?
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 think so, in that previously if lwm was non-zero we were already at leaf level and so would only go around the loop once. So you could argue it was a lurking bug but it's one that would never have been able to trigger previously.
@ghalliday Pushed a new commit addressing your comments |
@richardkchapman a couple of regression tests are now failing. |
ec87f79
to
501c735
Compare
@ghalliday Pushed changes per our discussions |
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.
@richardkchapman looks good, please squash.
What additional testing should we do to check i) it doesn't cause any regressions and ii) investigate its impact on performance?
@mckellyln please review this - related to roxie, and critical that it doesn't cause any regressions. |
Signed-off-by: Richard Chapman <[email protected]>
501c735
to
73c2f17
Compare
@ghalliday Squashed. Not sure what to do to test impact. I'm a bit nervous that the regression suite didn't initially pick up the pair of bugs in the first commit (only picked it up once one was fixed). I doubt the performance impact will be huge - mostly reduced cache contention when under heavy load |
Type of change:
Checklist:
Smoketest:
Testing: