Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
domain: stop schema validator to prohibit DML executing when tidb lost session of etcd #8441
What problem does this PR solve?
The etcd is responsible for schema synchronization, we should ensure there is at most two diffrent schema version in the TiDB cluster, to make the data/schema be consistent.
If we lost connection/session to etcd, the cluster will treats this TiDB as a down instance, and etcd will remove the key of
Say the schema version now is 1, the owner is changing the schema version to 2, it will not wait for this down TiDB syncing the schema, then continue to change the TiDB schema to version 3. Unfortunately, this down TiDB schema version will still be version 1. And version 1 is not consistent to version 3.
So we need to stop the schema validator to prohibit the DML executing when we lost session of etcd.
This PR revert partial changes of #7810
A schema change should meet either of the two conditions:
If none of the condition is satisfied, how could it change to a newer version 3 ?
We do not need to stop the schema validator, instead, we should stop the version change in the owner. @winkyao