Skip to content

PBM-1511: Configuration for Fallback dbpath feature #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 10, 2025

Conversation

boris-ilijic
Copy link
Member

@boris-ilijic boris-ilijic commented May 29, 2025

PR for https://perconadev.atlassian.net/browse/PBM-1511

Following options and config params are added for pbm restore command:

Config Param Cmd Option Default
fallbackEnabled --fallback-enabled false
allowPartlyDone --allow-partly-done true

fallbackEnabled config param:

Enables or disables fallback feature during physical restore. When fallback is enabled, PBM moves all data files to the .fallbacksync dir, and if an error occurs during restore, PBM rolls back the whole cluster to the state before the restore.

allowPartlyDone config param:

If enabled, apply fallback feature to partly-done cluster. If the cluster finishes the restore with a state of partly-done, this parameter allows to decide whether to apply the fallback feature or not to such a cluster (successfully restored). When this parameter is disabled, PBM applies fallback feature and rolls back the whole cluster to the state before the restore.

Command line options for restore command

pbm restore --help
Restore backup

Usage:
  pbm restore [backup_name] [flags]

Flags:
      --allow-partly-done    Allows parly done state of the cluster after physical restore. If enabled (default), partly-done status for RS will be treated as successful restore.If disabled, fallback will be applied when cluster is partly-done.
      --fallback-enabled     Enables/disables fallback strategy when doing physical restore.
...

Disk free space validation

Before applying restore with enabled fallback feature, pbm-agents check for available space on disk and logs:

disk total: 71.61GB; used: 59.77GB; free space on disk: 11.84GB; available for pbm usage: 1.10GB; backup size: 1.57GB;

In case when there's not enough space restore will be canceled.
In case of incremental backup, all increments will be included in the backup size calculation.

Backup size metrics reported with describe-backup command

Following additional metrics are reported:

  • uncompressed size for the whole backup
  • compresses / uncompressed size for each RS within the cluster
pbm describe-backup 2025-06-05T16:57:35Z
name: "2025-06-05T16:57:35Z"
opid: 6841cc7f1f576b79efb26752
type: physical
...
status: done
size_h: 3.3 GiB
size_uncompressed_h: 4.0 GiB
....
replsets:
- name: rs2
  status: done
  node: rs202:30202
  size_h: 3.3 GiB
  size_uncompressed_h: 3.6 GiB

Support for older backups (v2.9.1 and below)

When fallback feature is enabled, and backup is made with PBM v2.9.1 or older release, fallback feature cannot be applied due to missing information about backup sizes on RS level. For such a backup, fallback feature will be automatically disabled and PBM will add log entry with appropriate description.

@boris-ilijic boris-ilijic marked this pull request as ready for review June 9, 2025 08:09
@boris-ilijic boris-ilijic requested a review from veceraj as a code owner June 9, 2025 08:09
veceraj
veceraj previously approved these changes Jun 9, 2025
@boris-ilijic boris-ilijic merged commit a8011e0 into dev Jun 10, 2025
35 of 36 checks passed
@boris-ilijic boris-ilijic deleted the PBM-1511-fallback-config-params branch June 10, 2025 14:44
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