Fix backup script execution order and add post-upload verification - #497
Open
Peolite001 wants to merge 1 commit into
Open
Fix backup script execution order and add post-upload verification#497Peolite001 wants to merge 1 commit into
Peolite001 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the database backup script execution order to prevent silent backup failures. Previously, the script attempted to call
upload_to_s3andupload_to_gcswithin the case statement before those functions were actually defined. Due toset -euo pipefail, this caused the script to exit with a "command not found" error immediately after a successful local dump, meaning backups were never uploaded.Key Changes:
scripts/backup-db.shto use a standardmain()function invoked at the bottom, ensuring all functions are defined before execution.aws s3api head-objectfor S3 andgsutil lsfor GCS) to verify the integrity of the uploaded backup, surfacing a distinct error if the upload fails to land in the bucket.Type
Related Issue
Closes #157
Testing
Infra / Docs Sync
docs/*claims were verified against the manifests (deployment, database, indexer, runbooks)Screenshots (if UI change)
N/A