From 7edbbb642e1a635de3853eb7a548409877cea21d Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Fri, 1 May 2020 20:58:37 +0000 Subject: [PATCH] Test SetVersionstampedKey without ryw enabled --- fdbclient/ReadYourWrites.actor.cpp | 1 + fdbserver/workloads/VersionStamp.actor.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/fdbclient/ReadYourWrites.actor.cpp b/fdbclient/ReadYourWrites.actor.cpp index 4ff52e426f..b44acef25e 100644 --- a/fdbclient/ReadYourWrites.actor.cpp +++ b/fdbclient/ReadYourWrites.actor.cpp @@ -1590,6 +1590,7 @@ void ReadYourWritesTransaction::atomicOp( const KeyRef& key, const ValueRef& ope } if(operationType == MutationRef::SetVersionstampedKey) { + TEST(options.readYourWritesDisabled); // SetVersionstampedKey without ryw enabled // this does validation of the key and needs to be performed before the readYourWritesDisabled path KeyRangeRef range = getVersionstampKeyRange(arena, k, tr.getCachedReadVersion().orDefault(0), getMaxReadKey()); if(!options.readYourWritesDisabled) { diff --git a/fdbserver/workloads/VersionStamp.actor.cpp b/fdbserver/workloads/VersionStamp.actor.cpp index 55fc754764..cba06bcc65 100644 --- a/fdbserver/workloads/VersionStamp.actor.cpp +++ b/fdbserver/workloads/VersionStamp.actor.cpp @@ -321,7 +321,11 @@ struct VersionStampWorkload : TestWorkload { versionStampValue = value.withSuffix(LiteralStringRef("\x00\x00\x00\x00")); } + state bool ryw = deterministicRandom()->coinflip(); loop{ + if (!ryw) { + tr.setOption(FDBTransactionOptions::READ_YOUR_WRITES_DISABLE); + } state bool error = false; state Error err; //TraceEvent("VST_CommitBegin").detail("Key", printable(key)).detail("VsKey", printable(versionStampKey)).detail("Clear", printable(range));