Skip to content

Do not use parallel replicas for the change data feed of a Delta Lake table function - #129548

Merged
alexey-milovidov merged 3 commits into
masterfrom
delta-lake-cdf-parallel-replicas
Nov 7, 2026
Merged

alexey-milovidov merged 3 commits into
masterfrom
delta-lake-cdf-parallel-replicas

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

With parallel replicas, reading the change data feed of a Delta Lake table with the deltaLake table function (delta_lake_snapshot_start_version / delta_lake_snapshot_end_version) returned every change once per replica.

TableFunctionObjectStorage replaces a data lake table function that has a Cluster variant with StorageObjectStorageCluster when parallel replicas can be used. The change data feed is read by ReadFromDeltaLakeTableChangesStep, which does not distribute work between replicas, so each replica read all changes. StorageObjectStorage::getStorageForParallelReplicasRead already excludes the change data feed for tables; the table function now does the same.

It was found by 05566_delta_lake_s3_deletion_vectors_change_data_feed of #129100, which reads the change data feed of a table in S3: in the ParallelReplicas job every row came three times (report). 05565_delta_lake_change_data_feed_parallel_replicas covers the fix: it creates a Delta table with the change data feed enabled in MinIO and reads the change data feed with parallel replicas over three replicas. Without the fix every row comes back three times.

Related: #129100

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 into CHANGELOG.md):

Fix duplicated rows when reading the change data feed of a Delta Lake table with the deltaLake table function and parallel replicas.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/129548]

Version info

  • Merged into: 26.11.1.1599-master (included in 26.11 and later)

… table function

With parallel replicas, `deltaLake` and other data lake table functions with a `Cluster` variant were replaced
with it even when reading the change data feed (`delta_lake_snapshot_start_version`,
`delta_lake_snapshot_end_version`). The change data feed is read by `ReadFromDeltaLakeTableChangesStep`,
which does not distribute work between replicas, so every replica returned all changes and each row was
returned once per replica. Do not use parallel replicas for it, as `getStorageForParallelReplicasRead`
already does for tables.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129100&sha=e976b03a34770f15d52f3d8bec00636f8f51d88f&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29
Related: #129100

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9b8ba97]

Summary: ✅


AI Review

Summary

This PR prevents automatic parallel-replica distribution of Delta Lake change-feed reads through deltaLake table functions, avoiding duplicated changes. The new regression test covers open-ended and bounded change feeds and an ordinary snapshot read, addressing the previous coverage finding. No outstanding findings in head 9b8ba97ca01377cd21e69ad2a17bcdac9ce763a3.

Missing context / blind spots
  • ⚠️ Current-head CI job reports did not expose results for the new test, and I did not execute it locally. The author reports that it passes with the fix and returns each change three times without it; an accessible CI result would provide independent confirmation.
Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Nov 5, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Nov 5, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 9b8ba97ca with master 352ee5c45 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 5581a35f4; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

7 translation units recompiled, 22 s compile time in total, 7 of them have a recent master baseline.

Job report

alexey-milovidov and others added 2 commits November 7, 2026 06:52
…plicas

The test bootstraps a Delta table with the change data feed enabled in MinIO, adds two
versions with the `deltaLakeS3` table function, and reads the change data feed with parallel
replicas over three replicas. Without the fix every change is returned three times.

Address review: cover the replica exclusion with a regression test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Nov 7, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit 32d5e79 Nov 7, 2026
188 checks passed
@alexey-milovidov
alexey-milovidov deleted the delta-lake-cdf-parallel-replicas branch November 7, 2026 14:09
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 7, 2026
@clickhouse-gh clickhouse-gh Bot added comp-delta-lake Delta Lake tables: reading Delta metadata through delta-kernel-rs (table snapshots, schema and ty... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-delta-lake Delta Lake tables: reading Delta metadata through delta-kernel-rs (table snapshots, schema and ty... pr-bugfix Pull request with bugfix, not backported by default 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.

2 participants