Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing consumer's record lag in /consumingSegmentsInfo #9515

Merged
merged 11 commits into from
Oct 18, 2022

Conversation

navina
Copy link
Contributor

@navina navina commented Oct 3, 2022

Re-work of the PR : #8280

Changes in this PR:

  • /consumingSegmentsInfo API was moved into PinotRealtimeTableResource .
    • This returns additional per-partition map for upstream latest record offset and partition lag (when calculated)
  • Introduces new API in StreamMetadataProvider#getCurrentPartitionLagState
    • This PR only adds support for Kafka.
    • Any stream connector that hasn't implemented this method will return NOT_CALCULATED for these new lag status
    • Additionally, connectors can extend PartitionLagState interface to return more custom lag definitions

Things to be addressed in a follow-up PR:

  • Define a time-based lag status
  • Add partition lag info for kinesis and pulsar stream

@navina
Copy link
Contributor Author

navina commented Oct 3, 2022

@KKcorps / @npawar : extending metrics to plugin is taking a while. So, let's get this in while I continue working on that.

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2022

Codecov Report

Merging #9515 (daa4728) into master (0a442b9) will decrease coverage by 6.25%.
The diff coverage is 15.27%.

@@             Coverage Diff              @@
##             master    #9515      +/-   ##
============================================
- Coverage     70.03%   63.78%   -6.26%     
+ Complexity     5288     4952     -336     
============================================
  Files          1937     1889      -48     
  Lines        103498   101377    -2121     
  Branches      15715    15453     -262     
============================================
- Hits          72487    64660    -7827     
- Misses        25907    31986    +6079     
+ Partials       5104     4731     -373     
Flag Coverage Δ
integration1 ?
integration2 ?
unittests1 67.31% <0.00%> (-0.10%) ⬇️
unittests2 15.58% <15.27%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
.../common/restlet/resources/SegmentConsumerInfo.java 0.00% <0.00%> (ø)
...ller/api/resources/PinotRealtimeTableResource.java 0.00% <0.00%> (ø)
...ler/api/resources/PinotSegmentRestletResource.java 10.31% <ø> (-28.13%) ⬇️
...manager/realtime/HLRealtimeSegmentDataManager.java 0.00% <0.00%> (-82.88%) ⬇️
...manager/realtime/LLRealtimeSegmentDataManager.java 52.19% <0.00%> (-17.68%) ⬇️
...a/manager/realtime/RealtimeSegmentDataManager.java 50.00% <ø> (-50.00%) ⬇️
...ugin/stream/kafka20/KafkaConsumerPartitionLag.java 0.00% <0.00%> (ø)
...in/stream/kafka20/KafkaStreamMetadataProvider.java 50.90% <0.00%> (-17.28%) ⬇️
...pache/pinot/spi/stream/ConsumerPartitionState.java 0.00% <0.00%> (ø)
...org/apache/pinot/spi/stream/PartitionLagState.java 0.00% <0.00%> (ø)
... and 488 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@npawar npawar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments only, looking good!

Copy link
Contributor

@npawar npawar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
we need to mark this backward incompat because of the partitionToOffset map being removed? should we keep it around and deprecate it first?

@navina
Copy link
Contributor Author

navina commented Oct 17, 2022

lgtm! we need to mark this backward incompat because of the partitionToOffset map being removed? should we keep it around and deprecate it first?

Strictly speaking, this is considered backward incompat. But how do you "deprecate" an API response alone?

@npawar
Copy link
Contributor

npawar commented Oct 17, 2022

lgtm! we need to mark this backward incompat because of the partitionToOffset map being removed? should we keep it around and deprecate it first?

Strictly speaking, this is considered backward incompat. But how do you "deprecate" an API response alone?

all we can do is just mark it deprecated in the java class for devs, and callout in release notes for users in next release. and in release after that we can remove it. we could also add it as API notes so it appears in swagger?

@npawar npawar added the release-notes Referenced by PRs that need attention when compiling the next release notes label Oct 17, 2022
@npawar npawar added the backward-incompat Referenced by PRs that introduce or fix backward compat issues label Oct 18, 2022
@npawar npawar merged commit d580bbc into apache:master Oct 18, 2022
@navina navina mentioned this pull request Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backward-incompat Referenced by PRs that introduce or fix backward compat issues release-notes Referenced by PRs that need attention when compiling the next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants