diff --git a/fdbclient/ReadYourWrites.actor.cpp b/fdbclient/ReadYourWrites.actor.cpp index 8d3ec00eb0..313d1495e4 100644 --- a/fdbclient/ReadYourWrites.actor.cpp +++ b/fdbclient/ReadYourWrites.actor.cpp @@ -1581,6 +1581,9 @@ Standalone ReadYourWritesTransaction::getReadConflictRangeInters } Standalone ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRangeRef kr) { + if (writeConflictRangeUnknown) { + throw accessed_unreadable(); + } ASSERT(writeConflictRangeKeysRange.contains(kr)); Standalone result; @@ -1682,6 +1685,7 @@ void ReadYourWritesTransaction::atomicOp( const KeyRef& key, const ValueRef& ope } if(operationType == MutationRef::SetVersionstampedKey) { + writeConflictRangeUnknown = true; // 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/fdbclient/ReadYourWrites.h b/fdbclient/ReadYourWrites.h index e613abab46..3fc5f5cca7 100644 --- a/fdbclient/ReadYourWrites.h +++ b/fdbclient/ReadYourWrites.h @@ -162,6 +162,10 @@ private: double creationTime; bool commitStarted; + // If true, then this transactions write conflict range is not known until commit time. + // Currently only set if this transaction has a SetVersionstampedKey mutation + bool writeConflictRangeUnknown = false; + Reference transactionDebugInfo; void resetTimeout();