mirror of
https://github.com/apache/rocketmq.git
synced 2026-08-28 20:09:14 +08:00
remove lock mq step in broadcasting mode rebalancing (#8773)
remove lock MQ step in broadcasting mode rebalancing (#8773)
This commit is contained in:
@@ -241,7 +241,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 {} {} {} {}",
|
||||
@@ -327,7 +327,7 @@ public abstract class RebalanceImpl {
|
||||
}
|
||||
|
||||
private boolean updateProcessQueueTableInRebalance(final String topic, final Set<MessageQueue> mqSet,
|
||||
final boolean isOrder) {
|
||||
final boolean needLockMq) {
|
||||
boolean changed = false;
|
||||
|
||||
Iterator<Entry<MessageQueue, ProcessQueue>> it = this.processQueueTable.entrySet().iterator();
|
||||
@@ -367,7 +367,7 @@ public abstract class RebalanceImpl {
|
||||
List<PullRequest> pullRequestList = new ArrayList<PullRequest>();
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user