[YSQL] Investigate why the first request picks a local limit only when the read time is not set. #22158
Open
1 task done
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/bug
This issue is a bug
priority/medium
Medium priority issue
status/awaiting-triage
Issue awaiting triage
Jira Link: DB-11085
Description
Context
Read time is either picked on docdb
or it is provided to docdb
In the latter case, the local limit is set only for the second RPC to the tablet as part of the txn.
This is stated in c784595.
but no reason was given for why local limit is not used for the first request. Moreover, this claim is not even accurate when the read time is picked on the tablet.
Motivation
local limit is most useful when the original time of the scanned intent is higher than this limit. Then, we can skip checking the uncertainty window because we have just established a causal relation: the read operation happens before the provisional write op. Similar logic applies to fast path writes that bypass the provisional write mechanism.
This local limit logic should be independent of whether the read time is picked on the tablet or provided to the tablet.
NOTE: The local limit is still picked as safe time of the tablet and not provided to docdb. So, the causal relation still holds.
Scenario 1
The read clearly happened before the provisional write is raft-replicated. The operations are concurrent, implying no uncertainty.
Scenario 2
The read clearly happened before the write operation and there is no "real" uncertainty.
Objective
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: