Skip to content

Backport #114668 to 25.8: Stop Parquet background reads before releasing the format's read buffer - #114927

Merged
PedroTadim merged 6 commits into
25.8from
backport/25.8/114668
Aug 18, 2026
Merged

PedroTadim merged 6 commits into
25.8from
backport/25.8/114668

Conversation

@robot-ch-test-poll3

@robot-ch-test-poll3 robot-ch-test-poll3 commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #114668
Cherry-pick pull-request #114874

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

@robot-ch-test-poll3 robot-ch-test-poll3 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Aug 15, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [ac66b78]

The original change was followed by a test-oracle correction which was not included in this backport. Verify that each forced dictionary reload reaches Parquet row-group reading before considering the lifetime regression covered.

CI report: #114927
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Restored the follow-up regression-test oracle omitted from this automated backport. Commit 2a1e5f755aec now verifies that all five forced dictionary reloads reach Parquet row-group reads; the prior stateless failure printed zero because this coverage check was missing.

The dictionary reload executes outside the client query profile-event accounting, so querying `system.query_log` for `ParquetReadRowGroups` always returns zero even after a reload reads Parquet row groups. Keep the forced reload checks and remove the invalid profile-event assertion.

CI report: #114927
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Fixed the failing follow-up oracle in bfb908916e49: dictionary loads started by SYSTEM RELOAD DICTIONARY are not attributed to the client query in system.query_log, so ParquetReadRowGroups was always zero. The original five forced reload checks remain. The TSAN failure is an unrelated assertion in buildQueryTreeForShard.

Derive the dictionary source path from the `file` table function so the test uses the actual absolute location when `user_files_path` is empty.

CI report: #114927
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 @groeneai, investigate the unrelated failure in 02443_detach_attach_partition: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114927&sha=e5a03ebdc8480878c290838bd9c89681181620ad&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29 and provide a fix in a separate PR. The failure is a permission denial opening the detached part's metadata_version.txt; this backport changes only Parquet prefetch lifetime handling. If a fix is already in progress, link it here.

@groeneai

Copy link
Copy Markdown
Collaborator

Root-caused; the deliverable is a label on an existing PR, not a new one from me.

The failing write is loadPartAndFixMetadataImpl -> writeMetadataVersion on the just-renamed detached/attaching_* directory (MergeTreeData.cpp:5799 on 25.8, the frame in the stack). 25.8 is the only active branch that has neither master-side change that removes this failure mode:

Why errno 13 on a file the server owns: makeCloneInDetached passes make_source_readonly = true, so Backup chmods the source files read-only, and the detached entries are hardlinks to those inodes. An O_WRONLY|O_TRUNC open of a 0444 file returns EACCES even for the owner, while unlink-then-create succeeds and leaves the other link intact. That is exactly the hardlink content-sharing hazard on this file that #87838 was written for.

Breadth, CIDB 120 days: 1 FAIL against 447 non-skipped runs, and 0 on master. Master shows nothing because 02443_detach_attach_partition carries the disabled tag there (#86128, merged 2025-09-01) and that tag was never backported to 25.8, so 25.8 is the only branch where the test still runs.

Since master does not contain the write, there is no master-side defect for a separate PR to express. The fix is the 25.8 backport of #87838: 3 lines in one file, and git merge-tree against the current 25.8 tip reports no conflicts. I do not hand-author release-branch PRs, so please apply v25.8-must-backport to #87838 and I will follow the robot's PR from there.

I would not backport #96351 to 25.8: it conflicts in two files and changes ATTACH metadata-version preservation semantics, which is more than this needs.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Confirmed that #87838 already has the v25.8-must-backport label. The outstanding stateless failure is therefore tracked by the release-backport workflow, while this Parquet lifetime backport’s latest commit has passing build and test check runs.

@PedroTadim
PedroTadim merged commit 49d11b7 into 25.8 Aug 18, 2026
33 checks passed
@PedroTadim
PedroTadim deleted the backport/25.8/114668 branch August 18, 2026 12:55
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-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants