You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "klsince (via GitHub)" <gi...@apache.org> on 2024/07/29 20:36:56 UTC
[PR] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
klsince opened a new pull request, #13706:
URL: https://github.com/apache/pinot/pull/13706
When using strictReplicaGroup routing policy, the error msg may contain a huge number of segments that are unavailable. The segments are not really down but treated as unavailable by strictReplicaGroup policy, because all segments in a replica group are skipped if any one segment is unavailable in that group.
This PR adds the routing policy in query error msg when there are unavailable segments, to help reduce the confusion and triage the issue faster.
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on code in PR #13706:
URL: https://github.com/apache/pinot/pull/13706#discussion_r1710316668
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -836,6 +840,31 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
}
}
+ @VisibleForTesting
+ static String addRoutingPolicyInErrMsg(String errorMessage, String realtimeRoutingPolicy,
+ String offlineRoutingPolicy) {
+ if (realtimeRoutingPolicy != null && offlineRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [realtime], %s [offline]", errorMessage, realtimeRoutingPolicy,
+ offlineRoutingPolicy);
+ }
+ if (realtimeRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [realtime]", errorMessage, realtimeRoutingPolicy);
+ }
+ if (offlineRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [offline]", errorMessage, offlineRoutingPolicy);
+ }
Review Comment:
got it. it's error handling path, but anyway, lemme update to use +
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on code in PR #13706:
URL: https://github.com/apache/pinot/pull/13706#discussion_r1704594337
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -605,12 +610,22 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
List<ProcessingException> exceptions = new ArrayList<>();
if (numUnavailableSegments > 0) {
String errorMessage;
+ String routingPolicy;
+ if (offlineRoutingPolicy != null && realtimeRoutingPolicy != null) {
+ routingPolicy = String.format("%s [realtime], %s [offline]", realtimeRoutingPolicy, offlineRoutingPolicy);
+ } else if (offlineRoutingPolicy != null) {
+ routingPolicy = offlineRoutingPolicy;
Review Comment:
sgtm
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -605,12 +610,22 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
List<ProcessingException> exceptions = new ArrayList<>();
if (numUnavailableSegments > 0) {
String errorMessage;
+ String routingPolicy;
+ if (offlineRoutingPolicy != null && realtimeRoutingPolicy != null) {
+ routingPolicy = String.format("%s [realtime], %s [offline]", realtimeRoutingPolicy, offlineRoutingPolicy);
+ } else if (offlineRoutingPolicy != null) {
+ routingPolicy = offlineRoutingPolicy;
+ } else {
+ routingPolicy = realtimeRoutingPolicy;
+ }
Review Comment:
ack
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on code in PR #13706:
URL: https://github.com/apache/pinot/pull/13706#discussion_r1708886566
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -836,6 +840,31 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
}
}
+ @VisibleForTesting
+ static String addRoutingPolicyInErrMsg(String errorMessage, String realtimeRoutingPolicy,
+ String offlineRoutingPolicy) {
+ if (realtimeRoutingPolicy != null && offlineRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [realtime], %s [offline]", errorMessage, realtimeRoutingPolicy,
+ offlineRoutingPolicy);
+ }
+ if (realtimeRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [realtime]", errorMessage, realtimeRoutingPolicy);
+ }
+ if (offlineRoutingPolicy != null) {
+ return String.format("%s, with routing policy: %s [offline]", errorMessage, offlineRoutingPolicy);
+ }
Review Comment:
Is there a reason to use `String.format` here? It is pretty inefficient and IMHO more difficult to read that just concatenating Strings.
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "ege-st (via GitHub)" <gi...@apache.org>.
ege-st commented on code in PR #13706:
URL: https://github.com/apache/pinot/pull/13706#discussion_r1696122861
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -605,12 +610,22 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
List<ProcessingException> exceptions = new ArrayList<>();
if (numUnavailableSegments > 0) {
String errorMessage;
+ String routingPolicy;
+ if (offlineRoutingPolicy != null && realtimeRoutingPolicy != null) {
+ routingPolicy = String.format("%s [realtime], %s [offline]", realtimeRoutingPolicy, offlineRoutingPolicy);
+ } else if (offlineRoutingPolicy != null) {
+ routingPolicy = offlineRoutingPolicy;
Review Comment:
Why not format this to have the `[offline]` tag like line 615? It will help make sure people know that it's an offline/realtime policy and it keeps consistency for the logging.
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -605,12 +610,22 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
List<ProcessingException> exceptions = new ArrayList<>();
if (numUnavailableSegments > 0) {
String errorMessage;
+ String routingPolicy;
+ if (offlineRoutingPolicy != null && realtimeRoutingPolicy != null) {
+ routingPolicy = String.format("%s [realtime], %s [offline]", realtimeRoutingPolicy, offlineRoutingPolicy);
+ } else if (offlineRoutingPolicy != null) {
+ routingPolicy = offlineRoutingPolicy;
+ } else {
+ routingPolicy = realtimeRoutingPolicy;
+ }
Review Comment:
It would be cleaner to pull this out into a small helper function.
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince merged PR #13706:
URL: https://github.com/apache/pinot/pull/13706
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on PR #13706:
URL: https://github.com/apache/pinot/pull/13706#issuecomment-2256932383
Tested with HybridQuickstart, with bad segment injected manually and different routing policies for RT/OFFLINE tables, to trigger the error msgs like below:
```
select * from airlineStats limit 10
1 segments unavailable: [...], with routing policy: replicaGroup [realtime], balanced [offline]
select * from airlineStats_REALTIME limit 10
1 segments unavailable: [...], with routing policy: replicaGroup
select * from airlineStats_OFFLINE limit 10
1 segments unavailable: [...], with routing policy: balanced
```
--
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] add routing policy in query errmsg upon unavailable segments for a bit more context [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #13706:
URL: https://github.com/apache/pinot/pull/13706#issuecomment-2257019168
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/13706?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `0%` with `19 lines` in your changes missing coverage. Please review.
> Project coverage is 0.00%. Comparing base [(`59551e4`)](https://app.codecov.io/gh/apache/pinot/commit/59551e45224f1535c4863fd577622b37366ccc97?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`4cc9734`)](https://app.codecov.io/gh/apache/pinot/commit/4cc973432ac1e1000fc4f3c8698b65aedf73c905?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 807 commits behind head on master.
| [Files](https://app.codecov.io/gh/apache/pinot/pull/13706?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...sthandler/BaseSingleStageBrokerRequestHandler.java](https://app.codecov.io/gh/apache/pinot/pull/13706?src=pr&el=tree&filepath=pinot-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fbroker%2Frequesthandler%2FBaseSingleStageBrokerRequestHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcmVxdWVzdGhhbmRsZXIvQmFzZVNpbmdsZVN0YWdlQnJva2VyUmVxdWVzdEhhbmRsZXIuamF2YQ==) | 0.00% | [19 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/13706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (59551e4) and HEAD (4cc9734). Click for more details.
>
> <details><summary>HEAD has 53 uploads less than BASE</summary>
>
>| Flag | BASE (59551e4) | HEAD (4cc9734) |
>|------|------|------|
>|integration|7|1|
>|integration2|3|1|
>|temurin|12|1|
>|java-21|7|1|
>|skip-bytebuffers-true|3|0|
>|skip-bytebuffers-false|7|1|
>|unittests|5|0|
>|unittests1|2|0|
>|java-11|5|0|
>|unittests2|3|0|
>|integration1|2|0|
>|custom-integration1|2|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #13706 +/- ##
=============================================
- Coverage 61.75% 0.00% -61.76%
=============================================
Files 2436 2479 +43
Lines 133233 136950 +3717
Branches 20636 21322 +686
=============================================
- Hits 82274 0 -82274
- Misses 44911 136950 +92039
+ Partials 6048 0 -6048
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/13706/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/13706/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/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-0.01%)` | :arrow_down: |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/13706/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/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (ø)` | |
| [java-11](https://app.codecov.io/gh/apache/pinot/pull/13706/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/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-61.63%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-61.75%)` | :arrow_down: |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-61.76%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/13706/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
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 Sentry](https://app.codecov.io/gh/apache/pinot/pull/13706?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).
--
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