Skip to content

Backport #115222 to 26.7: Bound text index posting list deserialization - #116536

Merged
CurtizJ merged 3 commits into
26.7from
backport/26.7/115222
Aug 29, 2026
Merged

CurtizJ merged 3 commits into
26.7from
backport/26.7/115222

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #115222
Cherry-pick pull-request #116311

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.7.6.20

@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 Aug 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [7658293]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_asan_ubsan, distributed plan, parallel) FAIL
02995_new_settings_history FAIL cidb

@CurtizJ

CurtizJ commented Aug 26, 2026

Copy link
Copy Markdown
Member

@groeneai fix CI in this backport

@groeneai

Copy link
Copy Markdown
Collaborator

Same cause as #116535, and the same one-line fix.

makeSerialization() passes nullptr, but PostingsSerialization's constructor is chassert(posting_list_codec) (MergeTreeIndexText.cpp:218 on this branch), so the very first decodePostingsInPlace aborts inside the constructor, before deserialize is reached. That is the bare SIGABRT with no assertion text and no gtest.json, and it is why TruncatedPayloadRejected never runs.

-    return PostingsSerialization(nullptr, MergeTreeTextIndexSerializationVersion::V2_WithPositions);
+    return PostingsSerialization(std::make_unique<PostingListCodecNone>(), MergeTreeTextIndexSerializationVersion::V2_WithPositions);

and restore #include <Storages/MergeTree/MergeTreeIndexTextPostingListCodec.h>, which the rewrite dropped. With header = 0 the Type::None codec is still never consulted, so coverage does not change.

02995_new_settings_history is pre-existing and branch-wide, not from this change: 7 hits on bare 26.7 and 19 other backport/26.* branches in the last 14 days.

Full write-up, including why master is green and why the same file went unvalidated onto 26.3 and 26.5: #116535 (comment)

I have no push access to backport/26.7/115222 (maintainerCanModify is false), so I will open a PR against that base with the change above, in the same shape as #114814. Tell me if you would rather apply it directly.

… codec

`PostingsSerialization`'s constructor asserts its codec is non-null
(`chassert(posting_list_codec)`, `MergeTreeIndexText.cpp:218`), and the rewritten
`gtest_text_index_postings_deserialization.cpp` on this branch passes `nullptr`.
The first `decodePostingsInPlace` call in `RoundTrip` therefore aborts inside the
constructor, before `deserialize` is entered. That is why `Unit tests (asan_ubsan)`
and `Unit tests (tsan)` fail on the backport while every `Build` job is green
(`chassert` is inert in release), why the `function_prop_fuzzer` variants pass
(they filter this suite out), and why `TruncatedPayloadRejected` never reported.

The test's comment is accurate about `deserialize`: with `header = 0` the
uncompressed branch never consults the codec. The constructor asserts first,
though, so the precondition has to be satisfied regardless.

A `Type::None` codec keeps coverage identical, because `PostingListCodecNone::decode`
is a no-op: had the codec been consulted, `RoundTrip` would deserialize an empty
posting list and fail on cardinality. It passes, so the assertions still traverse
the `PostingList::readSafe` bounding this backport adds. Reverting that bound while
keeping this change makes `TruncatedPayloadRejected` fail all four assertions, so
the repaired test still catches the defect it was written for.

`MergeTreeIndexText.h` includes only `IPostingListCodec.h`, so the codec header has
to be included here; the version of this test on `master` carries the same include.

Related: #115222

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

Copy link
Copy Markdown
Collaborator

Opened #116636 against this branch: #116636

Validated on a Debug build of this branch: unpatched, RoundTrip aborts with Logical error: 'posting_list_codec'.; patched, both RoundTrip and TruncatedPayloadRejected pass. No checks run on that PR, since CI triggers only for a base of master or a release branch, so the gate is this PR's own Unit tests re-run once it is merged in.

Fix the text index postings unit test aborting on a null posting list codec
@CurtizJ
CurtizJ merged commit e377e2b into 26.7 Aug 29, 2026
74 of 78 checks passed
@CurtizJ
CurtizJ deleted the backport/26.7/115222 branch August 29, 2026 13:33
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