You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "lizhimins (via GitHub)" <gi...@apache.org> on 2023/05/12 09:37:00 UTC

[GitHub] [rocketmq] lizhimins commented on a diff in pull request #6623: [ISSUE #6598] Fix pop cause out memory error when message store not writeable

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


##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java:
##########
@@ -602,6 +602,28 @@ private CompletableFuture<Long> popMsgFromQueue(boolean isRetry, GetMessageResul
                     return atomicRestNum.get();
                 }
                 if (!result.getMessageMapedList().isEmpty()) {
+                    if (isOrder) {
+                        this.brokerController.getConsumerOrderInfoManager().update(isRetry, topic,
+                            requestHeader.getConsumerGroup(),
+                            queueId, popTime, requestHeader.getInvisibleTime(), result.getMessageQueueOffset(),
+                            orderCountInfo);
+                        this.brokerController.getConsumerOffsetManager().commitOffset(channel.remoteAddress().toString(),
+                            requestHeader.getConsumerGroup(), topic, queueId, finalOffset);
+                    } else {
+                        boolean success = appendCheckPoint(requestHeader, topic, reviveQid, queueId, finalOffset, result, popTime, this.brokerController.getBrokerConfig().getBrokerName());
+                        if (!success) {
+                            // If append checkPoint error, will not return these messages.
+                            for (SelectMappedBufferResult mapedBuffer : result.getMessageMapedList()) {
+                                mapedBuffer.release();
+                            }
+                            atomicRestNum.set(result.getMaxOffset() - atomicOffset.get() + atomicRestNum.get());

Review Comment:
   Suggest adding comments here



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org