mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +08:00
Fix compaction issue when rolling nodes back
This commit is contained in:
parent
a8828db58e
commit
803fc86e61
@ -495,7 +495,7 @@ class ConfigNodeImpl {
|
||||
}
|
||||
|
||||
ACTOR static Future<Void> rollforward(ConfigNodeImpl* self, ConfigFollowerRollforwardRequest req) {
|
||||
Version lastCompactedVersion = wait(getLastCompactedVersion(self));
|
||||
state Version lastCompactedVersion = wait(getLastCompactedVersion(self));
|
||||
if (req.lastKnownCommitted < lastCompactedVersion) {
|
||||
req.reply.sendError(version_already_compacted());
|
||||
return Void();
|
||||
@ -529,6 +529,10 @@ class ConfigNodeImpl {
|
||||
versionedAnnotationKey(currentGeneration.committedVersion + 1)));
|
||||
|
||||
currentGeneration.committedVersion = req.rollback.get();
|
||||
if (req.rollback.get() < lastCompactedVersion) {
|
||||
self->kvStore->set(
|
||||
KeyValueRef(lastCompactedVersionKey, BinaryWriter::toValue(req.rollback.get(), IncludeVersion())));
|
||||
}
|
||||
// The mutation commit loop below should persist the new generation
|
||||
// to disk, so we don't need to do it here.
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user