Skip to content

Antalya 26.8: Honor remote_fs_execute_merges_on_single_replica_time_threshold on CAS disks and tolerate trailing whitespace in ServerUUID::load - #2916

Open
sks wants to merge 1 commit into
Altinity:antalya-26.8from
stackgenhq:fix/antalya-26.8/cas-prod-improvements
Open

sks wants to merge 1 commit into
Altinity:antalya-26.8from
stackgenhq:fix/antalya-26.8/cas-prod-improvements

Conversation

@sks

@sks sks commented Nov 18, 2026 •

Copy link
Copy Markdown

On a ReplicatedMergeTree table backed by a content-addressed (metadata_type = cas) disk, remote_fs_execute_merges_on_single_replica_time_threshold was previously only populated in ReplicatedMergeTreeMergeStrategyPicker::refreshState() when allow_remote_fs_zero_copy_replication was enabled (which is rejected on a CAS disk), and shouldMergeOnSingleReplica() only read execute_merges_on_single_replica_time_threshold. On a multi-volume storage policy (a local hot disk paired with a content-addressed cold disk), enabling execute_merges_on_single_replica_time_threshold to coordinate cold merges also forced local hot-volume merges onto a single replica, where peers could not relink via CA_RELINK_COOKIE and had to wait and stream bytes over interserver HTTP.

Separately, loadServerUUID() (src/Core/ServerUUID.cpp) called readUUIDText(uuid, in) followed immediately by assertEOF(in). When /var/lib/clickhouse/uuid was pre-seeded with a trailing newline (37 bytes), assertEOF(in) threw Code: 27 (CANNOT_PARSE_INPUT_ASSERTION_FAILED), logged an error, and overwrote /var/lib/clickhouse/uuid with a newly generated random UUIDv4 — breaking server identity continuity across restarts on a content-addressed mount slot (Code: 246).

Changes

  • ReplicatedMergeTreeMergeStrategyPicker:
    • refreshState() now populates remote_fs_execute_merges_on_single_replica_time_threshold whenever the table's storage policy contains a content-addressed (disk->isContentAddressed()) disk, in addition to allow_remote_fs_zero_copy_replication.
    • shouldMergeOnSingleReplica() checks whether all source_parts of a MERGE_PARTS log entry reside on a content-addressed or zero-copy disk (isContentAddressed() || supportZeroCopyReplication()). When they do, remote_fs_execute_merges_on_single_replica_time_threshold applies so cold CAS merges execute on a single replica and peers relink via CA_RELINK_COOKIE. When any source part resides on a local non-CAS disk, only execute_merges_on_single_replica_time_threshold (0 by default) applies.
  • ServerUUID:
    • loadServerUUID() now calls skipWhitespaceIfAny(in) before assertEOF(in) so a trailing newline in /var/lib/clickhouse/uuid is accepted without regenerating the server UUID, while trailing non-whitespace garbage still fails assertEOF(in) and regenerates.
  • Tests & Docs:
    • Added src/Core/tests/gtest_server_uuid.cpp covering exact 36-byte UUIDs, newline-terminated UUIDs, and invalid trailing content.
    • Documented single-replica merge coordination for single-disk and multi-volume CAS policies in docs/en/antalya/cas/architecture/replication.md.

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Honor remote_fs_execute_merges_on_single_replica_time_threshold for ReplicatedMergeTree merges whose source parts reside on a content-addressed (cas) disk (keeping local-volume merges on multi-volume policies governed by execute_merges_on_single_replica_time_threshold), and tolerate trailing whitespace when loading /var/lib/clickhouse/uuid in ServerUUID::load.

Documentation entry for user-facing changes

  • Documentation is written: updated docs/en/antalya/cas/architecture/replication.md with single-replica merge threshold behavior on single-disk and multi-volume CAS policies.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

…pace-tolerant ServerUUID::load

1. In ReplicatedMergeTreeMergeStrategyPicker, populate
   remote_fs_execute_merges_on_single_replica_time_threshold when the
   table's storage policy includes a content-addressed (CAS) disk, and
   use it in shouldMergeOnSingleReplica() when all source parts of the
   merge reside on a content-addressed or zero-copy remote disk. On
   multi-volume local-hot / CAS-cold storage policies, this keeps local
   disk merges independent of remote_fs_execute_merges_on_single_replica_time_threshold
   while coordinating cold CAS merges on a single replica for
   CA_RELINK_COOKIE relinking.

2. In loadServerUUID (ServerUUID.cpp), skip trailing whitespace before
   assertEOF() so newline-terminated /var/lib/clickhouse/uuid files do
   not fail with CANNOT_PARSE_INPUT_ASSERTION_FAILED and get overwritten
   with a newly generated random UUIDv4.

3. Add unit test coverage in src/Core/tests/gtest_server_uuid.cpp and
   document single-replica merge coordination for mixed local/CAS
   policies in docs/en/antalya/cas/architecture/replication.md.

Signed-off-by: sabith <sks@stackgen.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants