Skip to content

Comments

refactor(restore/backup): structure pgBackRest options as map for safer and flexible#46

Merged
tsivaprasad merged 1 commit intomainfrom
PLAT-100-refactor-restore-backup-database-to-make-options-more-structured-phase1
Jun 13, 2025
Merged

refactor(restore/backup): structure pgBackRest options as map for safer and flexible#46
tsivaprasad merged 1 commit intomainfrom
PLAT-100-refactor-restore-backup-database-to-make-options-more-structured-phase1

Conversation

@tsivaprasad
Copy link
Contributor

@tsivaprasad tsivaprasad commented Jun 12, 2025

This PR refactors the restore and backup logic to support structured pgBackRest options via maps instead of raw string arrays.

Validation:

  1. Set up a 3-node cluster environment.
  2. Created a database, added a table, and inserted some rows.
  3. Took a backup of the database.
  4. Created a new database based on the one from step 2, and added a few more rows to it.
  5. Performed an in-place restore using the following configuration:
{
   "restore_config": {
        "provider": "pgbackrest",
        "source_database_id": "f2f1cae9-6f37-4609-aa98-d0991bff3493",
        "source_node_name": "n1",
        "source_database_name": "my_app",
        "repository": {
            "id": "e45dfd13-b318-4ce2-acbe-dd07a7c1c006",
            "type": "posix",
            "base_path": "/backups/container"
        },
         "restore_options": {
            "set": "20250612-083439F"
        }
    }
}
  1. Confirmed that the restore worked correctly and brought back the original data from step 2.
  2. Added unit tests to verify that basic options, keys with & without '--' prefix, and values containing whitespace are correctly converted from a map to an array.

PLAT-100

@tsivaprasad tsivaprasad requested a review from jason-lynch June 12, 2025 11:49
@tsivaprasad tsivaprasad merged commit de96f76 into main Jun 13, 2025
2 checks passed
@tsivaprasad tsivaprasad deleted the PLAT-100-refactor-restore-backup-database-to-make-options-more-structured-phase1 branch July 3, 2025 12:54
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