-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
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