You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "ankitsultana (via GitHub)" <gi...@apache.org> on 2023/05/20 18:23:06 UTC

[GitHub] [pinot] ankitsultana opened a new pull request, #10789: [multistage] Use RNG for Request Id Generation

ankitsultana opened a new pull request, #10789:
URL: https://github.com/apache/pinot/pull/10789

   cc: @walterddr 
   
   request id collisions across brokers can cause weird query failures (we are seeing this in our production).
   
   Later we should switch to string based request-id. For now going with RNG to avoid having to deal with broker response changes and b/w incompatibility issues.


-- 
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


[GitHub] [pinot] walterddr commented on a diff in pull request #10789: [multistage] Use RNG for Request Id Generation

Posted by "walterddr (via GitHub)" <gi...@apache.org>.
walterddr commented on code in PR #10789:
URL: https://github.com/apache/pinot/pull/10789#discussion_r1201466858


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -69,13 +71,15 @@
 
 public class MultiStageBrokerRequestHandler extends BaseBrokerRequestHandler {
   private static final Logger LOGGER = LoggerFactory.getLogger(MultiStageBrokerRequestHandler.class);
+  private final Random _random = new Random();

Review Comment:
   had some offline discussion, can we do something like
   ```
   requestID = ((Long)((hash(brokerId) << 32)) + _requestIdGenerator.incrementAndGet()
   ```
   encode brokerID and requestID with high/low bits?
   
   this way we can still masked out the lower bit to get the exact ordering of the requests when we look at the requestID. this will be better in terms of debuggability.



-- 
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


[GitHub] [pinot] walterddr commented on a diff in pull request #10789: [multistage] Use RNG for Request Id Generation

Posted by "walterddr (via GitHub)" <gi...@apache.org>.
walterddr commented on code in PR #10789:
URL: https://github.com/apache/pinot/pull/10789#discussion_r1200646194


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -115,7 +119,7 @@ public MultiStageBrokerRequestHandler(PinotConfiguration config, String brokerId
   public BrokerResponse handleRequest(JsonNode request, @Nullable SqlNodeAndOptions sqlNodeAndOptions,
       @Nullable RequesterIdentity requesterIdentity, RequestContext requestContext)
       throws Exception {
-    long requestId = _requestIdGenerator.incrementAndGet();
+    long requestId = _multistageRequestIdGenerator.get();

Review Comment:
   +1 on this. CC @Jackie-Jiang to take a look and see if there's any alternative opinion on solving this issue. 



-- 
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


[GitHub] [pinot] walterddr merged pull request #10789: [multistage] Avoid Broker Request Id Collision

Posted by "walterddr (via GitHub)" <gi...@apache.org>.
walterddr merged PR #10789:
URL: https://github.com/apache/pinot/pull/10789


-- 
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


[GitHub] [pinot] ankitsultana commented on a diff in pull request #10789: [multistage] Avoid Broker Request Id Collision

Posted by "ankitsultana (via GitHub)" <gi...@apache.org>.
ankitsultana commented on code in PR #10789:
URL: https://github.com/apache/pinot/pull/10789#discussion_r1202597617


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -69,13 +71,15 @@
 
 public class MultiStageBrokerRequestHandler extends BaseBrokerRequestHandler {
   private static final Logger LOGGER = LoggerFactory.getLogger(MultiStageBrokerRequestHandler.class);
+  private final Random _random = new Random();

Review Comment:
   Added base-2 masking. We can also do base-10 masking to make debugging even easier. Something like:
   
   ```
   brokerHash * 10^9 + (requestId.incrementAndGet() % 10^9)
   ```
   
   lmk your preference



-- 
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


[GitHub] [pinot] codecov-commenter commented on pull request #10789: [multistage] Use RNG for Request Id Generation

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #10789:
URL: https://github.com/apache/pinot/pull/10789#issuecomment-1555979522

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/10789?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#10789](https://app.codecov.io/gh/apache/pinot/pull/10789?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (12172da) into [master](https://app.codecov.io/gh/apache/pinot/commit/3851f3309457340d83f9341c8eb981da1b4f8bb1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (3851f33) will **decrease** coverage by `44.47%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #10789       +/-   ##
   =============================================
   - Coverage     68.51%   24.05%   -44.47%     
   + Complexity     6479       49     -6430     
   =============================================
     Files          2159     2143       -16     
     Lines        116044   115613      -431     
     Branches      17569    17514       -55     
   =============================================
   - Hits          79510    27811    -51699     
   - Misses        30899    84861    +53962     
   + Partials       5635     2941     -2694     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration1 | `24.05% <100.00%> (+0.06%)` | :arrow_up: |
   | unittests1 | `?` | |
   | unittests2 | `?` | |
   
   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.
   
   | [Impacted Files](https://app.codecov.io/gh/apache/pinot/pull/10789?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...requesthandler/MultiStageBrokerRequestHandler.java](https://app.codecov.io/gh/apache/pinot/pull/10789?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcmVxdWVzdGhhbmRsZXIvTXVsdGlTdGFnZUJyb2tlclJlcXVlc3RIYW5kbGVyLmphdmE=) | `62.96% <100.00%> (-4.71%)` | :arrow_down: |
   
   ... and [1548 files with indirect coverage changes](https://app.codecov.io/gh/apache/pinot/pull/10789/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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