Skip to content

Fix 04507_mvt_encode_state_serialize failure under parallel replicas - #111148

Merged
alexey-milovidov merged 3 commits into
masterfrom
fix/04507-mvt-no-parallel-replicas
Jul 22, 2026
Merged

alexey-milovidov merged 3 commits into
masterfrom
fix/04507-mvt-no-parallel-replicas

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or improvement (changelog entry is not required)

Fix the 04507_mvt_encode_state_serialize failure in the ParallelReplicas coverage configuration by rewriting its assertions: compare hex(MVTEncodeMerge(...)(s)) against golden tile byte literals (the same values as in 04299_mvt_encode.reference) instead of re-evaluating MVTEncode on a constant ::Point::Geometry expression. This keeps the parallel-replicas coverage of reading stored AggregateFunction(MVTEncode...) states (per review feedback, instead of the initially proposed no-parallel-replicas tag).

Background: with parallel replicas, the initiator constant-folds the ::Point::Geometry cast and re-serializes the query with _CAST((0., 0.), 'Geometry'). The remote replica then fails with an exception: Cannot convert type Tuple(Float64, Float64) to Geometry. Conversion to Variant allowed only for types from this Variant (CANNOT_CONVERT_TYPE), because Variant conversion matches member types by name and the folded literal has lost the Point custom type name. This is the known parallel-replicas Variant conversion bug, not a problem in the serialize/deserialize path the test covers. The rewritten assertions no longer contain a constant Geometry cast in any SELECT ... FROM query, so they are immune to that bug (the INSERT ... SELECT without FROM runs only on the initiator).

The test started failing en masse in the Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) check on 2026-07-20 (52 failures that day across master and many pull requests).

Example failure (on #109006): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109006&sha=17d1fd695c85b4225554cfcfe6375c3672812b6c&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29

Related: #74366

With parallel replicas, the initiator constant-folds the `::Point::Geometry`
cast and re-serializes the query with `_CAST((0., 0.), 'Geometry')`. The remote
replica then fails with `Cannot convert type Tuple(Float64, Float64) to
Geometry. Conversion to Variant allowed only for types from this Variant`
(`CANNOT_CONVERT_TYPE`), because `Variant` conversion matches member types by
name and the folded literal has lost the `Point` custom type name. This is the
known parallel-replicas `Variant` conversion bug #74366, not a problem in the
test itself, so skip the test under parallel replicas until that bug is fixed.

Seen in https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109006&sha=17d1fd695c85b4225554cfcfe6375c3672812b6c&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29
on #109006, and failing across
master and many PRs (52 failures on 2026-07-20 alone).

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5907e8a]

Summary: ✅


AI Review

Summary

This PR rewrites 04507_mvt_encode_state_serialize to compare the stored MVTEncode aggregate-state round-trip against stable golden tile bytes instead of re-evaluating MVTEncode on a constant ::Point::Geometry expression inside SELECT ... FROM. That preserves the intended coverage of reading serialized AggregateFunction(MVTEncode...) states from a table while avoiding the known parallel-replicas Geometry constant-folding exception, and the new expected bytes match the existing golden outputs in 04299_mvt_encode.reference. I did not find any remaining correctness, coverage, or metadata issues in the current diff.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 20, 2026
… under parallel replicas

Instead of tagging the test \`no-parallel-replicas\`, rewrite the assertions to
compare \`hex(MVTEncodeMerge(...)(s))\` against the golden tile bytes (the same
literals as in \`04299_mvt_encode.reference\`). This keeps the parallel-replicas
coverage of reading stored \`AggregateFunction(MVTEncode...)\` states while
avoiding the known constant-folding bug where the initiator re-serializes a
constant \`::Point::Geometry\` cast as \`_CAST((0., 0.), 'Geometry')\` and the
replica rejects the conversion, see
#74366.

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov alexey-milovidov changed the title Add no-parallel-replicas tag to 04507_mvt_encode_state_serialize Fix 04507_mvt_encode_state_serialize failure under parallel replicas Jul 21, 2026
@devcrafter devcrafter self-assigned this Jul 21, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The only red is the `Stress test (amd_tsan)` failure Logical error: Cannot determine row level filter; A columns deleted, B columns added in StorageMerge::RowPolicyData. This is unrelated to this test-only change — it is the known bare-column row-policy logical error on Merge tables, already being fixed in #109843 (not yet on master, so merging does not clear it here). Rebased onto latest master; the test itself is green (AI Review: ✅ Approve, no open review threads).

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 22, 2026
Merged via the queue into master with commit 4f33e47 Jul 22, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix/04507-mvt-no-parallel-replicas branch July 22, 2026 16:58
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 22, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…-parallel-replicas

Fix `04507_mvt_encode_state_serialize` failure under parallel replicas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants