GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [fix][client] Fix stale batch ACKs causing skipped messages after seek by void-ptr974 · Pull Request #27067 · apache/pulsar Conversation
|
| Step | Execution | State / user-visible result |
|---|---|---|
| 1 | A receives [0, 1] and ACKs index 0 |
The partial-batch bitmap waits for flush. |
| 2 | S handles seek success while disconnected and cleans up | flush() returns; the batch-index map is not cleared. Seek-related reconnect cleanup also leaves it behind. |
| 3 | Subscription succeeds; F flushes the stale ACK; replay starts after the broker applies it | The application receives only [1]. Clearing the bitmap prevents this stale ACK from affecting replay. |
The broker regression pauses delivery through reconnect and flush, waits for a subsequent broker response, and then resumes. The no-ACK control receives [0, 1]; the partial-ACK case receives only [1] before the fix.
Delayed write failure crossing cleanup:
Here g0/g1 are local ACK cleanup generations, not protocol consumer epochs.
| Step | F / W: flush and completion | S / A: cleanup and application | Required result |
|---|---|---|---|
| 1 | Drain old ACKs into snapshot g0; submit the write |
The callback retains the snapshot even though pending is empty. | |
| 2 | Write result remains pending | Clear pending state and advance to g1 |
Old snapshots become invalid. |
| 3 | Record a new ACK from replay | Preserve the new ACK. | |
| 4 | Old write fails and attempts to restore g0 |
Reject g0 != g1; do not reinsert or merge old ACKs. |
ackGeneration on cleanup and reject failed-write restoration from an older generation. Ordinary reconnects retain ACK retry behavior.pendingAcksLock.Generation capture and extraction must be atomic with cleanup: otherwise a flush could read g0, then drain a new ACK added after cleanup advances to g1, and incorrectly reject that new ACK's restoration.
This protects pending state and failed-write restoration; it does not retract ACKs already submitted to transport or globally order every application ACK call against seek.
Local verification passed:
AcknowledgementsGroupingTrackerTest, AcknowledgmentsGroupingFlushesTest, and ConsumerImplTest.testSeekAsyncInternal. Coverage includes disconnected/Connecting cleanup, ACK receipt settings, delayed legacy/multi-message write failures, and ordinary reconnect controls.ConsumerSeekBatchIndexAckTest, with and without the partial ACK. A long grouping interval and asynchronous reconnect gate make the failing sequence deterministic../gradlew quickCheck.An expanded ConsumerImplTest run hit timeouts in testChunkedMessageCountRaceBetweenReceiveAndExpiry and testClearIncomingMessagesConcurrentWithEnqueueAndReceive and was stopped. The focused tests above subsequently passed.
Adds synchronization around flush snapshots, cleanup, and restoration without changing executor assignments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: OpenAI Codex
There was an error while loading. Please reload this page.
apache#27067) (cherry picked from commit 73f70bc)
apache#27067) (cherry picked from commit 73f70bc)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.