DROP PARTITION has an anomaly during DELETE ONLY state, which looks like PK violation. #55888
Labels
affects-5.4
This bug affects 5.4.x versions.
affects-6.1
affects-6.5
affects-7.1
affects-7.5
affects-8.1
impact/inconsistency
incorrect/inconsistency/inconsistent
severity/critical
sig/sql-infra
SIG: SQL Infra
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)
Repeatable test case here. Check out the branch,
make failpoint-enable
then run the test TestMultiSchemaDropPartition.It looks like this in a multi domain (tidb node) scenario:
2. What did you expect to see? (Required)
This is not completely well defined with TiDB's DDL model, since it allows two schema versions with the same data.
But the most consistent view would probably be to not allow duplicate keys when the dropping partitions still can be used.
How to handle the anomaly that rows can exists in an overlapping partition (this case p1, when p0 is being dropped) is harder to define, since it would also be strange to not allow inserts/updates in p1 (that may match dropped p0) by client1 during StateDeleteOnly just because it may overlap with possible sessions seeing v0 schema versions
3. What did you see instead (Required)
See repeatable test case.
Duplicate rows and rows in p1 that matches the partition definition of p0 in client2.
4. What is your TiDB version? (Required)
b8a37f2 based on current master 9c7f4eb
i.e. v8.4.0-alpha something
The text was updated successfully, but these errors were encountered: