-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Consuming severe errors in regular mode using rerouting logic #3163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consuming severe errors in regular mode using rerouting logic #3163
Conversation
Summary of ChangesHello @aasthabharill, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a temporary fix to refine the Dead Letter Queue (DLQ) reconsumption mechanism within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3163 +/- ##
============================================
+ Coverage 50.79% 54.61% +3.81%
+ Complexity 5116 2234 -2882
============================================
Files 976 491 -485
Lines 59994 28440 -31554
Branches 6555 2982 -3573
============================================
- Hits 30476 15533 -14943
+ Misses 27380 11965 -15415
+ Partials 2138 942 -1196
🚀 New features to boost your workflow:
|
Documentation Change: GoogleCloudPlatform/spanner-migration-tool#1255
Implementation Details
A. The Recovery Function (SevereRetryRecoveryFn)
Acts as a gatekeeper for all errors destined for the Severe bucket.
Input: FailsafeElement tagged as PERMANENT.
Logic:
_metadata_severe_retriesis missing, initialize it to 0._metadata_severe_retries < maxRetries:RETRYABLEtag ("Rescued").counter >= maxRetries:_metadata_severe_retriesto 0.PERMANENTtag (Graveyard).B. Pipeline Graph Changes
Specific steps were added to intercept and process permanent errors from multiple sources.
1. FlattenProcessingFailures (Flatten)
2. EvaluateProcessingFailureRetry (ParDo)
SevereRetryRecoveryFnto theprocessingFailuresstream.3. EvaluateDlqRetry (ParDo)
SevereRetryRecoveryFnto thereconsumedElementsstream (errors coming from the DLQ).4. Flatten Retryable Errors (Flatten)
retry/GCS bucket.Potential Regressions & Risks
Important Callout: The _metadata_retry_count keeps incrementing on each retry. So if a retriable error has gone through: retry -> severe -> retry -> severe, it's _metadata_retry_count = 11 if maxRetryCount was 5
Design Decision: Template vs. Common Library
It was explicitly chosen NOT to implement this in the shared
DeadLetterQueueManager.javaDeadLetterQueueManageris a shared component used by multiple Dataflow templates (BigQuery, JDBC, MongoDB, etc.).Testing
Scenario 1: Fresh Severe Error (Direct to Severe)
Condition: A unique constraint violation (ALREADY_EXISTS) occurs immediately.
Behavior:
DLQ Entry:
Scenario 2: Manual Retry Loop (Severe -> Retry -> Severe)
Condition: User manually moves the file from Scenario 1 into the retry/bucket. The error is NOT resolved.
Behavior:
DLQ Entry (when it's written back to severe):
Scenario 3: "Fresh" severe error is moved to retry bucket after resolving issue (Severe -> Retry)
Condition: User manually moves the file from Scenario 1 into the retry/bucket after the error is resolved.
Behavior:
Scenario 4: Retriable Error that got exhausted and moved to severe (Retry -> Severe)
Condition: INTERLEAVE IN PARENT violation by orphan child - Error that is first written to retry bucket and is retried dlqMaxRetryCount (10 in this case) times but keeps failing
Behavior:
DLQ Entry (when it's written to severe):
Scenario 5: Cyclic Severe Exhaustion (Retry -> Severe -> Retry -> Severe)
Condition: User keeps moving the above file back to Retry, but error persists (5 times).
Behavior: