You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2024/10/23 02:30:01 UTC
(rocketmq) branch develop updated: [ISSUE #8772] Remove lock mq step in broadcasting mode rebalancing (#8774)
This is an automated email from the ASF dual-hosted git repository.
lizhimin pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 2956f6d46b [ISSUE #8772] Remove lock mq step in broadcasting mode rebalancing (#8774)
2956f6d46b is described below
commit 2956f6d46b03c5d8b06b06063313386d0a1f68d5
Author: Liu Shengzhong <sz...@gmail.com>
AuthorDate: Wed Oct 23 10:29:56 2024 +0800
[ISSUE #8772] Remove lock mq step in broadcasting mode rebalancing (#8774)
---
.../org/apache/rocketmq/client/impl/consumer/RebalanceImpl.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceImpl.java
index 711df3a9f0..d1f0d116e0 100644
--- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceImpl.java
+++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceImpl.java
@@ -308,7 +308,7 @@ public abstract class RebalanceImpl {
case BROADCASTING: {
Set<MessageQueue> mqSet = this.topicSubscribeInfoTable.get(topic);
if (mqSet != null) {
- boolean changed = this.updateProcessQueueTableInRebalance(topic, mqSet, isOrder);
+ boolean changed = this.updateProcessQueueTableInRebalance(topic, mqSet, false);
if (changed) {
this.messageQueueChanged(topic, mqSet, mqSet);
log.info("messageQueueChanged {} {} {} {}", consumerGroup, topic, mqSet, mqSet);
@@ -477,7 +477,7 @@ public abstract class RebalanceImpl {
}
private boolean updateProcessQueueTableInRebalance(final String topic, final Set<MessageQueue> mqSet,
- final boolean isOrder) {
+ final boolean needLockMq) {
boolean changed = false;
// drop process queues no longer belong me
@@ -518,7 +518,7 @@ public abstract class RebalanceImpl {
List<PullRequest> pullRequestList = new ArrayList<>();
for (MessageQueue mq : mqSet) {
if (!this.processQueueTable.containsKey(mq)) {
- if (isOrder && !this.lock(mq)) {
+ if (needLockMq && !this.lock(mq)) {
log.warn("doRebalance, {}, add a new mq failed, {}, because lock failed", consumerGroup, mq);
allMQLocked = false;
continue;