You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "noob-se7en (via GitHub)" <gi...@apache.org> on 2025/06/10 20:44:41 UTC
[PR] Adds API to return badSegments per partitionGroup [pinot]
noob-se7en opened a new pull request, #16067:
URL: https://github.com/apache/pinot/pull/16067
**Problem Statement:**
1. In Pauseless + Dedup, For fixing bad segment using `/deleteSegmentsFromSequenceNum/{tableNameWithType}` API, manual work is required to fetch segment with lowest sequence number per partition group.
2. Currently some users use a script to get bad segments for fixing the table (non pause-less tables as well).
**PR:**
This PR adds an API to Get a sorted list of bad segments per partition group (sort order is in increasing order of segment sequence number) for the input table.
**Sample Request:**
<img width="1470" alt="Screenshot 2025-06-11 at 2 04 55 AM" src="https://github.com/user-attachments/assets/79c796cc-dcdb-49e1-ab28-a9b719a7562d" />
**Sample Response:**
<img width="1460" alt="Screenshot 2025-06-11 at 2 05 28 AM" src="https://github.com/user-attachments/assets/bfc2db9f-2f8e-4a68-abca-bb17a8a3825c" />
--
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] Adds API to return badSegments per partitionGroup [pinot]
Posted by "noob-se7en (via GitHub)" <gi...@apache.org>.
noob-se7en commented on code in PR #16067:
URL: https://github.com/apache/pinot/pull/16067#discussion_r2150801484
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/LLCSegmentName.java:
##########
@@ -152,4 +153,9 @@ public int hashCode() {
public String toString() {
return _segmentName;
}
+
+ @JsonValue
Review Comment:
Yes, thanks. This also works.
--
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] Adds API to return badSegments per partitionId [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #16067:
URL: https://github.com/apache/pinot/pull/16067
--
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] Adds API to return badSegments per partitionGroup [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16067:
URL: https://github.com/apache/pinot/pull/16067#issuecomment-2960631863
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/16067?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 `1 line` in your changes missing coverage. Please review.
> Project coverage is 56.38%. Comparing base [(`1a476de`)](https://app.codecov.io/gh/apache/pinot/commit/1a476dea72ebf1c15e14ded28ae60c385f71b2c3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`6a6d2c9`)](https://app.codecov.io/gh/apache/pinot/commit/6a6d2c957813a07bb6bc7205acb9ab92393251b1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 229 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/16067?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [.../org/apache/pinot/common/utils/LLCSegmentName.java](https://app.codecov.io/gh/apache/pinot/pull/16067?src=pr&el=tree&filepath=pinot-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcommon%2Futils%2FLLCSegmentName.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvTExDU2VnbWVudE5hbWUuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/16067?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 (1a476de) and HEAD (6a6d2c9). Click for more details.
>
> <details><summary>HEAD has 68 uploads less than BASE</summary>
>
>| Flag | BASE (1a476de) | HEAD (6a6d2c9) |
>|------|------|------|
>|java-21|10|1|
>|unittests|6|1|
>|unittests1|3|1|
>|skip-bytebuffers-true|4|0|
>|temurin|15|1|
>|unittests2|3|0|
>|skip-bytebuffers-false|8|0|
>|java-11|5|0|
>|integration|9|0|
>|integration2|3|0|
>|integration1|3|0|
>|custom-integration1|3|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #16067 +/- ##
============================================
- Coverage 62.90% 56.38% -6.52%
+ Complexity 1386 690 -696
============================================
Files 2867 2276 -591
Lines 163354 124520 -38834
Branches 24952 19837 -5115
============================================
- Hits 102755 70212 -32543
+ Misses 52847 48516 -4331
+ Partials 7752 5792 -1960
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/16067/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/16067/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/16067/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/16067/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/16067/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/16067/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/16067/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.38% <0.00%> (-6.44%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/16067/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/16067/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/16067/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.38% <0.00%> (-6.52%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/16067/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.38% <0.00%> (-6.52%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/16067/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.38% <0.00%> (+0.56%)` | :arrow_up: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/16067/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/16067?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).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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] Adds API to return badSegments per partitionGroup [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #16067:
URL: https://github.com/apache/pinot/pull/16067#discussion_r2150662514
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/LLCSegmentName.java:
##########
@@ -152,4 +153,9 @@ public int hashCode() {
public String toString() {
return _segmentName;
}
+
+ @JsonValue
Review Comment:
(minor) Maybe just annotate `getSegmentName()`?
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/TableViews.java:
##########
@@ -171,52 +177,109 @@ public String getSegmentsStatusDetails(
return JsonUtils.objectToPrettyString(segmentStatusInfoListMap);
}
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/tables/{tableName}/badSegments")
+ @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.GET_SEGMENT_STATUS)
+ @ApiOperation(value = "Get bad segment names per partition group for a realtime table.", notes = "Get a sorted list"
+ + " of bad segments per partition group (sort order is in increasing order of segment sequence number)")
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Returns a map of partition group IDs to the list of segment names in sorted"
+ + " order of sequence number"),
+ @ApiResponse(code = 500, message = "Internal Server Error")
+ })
+ public String getBadSegments(
+ @ApiParam(value = "Name of the table.", required = true) @PathParam("tableName") String tableName,
+ @Context HttpHeaders headers) {
+ try {
+ tableName = DatabaseUtils.translateTableName(tableName, headers);
+ } catch (Exception e) {
+ throw new ControllerApplicationException(LOGGER, e.getMessage(), Response.Status.BAD_REQUEST);
+ }
+ String tableNameWithType =
+ ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, TableType.REALTIME, LOGGER)
+ .get(0);
+ try {
+ TableViews.TableView idealStateView = getTableState(tableNameWithType, TableViews.IDEALSTATE, null);
+ TableViews.TableView externalView = getTableState(tableNameWithType, TableViews.EXTERNALVIEW, null);
+
+ Map<String, Map<String, String>> idealStateMap = getStateMap(idealStateView);
+ Map<String, Map<String, String>> externalViewStateMap = getStateMap(externalView);
+
+ List<SegmentStatusInfo> segmentStatusInfoList = getSegmentStatuses(externalViewStateMap, idealStateMap,
+ CommonConstants.Helix.StateModel.DisplaySegmentStatus.BAD);
+
+ if (segmentStatusInfoList.isEmpty()) {
+ return JsonUtils.objectToPrettyString(new HashMap<>());
+ }
+
+ Map<Integer, SortedSet<LLCSegmentName>> partitionGroupIdToSegments = new HashMap<>();
+ for (SegmentStatusInfo segmentStatusInfo : segmentStatusInfoList) {
+ String segmentName = segmentStatusInfo.getSegmentName();
+ LLCSegmentName llcSegmentName = LLCSegmentName.of(segmentName);
+ Preconditions.checkNotNull(llcSegmentName, "Unable to convert segmentName to LLCSegment.");
Review Comment:
We shouldn't throw exception here. If the intention is to only collect bad LLC segment, we should skip other segments
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/TableViews.java:
##########
@@ -171,52 +177,109 @@ public String getSegmentsStatusDetails(
return JsonUtils.objectToPrettyString(segmentStatusInfoListMap);
}
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/tables/{tableName}/badSegments")
Review Comment:
Let's make the path more specific. Seems you are only collecting bad LLC segments, grouped on partition basis
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/TableViews.java:
##########
@@ -171,52 +177,109 @@ public String getSegmentsStatusDetails(
return JsonUtils.objectToPrettyString(segmentStatusInfoListMap);
}
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/tables/{tableName}/badSegments")
+ @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.GET_SEGMENT_STATUS)
+ @ApiOperation(value = "Get bad segment names per partition group for a realtime table.", notes = "Get a sorted list"
Review Comment:
Let's call it `partition` instead of `partition group`, same for other places
--
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