Fix missing localities for fdbserver#7994
Merged
Merged
Conversation
The localities are stored in ServerDBInfo for calculating distances to other processes. The localities are not set when creating ServerDBInfo, thus any distances calculated before UpdateServerDBInfoRequest will be wrong. This PR fixes this issue, thus preventing unnecessary cross DC calls, especially for index prefetching on the storage servers.
flowguru
reviewed
Aug 25, 2022
| if (nextAlt == startAlt) | ||
| triedAllOptions = TriedAllOptions::True; | ||
| stream = nullptr; | ||
| distance = LBDistance::DISTANT; |
Contributor
There was a problem hiding this comment.
can you explain why do we do it here? what happens if code reaches here?
Collaborator
Author
There was a problem hiding this comment.
This resets distance to a default value. the logic below uses stream for processing, so setting a value here has no effect.
flowguru
approved these changes
Aug 25, 2022
Collaborator
Doxense CI Report for Windows 10
|
5 tasks
flowguru
reviewed
Aug 25, 2022
| serverDBInfo.client.isEncryptionEnabled = SERVER_KNOBS->ENABLE_ENCRYPTION; | ||
| serverDBInfo.myLocality = localities; | ||
| auto dbInfo = makeReference<AsyncVar<ServerDBInfo>>(serverDBInfo); | ||
| TraceEvent("MyLocality").detail("Locality", dbInfo->get().myLocality.toString()); |
Contributor
There was a problem hiding this comment.
this seems to be a little different from what we have in our test here, looks like it is okay.
Contributor
There was a problem hiding this comment.
oh because we were on 7.1, let me test it again anyways
Collaborator
Author
There was a problem hiding this comment.
Yes, this is more efficient.
Contributor
Result of foundationdb-pr-macos on macOS BigSur 11.5.2
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
100k 20220825-213352-jzhou-4fc8cbab8319a4ea passed.
Code-Reviewer Section
The general pull request guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branchormainif this is the youngest branch)