redpanda-data / redpanda-data/connect

aws_s3 input: option to nack (dead-letter) SQS notifications for missing S3 objects

Open
#4,474 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
8.8k
Forks
969
Avg merge
1d 13h
Merged PRs (30d)
64

Description

Summary

The aws_s3 input (SQS-driven mode) currently has only one, 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.

This is the right default for pipelines that enable delete_objects — a redelivered notification for an object this input already processed and deleted is expected and harmless. But it is wrong for pipelines that need a missing object to be treated as a delivery failure.

Use case

We run an S3 → Kafka pipeline with a contractual at-least-once delivery requirement and an SQS redrive policy (DLQ, maxReceiveCount). One acceptance criterion is:

If the S3 object referenced by a notification cannot be found, the notification must be dead-lettered with an ERROR log (not silently dropped), so it can be inspected and replayed.

Today there is no way to express this: a missing object is always silently dropped at WARN level, so the DLQ never sees it and the failure is invisible to alerting on DLQ depth.

Proposal

Add an advanced enum field sqs.on_missing_object with two values:

  • drop (default, current/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 dead-letters it after maxReceiveCount.

To prevent a foot-gun, combining on_missing_object: nack with delete_objects: true is rejected at config-parse time: a redelivered notification for an object this input legitimately deleted would otherwise be dead-lettered.

The default value preserves existing behaviour exactly, so this is fully backward compatible.

I have an implementation ready and will open a PR referencing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the aws_s3 input's SQS-driven path for NoSuchKey/404 handling and its existing nack path first. Then trace config parsing for sqs.on_missing_object and delete_objects; done means drop remains the default, nack logs an error and requeues the notification, and the invalid option combination is rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, kafka
Domain
cloud, data-engineering, stream-processing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.