Repository navigation
[fix][broker] Report metadata write failures when creating partitioned topics - #27606
Open
oneby-wang wants to merge 1 commit into
Open
oneby-wang wants to merge 1 commit into
oneby-wang wants to merge 1 commit into
Conversation
…d topics Assisted-by: OpenAI Codex
11 tasks
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.
Motivation
Inspired by #27576 (originally oneby-wang#64), which fixed a similar failure during cluster migration.
When the metadata store is closing, a partitioned-topic metadata write can fail with an
AlreadyClosedExceptionwhose cause is null. ThewhenCompletecallback passesex.getCause()toRestException, which throws aNullPointerExceptionbefore the callback can complete the separate future returned to the caller. The admin request stays pending.Modifications
handlestage directly so a metadata failure reaches the REST error handler. A closed store now produces HTTP 500 with the original message.unwrapCompletionExceptionto recognize both direct and wrapped conflicts. A version conflict returns 409. An existing partitioned topic also returns 409, except whencreateLocalTopicOnlyallows local partition creation to continue.Verifying this change
Added
AdminTopicApiTest.testCreatePartitionedTopicReportsMetadataStoreFailure. It injects the failure only for the test topic's metadata write. Before the fix, the request received no response within five seconds. With the fix, it receives HTTP 500 and the original store error message.All seven tests in
AdminTopicApiTestandquickCheckpassed locally.Does this pull request potentially affect one of the following parts: