-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add pre-built list of neighborhood Targets to each node #118
Conversation
Pull Request Test Coverage Report for Build 552682360
💛 - Coveralls |
src/metadata_management.cc
Outdated
@@ -975,4 +975,80 @@ void DecrementRefcount(SharedMemoryContext *context, RpcContext *rpc, | |||
} | |||
} | |||
|
|||
u32 GetRelativeNodeId(RpcContext *rpc, int offset) { | |||
int result = rpc->node_id + offset; | |||
CHECK_GE(result, 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 it fine to abort here if check failed?
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 believe so. Since this is an internal developer interface, the check is here to prevent developer errors. In that case, I prefer to fail as fast as possible. Maybe an assert
would be better since it's intended as a developer check.
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 changed it to assert
.
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!
Closes #76.
Target
s to each node that consists of the localTarget
s fromnode_id
- 1 andnode_id
+ 1 (wrapping around). This is a temporary definition of a neighborhood. In the future aTopologyManager
will decide how neighborhoods are built.LocalGetNeighborhoodTargets
. Unfortunately we can't create automated tests for it until we resolve Automated cluster testing #116.