caigy commented on code in PR #4477:
URL: https://github.com/apache/rocketmq/pull/4477#discussion_r901040846


##########
broker/src/main/java/org/apache/rocketmq/broker/transaction/queue/TransactionalMessageServiceImpl.java:
##########
@@ -354,7 +358,13 @@ private PutMessageResult 
putBackToHalfQueueReturnResult(MessageExt messageExt) {
         PutMessageResult putMessageResult = null;
         try {
             MessageExtBrokerInner msgInner = 
transactionalMessageBridge.renewHalfMessageInner(messageExt);
-            putMessageResult = 
transactionalMessageBridge.putMessageReturnResult(msgInner);
+            if 
(this.transactionalMessageBridge.getBrokerController().isSpecialServiceRunning()
+                    && BrokerRole.SLAVE == 
this.transactionalMessageBridge.getBrokerController().getMessageStoreConfig()
+                    .getBrokerRole()) {
+                putMessageResult = 
transactionalMessageBridge.getBrokerController().getEscapeBridge().putMessage(msgInner);
+            } else {
+                putMessageResult = 
transactionalMessageBridge.putMessageReturnResult(msgInner);
+            }

Review Comment:
   If retry times of the half message reached maximum value, the broker where 
it escaped would not check it any more, and the broker it was born also had 
skipped it, that message would be lost.



##########
broker/src/main/java/org/apache/rocketmq/broker/transaction/queue/TransactionalMessageServiceImpl.java:
##########
@@ -354,7 +358,13 @@ private PutMessageResult 
putBackToHalfQueueReturnResult(MessageExt messageExt) {
         PutMessageResult putMessageResult = null;
         try {
             MessageExtBrokerInner msgInner = 
transactionalMessageBridge.renewHalfMessageInner(messageExt);
-            putMessageResult = 
transactionalMessageBridge.putMessageReturnResult(msgInner);
+            if 
(this.transactionalMessageBridge.getBrokerController().isSpecialServiceRunning()
+                    && BrokerRole.SLAVE == 
this.transactionalMessageBridge.getBrokerController().getMessageStoreConfig()
+                    .getBrokerRole()) {
+                putMessageResult = 
transactionalMessageBridge.getBrokerController().getEscapeBridge().putMessage(msgInner);
+            } else {
+                putMessageResult = 
transactionalMessageBridge.putMessageReturnResult(msgInner);
+            }

Review Comment:
   If retry times of the half message reached maximum value, the broker where 
it escaped would not check it any more, and the broker it was born also had 
skipped it, that message would be lost.



-- 
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]

Reply via email to