I am trying understand the timestamp allocation in crdb. I have run a basic transaction
T : b1 r1(x) w(x) r(y) w(y) c1.
I have “reply” printed in logs at replica_command/execute_cmd. Below are the timestamps I am seeing in the reply structure.
Things to notice :
According to my expectation all the reads and writes should at same timestamp (orig_timestamp).
- But here r(w) and r(y) are hapenning at one timestamp (which is other than orig_timestamp)
- there is no timestamp for w(x) and w(y)
- commit is at orig_timestamp (as expected)
Can someone please explain me this behaviour ?
Follwing up questions
- I understand timestamps for the transaction is picked at trans_cored_sender. Am I right ?
- Transaction record is created on first write. So where is the timestamp picked for the first read (before any write) is stored ? Becuase that is used for other reads for transaction ?