Skip to content

Commit

Permalink
If version vector is enabled then preserve all versions from "knownCo…
Browse files Browse the repository at this point in the history
…mmittedVersion"

onwards in log server's disk queue.
  • Loading branch information
sbodagala committed Dec 5, 2024
1 parent 0b7fbae commit c6f99e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fdbserver/TLogServer.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,10 +976,19 @@ ACTOR Future<Void> popDiskQueue(TLogData* self, Reference<LogData> logData) {
IDiskQueue::location minLocation = 0;
Version minVersion = 0;
auto locationIter = logData->versionLocation.lower_bound(logData->persistentDataVersion);
// If version vector is enabled then we need to preserve all versions from "knownCommittedVersion"
// onwards (for recovery purpose). Adjust the iterator position accordingly.
if (SERVER_KNOBS->ENABLE_VERSION_VECTOR_TLOG_UNICAST &&
logData->knownCommittedVersion < logData->persistentDataVersion) {
locationIter = logData->versionLocation.lastLessOrEqual(logData->knownCommittedVersion);
}
if (locationIter != logData->versionLocation.end()) {
minLocation = locationIter->value.first;
minVersion = locationIter->key;
}
if (SERVER_KNOBS->ENABLE_VERSION_VECTOR_TLOG_UNICAST) {
ASSERT_WE_THINK(minVersion <= logData->knownCommittedVersion);
}
logData->minPoppedTagVersion = std::numeric_limits<Version>::max();

for (int tagLocality = 0; tagLocality < logData->tag_data.size(); tagLocality++) {
Expand Down

0 comments on commit c6f99e2

Please sign in to comment.