zjncs opened a new pull request, #11142:
URL: https://github.com/apache/rocketmq/pull/11142
### Motivation
`appendAck` set `PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX` correctly per ack
type (`genBatchAckUniqueId` for `BatchAckMsg`, `genAckUniqueId` otherwise), but
a later unconditional `put` overwrote it with `genAckUniqueId` for every ack.
Batch acks therefore landed on the revive topic with a bogus uniq key: the
offset segment was the `-1` sentinel the batch path assigns, and the tag
segment was `ack` instead of `bAck`, so every batch ack of a pop produced the
same non-unique client id and tracing by uniq key was impossible.
The buffered path in `PopBufferMergeService` already writes the batch uniq
key without overwriting it.
### Modifications
Drop the stray `put` so the per-type key set just above survives.
### Verification
Fail-before (new test, run against the unpatched code):
```
AckMessageProcessorTest#testBatchAck_appendAck_BatchUniqKeyKept
expected: "FooBar@0@[101]@DEFAULT_CONSUMER@1666860736757@bAck"
but was: "FooBar@0@-1@DEFAULT_CONSUMER@1666860736757@broker-a@ack"
```
Pass-after:
```
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 -- AckMessageProcessorTest
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]