poorbarcode opened a new pull request, #22090:
URL: https://github.com/apache/pulsar/pull/22090
### Motivation
Context:
- After a consumer closes, it may leave an in-progress acknowledge task.
Issue:
- There are two consumers: `c1` and `c2`
- `c1` received a batch message: `ledger: L1, entry: E1, batch-size: 100`.
- `c1` was closed, after leaving an in-progress task to acknowledge `{L1,
E1, batch_index: 1}`
- Pulsar read `{L1, E1}` and tries to delivery to `c2`.
- The acknowledgement `{L1, E1, batch_index: 1}` is finished.
- `c2` gets `100` messages, but `unackedMessages` of `c2` is `98`.
We can always get the warn logs like below:
```
07:01:11.037 [pulsar-io-4-17] WARN
org.apache.pulsar.broker.service.Consumer - unackedMsgs is : -1,
```
### Modifications
Fix the bug.
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update
later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: x
--
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]