lizhimins commented on code in PR #8323:
URL: https://github.com/apache/rocketmq/pull/8323#discussion_r1682442682


##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java:
##########
@@ -672,19 +672,17 @@ protected void 
composeResponseHeader(PullMessageRequestHeader requestHeader, Get
         }
 
         if (this.brokerController.getBrokerConfig().getBrokerId() != 
MixAll.MASTER_ID && !getMessageResult.isSuggestPullingFromSlave()) {
-            if (this.brokerController.getMinBrokerIdInGroup() == 
MixAll.MASTER_ID) {
-                LOGGER.debug("slave redirect pullRequest to master, topic: {}, 
queueId: {}, consumer group: {}, next: {}, min: {}, max: {}",
-                    requestHeader.getTopic(),
-                    requestHeader.getQueueId(),
-                    requestHeader.getConsumerGroup(),
-                    responseHeader.getNextBeginOffset(),
-                    responseHeader.getMinOffset(),
-                    responseHeader.getMaxOffset()
-                );
-                responseHeader.setSuggestWhichBrokerId(MixAll.MASTER_ID);
-                if 
(!getMessageResult.getStatus().equals(GetMessageStatus.FOUND)) {
-                    response.setCode(ResponseCode.PULL_RETRY_IMMEDIATELY);
-                }
+            LOGGER.debug("slave redirect pullRequest to master, topic: {}, 
queueId: {}, consumer group: {}, next: {}, min: {}, max: {}",

Review Comment:
   在使用 inner broker controller 的时候,这个判断是看这个副本组的 master 
是否在线。因此整体的语义是读备机且不建议从备读的时候,如果主在线才切回主,主不在线是切不回去的。



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