Skip to content

fix: prevent database backups from running the dump twice#4586

Open
ravindu0823 wants to merge 1 commit into
Dokploy:canaryfrom
ravindu0823:fix/duplicate-database-backup-dump
Open

fix: prevent database backups from running the dump twice#4586
ravindu0823 wants to merge 1 commit into
Dokploy:canaryfrom
ravindu0823:fix/duplicate-database-backup-dump

Conversation

@ravindu0823

Copy link
Copy Markdown

@-

getBackupCommand executed the dump command once to /dev/null as a
"validation" pass and then a second time piped to rclone. This doubled
the load on the database and, on busy databases, risked an inconsistent
backup between the two runs.

Stream the dump straight to S3 in a single pass and rely on
`set -o pipefail` so a dump failure (not just an rclone failure) still
aborts the upload and reports an error. Affects all database types that
share this command builder (postgres, mysql, mariadb, mongo, libsql,
compose).

Adds a regression test asserting the dump command appears exactly once
and is piped into the upload.

Fixes Dokploy#4222

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ravindu0823 ravindu0823 requested a review from Siumauricio as a code owner June 9, 2026 08:20
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant