Skip to content

Backport #129184 to 26.10: Hash each node of an ActionsDAG once, fixing a planning hang in the hash table statistics key - #129678

Merged
PedroTadim merged 2 commits into
26.10from
backport/26.10/129184
Nov 6, 2026
Merged

PedroTadim merged 2 commits into
26.10from
backport/26.10/129184

Conversation

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

Original pull-request #129184
Cherry-pick pull-request #129668

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

…ng a planning hang in the hash table statistics key
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 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 Nov 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [557948a]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_tsan, 6/8) FAIL
test_refreshable_mat_view_replicated/test.py::test_alters[settings1-test_db-False-depends_on1-False] FAIL cidb

…ild loop

The conflict resolution of the cherry-pick (#129668) kept the old body of
Node::updateHash as the new updateOwnHash, so:

- updateOwnHash is defined in ActionsDAG.cpp but not declared in
  ActionsDAG.h (the declaration came with #126148, which is not on 26.10),
  and the build fails with "no member named 'updateOwnHash'".
- updateOwnHash still ends with the recursion over the children, so each
  per-node digest re-hashes the whole subtree and the planning hang of
  #126250 stays.

Add the declaration as on master and remove the loop. The tree now equals
26.10 + #129184 with only the #126148 updateOwnHash split, as on master.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

The resolution merged in #129668 (93b16979c) keeps the old 26.10 body of Node::updateHash as updateOwnHash, which breaks this backport in two ways:

  1. updateOwnHash is defined in ActionsDAG.cpp but not declared in ActionsDAG.h (the declaration came with Keep same-type GROUP BY expressions apart in the hash table statistics key #126148, which is not on 26.10), so every build fails with ActionsDAG.cpp:328:15: error: no member named 'updateOwnHash' in 'DB::ActionsDAG::Node' (Build (amd_release)).
  2. updateOwnHash still ends with for (const auto & child : children) child->updateHash(...), so each per-node digest re-hashes the whole subtree. Adding only the declaration would compile, but the planning hang of getOutputIdentity hashes shared nodes per path: planning hangs at defaults #126250 would stay: with this loop kept, the new gtest does not finish in 120 s.

The fix adds the declaration as on master and removes the loop (ActionsDAG.h +3, ActionsDAG.cpp -3). The resulting tree is the one I validated in #129668 (comment) (gtest and both 05359_* tests pass on the 26.10 tree; the official 26.10.3.7 times out on both). It is one commit on my fork on top of this PR's head cd38a160e824, so applying it is a fast-forward:

git fetch https://github.com/groeneai/ClickHouse.git resolve-26.10-backport-129184
git push origin FETCH_HEAD:backport/26.10/129184

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

CI finish ledger - 557948a

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Integration tests (amd_tsan, 6/8) / test_refreshable_mat_view_replicated/test.py::test_alters[settings1-test_db-False-depends_on1-False] flaky, not caused by this PR (it only changes ActionsDAG hashing): DROP TABLE got Connection loss, path /clickhouse/test_db/max_log_ptr after the Keeper client logged Operation timeout ... (no progress for 15000 ms) and dropped its session; the in-job rerun passed (retry_ok) a fix task is created (investigating at full effort, fixing-PR link to follow here)
BackportPR praktika rollup of the row above a fix task is created (the same task as the row above)

CIDB has no other FAIL or ERROR row on this head.

Session id: cron:clickhouse-maint-slot-14:20261106-110700

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Follow-up on the Integration tests (amd_tsan, 6/8) / test_refreshable_mat_view_replicated/test.py::test_alters[settings1-test_db-False-depends_on1-False] row of the ledger above: no fixing PR will follow.

The Keeper follower zoo1 (TSan build), which held node1_1's session, was stalled for most of 32 s (07:13:10 to 07:13:43 UTC): one append_entries call took 14068 ms because preprocessing a three-operation Multi took 14066 ms, and the next call took 18344 ms. The leader and the other follower kept running, and the host was not loaded (CPU 30-44%, iowait under 2%, memory 30% in 5 s windows, no OOM). After 15 s without progress the client finalized the session, so the DROP TABLE's read of /clickhouse/test_db/max_log_ptr failed with Connection loss; the in-job rerun passed. The artifacts do not show what blocked that Keeper thread, this is the only failure of this module outside PR-caused and bugfix-validation runs in 30 days, and the backport's diff does not touch Keeper, so I am not opening a PR for it.

@PedroTadim
PedroTadim merged commit e2ee3fd into 26.10 Nov 6, 2026
47 of 50 checks passed
@PedroTadim
PedroTadim deleted the backport/26.10/129184 branch November 6, 2026 16:53
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.

5 participants