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

get online brokers in pinot spark connector #14802

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rohityadav1993
Copy link
Contributor

bugfix

pinot-spark-connector when reading from Pinot table fetches the broker urls from controller using http://%s/v2/brokers/tables/%s.
This returns all brokers including dead broker instances as well which can cause the spark job to fail.

This PR updates the controller API uri in request to also filter on state="OFFLINE" so that only a valid list of brokers is fetched.

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 63.83%. Comparing base (59551e4) to head (ec949a9).
Report is 1575 commits behind head on master.

Files with missing lines Patch % Lines
...ot/connector/spark/common/PinotClusterClient.scala 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14802      +/-   ##
============================================
+ Coverage     61.75%   63.83%   +2.07%     
- Complexity      207     1611    +1404     
============================================
  Files          2436     2704     +268     
  Lines        133233   150910   +17677     
  Branches      20636    23291    +2655     
============================================
+ Hits          82274    96327   +14053     
- Misses        44911    47368    +2457     
- Partials       6048     7215    +1167     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.80% <0.00%> (+2.10%) ⬆️
java-21 63.73% <0.00%> (+2.10%) ⬆️
skip-bytebuffers-false 63.82% <0.00%> (+2.07%) ⬆️
skip-bytebuffers-true 63.69% <0.00%> (+35.96%) ⬆️
temurin 63.83% <0.00%> (+2.07%) ⬆️
unittests 63.82% <0.00%> (+2.07%) ⬆️
unittests1 56.38% <ø> (+9.49%) ⬆️
unittests2 34.08% <0.00%> (+6.35%) ⬆️

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

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

@rohityadav1993 rohityadav1993 marked this pull request as ready for review January 13, 2025 14:49
@rohityadav1993
Copy link
Contributor Author

cc: @ankitsultana

@@ -33,7 +33,7 @@ import scala.util.{Failure, Success, Try}
*/
private[pinot] object PinotClusterClient extends Logging {
private val TABLE_SCHEMA_TEMPLATE = "http://%s/tables/%s/schema"
private val TABLE_BROKER_INSTANCES_TEMPLATE = "http://%s/v2/brokers/tables/%s"
private val TABLE_BROKER_INSTANCES_TEMPLATE = "http://%s/v2/brokers/tables/%s?state=%s"
Copy link
Contributor

Choose a reason for hiding this comment

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

can you instead use the livebrokers API? We have used it at scale in the past so there are no concerns with whether it works or not.

@@ -33,7 +33,7 @@ import scala.util.{Failure, Success, Try}
*/
private[pinot] object PinotClusterClient extends Logging {
private val TABLE_SCHEMA_TEMPLATE = "http://%s/tables/%s/schema"
private val TABLE_BROKER_INSTANCES_TEMPLATE = "http://%s/v2/brokers/tables/%s"
private val LIVE_BROKERS_TEMPLATE = "http://%s/tables/livebrokers?tables=%s"
Copy link
Contributor

Choose a reason for hiding this comment

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

usage is incorrect. table goes in the path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The API with path param was deprecated in favour of this one in #12201

@rohityadav1993 rohityadav1993 marked this pull request as draft January 16, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants