Skip to content
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

Concurrent updates during Reorganize partition backfill can be overwritten/reverted #58226

Closed
mjonss opened this issue Dec 12, 2024 · 0 comments · Fixed by #58229
Closed

Concurrent updates during Reorganize partition backfill can be overwritten/reverted #58226

mjonss opened this issue Dec 12, 2024 · 0 comments · Fixed by #58229
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@mjonss
Copy link
Contributor

mjonss commented Dec 12, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Use current master, a3fa29e, apply this diff backfill-concurrent-dml-reorg-part.diff.txt
make failpoint-enable and run test TestMultiSchemaReorganizeNoPKBackfillDML.

2. What did you expect to see? (Required)

Test passing

3. What did you see instead (Required)

The rows updated during the Backfill was overwritten by the just read versions.
error log:

    result.go:49: 
        	Error Trace:	/Users/mattias/repos/tidb/pkg/testkit/result.go:49
        	            				/Users/mattias/repos/tidb/pkg/ddl/tests/partition/multi_domain_test.go:1179
        	            				/Users/mattias/repos/tidb/pkg/ddl/tests/partition/multi_domain_test.go:1001
        	            				/Users/mattias/repos/tidb/pkg/ddl/tests/partition/multi_domain_test.go:1195
        	Error:      	Not equal: 
        	            	expected: "[1 1 init O updated]\n[10 30004 delete reorganization NO Original]\n[11 7 public O Original]\n[12 30005 public NO Original]\n[13 8 none O Original]\n[14 30006 none NO Original]\n[2 2 init O updated]\n[3 3 delete only O updated]\n[4 30001 delete only NO updated]\n[5 4 write only O updated]\n[6 30002 write only NO updated]\n[7 5 write reorganization O Original]\n[8 30003 write reorganization NO Original]\n[9 6 delete reorganization O Original]\n"
        	            	actual  : "[1 60001 init O Original]\n[10 30004 delete reorganization NO Original]\n[11 7 public O Original]\n[12 30005 public NO Original]\n[13 8 none O Original]\n[14 30006 none NO Original]\n[2 60002 init O Original]\n[3 60003 delete only O Original]\n[4 60004 delete only NO Original]\n[5 4 write only O Original]\n[6 60005 write only NO Original]\n[7 5 write reorganization O Original]\n[8 30003 write reorganization NO Original]\n[9 6 delete reorganization O Original]\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,2 +1,2 @@
        	            	-[1 1 init O updated]
        	            	+[1 60001 init O Original]
        	            	 [10 30004 delete reorganization NO Original]
        	            	@@ -6,7 +6,7 @@
        	            	 [14 30006 none NO Original]
        	            	-[2 2 init O updated]
        	            	-[3 3 delete only O updated]
        	            	-[4 30001 delete only NO updated]
        	            	-[5 4 write only O updated]
        	            	-[6 30002 write only NO updated]
        	            	+[2 60002 init O Original]
        	            	+[3 60003 delete only O Original]
        	            	+[4 60004 delete only NO Original]
        	            	+[5 4 write only O Original]
        	            	+[6 60005 write only NO Original]
        	            	 [7 5 write reorganization O Original]
        	Test:       	TestMultiSchemaReorganizeNoPKBackfillDML
        	Messages:   	sql:select c1,_tidb_rowid,c2,c3 from t, args:[]
--- FAIL: TestMultiSchemaReorganizeNoPKBackfillDML (0.33s)

4. What is your TiDB version? (Required)

Current master:

tidb_version(): Release Version: v8.5.0-alpha-330-ga3fa29e58c-dirty
Edition: Community
Git Commit Hash: a3fa29e58c3bd368982116942f8cff916cb0eb67
Git Branch: master
UTC Build Time: 2024-12-12 22:57:58
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: unistore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants