Skip to content

download: skip chown of embedded_backup_disk for regular backups - #1654

Merged
Slach merged 1 commit into
masterfrom
issue_1653_regular_download_backup_disk
Oct 29, 2026
Merged

Slach merged 1 commit into
masterfrom
issue_1653_regular_download_backup_disk

Conversation

@Slach

@Slach Slach commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1653

downloadEpilogue chowned <embedded_backup_disk path>/<backup> for every disk with IsBackup. IsBackup is assigned in GetDisks purely by matching the disk name to clickhouse.embedded_backup_disk, independent of whether the downloaded backup is embedded. So a regular backup downloaded with use_embedded_backup_restore: true + embedded_backup_disk configured failed after the data was fetched:

Chown backup disk: lstat /var/lib/clickhouse/disks/backups_s3/<backup>: no such file or directory

(only when running as root, Chown is a no-op otherwise). The loop is now guarded by b.isEmbedded, which is derived from the backup tags, same as the .backup download block just above.

Test: TestDownloadRegularBackupWithEmbeddedBackupDisk creates a regular backup, then downloads and restores it with CLICKHOUSE_USE_EMBEDDED_BACKUP_RESTORE=true CLICKHOUSE_EMBEDDED_BACKUP_DISK=backups_s3. Fails on master with the error above, passes with the fix.

🤖 Generated with Claude Code

downloadEpilogue chowned <embedded_backup_disk path>/<backup> for every
disk marked IsBackup. IsBackup is set by disk name from config, regardless
of the kind of the downloaded backup, so a regular backup downloaded with
use_embedded_backup_restore=true + embedded_backup_disk configured failed
after the data was fetched with "Chown backup disk: lstat ...: no such
file or directory" (only as root, Chown is a no-op otherwise).

Guard the loop with b.isEmbedded, which is taken from the backup tags.

Fixes #1653

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40843672532

Coverage increased (+0.003%) to 70.571%

Details

  • Coverage increased (+0.003%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • 22 coverage regressions across 7 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

22 previously-covered lines in 7 files lost coverage.

File Lines Losing Coverage Coverage
pkg/backup/delete.go 8 74.68%
pkg/clickhouse/clickhouse.go 3 81.14%
pkg/storage/general.go 3 70.52%
pkg/backup/create.go 2 74.48%
pkg/backup/download.go 2 78.4%
pkg/storage/azblob.go 2 64.91%
pkg/storage/structs.go 2 81.82%

Coverage Stats

Coverage Status
Relevant Lines: 29719
Covered Lines: 20973
Line Coverage: 70.57%
Coverage Strength: 34487.82 hits per line

💛 - Coveralls

@Slach
Slach merged commit 044ca6b into master Oct 29, 2026
30 checks passed
@Slach Slach added this to the 2.8.3 milestone Oct 30, 2026
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.

download of a regular backup fails with "Chown backup disk" when embedded_backup_disk is configured

2 participants