[Java] Propagate downstream errors from BigQuery success output - #40004
Draft
bvolpato wants to merge 2 commits into
Draft
[Java] Propagate downstream errors from BigQuery success output#40004bvolpato wants to merge 2 commits into
bvolpato wants to merge 2 commits into
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
withPropagateSuccessfulStorageApiWrites(true), the unsharded BigQuery Storage Write API writer catches exceptions from fused downstream transforms as if they were row-parsing failures. The SDK can then report bundle success despite missing downstream output.For example, write rows A and B using
STORAGE_API_AT_LEAST_ONCE, then attach a fusedParDotogetSuccessfulStorageApiInserts()that throws on A and emits B. Both rows reach the fake BigQuery service, but the original SDK harness logs A's exception, processes B, and completes the bundle successfully. A has disappeared from downstream processing without a bundle failure to trigger recovery.Move
outputWithTimestampoutside the row-parsing exception handler. A downstream exception now fails the bundle. Parsing failures retain their existing handling. This changes failure propagation; it does not roll back rows already accepted by BigQuery or change at-least-once write semantics.The regression builds a public
BigQueryIOpipeline, verifies that the writer and downstream consumer can fuse, and executes them through the real Java SDKProcessBundleHandler. It covers both the record-threshold flush duringProcessElementand the flush duringFinishBundle. Assertions check the downstream exception, instruction poisoning, and the exact rows stored before failure. A classic DirectRunner pipeline alone does not exercise this synchronous fused-output call.Validation:
BigQueryIOWriteTest.testStorageApiErrorsWriteTableRows*passes 5 cases, with 2 inapplicable parameter combinations skipped. This used JDK 21 with the repository's default Java compilation target.validateChanges, andgit diff --checkpass.CHANGES.mdincludes the fix.The production change adds no dependencies and does not alter the append or retry protocol.