You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "tibrewalpratik17 (via GitHub)" <gi...@apache.org> on 2024/06/04 21:07:13 UTC
[PR] Update getValidDocIdsMetadataFromServer to make call in batches to servers [pinot]
tibrewalpratik17 opened a new pull request, #13314:
URL: https://github.com/apache/pinot/pull/13314
label:
`bugfix`
`upsert`
--
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] Update getValidDocIdsMetadataFromServer to make call in batches to servers [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #13314:
URL: https://github.com/apache/pinot/pull/13314#issuecomment-2148478178
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/13314?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 `8 lines` in your changes missing coverage. Please review.
> Project coverage is 27.76%. 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 [(`c7372cd`)](https://app.codecov.io/gh/apache/pinot/commit/c7372cd58965a4d95c2862b90f4235f9b6f4084d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 553 commits behind head on master.
| [Files](https://app.codecov.io/gh/apache/pinot/pull/13314?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...t/controller/util/ServerSegmentMetadataReader.java](https://app.codecov.io/gh/apache/pinot/pull/13314?src=pr&el=tree&filepath=pinot-controller%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcontroller%2Futil%2FServerSegmentMetadataReader.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci91dGlsL1NlcnZlclNlZ21lbnRNZXRhZGF0YVJlYWRlci5qYXZh) | 0.00% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/13314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #13314 +/- ##
=============================================
- Coverage 61.75% 27.76% -33.99%
+ Complexity 207 198 -9
=============================================
Files 2436 2538 +102
Lines 133233 139519 +6286
Branches 20636 21594 +958
=============================================
- Hits 82274 38743 -43531
- Misses 44911 97811 +52900
+ Partials 6048 2965 -3083
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/13314/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/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `<0.01% <0.00%> (-0.01%)` | :arrow_down: |
| [integration](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `<0.01% <0.00%> (-0.01%)` | :arrow_down: |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `<0.01% <0.00%> (-0.01%)` | :arrow_down: |
| [integration2](https://app.codecov.io/gh/apache/pinot/pull/13314/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/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `<0.01% <0.00%> (-61.71%)` | :arrow_down: |
| [java-21](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.76% <0.00%> (-33.86%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `<0.01% <0.00%> (-61.75%)` | :arrow_down: |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.76% <0.00%> (+0.04%)` | :arrow_up: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.76% <0.00%> (-33.99%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.76% <0.00%> (-33.99%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/13314/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/13314/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.76% <0.00%> (+0.03%)` | :arrow_up: |
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/13314?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
Re: [PR] Update getValidDocIdsMetadataFromServer to make call in batches to servers and other bug fixes [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince merged PR #13314:
URL: https://github.com/apache/pinot/pull/13314
--
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] Update getValidDocIdsMetadataFromServer to make call in batches to servers and other bug fixes [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on code in PR #13314:
URL: https://github.com/apache/pinot/pull/13314#discussion_r1628481078
##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerSegmentMetadataReader.java:
##########
@@ -235,8 +236,18 @@ public List<ValidDocIdsMetadataInfo> getValidDocIdsMetadataFromServer(String tab
}
}
}
- serverURLsAndBodies.add(generateValidDocIdsMetadataURL(tableNameWithType, segmentsToQuery, validDocIdsType,
- serverToEndpoints.get(serverToSegments.getKey())));
+
+ // Number of segments to query per server request. If a table has a lot of segments, then we might send a
+ // huge payload to pinot-server in request. Batching the requests will help in reducing the payload size.
Review Comment:
use Lists.partition() for short?
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java:
##########
@@ -972,7 +972,10 @@ public String getTableAggregateValidDocIdsMetadata(
@ApiParam(value = "A list of segments", allowMultiple = true) @QueryParam("segmentNames")
List<String> segmentNames,
@ApiParam(value = "Valid doc ids type") @QueryParam("validDocIdsType")
- @DefaultValue("SNAPSHOT") ValidDocIdsType validDocIdsType, @Context HttpHeaders headers) {
+ @DefaultValue("SNAPSHOT") ValidDocIdsType validDocIdsType,
+ @ApiParam(value = "Number of segments in a batch per server request")
+ @QueryParam("numSegmentsBatchPerServerRequest") @DefaultValue("500") int numSegmentsBatchPerServerRequest,
Review Comment:
nit: numSegmentsPerServerRequest or serverRequestBatchSize
##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/CompletionServiceHelper.java:
##########
@@ -129,13 +130,20 @@ private CompletionServiceResponse collectResponse(String tableNameWithType, int
int statusCode = multiHttpRequestResponse.getResponse().getStatusLine().getStatusCode();
if (statusCode >= 300) {
String reason = multiHttpRequestResponse.getResponse().getStatusLine().getReasonPhrase();
- LOGGER.error("Server: {} returned error: {}, reason: {}", instance, statusCode, reason);
+ LOGGER.error("Server: {} returned error: {}, reason: {} for uri: {}", instance, statusCode, reason, uri);
completionServiceResponse._failedResponseCount++;
continue;
}
String responseString = EntityUtils.toString(multiHttpRequestResponse.getResponse().getEntity());
- completionServiceResponse._httpResponses
- .put(multiRequestPerServer ? uri.toString() : instance, responseString);
+ String key = multiRequestPerServer ? uri.toString() : instance;
+ // there can be a scenario where all the requests to a particular server had the same uri but the
+ // payload might be different. In that scenario, we should append a random string to the key so that
+ // we send all the responses back to the caller otherwise in the map, the last response will overwrite
+ if (multiRequestPerServer && completionServiceResponse._httpResponses.containsKey(key)) {
+ LOGGER.warn("Appending random string to http response key name: {}", key);
+ key = key + "__" + RandomStringUtils.randomAlphanumeric(10);
Review Comment:
use a counter to avoid conflict, to make it easier to tell how many requests created for the same uri
##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -657,9 +657,7 @@ private List<Map<String, Object>> processValidDocIdsMetadata(String tableNameWit
}
try {
if (!missingSegments.isEmpty()) {
- throw new WebApplicationException(
- String.format("Table %s has missing segments: %s)", tableNameWithType, segments),
- Response.Status.NOT_FOUND);
+ LOGGER.warn("Table {} has missing segments {}", tableNameWithType, missingSegments);
Review Comment:
can add a comment on why no need to abort
##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/upsertcompaction/UpsertCompactionTaskGenerator.java:
##########
@@ -58,6 +58,7 @@ public class UpsertCompactionTaskGenerator extends BaseTaskGenerator {
private static final String DEFAULT_BUFFER_PERIOD = "7d";
private static final double DEFAULT_INVALID_RECORDS_THRESHOLD_PERCENT = 0.0;
private static final long DEFAULT_INVALID_RECORDS_THRESHOLD_COUNT = 0;
+ private static final int DEFAULT_SEGMENT_BATCH_SIZE_FOR_QUERYING_SERVER = 500;
Review Comment:
nit: simply `DEFAULT_`NUM_SEGMENTS_BATCH_PER_SERVER_REQUEST
--
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] Update getValidDocIdsMetadataFromServer to make call in batches to servers [pinot]
Posted by "tibrewalpratik17 (via GitHub)" <gi...@apache.org>.
tibrewalpratik17 commented on code in PR #13314:
URL: https://github.com/apache/pinot/pull/13314#discussion_r1626674964
##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerSegmentMetadataReader.java:
##########
@@ -61,6 +61,7 @@
*/
public class ServerSegmentMetadataReader {
private static final Logger LOGGER = LoggerFactory.getLogger(ServerSegmentMetadataReader.class);
+ private static final int DEFAULT_SEGMENT_BATCH_SIZE_FOR_QUERYING_SERVER = 500;
Review Comment:
Discussed offline with @klsince , we want to expose this as a configurable param in upsert-compaction-task and in the controller GET call API as well.
--
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] Update getValidDocIdsMetadataFromServer to make call in batches to servers and other bug fixes [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on code in PR #13314:
URL: https://github.com/apache/pinot/pull/13314#discussion_r1628544264
##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/CompletionServiceHelper.java:
##########
@@ -129,13 +129,21 @@ private CompletionServiceResponse collectResponse(String tableNameWithType, int
int statusCode = multiHttpRequestResponse.getResponse().getStatusLine().getStatusCode();
if (statusCode >= 300) {
String reason = multiHttpRequestResponse.getResponse().getStatusLine().getReasonPhrase();
- LOGGER.error("Server: {} returned error: {}, reason: {}", instance, statusCode, reason);
+ LOGGER.error("Server: {} returned error: {}, reason: {} for uri: {}", instance, statusCode, reason, uri);
completionServiceResponse._failedResponseCount++;
continue;
}
String responseString = EntityUtils.toString(multiHttpRequestResponse.getResponse().getEntity());
- completionServiceResponse._httpResponses
- .put(multiRequestPerServer ? uri.toString() : instance, responseString);
+ String key = multiRequestPerServer ? uri.toString() : instance;
+ // If there are multiple requests to the same server with the same URI but different payloads,
+ // we append a count value to the key to ensure each response is uniquely identified.
+ // Otherwise, the map will store only the last response, overwriting previous ones.
+ if (multiRequestPerServer) {
+ int count = completionServiceResponse._instanceToRequestCount.getOrDefault(key, 0) + 1;
+ completionServiceResponse._instanceToRequestCount.put(key, count);
Review Comment:
can do `compute(key, (k, v) -> (v == null) ? 1 : v + 1);` but not a blocking comment
--
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