peloton
peloton copied to clipboard
MVTO: Allow reads of write locked tuples as long as reader's TS < writer's TS
Currently we abort if we try to read a tuple whose write lock is held by another transaction. This is too conservative. We can read the tuple if the txn holding the write lock has a timestamp greater than the reader's timestamp, since no matter what the writer does (commit or abort), that version of the committed tuple is the version that reader will see.
This also adds an optimization that if the current read timestamp of the tuple is greater than or equal to the transaction attempting to read, immediately succeed. There's no reason to try to take the latch to update the read timestamp to a smaller value.