Skip to content

Remove unused IDisk::chmod and supportsChmod - #133549

Merged
alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/remove-unused-disk-chmod
Nov 23, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/remove-unused-disk-chmod

Conversation

@groeneai

@groeneai groeneai commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #133464

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 of #133464, as asked in #133464 (comment). After #133464 nothing calls chmod or supportsChmod on a disk, a disk transaction or a metadata storage. This removes them at every layer, together with ChmodOperation of the local metadata storage and its two cases in MetadataLocalDiskTest.TestRollbackUndoesOnlyWhatAFailedOperationDid.

IDisk::stat and supportsStat stay: since #133436, StorageReplicatedMergeTree::checkPartsImpl uses them to compare the inodes of a part and of its copy in detached/.

Deletions only. Validation: clickhouse and unit_tests_dbms build on top of #133464, and the disk and metadata storage gtests pass.


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

Version info

  • Merged into: 26.12.1.295-master (included in 26.12 and later)

After ClickHouse#133464 removed the background cleanup of unused directories in
`store/`, nothing calls `chmod` or `supportsChmod` on a disk, a disk
transaction or a metadata storage any more. Remove them at every layer:

- `IDisk::chmod`, `IDisk::supportsChmod` and the overrides in `DiskLocal`,
  `DiskEncrypted`, `DiskObjectStorage` and `ReadOnlyDiskWrapper`;
- `IDiskTransaction::chmod` and the overrides in `FakeDiskTransaction`,
  `DiskEncryptedTransaction` and `DiskObjectStorageTransaction`;
- `IMetadataTransaction::chmod`, `IMetadataTransaction::supportsChmod`,
  `IMetadataStorage::supportsChmod` and every metadata storage override;
- `ChmodOperation` of the local metadata storage, and its two cases in
  `MetadataLocalDiskTest.TestRollbackUndoesOnlyWhatAFailedOperationDid`.

`IDisk::stat` and `supportsStat` stay: since ClickHouse#133436 they are used by
`StorageReplicatedMergeTree::checkPartsImpl` to compare the inodes of a
part and of its copy in `detached/`.

Related: ClickHouse#133464

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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) and my own review of the full diff: 0 findings.
Census on current master (with #133464): no declaration, override or caller of chmod / supportsChmod / ChmodOperation remains in src/, programs/ or utils/ after the merge.

Session id: cron:clickhouse-review-slot-9:20261122-151102

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? N/A as a failure repro (dead-code removal). The claim "nothing calls chmod after #133464" is checked by the build: with #133464 the whole tree (clickhouse, unit_tests_dbms) compiles; without it, DatabaseCatalog.cpp fails at exactly its three chmod/supportsChmod call sites.
b Root cause explained? #133464 removed the only users (the store/ cleanup in DatabaseCatalog). The rest of the chain (disk wrappers, disk transactions, metadata transactions, ChmodOperation) only forwarded to itself.
c Fix matches root cause? Removes that chain at every layer and nothing else: stat/supportsStat stay (used by StorageReplicatedMergeTree since #133436), no include or rename changes.
d Test intent preserved / new tests added? No new test (no behaviour change). The two rollback-test cases for the removed operation go with it; the other cases of TestRollbackUndoesOnlyWhatAFailedOperationDid pass.
e Both directions demonstrated? With #133464: build OK and 395 *Metadata*:*Disk*:*ObjectStorage* gtests pass. Without it: compile error at its call sites. A 57-statement smoke over local, cache, plain_rewritable, encrypted and read-only disks gives identical output on this build and on a master build.
f Fix is general across code paths? Every override in the IDisk, IDiskTransaction, IMetadataTransaction and IMetadataStorage hierarchies is removed; an override of a removed virtual would not compile, so none is left.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no reachable runtime path changes).
h Backward compatible? (maintainer-approved exception only) Yes: no setting, format, on-disk or SQL change.
i Invariants and contracts preserved? Deletion only; no other metadata operation references ChmodOperation, and the transaction rollback test still passes.

Session id: cron:clickhouse-impl-slot-5:20261122-144300

@clickhouse-gh

clickhouse-gh Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a2eec56]

Summary: ✅


AI Review

Summary

Removes unused chmod and supportsChmod APIs throughout the disk and metadata storage hierarchies, together with ChmodOperation and its two rollback test cases, following #133464. No actionable findings at head a2eec567c97b46968fd0f8bef059efa5270c5a9d.

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 Nov 22, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Nov 22, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@alexey-milovidov alexey-milovidov self-assigned this Nov 22, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-multidisk Multiple disks/volumes storage policies, disk abstractions. label Nov 22, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing a2eec567c with master 91b044d19 (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

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

Median compile-time ratio to the baselines is ×1.05 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +294.5 s (+6%) in total before that adjustment.

Job report

@stresshouse

stresshouse Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📊 Cloud Performance Report

⚠️ AI verdict: not_sure — inconclusive across 29 queries analysed

This PR only removes the unused chmod/supportsChmod methods from the disk, transaction and metadata-storage interfaces, and no benchmark query calls them. All three flagged ClickBench queries stay inconclusive, and none can be traced to this change. Q30 (+18.9%) and Q31 (+11.4%) are hash aggregations where master's own baseline is unstable after a recent shift. Q28 (-6.4%) is borderline, the two tests disagree, and the measurements were noisy.

clickbench

⚠️ 3 inconclusive

Flagged queries (3 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 28 not_sure 1060 992 -6.4% <0.0001 cpu: This regex-heavy GROUP BY never calls disk chmod, and the two tests disagree on a noisy -6.4% shift. This PR cannot explain it.
⚠️ 30 not_sure 164 195 +18.9% <0.0001 aggregation: Master's own history for this two-key hash aggregation is unstable around a recent break, so the +18.9% can't be compared fairly. The PR's chmod removal is not on this path.
⚠️ 31 not_sure 219 244 +11.4% <0.0001 aggregation: This shows the same unstable-baseline pattern as Q30 on a high-cardinality hash aggregation. The PR's chmod removal does not touch query execution, so the +11.4% is not attributable to it.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: dde2cea1-959d-4d12-acf2-dc8d09ec6429
  • MIRAI run: 891ff322-a1b6-4854-bb87-32204a37c0d2
  • PR check IDs:
    • clickbench_919467_1795407910
    • clickbench_919481_1795407910
    • tpch_adapted_1_official_919511_1795407910
    • tpch_adapted_1_official_919531_1795407910

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (a2eec56, clean merge, no conflicts). The branch was based on a commit before #133464 was merged, so the PR head on its own still had the three chmod / supportsChmod call sites in DatabaseCatalog.cpp. The public CI builds the merge with master and was green, but the "Check public build" job of the private sync builds the PR head as is and failed there with no member named 'supportsChmod' in 'DB::IDisk', which keeps CH Inc sync from passing. With master merged in, no reference to chmod, supportsChmod or ChmodOperation of a disk remains in src/, programs/ or utils/, and the PR diff is unchanged (26 files, 166 deletions).

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 23, 2026
Merged via the queue into ClickHouse:master with commit 73c474c Nov 23, 2026
195 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 23, 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-multidisk Multiple disks/volumes storage policies, disk abstractions. 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.

3 participants