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

ddl: Reorganize Partition failure/rollback tests and fixes #53544

Merged
merged 66 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
207fd40
Support global index for reorganize partitions, wip
mjonss May 14, 2024
bb22854
Reorganize partition with global index works now, needs testing
mjonss May 14, 2024
762875a
Put back a line that was mistakenly removed
mjonss May 14, 2024
1cfe9f2
bazel_prepare
mjonss May 14, 2024
129377a
Cleanups
mjonss May 14, 2024
fffb68e
Issue when reorganize partition, expected index to exists, which is n…
mjonss May 14, 2024
59a8282
wip
mjonss May 16, 2024
098b8a6
Fixed REMOVE PARTITIONING and ALTER TABLE PARTITION BY
mjonss May 16, 2024
1c1b808
Added test
mjonss May 16, 2024
2bdbc14
Updated tests
mjonss May 17, 2024
62083f4
Updated tests
mjonss May 17, 2024
9884a80
Merge remote-tracking branch 'pingcap/master' into reorganize-global-…
mjonss May 17, 2024
ba38aab
More tests
mjonss May 17, 2024
7658bca
Merge remote-tracking branch 'pingcap/master' into reorganize-global-…
mjonss May 17, 2024
574259e
Fixed global index for Remove Partitioning and Partition By
mjonss May 18, 2024
4da81fc
bazel_prepare
mjonss May 18, 2024
96ad64a
Updated unstable test
mjonss May 19, 2024
041ca87
Updated comments
mjonss May 20, 2024
0bc6364
Review comment
mjonss May 20, 2024
90f1d68
Shadowed err variable, causing returning wrong err.
mjonss May 20, 2024
03cab15
Allow non-clustered global index
mjonss May 21, 2024
170f745
Added test for PK and disabled global index
mjonss May 21, 2024
79b813a
Updated tests
mjonss May 21, 2024
45e0538
Added comments about the different states in reorg partition
mjonss May 21, 2024
dd4808e
linting
mjonss May 21, 2024
f5818ad
bazel_prepare
mjonss May 21, 2024
a6d25c0
Updated integration tests
mjonss May 21, 2024
cab90d4
index on reorganize-global-index: a6d25c040f Updated integration tests
mjonss May 22, 2024
c6bf084
On reorganize-global-index: wip failpoint tests for reorganize partition
mjonss May 22, 2024
b3f2a13
More rollback and failure tests for reorg partition
mjonss May 22, 2024
6c294fa
WIP improving reorg partition failure handling
mjonss May 22, 2024
db68b7a
Fixed failures and rollbacks in doReorganizeTablePartitions
mjonss May 24, 2024
232477b
More reorg failure tests and fixes
mjonss May 24, 2024
79530c9
Linting
mjonss May 24, 2024
7ac60dc
Linting
mjonss May 24, 2024
d102984
Linting
mjonss May 24, 2024
ec8ce10
minor change, addressed review comments
mjonss May 25, 2024
265c7da
Merge remote-tracking branch 'pingcap/master' into reorganize-global-…
mjonss May 25, 2024
d429108
Updated test
mjonss May 25, 2024
f897392
Linting
mjonss May 25, 2024
fb0909e
Linting
mjonss May 25, 2024
e35466c
Merge remote-tracking branch 'pingcap/master' into reorganize-global-…
mjonss May 25, 2024
c4bf0de
Merge remote-tracking branch 'pingcap/master' into reorganize-global-…
mjonss May 29, 2024
d232fa5
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss May 29, 2024
e8585d6
Minor changes after testing rollback in a separate PR
mjonss May 29, 2024
bdca845
Cleanup
mjonss May 29, 2024
7f9e96e
Merge branch 'reorganize-global-index' into part-reorg-rollback-tests
mjonss May 31, 2024
44533f2
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Jun 4, 2024
1ad5526
Reload the tableInfo, instead of using the just altered one.
mjonss Jun 5, 2024
510226f
Fixed rollback for LIST partitioned tables.
mjonss Jun 5, 2024
ff3a856
Added DML to test
mjonss Jun 10, 2024
69594fd
Fixed handle compare for global index during index creation.
mjonss Jun 11, 2024
d02c461
Simplified the code and updated tests
mjonss Jun 11, 2024
bec8d4e
reverted non-needed changes
mjonss Jun 11, 2024
7c27c0f
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Jun 11, 2024
18a5c80
Linting
mjonss Jun 12, 2024
9c79706
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Aug 5, 2024
95ae8de
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Sep 9, 2024
4e5b35c
manual merge resolution, added back tests.
mjonss Sep 9, 2024
de01630
Moved test file + bazel_prepare
mjonss Sep 9, 2024
13f2a00
Update pkg/meta/model/table.go
mjonss Sep 19, 2024
5bdf0a7
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Sep 19, 2024
8214807
using testfailpoint instead of failpoint in test
mjonss Sep 20, 2024
da8df8d
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Sep 20, 2024
47e4b74
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Sep 26, 2024
d7c70a8
Merge remote-tracking branch 'pingcap/master' into part-reorg-rollbac…
mjonss Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkg/ddl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ go_test(
"placement_policy_test.go",
"placement_sql_test.go",
"primary_key_handle_test.go",
"reorg_partition_test.go",
"repair_table_test.go",
"restart_test.go",
"rollingback_test.go",
Expand Down Expand Up @@ -337,7 +336,6 @@ go_test(
"//pkg/util/domainutil",
"//pkg/util/gcutil",
"//pkg/util/generic",
"//pkg/util/mathutil",
"//pkg/util/mock",
"//pkg/util/sem",
"//pkg/util/sqlexec",
Expand Down
8 changes: 8 additions & 0 deletions pkg/ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,14 @@ func (w *addIndexTxnWorker) checkHandleExists(idxInfo *model.IndexInfo, key kv.K
if hasBeenBackFilled {
return nil
}
if idxInfo.Global {
// 'handle' comes from reading directly from a partition, without partition id,
// so we can only compare the handle part of the key.
if ph, ok := h.(kv.PartitionHandle); ok && ph.Handle.Equal(handle) {
// table row has been back-filled already, OK to add the index entry
return nil
}
}
return ddlutil.GenKeyExistsErr(key, value, idxInfo, tblInfo)
}

Expand Down
Loading