Skip to content

support Antalya CAS disks for embedded backup/restore, fix #1562 - #1656

Merged
Slach merged 1 commit into
masterfrom
antalya_cas_disk_1562
Oct 30, 2026
Merged

Slach merged 1 commit into
masterfrom
antalya_cas_disk_1562

Conversation

@Slach

@Slach Slach commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Fix #1562

Antalya metadata_type=cas disks keep parts as content-addressed objects in the pool. system.disks.path for such a disk is a bucket prefix with no local directory behind it.

Problem

  • create_remote with use_embedded_backup_restore: true failed in checkDisksConsistency:
    disk "cas" (type "s3") path "/var/lib/clickhouse/<prefix>/" is not exists locally
  • after that was fixed, restore_remote failed in fixEmbeddedMetadata → getObjectDisksCredentials:
    unsupported <metadata_type>cas</metadata_type>, because credentials are parsed for every server disk

Changes

  • checkDisksConsistency skips CAS disks when use_embedded_backup_restore: true. Without embedded mode it now reports an explicit error: FREEZE on CAS publishes shadow refs inside the pool, so there are no local files to hardlink.
  • credentialsFromDiskArgs accepts metadata_type=cas, which uses the same connection settings as other object storage disks.
  • new Disk.IsCAS()

Tests

  • unit: TestCheckDisksConsistency (CAS with and without embedded), CAS case in TestCredentialsFromDiskArgs_XMLAndSQLParity
  • integration: TestAntalyaCASDisk runs embedded create_remote → DROP → restore_remote for a table on cas + cas_cache disks (the reporter's layout), then checks the row count and that the restored parts are back on the CAS disks.
    It runs only on the Antalya image and is skipped elsewhere. Passes locally with:
    CLICKHOUSE_IMAGE=altinity/clickhouse-server CLICKHOUSE_VERSION=26.6.8.20002.altinityantalya RUN_TESTS=TestAntalyaCASDisk ./test/integration/run.sh
    
    MinIO OSS fails the CAS mount capability probe, so the test disk uses skip_access_check=true, the same as the reporter's config.

The CI integration matrix has no Antalya image yet, so TestAntalyaCASDisk is skipped in CI.

🤖 Generated with Claude Code

Antalya `metadata_type=cas` disks keep parts as content-addressed objects
in the pool, system.disks.path is a bucket prefix without any local
directory behind it. create_remote failed in checkDisksConsistency with
"is not exists locally", and restore_remote failed in fixEmbeddedMetadata
because credentialsFromDiskArgs rejected `<metadata_type>cas</metadata_type>`
while parsing credentials of all server disks.

- checkDisksConsistency skips CAS disks when use_embedded_backup_restore
  is enabled, otherwise reports an explicit error: FREEZE on CAS publishes
  shadow refs in the pool, there are no local files to hardlink
- credentialsFromDiskArgs accepts metadata_type=cas, connection settings
  are the same as for other object storage disks
- TestAntalyaCASDisk runs embedded create_remote/restore_remote for a
  table on cas+cache disk, requires altinity antalya image >= 26.6
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40926125661

Coverage increased (+0.02%) to 70.568%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 8 of 8 lines across 3 files are fully covered (100%).
  • 17 coverage regressions across 7 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

17 previously-covered lines in 7 files lost coverage.

File Lines Losing Coverage Coverage
pkg/backup/upload.go 4 74.06%
pkg/backup/freezes.go 3 72.95%
pkg/backup/list.go 2 70.26%
pkg/clickhouse/clickhouse.go 2 81.56%
pkg/backup/create_remote.go 2 66.8%
pkg/storage/general.go 2 70.27%
pkg/backup/backuper.go 2 79.93%

Coverage Stats

Coverage Status
Relevant Lines: 29726
Covered Lines: 20977
Line Coverage: 70.57%
Coverage Strength: 34498.2 hits per line

💛 - Coveralls

@Slach
Slach merged commit 1591f26 into master Oct 30, 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.

support backup for antalya CAS disks

2 participants