Skip to content

Backport #119105 to 26.8: Fix TRUNCATE of an Alias table over a MergeTree blocking on concurrent readers - #125086

Merged
clickhouse-gh[bot] merged 1 commit into
26.8from
backport/26.8/119105
Oct 10, 2026
Merged

clickhouse-gh[bot] merged 1 commit into
26.8from
backport/26.8/119105

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #119105
Cherry-pick pull-request #125083

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.8.24.5

…MergeTree` blocking on concurrent readers
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Oct 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [e60aca5]

Summary: ✅

@groeneai

Copy link
Copy Markdown
Collaborator

These three backports (this one, #125088 for 26.7 and #125089 for 26.9) bring one regression that master no longer has. When the target of an Alias is in a database with lazy_load_tables = 1 (so after a restart or ATTACH DATABASE it is a TableProxy), TRUNCATE TABLE <alias> now waits for any SELECT reading the target and then fails with Code: 473 ... WRITE locking attempt on "<db>.<target>" has timed out!. On the current 26.7, 26.8 and 26.9 branch tips the same statement truncates at once. The cause is that StorageAlias::truncate picks the target's lock with target_storage->isMergeTree(), which a StorageTableProxy does not forward, so a MergeTree target gets the exclusive lock. Master fixed exactly this in #121703, which has no backport label.

I measured it on Debug builds of the merged cherry-pick trees (d9dcf8e7 for 26.7, 70455734 for 26.8, f20b8223 for 26.9) with lock_acquire_timeout = 3. Apart from this the backports look right to me: 05153 and 05233 pass on the 26.8 and 26.9 trees.

@alexey-milovidov, v26.7-must-backport on #121703 would bring 26.7 to 26.9 in line with master. It is not a reason to hold these PRs.

@clickhouse-gh
clickhouse-gh Bot merged commit fea126a into 26.8 Oct 10, 2026
40 of 41 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.8/119105 branch October 10, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants