-
Notifications
You must be signed in to change notification settings - Fork 85
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
Choose sync peer other than leader when possible #2041
base: main
Are you sure you want to change the base?
Conversation
sqlitecluster/SQLiteNode.cpp
Outdated
@@ -1278,7 +1278,19 @@ void SQLiteNode::_onMESSAGE(SQLitePeer* peer, const SData& message) { | |||
peer->commandAddress = message["commandAddress"]; | |||
} | |||
peer->setCommit(message.calcU64("CommitCount"), message["Hash"]); | |||
|
|||
|
|||
// We check the commit difference with 12,500 commits behind because 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.
Is this change supposed to be in this PR? Seems kind of unrelated to the other change.
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 PR should be on hold til the other one is 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.
What is the "other 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.
this was the other one: #2039
I changed the base branch to that PR so you can see only the necessary changes.
Change looks good. Happy to approve when the other PR is merged and this one only has the diff for this change |
Changed the base PR so it only shows the needed changes |
…chooseSyncPeerOtherThanLeader
The base branch was changed.
Approved (though not showing for me in the right pane), anyway leaving it for @cead22 and @tylerkaraszewski to review too |
Details
This PR changes the logic in
_updateSyncPeer
to choose the leader as a sync peer only if no other nodes are available. The change should help reduce processing pressure on the leader node.Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/455682
Tests
Internal Testing Reminder: when changing bedrock, please compile auth against your new changes