a txn should be able to see the effects of its own updates, however, I cant find any code related to that in NativeAPI.actor.cpp
, this set function does nothing but record the mutations and write conflict ranges. So where is this feature implemented in FDB exactly?
void Transaction::set(const KeyRef& key, const ValueRef& value, bool addConflictRange) {
++cx->transactionSetMutations;
if (key.size() >
(key.startsWith(systemKeys.begin) ? CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT : CLIENT_KNOBS->KEY_SIZE_LIMIT))
throw key_too_large();
if (value.size() > CLIENT_KNOBS->VALUE_SIZE_LIMIT)
throw value_too_large();
auto& req = tr;
auto& t = req.transaction;
auto r = singleKeyRange(key, req.arena);
auto v = ValueRef(req.arena, value);
t.mutations.push_back(req.arena, MutationRef(MutationRef::SetValue, r.begin, v));
if (addConflictRange) {
t.write_conflict_ranges.push_back(req.arena, r);
}
}