Skip to content

[qa] Fix racy barrier in Iceberg snapshot tests - #6752

Merged
ryzhyk merged 1 commit into
mainfrom
fix-iceberg-snapshot-test-barrier
Jul 30, 2026
Merged

[qa] Fix racy barrier in Iceberg snapshot tests#6752
ryzhyk merged 1 commit into
mainfrom
fix-iceberg-snapshot-test-barrier

Conversation

@ryzhyk

@ryzhyk ryzhyk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

test_iceberg_ordered_snapshot_ingests_all_rows failed in CI with "assert 0 == 60" on python-multihost. The tests waited on input_connector_iceberg_phase == 2 and then queried the table, but the phase gauge is a reader-side signal: crates/iceberg/src/input.rs sets it one statement after queueing the last records, and push_entry only appends to a mutex-guarded deque that the circuit thread drains later.

Multihost loses this race where single-host wins it: the coordinator advances last_committed_step, the only step an ad-hoc query may lease, only after every host reports a committed transaction, whereas a single-host pipeline republishes the snapshot in the thread that just committed.

Fix: Wait for total_completed_records to catch up with total_input_records.

Describe Manual Test Plan

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated
  • Changelog updated

Breaking Changes?

Mark if you think the answer is yes for any of these components:

Describe Incompatible Changes

test_iceberg_ordered_snapshot_ingests_all_rows failed in CI with
"assert 0 == 60" on python-multihost. The tests waited on
input_connector_iceberg_phase == 2 and then queried the table, but the
phase gauge is a reader-side signal: crates/iceberg/src/input.rs sets it
one statement after queueing the last records, and push_entry only
appends to a mutex-guarded deque that the circuit thread drains later.

Multihost loses this race where single-host wins it: the coordinator
advances last_committed_step, the only step an ad-hoc query may lease,
only after every host reports a committed transaction, whereas a
single-host pipeline republishes the snapshot in the thread that just
committed.

Fix: Wait for total_completed_records to catch up with total_input_records.

Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
@ryzhyk
ryzhyk requested a review from swanandx July 29, 2026 17:57
@ryzhyk ryzhyk added connectors Issues related to the adapters/connectors crate QA Testing and quality assurance labels Jul 29, 2026
return int(rows[0]["c"])


def _all_records_completed(pipeline) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this be a generic pipeline function?

@swanandx swanandx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

ideally we should use completion token for this kind of verifications right ? e.g. pipeline.wait_for_token(pipeline.generate_completion_token(TABLE, CONNECTOR))

@ryzhyk

ryzhyk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

LGTM!

ideally we should use completion token for this kind of verifications right ? e.g. pipeline.wait_for_token(pipeline.generate_completion_token(TABLE, CONNECTOR))

yes, completion tokens work too. The approach in this commit only works because the pipeline stops after ingesting bounded inputs.

@ryzhyk
ryzhyk added this pull request to the merge queue Jul 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 29, 2026
@mihaibudiu

Copy link
Copy Markdown
Contributor

test_now failed because seemingly it could not start the pipeline. I had increased the resource requirements because it kept failing. We could make the input smaller.

@ryzhyk
ryzhyk added this pull request to the merge queue Jul 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 29, 2026
@blp

blp commented Jul 29, 2026

Copy link
Copy Markdown
Member

I can't tell whether https://github.com/feldera/feldera/actions/runs/30494117799/job/90720857158 shows infra issues or product issues. The docker build failed, which indicates infra issues; an integration test failed in a weird way, which might be either.

@ryzhyk
ryzhyk added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit d771f84 Jul 30, 2026
1 check passed
@ryzhyk
ryzhyk deleted the fix-iceberg-snapshot-test-barrier branch July 30, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

connectors Issues related to the adapters/connectors crate QA Testing and quality assurance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants