remove lock mq step in broadcasting mode rebalancing (#8773)

remove lock MQ step in broadcasting mode rebalancing (#8773)
This commit is contained in:
Liu Shengzhong
2025-05-13 14:08:49 +08:00
committed by GitHub
parent e8a9d9ffd0
commit 18ff529c08
@@ -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;
}