Repository navigation
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
Conversation
…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>
sks
force-pushed
the
fix/antalya-26.8/cas-prod-improvements
branch
from
November 18, 2026 20:56
414c7e6 to
c682532
Compare
sks
marked this pull request as ready for review
November 18, 2026 20:57
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a
ReplicatedMergeTreetable backed by a content-addressed (metadata_type = cas) disk,remote_fs_execute_merges_on_single_replica_time_thresholdwas previously only populated inReplicatedMergeTreeMergeStrategyPicker::refreshState()whenallow_remote_fs_zero_copy_replicationwas enabled (which is rejected on a CAS disk), andshouldMergeOnSingleReplica()only readexecute_merges_on_single_replica_time_threshold. On a multi-volume storage policy (a local hot disk paired with a content-addressed cold disk), enablingexecute_merges_on_single_replica_time_thresholdto coordinate cold merges also forced local hot-volume merges onto a single replica, where peers could not relink viaCA_RELINK_COOKIEand had to wait and stream bytes over interserver HTTP.Separately,
loadServerUUID()(src/Core/ServerUUID.cpp) calledreadUUIDText(uuid, in)followed immediately byassertEOF(in). When/var/lib/clickhouse/uuidwas pre-seeded with a trailing newline (37bytes),assertEOF(in)threwCode: 27 (CANNOT_PARSE_INPUT_ASSERTION_FAILED), logged an error, and overwrote/var/lib/clickhouse/uuidwith a newly generated randomUUIDv4— breaking server identity continuity across restarts on a content-addressed mount slot (Code: 246).Changes
ReplicatedMergeTreeMergeStrategyPicker:refreshState()now populatesremote_fs_execute_merges_on_single_replica_time_thresholdwhenever the table's storage policy contains a content-addressed (disk->isContentAddressed()) disk, in addition toallow_remote_fs_zero_copy_replication.shouldMergeOnSingleReplica()checks whether allsource_partsof aMERGE_PARTSlog entry reside on a content-addressed or zero-copy disk (isContentAddressed() || supportZeroCopyReplication()). When they do,remote_fs_execute_merges_on_single_replica_time_thresholdapplies so cold CAS merges execute on a single replica and peers relink viaCA_RELINK_COOKIE. When any source part resides on a local non-CAS disk, onlyexecute_merges_on_single_replica_time_threshold(0by default) applies.ServerUUID:loadServerUUID()now callsskipWhitespaceIfAny(in)beforeassertEOF(in)so a trailing newline in/var/lib/clickhouse/uuidis accepted without regenerating the server UUID, while trailing non-whitespace garbage still failsassertEOF(in)and regenerates.src/Core/tests/gtest_server_uuid.cppcovering exact 36-byte UUIDs, newline-terminated UUIDs, and invalid trailing content.docs/en/antalya/cas/architecture/replication.md.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Honor
remote_fs_execute_merges_on_single_replica_time_thresholdforReplicatedMergeTreemerges whose source parts reside on a content-addressed (cas) disk (keeping local-volume merges on multi-volume policies governed byexecute_merges_on_single_replica_time_threshold), and tolerate trailing whitespace when loading/var/lib/clickhouse/uuidinServerUUID::load.Documentation entry for user-facing changes
docs/en/antalya/cas/architecture/replication.mdwith single-replica merge threshold behavior on single-disk and multi-volume CAS policies.CI/CD Options
Exclude tests:
Regression jobs to run: