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/11/12 09:23:27 UTC
[PR] Adds ability to pause consumption in batches [pinot]
noob-se7en opened a new pull request, #17194:
URL: https://github.com/apache/pinot/pull/17194
Instructions:
1. The PR has to be tagged with at least one of the following labels (*):
1. `feature`
2. `bugfix`
3. `performance`
4. `ui`
5. `backward-incompat`
6. `release-notes` (**)
2. Remove these instructions before publishing the PR.
(*) Other labels to consider:
- `testing`
- `dependencies`
- `docker`
- `kubernetes`
- `observability`
- `security`
- `code-style`
- `extension-point`
- `refactor`
- `cleanup`
(**) Use `release-notes` label for scenarios like:
- New configuration options
- Deprecation of configurations
- Signature changes to public methods/interfaces
- New plugins added or old plugins removed
--
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 ability to pause consumption in batches [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #17194:
URL: https://github.com/apache/pinot/pull/17194#issuecomment-3521055774
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/17194?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 55.94%. Comparing base ([`4c8ac19`](https://app.codecov.io/gh/apache/pinot/commit/4c8ac191d293eae00c4d87d82df5cdedf810a539?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`bb3454f`](https://app.codecov.io/gh/apache/pinot/commit/bb3454f41c20a9aa9f4e818f259618e33507f20d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 21 commits behind head on master.
> :exclamation: There is a different number of reports uploaded between BASE (4c8ac19) and HEAD (bb3454f). Click for more details.
>
> <details><summary>HEAD has 36 uploads less than BASE</summary>
>
>| Flag | BASE (4c8ac19) | HEAD (bb3454f) |
>|------|------|------|
>|unittests1|2|1|
>|unittests|4|1|
>|java-11|5|0|
>|temurin|10|1|
>|unittests2|2|0|
>|java-21|5|1|
>|integration|6|0|
>|integration2|2|0|
>|integration1|2|0|
>|custom-integration1|2|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #17194 +/- ##
============================================
- Coverage 63.19% 55.94% -7.25%
+ Complexity 1428 701 -727
============================================
Files 3114 2434 -680
Lines 184031 136485 -47546
Branches 28202 21809 -6393
============================================
- Hits 116300 76361 -39939
+ Misses 58745 53723 -5022
+ Partials 8986 6401 -2585
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/17194/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/17194/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/17194/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/17194/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/17194/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/17194/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/17194/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.94% <ø> (-7.20%)` | :arrow_down: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/17194/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.94% <ø> (-7.25%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/17194/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.94% <ø> (-7.25%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/17194/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.94% <ø> (-0.16%)` | :arrow_down: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/17194/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/17194?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 ability to pause consumption in batches [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2566650634
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2264,17 +2264,17 @@ private boolean isTmpAndCanDelete(String filePath, Set<String> downloadUrls, Pin
* @return the set of consuming segments for which commit was initiated
*/
public Set<String> forceCommit(String tableNameWithType, @Nullable String partitionGroupIdsToCommit,
- @Nullable String segmentsToCommit, ForceCommitBatchConfig batchConfig) {
+ @Nullable String segmentsToCommit, @Nullable ForceCommitBatchConfig batchConfig) {
Review Comment:
Could `batchConfig` be `null`?
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName);
validateTable(tableNameWithType);
+ ForceCommitBatchConfig batchConfig;
+ try {
+ batchConfig = ForceCommitBatchConfig.of(batchSize, batchStatusCheckIntervalSec, batchStatusCheckTimeoutSec);
Review Comment:
Consider renaming the class. It is not for force commit here
--
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 ability to pause consumption in batches [pinot]
Posted by "swaminathanmanish (via GitHub)" <gi...@apache.org>.
swaminathanmanish merged PR #17194:
URL: https://github.com/apache/pinot/pull/17194
--
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 ability to pause consumption in batches [pinot]
Posted by "noob-se7en (via GitHub)" <gi...@apache.org>.
noob-se7en commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2540949665
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName);
validateTable(tableNameWithType);
+ ForceCommitBatchConfig batchConfig;
+ try {
+ batchConfig = ForceCommitBatchConfig.of(batchSize, batchStatusCheckIntervalSec, batchStatusCheckTimeoutSec);
+ } catch (Exception e) {
+ throw new ControllerApplicationException(LOGGER, "Invalid batch config", Response.Status.BAD_REQUEST, e);
Review Comment:
exception is passed here right?
--
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 ability to pause consumption in batches [pinot]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2553369107
##########
pinot-controller/src/test/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResourceTest.java:
##########
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.controller.api.resources;
+
+import java.lang.reflect.Field;
Review Comment:
Using reflection to set private fields in tests is fragile and indicates tight coupling. Consider using constructor injection or a test-specific factory method to provide dependencies, which would make the code more maintainable and testable.
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
Review Comment:
The string concatenation with an empty string (`+ \"\"`) to convert the constant to a string is unclear. Consider using `String.valueOf()` or define the default as a string constant for better readability.
```suggestion
@QueryParam("batchSize") @DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE)) int batchSize,
@ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ " not")
@QueryParam("batchStatusCheckIntervalSec")
@DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC)) int batchStatusCheckIntervalSec,
@ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ " of segments and throw an exception")
@QueryParam("batchStatusCheckTimeoutSec")
@DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC)) int batchStatusCheckTimeoutSec,
```
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
Review Comment:
The string concatenation with an empty string (`+ \"\"`) to convert the constant to a string is unclear. Consider using `String.valueOf()` or define the default as a string constant for better readability.
```suggestion
@QueryParam("batchSize") @DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE)) int batchSize,
@ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ " not")
@QueryParam("batchStatusCheckIntervalSec")
@DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC)) int batchStatusCheckIntervalSec,
@ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ " of segments and throw an exception")
@QueryParam("batchStatusCheckTimeoutSec")
@DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC)) int batchStatusCheckTimeoutSec,
```
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2429,9 +2429,19 @@ private Set<String> filterSegmentsToCommit(Set<String> allConsumingSegments,
*/
public PauseStatusDetails pauseConsumption(String tableNameWithType, PauseState.ReasonCode reasonCode,
@Nullable String comment) {
+ return pauseConsumption(tableNameWithType, reasonCode, comment, null);
+ }
+
+ /**
+ * Pause consumption on a table by
+ * 1) update PauseState in the table ideal state and
+ * 2) sending force commit messages to servers
+ */
Review Comment:
Corrected capitalization of 'update' to 'Update' to maintain consistency with standard Javadoc conventions.
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
Review Comment:
The string concatenation with an empty string (`+ \"\"`) to convert the constant to a string is unclear. Consider using `String.valueOf()` or define the default as a string constant for better readability.
```suggestion
@QueryParam("batchSize") @DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE)) int batchSize,
@ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ " not")
@QueryParam("batchStatusCheckIntervalSec")
@DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC)) int batchStatusCheckIntervalSec,
@ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ " of segments and throw an exception")
@QueryParam("batchStatusCheckTimeoutSec")
@DefaultValue(String.valueOf(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC)) int batchStatusCheckTimeoutSec,
```
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName);
validateTable(tableNameWithType);
+ ForceCommitBatchConfig batchConfig;
+ try {
+ batchConfig = ForceCommitBatchConfig.of(batchSize, batchStatusCheckIntervalSec, batchStatusCheckTimeoutSec);
+ } catch (Exception e) {
Review Comment:
Catching generic `Exception` is too broad. Catch the specific exception type thrown by `ForceCommitBatchConfig.of()` to avoid accidentally catching unexpected errors.
```suggestion
} catch (IllegalArgumentException e) {
```
--
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 ability to pause consumption in batches [pinot]
Posted by "KKcorps (via GitHub)" <gi...@apache.org>.
KKcorps commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2540628395
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName);
validateTable(tableNameWithType);
+ ForceCommitBatchConfig batchConfig;
+ try {
+ batchConfig = ForceCommitBatchConfig.of(batchSize, batchStatusCheckIntervalSec, batchStatusCheckTimeoutSec);
+ } catch (Exception e) {
+ throw new ControllerApplicationException(LOGGER, "Invalid batch config", Response.Status.BAD_REQUEST, e);
Review Comment:
please make this error message more descriptive
--
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 ability to pause consumption in batches [pinot]
Posted by "noob-se7en (via GitHub)" <gi...@apache.org>.
noob-se7en commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2540956723
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2264,17 +2264,17 @@ private boolean isTmpAndCanDelete(String filePath, Set<String> downloadUrls, Pin
* @return the set of consuming segments for which commit was initiated
*/
public Set<String> forceCommit(String tableNameWithType, @Nullable String partitionGroupIdsToCommit,
- @Nullable String segmentsToCommit, ForceCommitBatchConfig batchConfig) {
+ @Nullable String segmentsToCommit, @Nullable ForceCommitBatchConfig batchConfig) {
IdealState idealState = getIdealState(tableNameWithType);
Set<String> allConsumingSegments = findConsumingSegments(idealState);
Set<String> targetConsumingSegments =
filterSegmentsToCommit(allConsumingSegments, partitionGroupIdsToCommit, segmentsToCommit);
- int batchSize = batchConfig.getBatchSize();
- if (batchSize >= targetConsumingSegments.size()) {
+ if ((batchConfig == null) || (batchConfig.getBatchSize() >= targetConsumingSegments.size())) {
// No need to divide segments in batches.
sendForceCommitMessageToServers(tableNameWithType, targetConsumingSegments);
} else {
- List<Set<String>> segmentBatchList = getSegmentBatchList(idealState, targetConsumingSegments, batchSize);
+ List<Set<String>> segmentBatchList =
+ getSegmentBatchList(idealState, targetConsumingSegments, batchConfig.getBatchSize());
ExecutorService executor = Executors.newSingleThreadExecutor();
Review Comment:
This was what I kept before but there was valid reason to make it single threaded, pls refer this comment:
https://github.com/apache/pinot/pull/14811#discussion_r1931299015
--
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 ability to pause consumption in batches [pinot]
Posted by "KKcorps (via GitHub)" <gi...@apache.org>.
KKcorps commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2540631176
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2264,17 +2264,17 @@ private boolean isTmpAndCanDelete(String filePath, Set<String> downloadUrls, Pin
* @return the set of consuming segments for which commit was initiated
*/
public Set<String> forceCommit(String tableNameWithType, @Nullable String partitionGroupIdsToCommit,
- @Nullable String segmentsToCommit, ForceCommitBatchConfig batchConfig) {
+ @Nullable String segmentsToCommit, @Nullable ForceCommitBatchConfig batchConfig) {
IdealState idealState = getIdealState(tableNameWithType);
Set<String> allConsumingSegments = findConsumingSegments(idealState);
Set<String> targetConsumingSegments =
filterSegmentsToCommit(allConsumingSegments, partitionGroupIdsToCommit, segmentsToCommit);
- int batchSize = batchConfig.getBatchSize();
- if (batchSize >= targetConsumingSegments.size()) {
+ if ((batchConfig == null) || (batchConfig.getBatchSize() >= targetConsumingSegments.size())) {
// No need to divide segments in batches.
sendForceCommitMessageToServers(tableNameWithType, targetConsumingSegments);
} else {
- List<Set<String>> segmentBatchList = getSegmentBatchList(idealState, targetConsumingSegments, batchSize);
+ List<Set<String>> segmentBatchList =
+ getSegmentBatchList(idealState, targetConsumingSegments, batchConfig.getBatchSize());
ExecutorService executor = Executors.newSingleThreadExecutor();
Review Comment:
You should use a cached executor service here. Don't create a new executor on every method call
--
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 ability to pause consumption in batches [pinot]
Posted by "noob-se7en (via GitHub)" <gi...@apache.org>.
noob-se7en commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2586215727
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName);
validateTable(tableNameWithType);
+ ForceCommitBatchConfig batchConfig;
+ try {
+ batchConfig = ForceCommitBatchConfig.of(batchSize, batchStatusCheckIntervalSec, batchStatusCheckTimeoutSec);
Review Comment:
I think it's fine? considering that Pause consumption just changes the pause state in IS and then uses the batch config to force commit.
`forceCommit(tableNameWithType, null, null, batchConfig);`
Or I can just rename it to `BatchConfig`
--
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 ability to pause consumption in batches [pinot]
Posted by "noob-se7en (via GitHub)" <gi...@apache.org>.
noob-se7en commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2586207107
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2264,17 +2264,17 @@ private boolean isTmpAndCanDelete(String filePath, Set<String> downloadUrls, Pin
* @return the set of consuming segments for which commit was initiated
*/
public Set<String> forceCommit(String tableNameWithType, @Nullable String partitionGroupIdsToCommit,
- @Nullable String segmentsToCommit, ForceCommitBatchConfig batchConfig) {
+ @Nullable String segmentsToCommit, @Nullable ForceCommitBatchConfig batchConfig) {
Review Comment:
Yes. Existing code like where RVM job pauses consumption doesn't pass any batch config.
example:
https://github.com/apache/pinot/blob/8bfb907db9eeb29ea3f494f435aa2fa781378db1/pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeSegmentValidationManager.java#L168-L169
--
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 ability to pause consumption in batches [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2608726081
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -114,13 +114,29 @@ public class PinotRealtimeTableResource {
public Response pauseConsumption(
@ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName,
@ApiParam(value = "Comment on pausing the consumption") @QueryParam("comment") String comment,
+ @ApiParam(value = "Max number of consuming segments to commit at once")
+ @QueryParam("batchSize") @DefaultValue(ForceCommitBatchConfig.DEFAULT_BATCH_SIZE + "") int batchSize,
+ @ApiParam(value = "How often to check whether the current batch of segments have been successfully committed or"
+ + " not")
+ @QueryParam("batchStatusCheckIntervalSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_INTERVAL_SEC + "") int batchStatusCheckIntervalSec,
+ @ApiParam(value = "Timeout based on which the controller will stop checking the forceCommit status of the batch"
+ + " of segments and throw an exception")
+ @QueryParam("batchStatusCheckTimeoutSec")
+ @DefaultValue(ForceCommitBatchConfig.DEFAULT_STATUS_CHECK_TIMEOUT_SEC + "") int batchStatusCheckTimeoutSec,
@Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName);
validateTable(tableNameWithType);
+ ForceCommitBatchConfig batchConfig;
+ try {
+ batchConfig = ForceCommitBatchConfig.of(batchSize, batchStatusCheckIntervalSec, batchStatusCheckTimeoutSec);
Review Comment:
Sounds good. `BatchConfig` is a better name
--
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