fix(dataprotection): redirect postReady for multi-component restores - #10466
Conversation
|
Auto Cherry-pick Instructions CLA Recheck Instructions |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10466 +/- ##
==========================================
+ Coverage 62.10% 62.16% +0.05%
==========================================
Files 533 533
Lines 63722 63839 +117
==========================================
+ Hits 39577 39687 +110
+ Misses 20547 20546 -1
- Partials 3598 3606 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cd0622a to
4b36418
Compare
Create the postReady Restore from the backup target component when a non-matching restore PVC is the trigger. Cover postReady-only logical restores and PITR prepareData+postReady restores so postReady is not treated as complete before the target-component Restore CR exists.
4b36418 to
082f164
Compare
| var target *dpv1alpha1.BackupStatusTarget | ||
| if backup.Status.Target != nil { | ||
| target = backup.Status.Target | ||
| } else if len(backup.Status.Targets) == 1 { |
There was a problem hiding this comment.
Updated in 082f164. Sharding PVCs now resolve through the sharding order before the single-target selector fallback, and postReady redirect re-checks the sharding source-target result so missing-target shards stay skip-only instead of redirecting to the unique backup target. Added TestEnsurePostReadyRestore_ShardingSingleTargetMissingTargetSkip_DoesNotRedirect. Focused suite and TestDecidePVCRestore passed locally; CI is rerunning.
Fixes #10418.
Summary
skipPostReadyas skip-only instead of treating every skip as redirectableValidation
go generate ./pkg/testutil/k8s/mocks(local compile prerequisite)go test ./controllers/dataprotection -run 'TestEnsurePostReadyRestore_(ShardingMissingTargetSkip_DoesNotRedirect|MultiComponent_(PrepareDataAndPostReady_RedirectsPostReady|PostReadyOnly_ShouldNotSilentlySkip|PostReadyOnly_TargetComponentNotYetCreated|PostReadyOnly_WaitsForAllComponentPVCs|PostReadyOnly_TargetsSlice|PostReadyRedirectPreservesTargetExecutionFields))|TestDecidePVCRestore_MultiComponent_PostReadyOnly_SkipsNonMatchingPVC|TestDecidePVCRestoreAssignsShardingTargetsByStableComponentOrder|TestRebindPVCAndPV_NilPopulatePVC_ReturnsFatalError' -count=1git diff --check -- controllers/dataprotection/volumepopulator_controller.go controllers/dataprotection/volumepopulator_controller_test.gogo test ./controllers/dataprotection -count=1cannot start envtest because/usr/local/kubebuilder/bin/etcdis absent; 0 envtest specs ranEvidence boundary
TiDB PITR on PR1/idc4 reported
13P/1F/0S, with PITR.6 showing zero postReady Restore CRs on #10423 head95b0723. This PR fixes the controller path and closes the local regression gate. A TiDB PITR runtime rerun against this PR head is still required for addon acceptance.