Skip to content

Fix backup script execution order and add post-upload verification - #497

Open
Peolite001 wants to merge 1 commit into
Stellar-Search:mainfrom
Peolite001:fix-backup-script
Open

Fix backup script execution order and add post-upload verification#497
Peolite001 wants to merge 1 commit into
Stellar-Search:mainfrom
Peolite001:fix-backup-script

Conversation

@Peolite001

Copy link
Copy Markdown

Summary

Fixes the database backup script execution order to prevent silent backup failures. Previously, the script attempted to call upload_to_s3 and upload_to_gcs within the case statement before those functions were actually defined. Due to set -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:

  • Restructured scripts/backup-db.sh to use a standard main() function invoked at the bottom, ensuring all functions are defined before execution.
  • Added post-upload verification steps (aws s3api head-object for S3 and gsutil ls for GCS) to verify the integrity of the uploaded backup, surfacing a distinct error if the upload fails to land in the bucket.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Smart contract change

Related Issue

Closes #157

Testing

  • Tested locally on Testnet
  • No TypeScript / Rust errors
  • Docs updated if needed

Infra / Docs Sync

  • If this PR changes infrastructure (k8s/ manifests, workflows, scripts), docs/* claims were verified against the manifests (deployment, database, indexer, runbooks)

Screenshots (if UI change)

N/A

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.

Infra: scripts/backup-db.sh calls upload_to_s3/upload_to_gcs before they're defined — nightly production backups fail every run

1 participant