Skip to content

Lower Plain-Rewritable Metadata Transactions Isolation - #111353

Merged
Michicosun merged 3 commits into
masterfrom
lower_plain_rewritable_isolation
Jul 22, 2026
Merged

Michicosun merged 3 commits into
masterfrom
lower_plain_rewritable_isolation

Conversation

@Michicosun

@Michicosun Michicosun commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

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):

This patch removes preconditions from metadata-only transactions. These transactions will be validated during commit.

Fixes: #111289

Version info

  • Backported to: 26.7.2.1

@clickhouse-gh

clickhouse-gh Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e832b3b]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan_ubsan, db disk, old analyzer, 1/6) FAIL
test_backup_restore_on_cluster/test_cancel_backup.py::test_cancel_backup FAIL cidb
Integration tests (amd_asan_ubsan, db disk, old analyzer, 3/6) FAIL
test_replicated_database/test.py::test_replicated_table_structure_alter FAIL cidb, issue
Stress test (arm_tsan) FAIL
Cannot start clickhouse-server FAIL cidb, issue
Check failed FAIL cidb
Upgrade check (amd_release) FAIL
Error message in clickhouse-server.log (see upgrade_error_messages.txt) FAIL cidb

AI Review

Summary

This PR lowers the isolation of plain-rewritable metadata transactions by deferring more decisions to commit time. The target-side relaxation matches the flaky case from #111289, but the same change also drops the only guard that kept transaction-local directories from mutating a concurrent directory that reused the same logical path. In its current form, the PR can either delete or rename a directory that the transaction never observed.

Findings

❌ Blockers

  • [src/Disks/DiskObjectStorage/MetadataStorages/PlainRewritable/Transactions/UncommittedState.cpp:131-137] removeDirectory no longer records any source precondition before removeDirectory / removeRecursive commits. A transaction like createDirectory("tmp"); removeRecursive("tmp") can now commit after another transaction creates tmp, and the later RemoveRecursiveOperation will delete the replacement subtree and its blobs. Suggested fix: keep a source-side precondition for paths that existed only in the transaction snapshot, so commit rejects logical-path reuse instead of deleting data it never observed.
  • [src/Disks/DiskObjectStorage/MetadataStorages/PlainRewritable/Transactions/UncommittedState.cpp:140-149] moveDirectory now drops the only source-identity check. A transaction like createDirectory("tmp"); moveDirectory("tmp", "part") can succeed by moving a concurrent transaction's tmp, because the create becomes a no-op on the commit snapshot and the move runs against the replacement source directory. Suggested fix: retain source-side validation for path_from even if the target-side check is intentionally relaxed.
Final Verdict

Status: ❌ Block

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 22, 2026
@CheSema CheSema self-assigned this Jul 22, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.20% 86.20% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 78.30% 78.30% +0.00%

Changed lines: Changed C/C++ lines covered: 155/159 (97.48%) · Uncovered code

Full report · Diff report

@Michicosun
Michicosun added this pull request to the merge queue Jul 22, 2026
Merged via the queue into master with commit 8875e70 Jul 22, 2026
175 of 180 checks passed
@Michicosun
Michicosun deleted the lower_plain_rewritable_isolation branch July 22, 2026 17:31
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 22, 2026
alexey-milovidov added a commit that referenced this pull request Jul 22, 2026
…pe-and-timeseries-irate

Master merged the same column via #108118 (commit dcf06b2, "Expose part_storage_type in system.parts");
resolved the conflict in StorageSystemParts.cpp by keeping this branch's comment wording
(names wrapped in inline code). This branch still adds the docs entries, the test, and pulls in
the fix for the unrelated test_check_table red (#111353).

Co-Authored-By: Claude Fable 5 <[email protected]>
alexey-milovidov added a commit that referenced this pull request Jul 23, 2026
Pulls in the merged fix for the flaky integration test
test_check_table/test.py::test_check_all_tables
(#111289, fixed by
#111353), which was the
integration-test failure in the CI report
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97540&sha=0765ebbca852917ad3e1c7169f304bd3ccec3213&name_0=PR

Co-Authored-By: Claude Fable 5 <[email protected]>
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jul 23, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 23, 2026
clickhouse-gh Bot added a commit that referenced this pull request Jul 23, 2026
Backport #111353 to 26.7: Lower Plain-Rewritable Metadata Transactions Isolation
This was referenced Jul 26, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 3, 2026
Picks up the fixing PRs for the three trunk-flaky integration reds on the
previous head: ClickHouse#111029 (test_replicated_table_structure_alter, merged 07-24)
and ClickHouse#111353 (test_check_all_tables, merged 07-22). Base was 6193 commits
behind, so CI was also stale.
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…itable_isolation

Lower Plain-Rewritable Metadata Transactions Isolation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync 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 v26.7-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: test_check_table/test.py::test_check_all_tables

5 participants