merlimat opened a new pull request, #25882: URL: https://github.com/apache/pulsar/pull/25882
## Motivation Follow-up to the PIP-475 migration work. #25878 hardened the **sync** producer send path so a connected V5 producer rides through the synthetic→real-DAG transition during a regular-to-scalable migration: when a per-segment producer is (re)created on a partition that the migration just terminated, the send retries onto an active child once the new layout arrives instead of failing. The **async** path (`producer.async()…send()` → `dispatchSendAttempt` / `appendToDispatchChain`) had the same gap and was missed, so an application using the async producer API and sending across a migration could still see sends fail. ## Modifications - **Creation-time failures are now retried.** `appendToDispatchChain` previously failed the user future immediately when the per-segment producer failed to create; it now hands the failure to a callback that applies the same retry decision as a send failure. - **Unified, robust detection.** Both the v4 `sendAsync` failure and the producer-creation failure now go through the shared `isSegmentGoneError` (type or message match), instead of the async path's previous type-only check that missed the message-wrapped exception the creation path surfaces. - **Full retry budget.** Both paths now use `SEND_RETRY_MAX_ATTEMPTS` / `SEND_RETRY_MAX_BACKOFF_MS` (shared with the sync path) instead of the old 3-attempt (~600 ms) limit. No wire/API/behavior change for the happy path; this only affects retry behavior on the segment-gone transition. ## Verification - New `V5MigrationEndToEndTest.testV5AsyncProducerSurvivesMigration`: async sends issued immediately after migration must all complete (none fail across the boundary) and every pre-/post-migration message stays consumable. Passes alongside the existing sync + v4-lockout cases (3/3). - `pulsar-client-v5` checkstyle/compile and `pulsar-broker` checkstyle clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
