Say we have a range map that maps [a, f) to resolver#1, and we insert (a, 1) , (b, 1), (c, 1) into resolver#1, and then it triggers master to start a resolution split process as in link. Suppose, resolver#1’s new range is [a, c), but will key c got garbage collected in the skip list? I didnt find any code in SkipList.cpp relating to that.
Keys in the Resolvers are garbage collected after moving out of the MVCC window:
At Resolver, it calls:
conflictBatch.detectConflicts(
req.version, req.version - SERVER_KNOBS->MAX_WRITE_TRANSACTION_LIFE_VERSIONS, commitList, &tooOldList);
The second parameter is the oldest version to be kept in the skip list. In the SkipList.cpp
, the garbage collection code is:
if (newOldestVersion > cs->oldestVersion) {
cs->oldestVersion = newOldestVersion;
SkipList::Finger finger;
int temp;
cs->versionHistory.find(&cs->removalKey, &finger, &temp, 1);
cs->versionHistory.removeBefore(cs->oldestVersion, finger, combinedWriteConflictRanges.size() * 3 + 10);
cs->removalKey = finger.getValue();
}
2 Likes