Conversation
Record a per-pipeline run id during InitializeDoFn and skip re-execution when the metadata already belongs to the same run, so RESUME_OR_NEW cannot start a second consumer chain inside one job. Fixes apache#39970
arimu1
force-pushed
the
fix/39970-bigtable-resume-or-new
branch
from
September 13, 2026 00:29
9d2bfeb to
0cd0661
Compare
Use a unique change stream name per test and mark prior-job metadata in the resume case so shared emulator rows do not skip initialization.
Contributor
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
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.
Summary
BigtableIO.readChangeStream()usesExistingPipelineOptions.RESUME_OR_NEW, a re-executedInitializeDoFn(e.g. Dataflow bundle retry) could see Detect New Partition metadata written by the same job and take the resume path, emitting a secondInitialPipelineStateand starting duplicate change-stream consumers.InitializeDoFnoutput when the stored id matches the current run. A genuinely new job still resumes when the stored id differs.Fixes #39970
Test plan
InitializeDoFnTest.testInitializeSkipsDuplicatePipelineRun(emulator)./gradlew :sdks:java:io:google-cloud-platform:test --tests org.apache.beam.sdk.io.gcp.bigtable.changestreams.dofn.InitializeDoFnTest(local run hit disk pressure on cold clone; CI expected to run)