Skip to content

Add a controller gauge that marks ended stream partitions - #20008

Draft
KKcorps wants to merge 1 commit into
apache:masterfrom
KKcorps:kk/partition-end-of-life-compatible
Draft

KKcorps wants to merge 1 commit into
apache:masterfrom
KKcorps:kk/partition-end-of-life-compatible

Conversation

@KKcorps

@KKcorps KKcorps commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

When a stream partition ends, like a Kinesis shard that is fully read after a split or merge, Pinot never creates another consuming segment for it. Alerts on llcPartitionConsuming then keep firing for a partition that is done. This is the backward compatible alternative to #19730: it only adds a metric and leaves every existing one as it is.

The lead controller of the table now emits a partitionEndOfLife gauge for each partition. It is 1 when a partition stops for end of life, at commit or in RealtimeSegmentValidationManager, and 0 once such a partition gets a consuming segment again. Other partitions emit nothing, and the gauge is removed when the partition has no segments left or leadership moves. Commit and validation updates for a table are serialized, and validation never overwrites a mark that a commit made after it read the segments.

To stop the false alert, add unless on(table, partition) (partitionEndOfLife == 1) to the rule. Unlike #19730, the server still leaves llcPartitionConsuming at 0 for an ended partition, so a rule that is not updated keeps firing.

Tests: new cases in PinotLLCRealtimeSegmentManagerTest for the commit mark, validation, retention, a partition coming back, a commit racing a validation run, and leadership loss. Each fails without its fix. The Prometheus export test, spotless, checkstyle and license pass.

@KKcorps KKcorps added kinesis Related to AWS Kinesis stream connector observability Related to observability (logging, tracing, metrics) real-time Related to realtime table ingestion and serving metrics Related to metrics emission and collection labels Oct 23, 2026
When a stream partition reaches end of life, such as a fully consumed Kinesis
shard after a split or merge, no new consuming segment is created. Alerts on
llcPartitionConsuming then keep firing for a partition that is done.

The lead controller of the table now emits a per partition partitionEndOfLife
gauge: 1 when it stops a partition for end of life (at commit or in the
validation task), and 0 once such a partition gets a consuming segment again.
Other partitions emit nothing. The gauges are removed when the partition has no
segments left or the controller stops leading the table. Commit and validation
updates for a table run inside compute() on a per table map, and validation
skips partitions a commit updated after it read the segment metadata.

Existing metrics are unchanged.
@KKcorps
KKcorps force-pushed the kk/partition-end-of-life-compatible branch from 43fa379 to 03cf181 Compare October 23, 2026 06:48
@KKcorps KKcorps changed the title Mark ended stream partitions, with the server consuming gauge fix behind a config Add a controller gauge that marks ended stream partitions Oct 23, 2026
@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.32258% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.70%. Comparing base (678c8b0) to head (03cf181).

Files with missing lines Patch % Lines
.../core/realtime/PinotLLCRealtimeSegmentManager.java 91.52% 1 Missing and 4 partials ⚠️
...r/validation/RealtimeSegmentValidationManager.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20008      +/-   ##
============================================
+ Coverage     69.68%   69.70%   +0.01%     
  Complexity     1491     1491              
============================================
  Files          3548     3548              
  Lines        235054   235115      +61     
  Branches      37702    37713      +11     
============================================
+ Hits         163804   163889      +85     
+ Misses        58586    58556      -30     
- Partials      12664    12670       +6     
Flag Coverage Δ
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-25 69.70% <90.32%> (+0.01%) ⬆️
lane-a 100.00% <ø> (ø)
lane-b 0.00% <ø> (ø)
temurin 69.70% <90.32%> (+0.01%) ⬆️
unittests 69.70% <90.32%> (+0.01%) ⬆️
unittests1 58.91% <100.00%> (-0.02%) ⬇️
unittests2 41.58% <90.32%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kinesis Related to AWS Kinesis stream connector metrics Related to metrics emission and collection observability Related to observability (logging, tracing, metrics) real-time Related to realtime table ingestion and serving

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants