[fix][broker] Defer ack state updates until persistence succeeds#25528
[fix][broker] Defer ack state updates until persistence succeeds#25528nodece wants to merge 2 commits intoapache:masterfrom
Conversation
|
Will the broker stop dispatch messages to the consumer if the consumer has been set to a lower max unack message and the persistence interval of the cursor set to a higher value? |
|
The broker should not stop dispatching messages just because In this implementation, For the normal path, the ack immediately triggers async mark-delete/delete persistence, so it does not wait for
|
b6b33f1 to
65f7a2a
Compare
872e835 to
509d095
Compare
509d095 to
b27a7ae
Compare
Motivation
The broker ack path was updating consumer-side in-memory ack state before the underlying subscription ack path had fully completed. That makes ack failures harder to reason about and can leave broker-side state transitions out of sync with the persisted ack result and ack-receipt flow.
Changes
ServerCnxConsumer.individualAckNormalandConsumer.individualAckWithTransactioninto a single unifiedindividualAckmethod, eliminating code duplication between the transactional and non-transactional individual ack paths. The unified method preserves the original timing semantics:computeAckedCountto return the correct batch size (instead of always1) when no batch-index ack set is present, ensuringmessageAckRatemetrics are accurate for batched messages