You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "cypherean (via GitHub)" <gi...@apache.org> on 2025/12/22 09:46:21 UTC
[PR] [pinot-minion] Support MinionContext AuthProvider in Minion executors [pinot]
cypherean opened a new pull request, #17405:
URL: https://github.com/apache/pinot/pull/17405
Minion’s executors previously rebuilt auth from a static task token, forcing the Authorization header and preventing per-request token rotation. This broke short‑lived tokens and custom headers.
- The change makes executors use the runtime AuthProvider from MinionContext for every outbound HTTP call, preserving custom header names/values and enabling token rotation.
- We keep a strict fallback to the legacy task-token path when no runtime provider is configured, preserving backward compatibility.
- Tests verify runtime-provider preference and legacy fallback; manual validation confirms getRequestHeaders() is called for requests and headers are attached as expected on every 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] Support MinionContext AuthProvider in Minion executors [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #17405:
URL: https://github.com/apache/pinot/pull/17405
--
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] Support MinionContext AuthProvider in Minion executors [pinot]
Posted by "cypherean (via GitHub)" <gi...@apache.org>.
cypherean commented on PR #17405:
URL: https://github.com/apache/pinot/pull/17405#issuecomment-3771852281
> I'd do it in a different way, where each task can override the auth token if necessary.
>
> Currently auth token is set when starting a task (in `TaskFactoryRegistry.runInternal()`). Instead, we shouldn't set it, but check if that is explicitly provided. When explicitly provided, use it as the auth provider; if not, fall back to the minion global one.
Good catch, thanks. Fixed it to check for explicit token first.
--
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] Support MinionContext AuthProvider in Minion executors [pinot]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #17405:
URL: https://github.com/apache/pinot/pull/17405#discussion_r2647084391
##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/BaseMultipleSegmentsConversionExecutor.java:
##########
@@ -613,7 +622,13 @@ public SegmentUploadContext(PinotTaskConfig pinotTaskConfig,
Map<String, String> configs = pinotTaskConfig.getConfigs();
_tableNameWithType = configs.get(MinionConstants.TABLE_NAME_KEY);
_uploadURL = configs.get(MinionConstants.UPLOAD_URL_KEY);
- _authProvider = AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
+ // Prefer the runtime minion AuthProvider; fallback to token if needed.
+ AuthProvider runtimeProvider = MINION_CONTEXT.getTaskAuthProvider();
+ if (runtimeProvider != null && !(runtimeProvider instanceof NullAuthProvider)) {
+ _authProvider = runtimeProvider;
+ } else {
+ _authProvider = AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
Review Comment:
The condition structure in `SegmentUploadContext` differs from the other three locations (`authProvider == null || authProvider instanceof NullAuthProvider` vs `runtimeProvider != null && !(runtimeProvider instanceof NullAuthProvider)`). While logically equivalent, this inconsistency makes the code harder to maintain. Use the same condition pattern across all four locations for consistency.
```suggestion
if (runtimeProvider == null || runtimeProvider instanceof NullAuthProvider) {
_authProvider = AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
} else {
_authProvider = runtimeProvider;
```
##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/BaseSingleSegmentConversionExecutor.java:
##########
@@ -81,7 +82,11 @@ public SegmentConversionResult executeTask(PinotTaskConfig pinotTaskConfig)
String downloadURL = configs.get(MinionConstants.DOWNLOAD_URL_KEY);
String uploadURL = configs.get(MinionConstants.UPLOAD_URL_KEY);
String originalSegmentCrc = configs.get(MinionConstants.ORIGINAL_SEGMENT_CRC_KEY);
- AuthProvider authProvider = AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
+ // Prefer the runtime minion AuthProvider; fallback to token if needed.
+ AuthProvider authProvider = MINION_CONTEXT.getTaskAuthProvider();
+ if (authProvider == null || authProvider instanceof NullAuthProvider) {
+ authProvider = AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
+ }
Review Comment:
This auth provider resolution logic is duplicated in three places (`BaseSingleSegmentConversionExecutor.executeTask`, `BaseMultipleSegmentsConversionExecutor.preProcess`, and `BaseMultipleSegmentsConversionExecutor.executeTask`). Consider extracting this pattern into a shared helper method like `resolveAuthProvider(Map<String, String> configs)` to reduce duplication and ensure consistent behavior across all call sites.
--
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] Support MinionContext AuthProvider in Minion executors [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #17405:
URL: https://github.com/apache/pinot/pull/17405#issuecomment-3681533228
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/17405?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.63%. Comparing base ([`33d0ec1`](https://app.codecov.io/gh/apache/pinot/commit/33d0ec1dd610e4701b0829f8803fd610fdf3dab4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`79edde2`](https://app.codecov.io/gh/apache/pinot/commit/79edde2d8ab921d7e9a86c1d0409b0ba368a0067?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 7 commits behind head on master.
> :exclamation: There is a different number of reports uploaded between BASE (33d0ec1) and HEAD (79edde2). Click for more details.
>
> <details><summary>HEAD has 36 uploads less than BASE</summary>
>
>| Flag | BASE (33d0ec1) | HEAD (79edde2) |
>|------|------|------|
>|java-21|5|1|
>|unittests1|2|1|
>|unittests|4|1|
>|temurin|10|1|
>|java-11|5|0|
>|unittests2|2|0|
>|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 #17405 +/- ##
============================================
- Coverage 63.23% 55.63% -7.60%
+ Complexity 1475 702 -773
============================================
Files 3151 2464 -687
Lines 187852 139099 -48753
Branches 28761 22184 -6577
============================================
- Hits 118784 77386 -41398
+ Misses 59857 55184 -4673
+ Partials 9211 6529 -2682
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/17405/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/17405/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/17405/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/17405/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/17405/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/17405/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/17405/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.63% <ø> (-7.57%)` | :arrow_down: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/17405/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.63% <ø> (-7.60%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/17405/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.63% <ø> (-7.60%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/17405/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.63% <ø> (-0.03%)` | :arrow_down: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/17405/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/17405?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] Support MinionContext AuthProvider in Minion executors [pinot]
Posted by "tarun11Mavani (via GitHub)" <gi...@apache.org>.
tarun11Mavani commented on code in PR #17405:
URL: https://github.com/apache/pinot/pull/17405#discussion_r2645558574
##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/BaseMultipleSegmentsConversionExecutor.java:
##########
@@ -613,7 +622,13 @@ public SegmentUploadContext(PinotTaskConfig pinotTaskConfig,
Map<String, String> configs = pinotTaskConfig.getConfigs();
_tableNameWithType = configs.get(MinionConstants.TABLE_NAME_KEY);
_uploadURL = configs.get(MinionConstants.UPLOAD_URL_KEY);
- _authProvider = AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
+ // Prefer the runtime minion AuthProvider; fallback to token if needed.
+ AuthProvider runtimeProvider = MINION_CONTEXT.getTaskAuthProvider();
Review Comment:
Can move this method out BaseTaskExecutor or MinionUtil to avoid duplication.
--
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] Support MinionContext AuthProvider in Minion executors [pinot]
Posted by "cypherean (via GitHub)" <gi...@apache.org>.
cypherean commented on PR #17405:
URL: https://github.com/apache/pinot/pull/17405#issuecomment-3722370457
@tarun11Mavani @swaminathanmanish @xiangfu0 can you ptal?
--
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