-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-retry on PD crash can *also* cause lost updates, read skew #10076
Comments
It looks like this can happen even when there are no process crashes, network problems, or other issues. In this test, we have a single case of read skew with |
Hi @aphyr ,
The way to completely disable transaction automatic retry in TiDB is to set |
|
I think that's a good idea, thanks! :) |
After #10339 was merged, set tidb_disable_txn_auto_retry = 1 could avoid lost update and read skew. |
Fixed in 3.0.0-rc.2! |
As noted in #10075, TiDB loses updates by default thanks to an auto-retry mechanism. The documentation says you can disable this mechanism by setting
@@global.tidb_disable_txn_auto_retry = 1;
. This is not entirely correct. There is a second automatic transaction retry mechanism, which comes into play when the connection to PD is lost--for example, if PD crashes. This retry mechanism can also cause lost updates.I suggest disabling this retry mechanism by default as well, and, going forward, modify it to only retry transactions which can be safely re-applied.
In addition, setting
tidb_disable_txn_auto_retry
should disable all automatic retry mechanisms.With Jepsen 8c4f1101510b382266a3b8d3fdaa7adfc60d9d9a, run
The total of all accounts should be constant.
Shortly after the recovery from a PD crash affecting a majority of PD nodes, account balances can briefly fluctuate. This anomaly is not a transient read phenomenon; logical state is corrupted. We believe this represents another case of lost updates. http://jepsen.io.s3.amazonaws.com/analyses/tidb-2.1.7/20190408T132351-pd-auto-retry.zip
tidb-server -V
or runselect tidb_version();
on TiDB)?2.1.7-linux-amd64
The text was updated successfully, but these errors were encountered: