Skip to content

Use a unique random file name for the disk access check - #125098

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:disk-access-check-random-name
Oct 11, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:disk-access-check-random-name

Conversation

@groeneai

@groeneai groeneai commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Description

Follow-up to #124184, as asked in #124184 (comment).

The disk startup access check (IDisk::checkAccess) named its probe clickhouse_access_check_<server UUID>, so the name was unique only per server identity: two servers with the same uuid file (one data directory copied from the other) that check a shared location where the object key is the file name (an s3_plain or plain_rewritable prefix, a shared local path) at the same time write, read and delete the same file, so one server's delete can fail the other's check.

The probe is now named from a fresh random UUID per check, as the other two disk probes already are (clickhouse_disk_checker_<uuid> of DiskLocalCheckThread, clickhouse_case_sensitivity_check_<uuid> of IDisk::isCaseInsensitive). The clickhouse_access_check_ prefix is kept, so prefix-scoped bucket policies keep working. The server UUID dependency and its "Server UUID is not initialized" guard are removed; both programs that run the check load the UUID before any disk starts. One trade-off, shared with the other two probes: a probe left by a check that fails between its write and its delete is no longer overwritten by the next start.

This does not change the test_database_backup failure fixed in #124184: the servers there already used different names.

Validation: strace of a server with two local disks, started twice. On master all four checks use the one name clickhouse_access_check_<serverUUID()>; with the change they use four distinct names, each created and unlinked once, and nothing is left behind. 02454_create_table_with_custom_disk, 02714_local_object_storage, 03008_local_plain_rewritable (10 randomized runs each), test_merge_tree_s3::test_simple_insert_select and test_database_backup pass.


Workflow [PR]
Sync PR [sync-upstream/pr/125098]

Version info

  • Merged into: 26.10.1.2111-master (included in 26.10 and later)

`IDisk::checkAccess` named its probe after the server UUID, so the name
was unique only per server identity: two servers with the same `uuid`
file (one data directory copied from the other) that share a disk
location, such as an S3 prefix, and check it at the same time write,
read and delete the same file, and one delete can fail the other's
reads.

Name the probe from a fresh random UUID per check, as the other two disk
probes (`DiskLocalCheckThread` and `IDisk::isCaseInsensitive`) already
do. The `clickhouse_access_check_` prefix is kept, so prefix-scoped
bucket policies keep working. The Nil-server-UUID guard goes with the
dependency: both programs that run startup checks load the UUID before
any disk starts.

Follow-up to ClickHouse#124184 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-review-human PR origin: human review feedback on a groeneai PR labels Oct 10, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 3 findings; 1 full pass, no fix round needed).

# Sev Finding Verdict Evidence / action
1 ⚠️ No oracle shows the names are now per check DISAGREE strace A/B: master reuses clickhouse_access_check_<serverUUID> for 2 disks x 2 starts; this change gives 4 distinct names, each created and unlinked once, nothing left behind
2 💡 test_merge_tree_s3/test.py:180 comment still says {server_uuid} AGREE, not changed illustrative comment, the fixture only waits for 0 objects
3 💡 Related: line sits inside the template's HTML comment DISAGREE kept as the template places it; the link is also the first line of the description

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261010-194300

@groeneai groeneai added the groeneai-origin-review-human PR origin: human review feedback on a groeneai PR label Oct 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [73f29bd]

Summary: ✅


AI Review

Summary

This PR changes IDisk::checkAccess to use a fresh random probe name instead of ServerUUID, which eliminates the shared-name race when two servers with the same copied uuid touch the same s3_plain / plain_rewritable namespace during startup. The change is surgical, aligns checkAccess with the other random-named disk probes, and I did not find a remaining correctness, safety, or performance issue in the touched or adjacent startup paths; current PR CI is all green.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 10, 2026
@groeneai
groeneai requested review from Michicosun and azat October 10, 2026 20:06
@clickhouse-gh clickhouse-gh Bot added the comp-multidisk Multiple disks/volumes storage policies, disk abstractions. label Oct 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 73f29bd6b with master 3bab4eef3 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

7 translation units recompiled, 10 s compile time in total, 7 of them have a recent master baseline.

Job report

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 11, 2026
Merged via the queue into ClickHouse:master with commit 2c9fc6d Oct 11, 2026
163 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 2026
@clickhouse-gh clickhouse-gh Bot added comp-disk-abstractions Core disk abstractions: IDisk interface, DiskLocal, storage policies, volumes, disk management to... and removed comp-multidisk Multiple disks/volumes storage policies, disk abstractions. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-disk-abstractions Core disk abstractions: IDisk interface, DiskLocal, storage policies, volumes, disk management to... groeneai-origin-review-human PR origin: human review feedback on a groeneai PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants