You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2026/06/08 23:31:50 UTC
[PR] Use total stream partition count for realtime partition function divisor [pinot]
Jackie-Jiang opened a new pull request, #18708:
URL: https://github.com/apache/pinot/pull/18708
## Summary
`RealtimeSegmentDataManager.setPartitionParameters` derived the partition function divisor (`numPartitions`) from `computePartitionGroupMetadata(clientId, streamConfig, emptyList(), timeoutMs).size()`. That call fetches and discards a `StreamPartitionMsgOffset` for every partition just to take the list size, and — more importantly — returns the wrong count in two cases:
- **Kafka partition-subset feature** (`stream.kafka.partition.ids`): the `KafkaStreamMetadataProvider` override returns the *subset* size, not the topic's full partition count. The subset path also preserves the original Kafka partition ids as the partition group ids, so a divisor equal to the subset size cannot even represent those ids (e.g. a subset `{5, 17, 42}` with divisor `3`). The per-segment partition metadata is then computed inconsistently and partition pruning can prune valid segments, returning wrong results.
- **Kinesis**: the override excludes expired shards, so `.size()` reflects active shards rather than the producer's hashing space.
The divisor must match the partition count the upstream producer hashed each key over. `fetchPartitionCount` returns exactly that with a single call, so switch to it. For Kafka it resolves via `partitionsFor(topic)`, i.e. the full topic partition count, independent of any configured subset.
Kinesis partitioning remains unsupported (shards split/merge and ids are not a contiguous `0..N` range); a `TODO` records this.
Also refreshed the stale surrounding comments (no metric is emitted on mismatch; it is now logged at `warn`), promoted the fetch-failure log to `error`, and aligned the failure log message with the actual timeout.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Use total stream partition count for realtime partition function divisor [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #18708:
URL: https://github.com/apache/pinot/pull/18708#issuecomment-4654775283
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/18708?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `6 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 56.89%. Comparing base ([`b26d8c9`](https://app.codecov.io/gh/apache/pinot/commit/b26d8c940d6cb0181534c3e61ac5c95cdbee3ee9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`b68ea5f`](https://app.codecov.io/gh/apache/pinot/commit/b68ea5ff70df83af53d9c401d491fb41346d47db?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/18708?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...a/manager/realtime/RealtimeSegmentDataManager.java](https://app.codecov.io/gh/apache/pinot/pull/18708?src=pr&el=tree&filepath=pinot-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcore%2Fdata%2Fmanager%2Frealtime%2FRealtimeSegmentDataManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvcmVhbHRpbWUvUmVhbHRpbWVTZWdtZW50RGF0YU1hbmFnZXIuamF2YQ==) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/18708?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #18708 +/- ##
============================================
- Coverage 56.92% 56.89% -0.04%
+ Complexity 7 1 -6
============================================
Files 2587 2584 -3
Lines 150165 150158 -7
Branches 24274 24274
============================================
- Hits 85485 85435 -50
- Misses 57460 57494 +34
- Partials 7220 7229 +9
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration2](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-21](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.89% <0.00%> (-0.04%)` | :arrow_down: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.89% <0.00%> (-0.04%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.89% <0.00%> (-0.03%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/18708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.89% <0.00%> (-0.03%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/pinot/pull/18708?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Use total stream partition count for realtime partition function divisor [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #18708:
URL: https://github.com/apache/pinot/pull/18708#issuecomment-4661716183
Opened the corresponding docs update PR: pinot-contrib/pinot-docs#861
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Use total stream partition count for realtime partition function divisor [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #18708:
URL: https://github.com/apache/pinot/pull/18708
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org