You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "deeppatel710 (via GitHub)" <gi...@apache.org> on 2026/04/08 06:41:59 UTC
[PR] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
deeppatel710 opened a new pull request, #18127:
URL: https://github.com/apache/pinot/pull/18127
## Summary
Addresses review feedback from #15782 (Jackie-Jiang):
- Converted `RealtimeOffsetAutoResetHandler` from abstract class to interface with an `init(PinotLLCRealtimeSegmentManager, PinotHelixResourceManager)` method
for post-construction initialization
- Removed constructor injection from `RealtimeOffsetAutoResetKafkaHandler`; initialization now happens via `init()` called by the manager after reflective
instantiation
- Fixed `ensureBackfillJobsRunning` signature: `List<String>` → `Collection<String>` to match the interface contract
- Updated `RealtimeOffsetAutoResetManager.getOrConstructHandler()` to use no-arg constructor + `init()` instead of constructor injection via reflection
- Fixed bug in `nonLeaderCleanup()`: was not clearing `_tableEphemeralTopics`, leaving stale state when the controller re-acquires leadership
## Changes
| File | Change |
|---|---|
| `RealtimeOffsetAutoResetHandler.java` | Abstract class → interface; added `init()` |
| `RealtimeOffsetAutoResetKafkaHandler.java` | Implements interface; removed constructor; fixed `Collection<String>` signature |
| `RealtimeOffsetAutoResetManager.java` | Uses no-arg constructor + `init()`; fixed `nonLeaderCleanup()` |
## Labels
`refactor`, `release-notes`
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3077339650
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeOffsetAutoResetManager.java:
##########
@@ -214,13 +215,11 @@ private RealtimeOffsetAutoResetHandler getOrConstructHandler(TableConfig tableCo
try {
Class<?> clazz = Class.forName(className);
if (!RealtimeOffsetAutoResetHandler.class.isAssignableFrom(clazz)) {
- String exceptionMessage = "Custom analyzer must be a child of "
- + RealtimeOffsetAutoResetHandler.class.getCanonicalName();
- throw new ReflectiveOperationException(exceptionMessage);
+ throw new ReflectiveOperationException("Custom handler must implement "
+ + RealtimeOffsetAutoResetHandler.class.getCanonicalName());
}
- handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor(
- PinotLLCRealtimeSegmentManager.class, PinotHelixResourceManager.class).newInstance(
- _llcRealtimeSegmentManager, _pinotHelixResourceManager);
+ handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor().newInstance();
Review Comment:
@xiangfu0 how about now? can you review this again please? thank you
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3106411493
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeOffsetAutoResetManager.java:
##########
@@ -214,13 +215,11 @@ private RealtimeOffsetAutoResetHandler getOrConstructHandler(TableConfig tableCo
try {
Class<?> clazz = Class.forName(className);
if (!RealtimeOffsetAutoResetHandler.class.isAssignableFrom(clazz)) {
- String exceptionMessage = "Custom analyzer must be a child of "
- + RealtimeOffsetAutoResetHandler.class.getCanonicalName();
- throw new ReflectiveOperationException(exceptionMessage);
+ throw new ReflectiveOperationException("Custom handler must implement "
+ + RealtimeOffsetAutoResetHandler.class.getCanonicalName());
}
- handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor(
- PinotLLCRealtimeSegmentManager.class, PinotHelixResourceManager.class).newInstance(
- _llcRealtimeSegmentManager, _pinotHelixResourceManager);
+ handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor().newInstance();
Review Comment:
@xiangfu0 following up on this , can you please review and stamp this PR? thank you!
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on PR #18127:
URL: https://github.com/apache/pinot/pull/18127#issuecomment-4204339962
@Jackie-Jiang this addresses your review feedback from #[15782](https://github.com/apache/pinot/pull/15782). Would appreciate a review!
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on PR #18127:
URL: https://github.com/apache/pinot/pull/18127#issuecomment-4211551773
@Jackie-Jiang Thanks for the approval! I've addressed your feedback in the latest commit (removed the redundant abstract override and fixed the test to use a no-arg constructor). CI workflow needs a maintainer to approve it — could you approve the workflow run and merge when ready? Thanks!
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #18127:
URL: https://github.com/apache/pinot/pull/18127
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3054128039
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/periodictask/RealtimeOffsetAutoResetKafkaHandler.java:
##########
@@ -104,7 +99,7 @@ protected abstract Map<String, String> triggerDataReplicationAndGetTopicInfo(
String tableNameWithType, StreamConfig streamConfig, String topicName, int partitionId, long fromOffset,
long toOffset);
- public abstract void ensureBackfillJobsRunning(String tableNameWithType, List<String> topicNames);
+ public abstract void ensureBackfillJobsRunning(String tableNameWithType, Collection<String> topicNames);
Review Comment:
Should we remove this override given it is the same as the interface?
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #18127:
URL: https://github.com/apache/pinot/pull/18127#issuecomment-4209894788
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/18127?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.86%. Comparing base ([`e7ea035`](https://app.codecov.io/gh/apache/pinot/commit/e7ea035cc76874c9988fa7d377e46aeac5bb8d4c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1c55cb4`](https://app.codecov.io/gh/apache/pinot/commit/1c55cb417fe27d7f7d0b3fd2cb79a2be9ce0124c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
> :exclamation: There is a different number of reports uploaded between BASE (e7ea035) and HEAD (1c55cb4). Click for more details.
>
> <details><summary>HEAD has 32 uploads less than BASE</summary>
>
>| Flag | BASE (e7ea035) | HEAD (1c55cb4) |
>|------|------|------|
>|java-21|4|1|
>|unittests1|2|1|
>|unittests|4|1|
>|temurin|9|1|
>|java-11|5|0|
>|unittests2|2|0|
>|integration|5|0|
>|integration1|2|0|
>|integration2|1|0|
>|custom-integration1|2|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #18127 +/- ##
============================================
- Coverage 63.96% 55.86% -8.10%
+ Complexity 1617 822 -795
============================================
Files 3179 2481 -698
Lines 193741 142655 -51086
Branches 29926 22975 -6951
============================================
- Hits 123918 79701 -44217
+ Misses 60031 56130 -3901
+ Partials 9792 6824 -2968
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/18127/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/18127/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/18127/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/18127/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/18127/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/18127/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/18127/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.86% <ø> (-8.07%)` | :arrow_down: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/18127/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.86% <ø> (-8.10%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/18127/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.86% <ø> (-8.09%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/18127/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.86% <ø> (+0.01%)` | :arrow_up: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/18127/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/18127?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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3069186481
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeOffsetAutoResetManager.java:
##########
@@ -214,13 +215,11 @@ private RealtimeOffsetAutoResetHandler getOrConstructHandler(TableConfig tableCo
try {
Class<?> clazz = Class.forName(className);
if (!RealtimeOffsetAutoResetHandler.class.isAssignableFrom(clazz)) {
- String exceptionMessage = "Custom analyzer must be a child of "
- + RealtimeOffsetAutoResetHandler.class.getCanonicalName();
- throw new ReflectiveOperationException(exceptionMessage);
+ throw new ReflectiveOperationException("Custom handler must implement "
+ + RealtimeOffsetAutoResetHandler.class.getCanonicalName());
}
- handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor(
- PinotLLCRealtimeSegmentManager.class, PinotHelixResourceManager.class).newInstance(
- _llcRealtimeSegmentManager, _pinotHelixResourceManager);
+ handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor().newInstance();
Review Comment:
@xiangfu0 Thanks for catching this! You're right — the loading change would break existing handlers that only have the 2-arg constructor.
Fix: getOrConstructHandler() now tries the new no-arg + init() pattern first, and falls back to the deprecated 2-arg constructor (with a WARN log prompting migration) if no no-arg constructor is found.
RealtimeOffsetAutoResetKafkaHandler also has the 2-arg constructor restored as @Deprecated so existing subclasses remain source-compatible. Added a test that exercises this fallback path end-to-end.
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3121916025
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeOffsetAutoResetManager.java:
##########
@@ -214,13 +215,11 @@ private RealtimeOffsetAutoResetHandler getOrConstructHandler(TableConfig tableCo
try {
Class<?> clazz = Class.forName(className);
if (!RealtimeOffsetAutoResetHandler.class.isAssignableFrom(clazz)) {
- String exceptionMessage = "Custom analyzer must be a child of "
- + RealtimeOffsetAutoResetHandler.class.getCanonicalName();
- throw new ReflectiveOperationException(exceptionMessage);
+ throw new ReflectiveOperationException("Custom handler must implement "
+ + RealtimeOffsetAutoResetHandler.class.getCanonicalName());
}
- handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor(
- PinotLLCRealtimeSegmentManager.class, PinotHelixResourceManager.class).newInstance(
- _llcRealtimeSegmentManager, _pinotHelixResourceManager);
+ handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor().newInstance();
Review Comment:
@Jackie-Jiang can I get a stamp and deployment again? Thanks
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3068027353
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeOffsetAutoResetManager.java:
##########
@@ -214,13 +215,11 @@ private RealtimeOffsetAutoResetHandler getOrConstructHandler(TableConfig tableCo
try {
Class<?> clazz = Class.forName(className);
if (!RealtimeOffsetAutoResetHandler.class.isAssignableFrom(clazz)) {
- String exceptionMessage = "Custom analyzer must be a child of "
- + RealtimeOffsetAutoResetHandler.class.getCanonicalName();
- throw new ReflectiveOperationException(exceptionMessage);
+ throw new ReflectiveOperationException("Custom handler must implement "
+ + RealtimeOffsetAutoResetHandler.class.getCanonicalName());
}
- handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor(
- PinotLLCRealtimeSegmentManager.class, PinotHelixResourceManager.class).newInstance(
- _llcRealtimeSegmentManager, _pinotHelixResourceManager);
+ handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor().newInstance();
Review Comment:
This changes the auto-reset handler SPI from constructor injection to no-arg construction plus `init()`. Any existing custom handler compiled against the previous constructor-based contract will now fail to instantiate after upgrade, which is a backward-compatibility break for deployed plugins. Please keep a compatibility path for the legacy constructor (or add a shim/deprecation layer) before switching existing tables to the new loading flow.
--
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] Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup [pinot]
Posted by "deeppatel710 (via GitHub)" <gi...@apache.org>.
deeppatel710 commented on PR #18127:
URL: https://github.com/apache/pinot/pull/18127#issuecomment-4218579637
@yashmayya can you run the CI here as well? Thanks!!
--
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