Fix compact backup labels and sharded compact options#6919
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@RidRisR: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What changed
compactbackup.physicalFileCacheCapacityandnamefields toCompactSpecfor sharded compact configuration.physicalFileCacheCapacityto tikv-ctl as--physical-file-cache-capacityinstead of using the hard-coded value.physicalFileCacheCapacityto0in backup-manager options.physicalFileCacheCapacityvalues as Kubernetes quantities and reject negative values while allowing0.nameto tikv-ctl as--nameonly when it is set.--crr-checkpoint-prefix crr-checkpointfor every sharded compact job, including when--untilis set explicitly.--replication-status-sub-prefix=crr-checkpointto BR for replication restore; newer BR resolves the checkpoint state itself.Why
CompactBackup Jobs used a hard-coded
app.kubernetes.io/instancevalue and backup-specific labels. Anti-affinity selectors that target the actual CompactBackup or BackupSchedule instance could not match compact Pods, allowing multiple compact Pods to schedule onto the same node.Sharded compact also needs user-facing YAML configuration for tikv-ctl
--physical-file-cache-capacityand--name.physicalFileCacheCapacitynow has a friendlier default: users may omit it and backup-manager will pass0, while invalid or negative explicit values are still rejected.For replication restore, newer BR can parse
crr-checkpoint/resume-state.jsondirectly, so the operator no longer needs to pass the replication status sub-prefix. Sharded compact still needs the checkpoint prefix for tikv-ctl to locate the replication checkpoint state, even when an explicitEndTsproduces--until.Validation
GOCACHE=/tmp/tidb-operator-go-build go test ./pkg/controller/compactbackup ./cmd/backup-manager/app/compact/options -count=1go test ./cmd/backup-manager/app/restore ./cmd/backup-manager/app/compact ./pkg/backup/restorerg -n "physicalFileCacheCapacity.*required when mode is sharded|required when mode is sharded" docs/api-references/docs.md pkg/apis/pingcap/v1alpha1 cmd/backup-manager/app/compact pkg/controller/compactbackup -Sgit diff --check a650aa3ce1e66bb28d76e75fd88d6daef569ec91...HEAD