You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The schema checker and safe window are used to ensure the related schema version would not be changed in a transaction lifecycle. After the meta data lock mechanism is introduced in TiDB, it's guaranteed by the DDL module by default, so it's unnecessary to do extra schema checks. After removing these checks:
The backfill job is no longer blocked by the safe window, and the DDL statement executes faster.
The async commit/1pc transactions are no longer constrained by a max_commit_ts related to the safe window interval.
The schema lease checker could be removed from the kv client.
Previously when a transaction is being committed, it would check the schema versions of related tables, the commit would fail if there were any version changes. Besides, this checking requires a current valid schema version and the check would fail if the version has uncertainties.
Safety:
For 2PC transactions, the commit statement finishes after the primary key is committed, so it's safe to remove the schema checker directly.
For async commit/1PC transactions, the prewrite phase must be finished after the commit statement finishes and there must be a prewrite lock on the corresponding keys, the transaction state must be committed which is ensured by the committing protocol. The related table schema version could not be pushed forward as any DDL operations requiring data reorganization would conflict with the existing prewrite lock, so the commit is still safe. For DDL operations that do not require data reorganization, it's always safe to commit using older schema versions.
Note after removing these checks, the new checking logic is relaxed a lot compared with the previous utilities, it's better to review the test cases and there could be behavior and test result changes.
The text was updated successfully, but these errors were encountered:
Enhancement
The schema checker and safe window are used to ensure the related schema version would not be changed in a transaction lifecycle. After the meta data lock mechanism is introduced in TiDB, it's guaranteed by the DDL module by default, so it's unnecessary to do extra schema checks. After removing these checks:
max_commit_ts
related to the safe window interval.Previously when a transaction is being committed, it would check the schema versions of related tables, the commit would fail if there were any version changes. Besides, this checking requires a current valid schema version and the check would fail if the version has uncertainties.
Safety:
Note after removing these checks, the new checking logic is relaxed a lot compared with the previous utilities, it's better to review the test cases and there could be behavior and test result changes.
The text was updated successfully, but these errors were encountered: