-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make log servers return an empty version range only when it is correct to do so #12171
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
base: main
Are you sure you want to change the base?
Conversation
information, needed by the recovery algorithm when unicast is enabled: - PrevVersion of a version - List of log servers that a commit proxy sends a commit version to And, extend the code to populate "unknownCommittedVersions" list (the list of commit versions whose commit status is not known, and to be determined by the recovery version computation algorithm) on a log server restart. NOTE: Please note that these changes will cause version incompatibility and so additional code/logic will need to be added to make sure that upgrades/restart related simulation tests work properly.
committed version onwards in the case where the known committed version is behind LogData::persistentDataDurableVersion (and version vector unicast is enabled). This is so we will populate "LogData::unknownCommittedVersions", on log server restart, with all versions that are needed by unicast recovery.
…mmittedVersion" onwards in log server's disk queue.
from known committed version onwards, when version vector is enabled.
apple#11815 in "main". In case of spill by reference, log servers should use the logic that is based over "TagData::popped" to decide how long to keep the disk queue positions of versions in memory (instead of using the logic that is based over "LogData::persistentDataVersion", which is applicable to spill by value case).
an empty version range (on peeks) such that the receiver won't miss any versions that it is supposed to receive. - Make the cluster controller collect the set of log servers participated in recovery and propagate that information to the other processes - Extend the ServerPeekCursor to take a flag that tells the source log server whether it can return an empty version range or not (in the context of version vector/unicast), and make the source log server return an empty version range only when this flag is set - Make the peek APIs set the flag appropriately when initializing ServerPeekCursors - Also, take the internal logic used by SetPeekCursor and MergedPeekCursor into account while initializing the above mentioned flag.
NOTE: I didn't do a good job of making this branch. Please note that the very last commit is the only commit that is relevant to this task, thanks! |
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
@@ -390,8 +393,8 @@ Future<Reference<ILogSystem::IPeekCursor>> LogRouterData::getPeekCursorData(Refe | |||
.When(logSystemChanged, | |||
[&](const Void&) { | |||
if (logSystem->get()) { | |||
result = | |||
logSystem->get()->peekLogRouter(dbgid, beginVersion, routerTag, useSatellite, recoverAt); | |||
result = logSystem->get()->peekLogRouter( |
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.
Maybe LogRouter doesn't explicitly need to receive the list of participating log servers (receiving it as part of LogSystemConfig is probably good enough). I will need to look into that.
@@ -229,12 +229,15 @@ struct ILogSystem { | |||
int fastReplies; | |||
int unknownReplies; | |||
|
|||
bool returnEmptyIfStopped; // valid only when unicast is enabled |
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.
The source log server can return an empty version range only if this flag is set.
@@ -212,6 +213,13 @@ struct TagPartitionedLogSystem final : ILogSystem, ReferenceCounted<TagPartition | |||
Optional<UID> debugID, | |||
Optional<std::unordered_map<uint16_t, Version>> tpcvMap) final; | |||
|
|||
void maybeAdjustBestServer(int bestSet, |
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.
Please note that this API may need to be called in other peek calls too, thanks!
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
In the context of version vector/unicast, make log servers return an empty version range (on peeks) such that the receiver won't miss any versions that it is supposed to receive.
Make the cluster controller collect the set of log servers participated in recovery and propagate that information to the other processes
Extend the ServerPeekCursor to take a flag that tells the source log server whether it can return an empty version range or not (in the context of version vector/unicast), and make the source log server return an empty version range only when this flag is set
Make the peek APIs set the flag appropriately when initializing ServerPeekCursors
Also, take the internal logic used by SetPeekCursor and MergedPeekCursor into account while initializing the above mentioned flag.
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-branch
ormain
if this is the youngest branch)