ddl, ingest: improve test coverage for checkpoint validation#65421
Merged
ti-chi-bot[bot] merged 6 commits intoJan 13, 2026
Conversation
6476c6d to
b6717f7
Compare
Add test cases for the following previously uncovered scenarios: 1. TestIngestOwnerTransferEmptyPartition (pingcap#44265): Tests owner transfer with empty partitions ensures checkpoint contains partition ID. 2. TestIngestPartitionCheckpointRecovery (pingcap#43997/pingcap#44024): Tests that checkpoint correctly saves partition info for recovery. 3. TestIngestConcurrentJobCleanupRace (pingcap#44137/pingcap#44140): Tests parallel add index jobs don't cause panic from cleanup race. 4. TestIngestCancelCleanupOrder (pingcap#43323/pingcap#43326): Tests cancel during execution doesn't cause nil pointer panic. 5. TestIngestGCSafepointBlocking (pingcap#40074/pingcap#40081): Tests add index uses correct TS and blocks GC safepoint advancement. 6. TestCheckpointInstanceAddrValidation (pingcap#43983/pingcap#43957): Tests checkpoint instance address validation works correctly. 7. TestCheckpointPhysicalIDValidation: Tests checkpoint physical table ID validation during recovery.
b6717f7 to
1da2089
Compare
1da2089 to
a4bc6b2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #65421 +/- ##
================================================
+ Coverage 78.4730% 78.7759% +0.3028%
================================================
Files 1938 1917 -21
Lines 534229 543576 +9347
================================================
+ Hits 419226 428207 +8981
- Misses 113483 113794 +311
- Partials 1520 1575 +55
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Add tests to verify checkpoint validation in add index ingest mode: - TestCheckpointInstanceAddrValidation: Verify instance address uses unique identifier (AdvertiseAddress + TempDir) instead of just host:port, covering pingcap#43983 and pingcap#43957 - TestCheckpointPhysicalIDValidation: Verify checkpoint physical_id is always a valid partition ID by parsing from reorg_meta JSON - TestAddIndexWithEmptyPartitions: Verify all partitions (including empty ones) are correctly iterated during add index, using afterUpdatePartitionReorgInfo failpoint to capture each partition switch, covering pingcap#44265 Also clean up redundant/slow tests in realtikvtest: - Remove TestIngestOwnerTransferEmptyPartition (51s, too slow) - Remove TestIngestPartitionCheckpointRecovery (redundant) - Simplify TestIngestCancelCleanupOrder Issue Number: close pingcap#65420
a4bc6b2 to
fea2c99
Compare
D3Hunter
approved these changes
Jan 6, 2026
joechenrh
reviewed
Jan 7, 2026
Member
|
/retest |
Member
|
/retest |
4 similar comments
Member
|
/retest |
Member
|
/retest |
Member
|
/retest |
Member
|
/retest |
joechenrh
approved these changes
Jan 13, 2026
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, joechenrh 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 |
Member
|
/retest |
2 similar comments
Member
|
/retest |
Member
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #65420
Problem Summary:
Improve add index ingest test coverage for checkpoint validation and empty partitions, and fix realtikvtest reliability by using real backend failpoints, enforcing concurrent ingest overlap, and canceling after ingest starts.
What changed and how does it work?
Check List
Tests
Run: go test -v -run 'TestCheckpointInstanceAddrValidation|TestCheckpointPhysicalIDValidation|TestAddIndexWithEmptyPartitions' --tags=intest ./pkg/ddl/ingest
Run: go test -v -run 'TestIngestConcurrentJobCleanupRace|TestIngestCancelCleanupOrder' --tags=intest ./tests/realtikvtest/addindextest3/...
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.