Repository navigation
Conversation
… 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: ClickHouse#115222 Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding), plus my own cold review
Severity: ❌ blocker / On finding 1, recorded as citations rather than as a claim of mine, since it is about the parent Session id: cron:clickhouse-review-slot-9:20260827-024000 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20260827-015500 |
|
cc @ahmadov, could you review this? The rewritten |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #115222
Related: #116536
Base is
backport/26.7/115222, the head branch of robot backport #116536, whereUnit tests (asan_ubsan)andUnit tests (tsan)fail.PostingsSerialization's constructor asserts its codec is non-null(
chassert(posting_list_codec),MergeTreeIndexText.cpp:218), and the rewrittengtest_text_index_postings_deserialization.cpppassesnullptr.RoundTriptherefore abortsinside the constructor, before
deserializeruns. The test's comment is aboutdeserialize,where
header = 0indeed never consults the codec, but the constructor asserts first. Henceevery
Buildjob is green (chassertis inert in release), thefunction_prop_fuzzervariantspass because they filter this suite out, and
TruncatedPayloadRejectednever reported.This passes a real
Type::Nonecodec instead. Two lines, test only. Coverage is unchanged:PostingListCodecNone::decodeis a no-op, so if the codec were consultedRoundTripwould getan empty posting list and fail on cardinality; it passes, so the assertions still traverse the
readSafebounding that #115222 added.Validated with a Debug build on this branch's pinned clang-21, Build-ID asserted per arm.
Unpatched,
RoundTripaborts withLogical error: 'posting_list_codec'.; patched, both testspass. Reverting the merged
readSafebound while keeping this change makesTruncatedPayloadRejectedfail all four assertions, so the repaired test still catches the bugthe backport fixes.
I have no push access to
backport/26.7/115222(maintainerCanModifyis false on #116536), sothis is a fork PR against that base. No checks run on it, since CI triggers only for a base of
masteror a release branch; the gate is #116536's ownUnit testsre-run once this is mergedinto its head branch. The same rewritten file is already merged onto 26.3 (#116533) and 26.5
(#116534), where
Unit testsis not a BackportPR job so the abort is unobservable there; out ofscope here.