dao-jun commented on code in PR #25554:
URL: https://github.com/apache/pulsar/pull/25554#discussion_r3119180878
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -758,19 +758,21 @@ public void addComplete(Position pos, ByteBuf entryData,
Object ctx) {
@Override
public synchronized void addFailed(ManagedLedgerException exception,
Object ctx) {
+ PublishContext callback = (PublishContext) ctx;
/* If the topic is being transferred(in the Releasing bundle state),
- we don't want to forcefully close topic here.
- Instead, we will rely on the service unit state channel's
bundle(topic) transfer protocol.
- At the end of the transfer protocol, at Owned state, the source
broker should close the topic properly.
+ we don't want to forcefully close the topic here.
+ Instead, complete the broker-side publish callback and let the
transfer protocol finish the topic close on the
+ source broker.
*/
if (transferring) {
log.debug()
.exception(exception)
.log("Failed to persist msg in store while transferring");
+ callback.completed(new TopicClosedException(exception), -1, -1);
+ decrementPendingWriteOpsAndCheck();
Review Comment:
Thanks for your explain, now I understand it. 👍
--
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]