Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #9025] [RIP-73] Fix reset offset not effective in Pop Consumption #9087

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2187,9 +2187,13 @@ private RemotingCommand resetOffsetInner(String topic, String group, int queueId
ResetOffsetBody body = new ResetOffsetBody();
String brokerName = brokerController.getBrokerConfig().getBrokerName();
for (Map.Entry<Integer, Long> entry : queueOffsetMap.entrySet()) {
brokerController.getPopInflightMessageCounter().clearInFlightMessageNum(topic, group, entry.getKey());
if (brokerController.getPopInflightMessageCounter() != null) {
brokerController.getPopInflightMessageCounter().clearInFlightMessageNum(topic, group, entry.getKey());
}
if (brokerController.getBrokerConfig().isPopConsumerKVServiceEnable()) {
brokerController.getPopConsumerService().clearCache(group, topic, queueId);
brokerController.getPopConsumerService().clearCache(group, topic, entry.getKey());
brokerController.getConsumerOffsetManager().commitPullOffset(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice: here if we use the same consumer group to do pull and pop at the same time, they both commit the pull offset, May be pop requests may miss some messages here.

"ResetOffsetInner", group, topic, entry.getKey(), entry.getValue());
}
body.getOffsetTable().put(new MessageQueue(topic, brokerName, entry.getKey()), entry.getValue());
}
Expand Down
Loading