Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup#18127
Refactor: convert RealtimeOffsetAutoResetHandler to interface with init(); fix nonLeaderCleanup#18127deeppatel710 wants to merge 2 commits intoapache:masterfrom
Conversation
…it(); fix nonLeaderCleanup - Remove redundant public abstract modifiers from RealtimeOffsetAutoResetHandler interface - Update init() javadoc: "called once in constructor" -> "called once after instantiation" - Remove constructor injection from RealtimeOffsetAutoResetKafkaHandler; init() is now the sole initialization path called by the manager after no-arg reflective instantiation - Fix ensureBackfillJobsRunning signature: List<String> -> Collection<String> to match interface - Update RealtimeOffsetAutoResetManager.getOrConstructHandler() to use no-arg constructor + init() - Fix bug in nonLeaderCleanup(): also clear _tableBackfillTopics to avoid stale state on re-election - Fix misleading error message: "Custom analyzer" -> "Custom handler" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Jackie-Jiang this addresses your review feedback from #15782. Would appreciate a review! |
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Thanks for the contribution
...org/apache/pinot/controller/helix/core/periodictask/RealtimeOffsetAutoResetKafkaHandler.java
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #18127 +/- ##
============================================
- Coverage 63.96% 55.89% -8.07%
+ Complexity 1617 829 -788
============================================
Files 3179 2484 -695
Lines 193741 142663 -51078
Branches 29926 22975 -6951
============================================
- Hits 123918 79746 -44172
+ Misses 60031 56102 -3929
+ Partials 9792 6815 -2977
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove redundant `ensureBackfillJobsRunning` abstract override from RealtimeOffsetAutoResetKafkaHandler; the interface already declares it - Fix TestRealtimeOffsetAutoResetHandler to use no-arg constructor so reflection-based instantiation in getOrConstructHandler() works correctly - Strengthen testNonLeaderCleanup to assert handler is removed from internal map after nonLeaderCleanup is called Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@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! |
|
@yashmayya can you run the CI here as well? Thanks!! |
xiangfu0
left a comment
There was a problem hiding this comment.
Found one high-signal backward-compatibility issue; see inline comment.
| handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor( | ||
| PinotLLCRealtimeSegmentManager.class, PinotHelixResourceManager.class).newInstance( | ||
| _llcRealtimeSegmentManager, _pinotHelixResourceManager); | ||
| handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor().newInstance(); |
There was a problem hiding this 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.
Addresses review feedback from #15782 (Jackie-Jiang) that was not carried over when the feature was split and merged as #16492, #16692, and #16724:
public abstractmodifiers fromRealtimeOffsetAutoResetHandlerinterface methods; updatedinit()javadoc to reflect it is called afterinstantiation, not in a constructor
RealtimeOffsetAutoResetKafkaHandler; initialization now happens viainit()called by the manager after reflectiveinstantiation
ensureBackfillJobsRunningsignature:List<String>→Collection<String>to match the interface contractRealtimeOffsetAutoResetManager.getOrConstructHandler()to use no-arg constructor +init()instead of constructor injection via reflectionnonLeaderCleanup(): was not clearing_tableBackfillTopics, leaving stale state when the controller re-acquires leadershipChanges
RealtimeOffsetAutoResetHandler.javainit()RealtimeOffsetAutoResetKafkaHandler.javaCollection<String>signatureRealtimeOffsetAutoResetManager.javainit(); fixednonLeaderCleanup()Labels
refactor,release-notes