[Bug] POP retry response recoding uses the wrong record after a multi-message batch
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
## Reproduction\n\nWhen POP returns more than one normal message before a retry-topic result, PopConsumerContext stores one GetMessageResult per fetch result but flattens PopConsumerRecord entries per message.\n\nPopConsumerService later iterates getMessageResultList by result index and looks up popConsumerRecordList with the same index. After a multi-message result, that index points into the preceding batch instead of to the first record for the current result.\n\nWith popResponseReturnActualRetryTopic enabled, a retry result can therefore be treated as a normal result and skip retry-message recoding.\n\n## Expected behavior\n\nEach fetched GetMessageResult must use the first PopConsumerRecord that belongs to that result when deciding whether to recode retry messages.\n\n## Regression test\n\nPopConsumerServiceTest.popAsyncRecodeRetryMessagesAfterMultiMessageNormalResultTest fails on current develop.
Contributor guide
Research direction
Start by running PopConsumerServiceTest.popAsyncRecodeRetryMessagesAfterMultiMessageNormalResultTest and inspect how PopConsumerContext stores GetMessageResult and PopConsumerRecord entries. Trace the corresponding logic in PopConsumerService; done means each result checks the first record belonging to it and the regression test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100