attempt to write to system keys with snapshot
This commit is contained in:
parent
9c130b5ea2
commit
d334b6484e
|
@ -1062,4 +1062,6 @@ const KeyRangeRef testOnlyTxnStateStorePrefixRange(
|
||||||
);
|
);
|
||||||
|
|
||||||
const KeyRef writeRecoveryKey = LiteralStringRef("\xff/writeRecovery");
|
const KeyRef writeRecoveryKey = LiteralStringRef("\xff/writeRecovery");
|
||||||
|
const ValueRef writeRecoveryKeyTrue = LiteralStringRef("1");
|
||||||
|
const ValueRef writeRecoveryKeyFalse = LiteralStringRef("0");
|
||||||
const KeyRef snapshotEndVersionKey = LiteralStringRef("\xff/snapshotEndVersion");
|
const KeyRef snapshotEndVersionKey = LiteralStringRef("\xff/snapshotEndVersion");
|
||||||
|
|
|
@ -398,6 +398,7 @@ extern const KeyRangeRef testOnlyTxnStateStorePrefixRange;
|
||||||
|
|
||||||
// Snapshot + Incremental Restore
|
// Snapshot + Incremental Restore
|
||||||
extern const KeyRef writeRecoveryKey;
|
extern const KeyRef writeRecoveryKey;
|
||||||
|
extern const ValueRef writeRecoveryKeyTrue, writeRecoveryKeyFalse;
|
||||||
extern const KeyRef snapshotEndVersionKey;
|
extern const KeyRef snapshotEndVersionKey;
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
|
|
@ -4728,6 +4728,22 @@ static std::set<int> const& normalDataDistributorErrors() {
|
||||||
|
|
||||||
ACTOR Future<Void> ddSnapCreateCore(DistributorSnapRequest snapReq, Reference<AsyncVar<struct ServerDBInfo>> db ) {
|
ACTOR Future<Void> ddSnapCreateCore(DistributorSnapRequest snapReq, Reference<AsyncVar<struct ServerDBInfo>> db ) {
|
||||||
state Database cx = openDBOnServer(db, TaskPriority::DefaultDelay, true, true);
|
state Database cx = openDBOnServer(db, TaskPriority::DefaultDelay, true, true);
|
||||||
|
state Reference<ReadYourWritesTransaction> tr(new ReadYourWritesTransaction(cx));
|
||||||
|
loop {
|
||||||
|
try {
|
||||||
|
tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
|
||||||
|
tr->setOption(FDBTransactionOptions::LOCK_AWARE);
|
||||||
|
TraceEvent("SnapDataDistributor_WriteFlagAttempt")
|
||||||
|
.detail("SnapPayload", snapReq.snapPayload)
|
||||||
|
.detail("SnapUID", snapReq.snapUID);
|
||||||
|
tr->set(writeRecoveryKey, writeRecoveryKeyTrue);
|
||||||
|
wait(tr->commit());
|
||||||
|
break;
|
||||||
|
} catch (Error& e) {
|
||||||
|
TraceEvent("SnapDataDistributor_WriteFlagError").error(e);
|
||||||
|
wait(tr->onError(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
TraceEvent("SnapDataDistributor_SnapReqEnter")
|
TraceEvent("SnapDataDistributor_SnapReqEnter")
|
||||||
.detail("SnapPayload", snapReq.snapPayload)
|
.detail("SnapPayload", snapReq.snapPayload)
|
||||||
.detail("SnapUID", snapReq.snapUID);
|
.detail("SnapUID", snapReq.snapUID);
|
||||||
|
|
Loading…
Reference in New Issue