OXY-146: Pulsar createIfDNE idempotency (Topic already exists) - #292
Open
Kalin-Rudnicki wants to merge 2 commits into
Open
OXY-146: Pulsar createIfDNE idempotency (Topic already exists)#292Kalin-Rudnicki wants to merge 2 commits into
Kalin-Rudnicki wants to merge 2 commits into
Conversation
createIfDNE (tenant/namespace/topic) used a non-atomic check-then-act
(list then create). Under concurrent calls both fibers could see the
resource missing and both create it; the loser got a 409
PulsarAdminException ("... already exists").
- Add shared private `succeedIfAlreadyExists` combinator wrapping the
`create` call in all three createIfDNE methods (catchSome -> log Info).
- Add private `isAlreadyExists` predicate: PulsarAdminException status 409
first, unwrap CompletionException/ExecutionException, then fall back to
case-insensitive "already exists" message check.
- Preserve existing behavior (partition-mismatch warning, list fast-path);
non-already-exists errors still propagate.
- Add first test dir for oxygen-events-pulsar (+ oxygen-test % Test dep):
mock-based idempotency + propagation tests via JDK dynamic proxy.
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.
Summary
Fixes OXY-146:
PulsarAdminClient.{tenant,namespace,topic}.createIfDNEused a non-atomic check-then-act (list then create). Under concurrent calls both fibers could see the resource missing and both create it; the loser got a 409PulsarAdminException("... already exists"). Now treated as success.Changes
succeedIfAlreadyExistscombinator wraps thecreatecall in all threecreateIfDNEmethods (catchSome-> log Info, return unit).isAlreadyExistspredicate:PulsarAdminExceptionstatus 409 first, unwrapCompletionException/ExecutionException, then case-insensitive "already exists" message fallback.oxygen-events-pulsar(+oxygen-test% Test): mock-based idempotency + propagation tests via JDK dynamic proxy. 6 tests pass.Notes
report/OXY-146.md.🤖 Generated with Claude Code