Add new configuration for refreshed segment expiration time in instance selectors#16401
Closed
abhishekbafna wants to merge 1 commit intoapache:masterfrom
Closed
Add new configuration for refreshed segment expiration time in instance selectors#16401abhishekbafna wants to merge 1 commit intoapache:masterfrom
abhishekbafna wants to merge 1 commit intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16401 +/- ##
============================================
+ Coverage 62.90% 63.33% +0.42%
+ Complexity 1386 1364 -22
============================================
Files 2867 2984 +117
Lines 163354 173297 +9943
Branches 24952 26561 +1609
============================================
+ Hits 102755 109752 +6997
- Misses 52847 55159 +2312
- Partials 7752 8386 +634
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:
|
Jackie-Jiang
requested changes
Jul 28, 2025
| SegmentZKMetadata segmentZKMetadata = new SegmentZKMetadata(record); | ||
| long creationTimeMs = SegmentUtils.getSegmentCreationTimeMs(segmentZKMetadata); | ||
| if (InstanceSelector.isNewSegment(creationTimeMs, currentTimeMs, _newSegmentExpirationTimeInSeconds * 1000)) { | ||
| long segmentExpirationTimeInSec = segmentZKMetadata.getSegmentName().startsWith("refreshed__") |
Contributor
There was a problem hiding this comment.
This logic is not general. Let's discuss a general way to handle this
| public BalancedInstanceSelector(String tableNameWithType, ZkHelixPropertyStore<ZNRecord> propertyStore, | ||
| BrokerMetrics brokerMetrics, @Nullable AdaptiveServerSelector adaptiveServerSelector, Clock clock, | ||
| boolean useFixedReplica, long newSegmentExpirationTimeInSeconds) { | ||
| boolean useFixedReplica, long newSegmentExpirationTimeInSeconds, |
Contributor
There was a problem hiding this comment.
We can probably revisit the default new segment expiration time. 5 minutes is probably too short
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for a new configuration to handle expiration times for "refreshed" segments in the Pinot broker's instance selector logic. The changes primarily involve adding a new parameter for refreshed segment expiration and updating the related logic, constructors, and tests.
Note: New unit tests are pending.
label: configuration