Skip to content

Commit b8aba3b

Browse files
authored
[ISSUE #10181] Remove lock when resetting offset in PopConsumerService (#10250)
1 parent 2b5e709 commit b8aba3b

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,9 @@ public CompletableFuture<Boolean> revive(PopConsumerRecord record) {
555555
});
556556
}
557557

558-
@SuppressWarnings("StatementWithEmptyBody")
559558
public void clearCache(String groupId, String topicId, int queueId) {
560-
while (!consumerLockService.tryLock(groupId, topicId)) {
561-
}
562-
try {
563-
if (popConsumerCache != null) {
564-
popConsumerCache.removeRecords(groupId, topicId, queueId);
565-
}
566-
} finally {
567-
consumerLockService.unlock(groupId, topicId);
559+
if (popConsumerCache != null) {
560+
popConsumerCache.removeRecords(groupId, topicId, queueId);
568561
}
569562
}
570563

broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,6 @@ private RemotingCommand resetOffsetInner(String topic, String group, int queueId
21832183
brokerController.getPopInflightMessageCounter().clearInFlightMessageNum(topic, group, entry.getKey());
21842184
}
21852185
if (brokerController.getBrokerConfig().isPopConsumerKVServiceEnable()) {
2186-
brokerController.getPopConsumerService().clearCache(group, topic, entry.getKey());
21872186
brokerController.getConsumerOffsetManager().clearPullOffset(group, topic);
21882187
}
21892188
body.getOffsetTable().put(new MessageQueue(topic, brokerName, entry.getKey()), entry.getValue());

0 commit comments

Comments
 (0)