FastRestore:Applier:Handle CompareAndClear atomicOp

This commit is contained in:
Meng Xu 2020-02-13 11:06:29 -08:00
parent 58dad5373b
commit b1b44d4477
2 changed files with 3 additions and 2 deletions

View File

@ -779,7 +779,7 @@ ACTOR static Future<Void> handleApplyToDBRequest(RestoreVersionBatchRequest req,
}
// Copy from WriteDuringRead.actor.cpp with small modifications
// Not all AtomicOps are handled in this function: SetVersionstampedKey, SetVersionstampedValue,
// Not all AtomicOps are handled in this function: SetVersionstampedKey, SetVersionstampedValue, and CompareAndClear
Value applyAtomicOp(Optional<StringRef> existingValue, Value value, MutationRef::Type type) {
Arena arena;
if (type == MutationRef::AddValue)

View File

@ -117,7 +117,8 @@ struct StagingKey {
}
for (auto& mutation : lb->second) {
if (type == MutationRef::CompareAndClear) { // Special atomicOp
Optional<Value> retVal = doCompareAndClear(existingValue, value, arena);
Arena arena;
Optional<ValueRef> retVal = doCompareAndClear(val, mutation.param2, arena);
if (!retVal.present()) {
val = key;
type = MutationRef::ClearRange;