Skip to content

[Java] Propagate downstream errors from BigQuery Storage API - #40004

Open
bvolpato wants to merge 4 commits into
apache:masterfrom
bvolpato:bvolpato/java-bigquery-downstream-errors
Open

bvolpato wants to merge 4 commits into
apache:masterfrom
bvolpato:bvolpato/java-bigquery-downstream-errors

Conversation

@bvolpato

@bvolpato bvolpato commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

With success-row propagation enabled, the unsharded BigQuery Storage Write API path can catch exceptions from fused downstream transforms as parsing or conversion errors. A bundle can report success even though a downstream consumer failed. With withErrorHandler, an unrelated input row can also be sent to the dead-letter output.

This change moves successful output outside the parsing and conversion handlers so downstream failures fail the bundle. Actual parsing and conversion errors keep their existing handling. With STORAGE_API_AT_LEAST_ONCE, retrying a failed bundle can duplicate rows that BigQuery already accepted.

The SDK harness regression covers mid-bundle and finish-bundle flushes, with and without an error handler. The targeted GCP tests and Spotless passed locally.

Run the GCP module tests with:

./gradlew :sdks:java:io:google-cloud-platform:test

  • If this contribution is large, please file an Apache Individual Contributor License Agreement.
  • Replace these instructions with a description of your change and why you have made it.
  • Mention the appropriate issue in your description (for example: addresses #123 or fixes #456).
  • Update CHANGES.md with noteworthy changes.

See CONTRIBUTING.md for contribution guidelines.

@bvolpato

bvolpato commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

The GCP retry passed on the same commit: 2,229 tests passed, 237 were skipped, and none failed. Both new fused-harness regression cases passed, as did the streaming-insert KMS test that previously received a BigQuery HTTP 500.

All current-head checks are now complete: 18 successful and one neutral.

@bvolpato
bvolpato force-pushed the bvolpato/java-bigquery-downstream-errors branch from b93bead to 02e8496 Compare September 10, 2026 05:54
@bvolpato bvolpato changed the title [Java] Propagate downstream errors from BigQuery success output [Java] Propagate downstream errors from BigQuery output Sep 10, 2026
@bvolpato
bvolpato marked this pull request as ready for review September 10, 2026 05:56
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @kennknowles for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@kennknowles

Copy link
Copy Markdown
Member

R: @ahmedabu98

@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@bvolpato
bvolpato force-pushed the bvolpato/java-bigquery-downstream-errors branch from b607e9d to f5dfbd4 Compare September 26, 2026 06:12
@bvolpato bvolpato changed the title [Java] Propagate downstream errors from BigQuery output [Java] Propagate downstream errors from BigQuery Storage API Oct 13, 2026

@ahmedabu98 ahmedabu98 left a comment

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.

This is a good fix for the normal case.

Please look into the case when withErrorHandler is set. When the writer flushes mid-bundle, any downstream error (from success-row propagation) will bubble up past this try-catch and into the try-catch in ConvertMessagesDoFn. The bundle succeeds and whatever row ConvertMessagesDoFn was working on upstream incorrectly goes to the DLQ and never reaches BQ.

I think we should do the same fix in ConvertMessagesDoFn and move .output() outside of the try-catch

@ahmedabu98

Copy link
Copy Markdown
Contributor

waiting on author

Merge current master and retain both release notes. Keep success output outside conversion error handling so fused downstream failures fail the bundle, including when withErrorHandler is enabled.
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.

3 participants