Skip to content

fix(scheduledbackup): use label-based indexer instead of ownership#9489

Merged
leonardoce merged 1 commit intomainfrom
dev/9466
Dec 23, 2025
Merged

fix(scheduledbackup): use label-based indexer instead of ownership#9489
leonardoce merged 1 commit intomainfrom
dev/9466

Conversation

@armru
Copy link
Member

@armru armru commented Dec 18, 2025

The ScheduledBackup controller was using a broken field indexer on owner references to find child Backups for concurrency checking. The indexer checked for the wrong owner kind, making it non-functional.

This fix replaces the owner reference-based indexer with a more robust approach: a field indexer on the ParentScheduledBackupLabel that is already set on all backups created by ScheduledBackup. This label is always present regardless of the backupOwnerReference configuration.

Closes #9485

@armru armru requested a review from a team as a code owner December 18, 2025 12:01
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 18, 2025
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.27 release-1.28 labels Dec 18, 2025
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot bot added bug 🐛 Something isn't working ok to merge 👌 This PR can be merged labels Dec 18, 2025
@armru armru changed the title fix(scheduledbackup): fix backup concurrency checking using label-based indexer fix(scheduledbackup): use label-based indexer instead of ownership Dec 18, 2025
@armru
Copy link
Member Author

armru commented Dec 22, 2025

/test

@github-actions
Copy link
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/20435653514

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 22, 2025
…ed indexer

The ScheduledBackup controller was using a broken field indexer on owner references
to find child Backups for concurrency checking. The indexer checked for the wrong
owner kind, making it non-functional.

This fix replaces the owner reference-based indexer with a more robust approach:
a field indexer on the ParentScheduledBackupLabel that is already set on all backups
created by ScheduledBackup. This label is always present regardless of the
backupOwnerReference configuration.

Closes #9466

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@leonardoce leonardoce merged commit 54d9c2b into main Dec 23, 2025
28 checks passed
@leonardoce leonardoce deleted the dev/9466 branch December 23, 2025 16:45
cnpg-bot pushed a commit that referenced this pull request Dec 23, 2025
…9489)

The ScheduledBackup controller was using a broken field indexer on owner
references to find child Backups for concurrency checking. The indexer
checked for the wrong owner kind, making it non-functional.

This fix replaces the owner reference-based indexer with a more robust
approach: a field indexer on the ParentScheduledBackupLabel that is
already set on all backups created by ScheduledBackup. This label is
always present regardless of the backupOwnerReference configuration.

Closes #9485

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit 54d9c2b)
cnpg-bot pushed a commit that referenced this pull request Dec 23, 2025
…9489)

The ScheduledBackup controller was using a broken field indexer on owner
references to find child Backups for concurrency checking. The indexer
checked for the wrong owner kind, making it non-functional.

This fix replaces the owner reference-based indexer with a more robust
approach: a field indexer on the ParentScheduledBackupLabel that is
already set on all backups created by ScheduledBackup. This label is
always present regardless of the backupOwnerReference configuration.

Closes #9485

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit 54d9c2b)
cnpg-bot pushed a commit that referenced this pull request Dec 23, 2025
…9489)

The ScheduledBackup controller was using a broken field indexer on owner
references to find child Backups for concurrency checking. The indexer
checked for the wrong owner kind, making it non-functional.

This fix replaces the owner reference-based indexer with a more robust
approach: a field indexer on the ParentScheduledBackupLabel that is
already set on all backups created by ScheduledBackup. This label is
always present regardless of the backupOwnerReference configuration.

Closes #9485

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit 54d9c2b)
mnencia pushed a commit that referenced this pull request Jan 20, 2026
…9489)

The ScheduledBackup controller was using a broken field indexer on owner
references to find child Backups for concurrency checking. The indexer
checked for the wrong owner kind, making it non-functional.

This fix replaces the owner reference-based indexer with a more robust
approach: a field indexer on the ParentScheduledBackupLabel that is
already set on all backups created by ScheduledBackup. This label is
always present regardless of the backupOwnerReference configuration.

Closes #9485

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit 54d9c2b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases bug 🐛 Something isn't working lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged release-1.25 release-1.27 release-1.28 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Backups field indexer used by ScheduledBackup controller always returns empty

4 participants