You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Nemesis123925 (via GitHub)" <gi...@apache.org> on 2023/11/19 19:36:45 UTC
[PR] fix by checking the index first [pinot]
Nemesis123925 opened a new pull request, #12029:
URL: https://github.com/apache/pinot/pull/12029
## Setup:
Java version: openjdk 11.0.20.1
Maven version: Apache Maven 3.8.1
## Fixed Test:
`org.apache.pinot.core.transport.server.routing.stats.ServerRoutingStatsManagerTest.testQuerySubmitAndCompletionStats`
## Test Failure:
The test's `List<Pair<String, Integer>>` generated by `fetchNumInFlightRequestsForAllServers()`, `fetchEMALatencyForAllServers()`, and `fetchHybridScoreForAllServers()` shows non-determinism with the order of `Pair<String, Integer>` when applying the `NonDex` tool. Although the content of the Assertion is all correct, the assertion could assert on wrong index in the `List` due to the non-determinism in the `List`. One example could be the `List` contatins `{Pair("server1", 1), Pair("server2", 2)}`, but the assertion assert that the `List` is `{Pair("server2", 2), Pair("server1", 1)}`.
## Root Cause:
The root cause is in the `ConcurrentHashMap` used by [`ServerRoutingStatsManager.java`'s `_serverQueryStatsMap`](https://github.com/apache/pinot/blob/7217bb9d16b60074c1e9a9df72984556a7c8dbd5/pinot-core/src/main/java/org/apache/pinot/core/transport/server/routing/stats/ServerRoutingStatsManager.java#L50), which got iterated to create the `List` using the `entrySet()` function in [`fetchNumInFlightRequestsForAllServers`](https://github.com/apache/pinot/blob/7217bb9d16b60074c1e9a9df72984556a7c8dbd5/pinot-core/src/main/java/org/apache/pinot/core/transport/server/routing/stats/ServerRoutingStatsManager.java#L248), [`fetchEMALatencyForAllServers`](https://github.com/apache/pinot/blob/7217bb9d16b60074c1e9a9df72984556a7c8dbd5/pinot-core/src/main/java/org/apache/pinot/core/transport/server/routing/stats/ServerRoutingStatsManager.java#L293), and [`fetchHybridScoreForAllServers`](https://github.com/apache/pinot/blob/7217bb9d16b60074c1e9a9df72984556a7c8dbd5/pinot-core/src/main/java/org/apache
/pinot/core/transport/server/routing/stats/ServerRoutingStatsManager.java#L339). The `List<Pair<String, Interger>>` created is directly returned to the `testQuerySubmitAndCompletionStats`, which cause the order's non-determinism in the `List`.
## Fix:
Since the specific part suffering from the non-determinism here only have two elements in the `List`, the fix here is to first found the element's index (`0` or `1`) before asserting them. This eleminates the non-determinism here without modifing the source code in `main` folder.
--
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] fix by checking the index first [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #12029:
URL: https://github.com/apache/pinot/pull/12029
--
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] fix by checking the index first [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #12029:
URL: https://github.com/apache/pinot/pull/12029#issuecomment-1817998744
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/12029?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`7217bb9`)](https://app.codecov.io/gh/apache/pinot/commit/7217bb9d16b60074c1e9a9df72984556a7c8dbd5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 61.60% compared to head [(`160841e`)](https://app.codecov.io/gh/apache/pinot/pull/12029?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 46.78%.
> Report is 20 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #12029 +/- ##
=============================================
- Coverage 61.60% 46.78% -14.82%
+ Complexity 1151 944 -207
=============================================
Files 2385 1787 -598
Lines 129250 93799 -35451
Branches 20007 15175 -4832
=============================================
- Hits 79625 43886 -35739
- Misses 43828 46775 +2947
+ Partials 5797 3138 -2659
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/12029/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/12029/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/12029/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/12029/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/12029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-11](https://app.codecov.io/gh/apache/pinot/pull/12029/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/12029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `46.78% <ø> (-14.70%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/12029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `46.78% <ø> (-14.81%)` | :arrow_down: |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/12029/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/12029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `46.78% <ø> (-14.82%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/12029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `46.78% <ø> (-14.82%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/12029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `46.78% <ø> (-0.16%)` | :arrow_down: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/12029/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/12029?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