Skip to content

PBM-1665 keep PITR running and prioritize different node for profile backups#1263

Merged
jcechace merged 3 commits intopercona:devfrom
jcechace:PBM-1665-pitr-backup-profile-storage
Feb 13, 2026
Merged

PBM-1665 keep PITR running and prioritize different node for profile backups#1263
jcechace merged 3 commits intopercona:devfrom
jcechace:PBM-1665-pitr-backup-profile-storage

Conversation

@jcechace
Copy link
Collaborator

@jcechace jcechace commented Feb 11, 2026

Ticket: https://perconadev.atlassian.net/browse/PBM-1665

PITR was being stopped only temporarily – when backup arrived, the main PITR slicer would be signaled, take a last slice and return. However the PITR monitor rutine in Agent would then check active backup logs and in case of profile storage, start the PITR anew. This took about 15s

This PR adjust the behavior in two ways

  1. It doesn't signal the PITR slicer if the backup is not on main storage. So it never get stopped for those 15s
  2. If backup is not on the main storage, it checks what node is currently running PITR and penalizes its priority heavily (unless that would interfere with prior priority adjustments). This way the backup will preferably start on a different node.

@jcechace jcechace marked this pull request as ready for review February 12, 2026 12:04
@jcechace jcechace force-pushed the PBM-1665-pitr-backup-profile-storage branch from 66ae91f to 6c0de56 Compare February 12, 2026 12:14
Copy link
Member

@boris-ilijic boris-ilijic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but it's necessary to expand it from use-case perspective.


// Only set if not already present (preserve previous priorities)
if _, exists := coefficients[pl.Node]; !exists {
coefficients[pl.Node] = 0.1 // low priority, making it a last resort
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work correctly for PSA. From requirements:

In case of PSA topology, prioritize Secondary.

P: 1.0; S (after deprioritize): 0.1 --> backup will be executed on P, and it should go on S.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P is actually 1/2, but your point is valid anyway. The priority for PITR secondary should be > 1/2. Since the number matters, are you OK if we make the score constants in pnm/prio/priority.go public?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprioritizePITRNodes deals with coefficient not scores, so maybe we can make that intention clear by setting coefficient prio.defaultScore - 0.1. That would be well good rule for protecting PITR node of running backup.

I would remove fixed 0.6, it's kind "where's this number coming from?" :)
But all good for me, this would work now.

@jcechace jcechace force-pushed the PBM-1665-pitr-backup-profile-storage branch from 6c0de56 to edf4d8b Compare February 13, 2026 08:53

// Only set if not already present (preserve previous priorities)
if _, exists := coefficients[pl.Node]; !exists {
coefficients[pl.Node] = 0.6 // low priority, making it a last resort
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boris-ilijic this should be do the trick for PSA. But I would prefer making the score constants in priority package public and use that here.

@boris-ilijic boris-ilijic self-requested a review February 13, 2026 10:14
boris-ilijic
boris-ilijic previously approved these changes Feb 13, 2026
@boris-ilijic boris-ilijic self-requested a review February 13, 2026 10:45
@jcechace jcechace force-pushed the PBM-1665-pitr-backup-profile-storage branch from a1b5bd6 to 1f31f29 Compare February 13, 2026 10:45
@jcechace jcechace merged commit 01eb998 into percona:dev Feb 13, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants