22

Jepsen: TiDB 2.1.7

 4 years ago
source link: https://www.tuicool.com/articles/yqiEnem
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

TiDB is a distributed, auto-sharded SQL database based on Google’s Percolator model. Despite promising snapshot isolation, TiDB 2.1.7 through 3.0.0-beta.1-40 allowed read skew and lost updates by default, thanks to two auto-retry mechanisms which blindly re-applied updates when a transaction conflicted. TiDB also supports a select ... for update statement which mostly, but not entirely, prevents write skew. We found a minor race condition in table creation, reduced durability & fault tolerance in fresh clusters, and several crashes on startup. With both auto-retry mechanisms disabled, TiDB 2.1.8 through 3.0.0-beta.1-40 passed our tests for snapshot isolation and single-key linearizability. 3.0.0-rc.2, which disables auto-retry by default, also passes. Finally, TiDB has a theoretical dependence on CLOCK_MONOTONIC_RAW for safety, but we have not yet observed anomalies due to clock skew, possibly due to tooling limitations. This work was funded by PingCAP , the makers of TiDB, and conducted in accordance with theJepsen ethics policy.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK