dao-jun opened a new pull request, #25554:
URL: https://github.com/apache/pulsar/pull/25554
### Motivation
During bundle transfer, Pulsar intentionally keeps producer connections
alive in the releasing phase and avoids triggering client reconnection until
the later close step defined by PIP-307. However, if an in-flight publish
reaches PersistentTopic.addFailed() while the topic is already transferring,
the broker currently
returns early without completing the publish callback.
That leaves broker-side publish state stuck:
- pendingWriteOps is not decremented
- producer pendingPublishAcks is not decremented
This creates a real leak in the transfer path and can block proper
producer/topic cleanup, while the wire protocol semantics during transfer
should remain unchanged.
### Modifications
- Update PersistentTopic.addFailed() to complete the broker-side publish
callback even when the topic is in transferring state.
- Use TopicClosedException in that transfer-time failure path so the
broker releases internal publish bookkeeping without sending a SendError to the
client.
- Decrement pendingWriteOps in that path to avoid stuck write state on the
source broker.
- Add a focused regression test covering an in-flight publish failure
during transfer and asserting that:
- no SendError is sent to the client
- pendingWriteOps returns to zero
- producer pendingPublishAcks returns to zero
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe
tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads
(10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
--
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]