Repository navigation
fix(broker): return a retriable storage error when S3 is unavailable - #272
Merged
PaxMachinaOne merged 1 commit intoOct 30, 2026
Merged
Conversation
Produce and Fetch returned UNKNOWN_SERVER_ERROR when S3 was unavailable, when an S3 write or read failed, and when a partition could not be restored from S3. librdkafka treats that as permanent and drops the message. They now return KAFKA_STORAGE_ERROR (56), keep REQUEST_TIMED_OUT for degraded S3, and set a clear error message on Produce v8 and later. Fixes KafScale#255
PaxMachinaOne
approved these changes
Oct 30, 2026
PaxMachinaOne
left a comment
Collaborator
There was a problem hiding this comment.
🤖 PaxMachina automated review (worker-code)
The change correctly maps S3 failures to retriable Kafka errors without exposing sensitive storage details.
No blocking findings.
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
Produce and Fetch now return a retriable
KAFKA_STORAGE_ERROR(56) instead ofUNKNOWN_SERVER_ERROR(-1) when S3 is unavailable or an S3 request fails. librdkafka treats -1 on Produce as permanent and drops the message.Changes
backpressureErrorCodereturnedUNKNOWN_SERVER_ERRORforS3StateUnavailableand for the default case, which covers a failed append or read while S3 still looks healthy. Both now returnKAFKA_STORAGE_ERROR. Degraded S3 still returnsREQUEST_TIMED_OUT.KAFKA_STORAGE_ERRORtopkg/protocol/errors.go, and updatesdocs/architecture.mdand the release notes.Tests
TestProduceBackpressureUnavailableandTestFetchBackpressureUnavailablenow expect 56.TestProduceBackpressureErrorMessageschecks the code and message on Produce v9 for degraded, unavailable and append failure.TestFetchRestoreFailureReturnsStorageErrorcovers the restore failure path.All of them fail against main and pass with the fix.
Not covered here: the e2e or live check with a librdkafka producer through a short MinIO outage.
Fixes #255