Skip to content

Antalya 26.8 Backport of #124591 - Fix Iceberg _row_id pruning dropping rows of a rewritten file that has no row lineage statistics - #2676

Merged
zvonand merged 2 commits into
antalya-26.8from
backports/antalya-26.8/124591
Oct 25, 2026
Merged

zvonand merged 2 commits into
antalya-26.8from
backports/antalya-26.8/124591

Conversation

@zvonand

@zvonand zvonand commented Oct 25, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fixed a filter on the Iceberg v3 virtual columns _row_id or _last_updated_sequence_number returning no rows for a data file rewritten by copy-on-write, when the manifest has statistics for the table columns but not for the row lineage columns. Closes ClickHouse#124271. (ClickHouse#124591 by @groeneai)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

alexey-milovidov and others added 2 commits October 25, 2026 16:05
…ow-lineage-missing-stats-pruning

Fix Iceberg `_row_id` pruning dropping rows of a rewritten file that has no row lineage statistics

Conflicts committed as-is; the next commit resolves them:
- src/Storages/ObjectStorage/DataLakes/Iceberg/ManifestFileIterator.cpp (both modified)
- tests/integration/test_storage_iceberg_with_spark/test_row_lineage_pruning.py (both modified)
Took the removal of the "column presence known" pruning branch while keeping antalya-26.8's function signature and plain row-id arithmetic; brought over only the new test and the helpers it needs.
@zvonand

zvonand commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Backporter: cherry-pick conflicts resolved by AI

Conflicted files:

  • src/Storages/ObjectStorage/DataLakes/Iceberg/ManifestFileIterator.cpp (both modified)
  • tests/integration/test_storage_iceberg_with_spark/test_row_lineage_pruning.py (both modified)

Commits:

  • fce2709: cherry-pick with the conflicts committed as-is

  • 666c175: resolution

  • ManifestFileIterator.cpp: this branch lacks the upstream overflow guard and the path_to_manifest_file parameter, so the hunks conflicted. I kept antalya-26.8's signature, its plain last_inherited_row_id arithmetic and its two-argument getMaterializedRowLineageRange call. I applied the fix as-is: isColumnPresenceKnown and the branch that pruned on the inherited lower bound are removed, so a lineage column with no statistics now falls back to [0, top of the inherited block].

  • test_row_lineage_pruning.py: the conflicting block also contained two tests and a helper (_manifest_holding_row_id) from PRs that aren't on this branch. I dropped those.

  • From that block I kept the new test_materialized_row_lineage_without_statistics_is_not_pruned_away and the helpers it uses (_current_manifest_list, _rewrite_avro). I also added the ROW_ID_FIELD_ID and LAST_UPDATED_SEQUENCE_NUMBER_FIELD_ID constants and the json, os and avro imports.

  • The updated expected counts in the existing tests (== 2, == 0, == 1) had applied without conflict and stay as they are.

@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [666c175]

@zvonand

zvonand commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

blau-ai commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

CI triage for #2676

Verdict: 5 red checks — 1 is PR-related (DCO, trivial to fix), 4 are not caused by this backport (1 test-infra/grant issue in an unrelated test file, 2 unrelated regression suites, 1 aggregate gate). The backport's own logic looks healthy: the only files this PR touches are ManifestFileIterator.cpp and test_row_lineage_pruning.py, and the new/rewritten row-lineage tests are not among any of the CI failures.


1. DCO — ❌ PR-related (actionable)

Neither commit on the branch carries a Signed-off-by: trailer:

Fix (requires rewriting the two commits, so it has to be a force-push by you — I'm not permitted to force-push):

git rebase --signoff antalya-26.8        # adds your sign-off to both commits
git push --force-with-lease origin HEAD:backports/antalya-26.8/124591

If you'd rather not re-author Alexey's commit, the cncf/dco2 app also accepts a trailing remediation commit, but the --signoff rebase above is the clean path.

2. Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/8) — ❌ NOT PR-related (test-infra / grant)

All 21 failures are in test_storage_iceberg_with_spark/test_export_partition_iceberg.py — a file this PR does not touch — and every one fails identically before running any Iceberg pruning code:

Code: 497. DB::Exception: default: Not enough privileges. To execute this query,
it's necessary to have the grant SHOW NAMED COLLECTIONS SECRETS ON s3. (ACCESS_DENIED)
  (query: CREATE TABLE … ENGINE=IcebergS3(s3, …))

This is an access-control/named-collection setup problem in that test's fixture (the default user lacks SHOW NAMED COLLECTIONS SECRETS), orthogonal to the manifest-pruning change here. The code path this PR modifies (addRowLineageHyperrectangles) is never reached — the table never gets created. The PR's own test in the same directory (test_row_lineage_pruning.py) passed. Not caused by #2676.
→ Next step: track/fix separately as a test-env issue; safe to ignore for merging this backport (a re-run won't help since it's deterministic config, not flakiness).

3. Regression release oauth — ❌ NOT PR-related

Failing features are /oauth/access control and /oauth/groups (AssertionError), with 298/1814 retries failing — an OAuth / identity-provider authentication suite with no overlap with Iceberg. Classic connectivity/flaky pattern for this suite on backport PRs.
→ Next step: compare against a base-branch (antalya-26.8) run / re-run; not a blocker introduced here.

4. Regression release swarms — ❌ NOT PR-related

Failing features are /swarms/feature/cluster discovery and /swarms/feature/node failure (restart swarm node, CPU overload) — distributed-swarm resilience tests, timing/infra sensitive and unrelated to Iceberg metadata pruning.
→ Next step: re-run / compare to base.

5. PR — ❌ aggregate gate

This is the roll-up status; it is red only because of the checks above. It will go green once DCO is signed off and the unrelated suites are re-run/waived.


Bottom line: the backport itself is fine — the diff faithfully reproduces upstream ClickHouse#124591 (drop the "column presence known" branch; bound a missing lineage statistic by Range(0, inherited_upper_bound)), and its targeted integration tests pass. The only thing in your control to fix is the DCO sign-off; the remaining red is pre-existing/infra noise unrelated to this change.

@zvonand
zvonand merged commit a2f1c1a into antalya-26.8 Oct 25, 2026
274 of 282 checks passed
@zvonand zvonand added the verified Approved for release label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants