There's a mistake in observation.
Step 1: Began transaction A [No locks taken rn]
Step 2: Ran an update statement via transaction B [Step 3 is part of same step]
Step 4: SELECT statement executed by transaction A SHOULD NOT RETURN THE RESULTS OF THE SNAPSHOT WHEN TRANSACTION A BEGAN.
Ideally, Step 4 should be:
Exec "SELECT * from
user
WHERE id = 8;" in tran A, and the result of fans is 1, it has nothing to do with repeatable read, since repeatable read isolation only begins after you have read the row once.
Why?
Coz repeatable read does not mean, one shall hold the snapshot of entire table the moment transaction began, but if you have already read some kinda data, the snapshot shall remain same through out the transaction.
In other words, post reading a particular row within a transaction, another transaction could not perform UPDATE or DELETE operation on the same row. However, the current transaction [i.e. transaction A] can change the row and those updates would be visible only to transaction in concern [i.e. transaction A] .
Hence,
Rest of the steps are consistent with expectations.
Thanks.