Repository navigation
import into: fix conflict cleanup after functional-index schema evolution (#70374) - #70385
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughConflict cleanup now decodes only visible columns before re-encoding rows. Unit and NextGen integration tests cover functional-index conflicts after visible-column and unique-index additions. Two Bazel test targets also use lower shard counts. ChangesConflict cleanup
Test sharding
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, qw4990 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-nextgen-202603 #70385 +/- ##
===========================================================
Coverage ? 76.2468%
===========================================================
Files ? 1937
Lines ? 541473
Branches ? 0
===========================================================
Hits ? 412856
Misses ? 128617
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
ae13335
into
pingcap:release-nextgen-202603
This is an automated cherry-pick of #70374
What problem does this PR solve?
Issue Number: close #70372
Problem Summary:
When
IMPORT INTO ... WITH on_duplicate_key='capture'resolves conflicts for a table whose functional-index hidden column physically precedes a later visible column, conflict cleanup decodes persisted rows using all table columns but re-encodes them as visible-column input. The positional mismatch can reconstruct and delete the wrong ordinary index keys. The import can then fail checksum validation after leaving ghost unique-index entries or removing live uniqueness protection.What changed and how does it work?
VisibleCols()so the decoded datum slice uses the same positional domain as the duplicate-resolution encoder.ADMIN CHECK TABLE, and subsequent uniqueness enforcement.Check List
Tests
Validation performed:
./tools/check/failpoint-go-test.sh pkg/dxf/importinto/conflictedkv -run '^TestHandler$' -count=1NEXT_GEN=1 go test -count=1 -v -run '^TestImportInto$/^TestGlobalSortFunctionalIndexConflictAfterAddingVisibleColumn$' -tags=intest,nextgen -timeout=40m ./tests/realtikvtest/importintotest4 -args -with-real-tikv -tikv-path 'tikv://127.0.0.1:2379?disableGC=true'make lintADMIN CHECK TABLEstatements passed, and inserting a row using the formerly ghosted unique value succeeded.The RealTiKV regression was also run against the old
Cols()behavior and reproduced the checksum mismatch (total_kvs: 2 vs 0,total_bytes: 80 vs 21). The identical test passed withVisibleCols().Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit