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

non-existing rollback of TRUNCATE PARTITION, causing hang due to errors. #57721

Closed
mjonss opened this issue Nov 26, 2024 · 1 comment
Closed
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@mjonss
Copy link
Contributor

mjonss commented Nov 26, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

During state Write Only, TRUNCATE PARTITION should be able to rollback, but currently that is not implemented until #56029 was merged, including a lot of tests. This needs to be fixed in 8.5 as well.

It also blocks insert during some states, see #55819

1. Minimal reproduce step (Required)

Remove the actual code change from #56029 and run TestTiFlashFailTruncatePartition or TestTruncatePartitionListFailuresWithGlobalIndex to see they will never complete, due to missing rollback of TRUNCATE PARTITION. patch like this: truncate_partition.patch

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

Tests to terminate, preferably with success

3. What did you see instead (Required)

Test entered infinit loop.

From TestTiFlashFailTruncatePartition:

[2024/11/26 10:50:46.591 +01:00] [INFO] [job_worker.go:784] ["run DDL job"] [category=ddl] [jobID=118] [conn=6] [job="ID:118, Type:truncate partition, State:running, SchemaState:write only, SchemaID:2, TableID:110, RowCount:0, ArgLen:0, start time: 2024-11-26 10:34:41.456 +0100 CET, Err:[ddl:-1]enforced error, ErrCount:2643397, SnapshotVersion:0, Version: v2"]

From TestTruncatePartitionListFailuresWithGlobalIndex:

[2024/11/26 11:00:53.203 +01:00] [INFO] [job_worker.go:784] ["run DDL job"] [category=ddl] [jobID=117] [conn=3] [job="ID:117, Type:truncate partition, State:running, SchemaState:write only, SchemaID:2, TableID:110, RowCount:0, ArgLen:0, start time: 2024-11-26 11:00:10.181 +0100 CET, Err:[ddl:-1]Injected error by truncatePartFail1, ErrCount:32766215, SnapshotVersion:0, Version: v2"]

Where you see the ErrCount > 30M errors, without breaking or rolling back, in write only state, where it should be rollbackable

4. What is your TiDB version? (Required)

@mjonss
Copy link
Contributor Author

mjonss commented Nov 29, 2024

Closed by #57724

@mjonss mjonss closed this as completed Nov 29, 2024
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. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants