Keep retrying failed replication DLQ writes - #11999
Draft
taylan-oai wants to merge 1 commit into
Draft
taylan-oai wants to merge 1 commit into
taylan-oai wants to merge 1 commit into
Conversation
|
|
5 tasks
Contributor
|
This PR makes sense. I continue this change in PR: #12150 to add a break glass config. |
This branch has not been deployed
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
Retain replication tasks when the shared dead-letter queue (DLQ) handler fails, so repeated shard lookup or write failures cannot advance acknowledgement past the task.
Problem
The shared streaming-replication DLQ handler gives a failed task three attempts to enter the DLQ. If all three fail, the next
ExecutableTaskImpl.MarkPoisonPillcall returns success without writing anything. The task tracker then removes the task and can acknowledge past it. The destination may therefore miss a workflow update with no DLQ entry available to replay.The limit counts calls, including failures to find the destination shard; three attempts do not necessarily mean three storage writes.
Approach
Remove the attempt cap and its counter. Each call reports the actual shard lookup or DLQ write result, so the tracker retains failed tasks and retries during subsequent stream status updates. A successful write releases the task and allows acknowledgement progress. Existing failure logs and the replication DLQ failure metric continue to expose errors.
Validation
The new regression fails on the original code: both failure cases advance the watermark on the fourth attempt. With the fix, the full replication package passes:
go test -p 4 -tags test_dep ./service/history/replication -count=1The regression covers four consecutive DLQ write failures and four consecutive shard lookup failures. Each failure retains the task's acknowledgement boundary, and a later successful write releases it. Changed-package repository lint passes.
Risks, rollout, and scope
A persistent DLQ failure now holds the acknowledgement boundary until it is repaired. Retained tasks still count toward the receiver's existing limit for outstanding tasks. This change uses the current status-update retry cadence and adds no new configuration or storage format. Existing task-specific handling of unknown task types and malformed history payloads is outside this shared-handler fix.