Skip to content

feat: accept content_addressed as an Antalya CAS disk metadata type - #1678

Closed
mvanhorn wants to merge 1 commit into
Altinity:masterfrom
mvanhorn:fix/1478-content-addressed-metadata-type
Closed

mvanhorn wants to merge 1 commit into
Altinity:masterfrom
mvanhorn:fix/1478-content-addressed-metadata-type

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Why

Creating a backup fails when a disk uses Antalya's content-addressed metadata. The backup API reports createBackup failed because metadata_type content_addressed is rejected as unsupported while disk credentials are loaded from storage configuration.

Credential loading only allowed metadata types local, plain, plain_rewritable, and cas. Antalya writes content_addressed in storage_configuration and ContentAddressed in system.disks, which is lowercased to contentaddressed, and neither spelling was accepted or mapped to cas.

What changed

The credential allow-list now includes content_addressed and contentaddressed. normalizeDiskMetadataType maps both spellings to cas so system.disks rows match the existing CAS disk path. Tests cover that mapping and XML versus SQL credential parsing for both spellings, and the changelog records the accepted metadata type.

Tests

  • go test ./pkg/clickhouse/... ./pkg/storage/object_disk/... passed both packages.
  • Ran make test in a Linux container (golang:1.24) for the clickhouse-backup metadataPathFromRaw change; it passed.
  • The tests in pkg/clickhouse/disks_relative_test.go and pkg/storage/object_disk/object_disk_test.go fail without the fix in the clickhouse-backup metadataPathFromRaw change (checked by reverting the source changes).
  • The changed test pkg/clickhouse/disks_relative_test.go did not run here: no test runner for it was available.
  • The changed test pkg/storage/object_disk/object_disk_test.go did not run here: no test runner for it was available.

Fixes #1478

The credential allow-list now includes content_addressed and
contentaddressed. normalizeDiskMetadataType maps both spellings to cas
so system.disks rows match the existing CAS disk path. Tests cover that
mapping and XML versus SQL credential parsing for both spellings, and
the changelog records the accepted metadata type.

Fixes Altinity#1478
@Slach

Slach commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

This can't work, for two independent reasons.

  1. content_addressed is not a valid metadata_type in any released Antalya build. It existed only in the dev branch cas-gc-rebuild (Altinity/ClickHouse@464c37322d6, 2026-06-02) and was renamed to cas in Altinity/ClickHouse@e00e0121858 (2026-08-03). Current antalya-26.8 metadataTypeFromString() throws UNKNOWN_ELEMENT_IN_CONFIG for it, so clickhouse-server won't start with such a disk. The system.disks.metadata_type enum is CAS (lowercased to cas), which is already handled by Disk.IsCAS(). add support for content_addressed metadata type #1478 was reported against a pre-rename dev build.
  2. Even with the old spelling, the failing path in add support for content_addressed metadata type #1478 (AddTableToLocalBackup → uploadObjectDiskParts) is the non-embedded FREEZE path. FREEZE on a CAS disk leaves no local metadata to hardlink or read. That's why since v2.8.3 CAS disks are supported only with clickhouse.use_embedded_backup_restore: true, and checkDisksConsistency fails explicitly otherwise. With this PR's mapping to cas, create would just fail there with has no local files, set clickhouse.use_embedded_backup_restore: true instead. It doesn't fix anything.

Fix for #1478: upgrade Antalya to a build with metadata_type=cas and use clickhouse-backup 2.8.3+ with use_embedded_backup_restore: true. Closing.

@Slach Slach closed this Nov 14, 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.

add support for content_addressed metadata type

2 participants