fix(flink): remove pre-seed in metrics in GlobalRecordLevelIndexBackend and RecordLevelIndexBackend#18875
Conversation
…nd and RecordLevelIndexBackend
hudi-agent
left a comment
There was a problem hiding this comment.
🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.
Thanks for the cleanup! This PR removes the UnregisteredMetricsGroup pre-seed from both index backend constructors and updates tests to register metrics explicitly when they exercise the metric-touching paths. I traced the production callers (BucketAssignFunction.initializeState and DynamicBucketAssignFunction.initializeState) and confirmed both invoke registerMetrics(...) immediately after construction, before any get/update/bootstrapPartition call that would dereference metrics, so removing the pre-seed is safe for production paths. No issues flagged from this automated pass — a Hudi committer or PMC member can take it from here for a final review.
cc @yihua
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18875 +/- ##
=========================================
Coverage 68.81% 68.81%
- Complexity 29142 29144 +2
=========================================
Files 2515 2515
Lines 139931 139929 -2
Branches 17187 17187
=========================================
+ Hits 96288 96296 +8
+ Misses 35864 35854 -10
Partials 7779 7779
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Describe the issue this Pull Request addresses
The pre-seed logic in metrics in GlobalRecordLevelIndexBackend and RecordLevelIndexBackend are not needed by production code and they only existed for test purpose. This PR removes this unnecessary step and fix all test cases.
Fixes #18734
Summary and Changelog
Remove pre-seed in metrics in GlobalRecordLevelIndexBackend and RecordLevelIndexBackend and fix test cases
Impact
None
Risk Level
None. Production code doesn't need pre-seed.
Documentation Update
N/A
Contributor's checklist