Vamsi-klu opened a new pull request, #19086:
URL: https://github.com/apache/pinot/pull/19086

   ## Why
   
   After a Kinesis **shard merge/split**, servers correctly stop with 
`endOfPartitionGroup` and commit. The controller then re-probed end-of-shard 
via `KinesisStreamMetadataProvider.consumedEndOfShard`. On max empty non-EOP 
polls (including rate-limit empties), the provider **assumed the shard was 
still live**. That recreated a new consuming segment on the closed parent, 
which immediately committed empty — **forever** — and blocked child-shard 
admission (`shardsEnded`).
   
   This is a production reliability bug for any realtime table on Kinesis that 
rescales shards.
   
   ## Impact
   
   - **Stops unbounded empty segment commit loops** after Kinesis rescale.
   - **Unblocks child shards** so ingestion continues on the new lineage.
   - **Reduces controller/server thrash** (ZK IdealState churn, empty builds).
   - Localized to the Kinesis metadata provider — no LLC protocol redesign.
   
   ## How
   
   In `KinesisStreamMetadataProvider`:
   
   1. **Short-circuit** when the shard is closed and the checkpoint sequence is 
already at/past `endingSequenceNumber`.
   2. For **closed** shards, after empty-only probes (no messages seen), treat 
the shard as **ended** instead of fail-closed “still live”.
   3. Soften handling of throttle/timeout empty batches so they do not burn the 
attempt budget the same way as real empty non-EOP responses.
   4. Flip/extend unit tests that previously encoded the buggy “max attempts ⇒ 
still live” expectation.
   
   ## Test plan
   
   - [x] Extended `KinesisStreamMetadataProviderTest` (closed shard + 
empty-only probes ⇒ parent removed; sequence short-circuit; child admission 
after parent end).
   - [ ] `./mvnw -pl pinot-plugins/pinot-stream-ingestion/pinot-kinesis -am 
-Dtest=KinesisStreamMetadataProviderTest 
-Dsurefire.failIfNoSpecifiedTests=false test`
   - [ ] Manual/staging (optional): merge two Kinesis shards under a Pinot 
realtime table and confirm no empty-commit loop and children consume.
   
   ## Related
   
   fixes: #17209
   
   ## Reviewers
   
   Suggested: maintainers familiar with stream ingestion / Kinesis
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes — Grok Build (xAI)
   
   Generated-by: Grok Build (xAI)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to