server: using of timestamps not allocated by PD for reads can break the cluster's linearizability constraints #57769
Labels
affects-8.5
This bug affects the 8.5.x(LTS) versions.
component/ddl
This issue is related to DDL of TiDB.
severity/critical
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
The async commit and 1pc protocol should work as expected.
3. What did you see instead (Required)
Many tidb logs like
tikv logs like
and the
max_ts
in TiKV is pushed to an invalid value.The cause is the PR(https://github.com/pingcap/tidb/pull/56406/files#diff-45ad039a8b87835b475a52615355c444538d3a1f31a84d7b3ac94e15b1ce8721R1159), which uses the user specified timestamp
math.MaxInt64
to read directly with DAG interfaces.Using non-transactional interfaces along with self-constructed timestamps for reads and writes is a very dangerous thing, it could break the linearzibility of the whole TiDB cluster.
Please ensure that data reads are performed using transaction interfaces or internal SQL statements to avoid manually constructing requests and specifying timestamps.
For tidb and tikv, it's necessary to enhance checks for illegal timestamps. For cases where the timestamp might exceed the current maximum PD-allocated timestamp, checks and error reporting should be enhanced.
4. What is your TiDB version? (Required)
release-8.5 branch with
8e37df4224c1990a2c8e87646c75da01ea643b4b
The text was updated successfully, but these errors were encountered: