feat(aws_s3): add sqs.on_missing_object to dead-letter missing objects#4475
Open
peczenyj wants to merge 5 commits into
Open
feat(aws_s3): add sqs.on_missing_object to dead-letter missing objects#4475peczenyj wants to merge 5 commits into
peczenyj wants to merge 5 commits into
Conversation
The SQS-driven aws_s3 input currently has a single hard-coded behaviour
when an object referenced by a notification cannot be downloaded because
it no longer exists (NoSuchKey/404): it warns, acks the notification and
discards it, so the notification can never reach an SQS dead-letter queue.
This adds an advanced enum field `sqs.on_missing_object`:
- `drop` (default, the historical behaviour): warn, ack, discard.
- `nack`: log an error and return the notification to the queue so an
SQS redrive policy can dead-letter it after maxReceiveCount.
Combining `on_missing_object: nack` with `delete_objects: true` is
rejected at config-parse time, since a redelivered notification for an
object this input legitimately deleted would otherwise be dead-lettered.
The default preserves existing behaviour exactly (fully backward
compatible).
Fixes redpanda-data#4474
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Description
The SQS-driven
aws_s3input currently has a single, hard-coded behaviour when an SQS notification points at an S3 object that cannot be downloaded because it no longer exists (NoSuchKey/ 404): it logs a warning, acks the notification (DeleteMessage) and discards it. The notification can therefore never reach an SQS dead-letter queue.That is the correct default when
delete_objectsis enabled (a redelivered notification for an already-deleted object is expected and harmless), but it is wrong for pipelines that need a missing object to be treated as a delivery failure and dead-lettered for inspection/replay.This PR adds an advanced enum field
sqs.on_missing_object:drop(default, the historical behaviour): warn, ack, discard.nack: log an error and return the notification to the queue (the existing nack path) so an SQS redrive policy can dead-letter it aftermaxReceiveCount.To avoid a foot-gun, combining
on_missing_object: nackwithdelete_objects: trueis rejected at config-parse time, since a redelivered notification for an object this input legitimately deleted would otherwise be dead-lettered.The default value preserves existing behaviour exactly, so this change is fully backward compatible.
Changes
sqs.on_missing_objectstring enum field (drop|nack),Advanced(), defaultdrop.nack+delete_objects: true.readSQSEventsnow routesNoSuchKeyto the nack path whennackis selected (ERROR log) instead of always dropping (WARN log).aws_s3.adocand a CHANGELOG entry.Fixes #4474