9aman commented on code in PR #16856:
URL: https://github.com/apache/pinot/pull/16856#discussion_r2380632425
##########
pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java:
##########
@@ -240,6 +240,10 @@ public static class ControllerPeriodicTasksConf {
"controller.retentionManager.initialDelayInSeconds";
public static final String
OFFLINE_SEGMENT_INTERVAL_CHECKER_INITIAL_DELAY_IN_SECONDS =
"controller.offlineSegmentIntervalChecker.initialDelayInSeconds";
Review Comment:
What I have tried here is to use the new names. The old config and
frequencies are still valid.
`shouldRunSegmentValidation`
takes the minimum of the old and new frequencies in case both are set.
What you suggest also sounds good. The only concern there is that for the
segment level validations frequency, I am relying on
`_segmentLevelValidationIntervalInSeconds =
config.getSegmentLevelValidationIntervalInSeconds();
`
This is the same frequency that is used for segment level validations under
RealtimeSegmentValidationManager (RSVM). It's likely that the user has set that
frequency for RSVM. Thus, the old config will not be applied.
The reason for re-using an existing frequency/ config is to not increase the
number of knobs. Also, the expensive part in these segment level checks is
fetching the ZK metadata, which is common for both OFFLINE and REALTIME tables.
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/OfflineSegmentValidationManager.java:
##########
@@ -47,24 +51,44 @@
* Manages the segment validation metrics, to ensure that all offline segments
are contiguous (no missing segments) and
* that the offline push delay isn't too high.
*/
-public class OfflineSegmentIntervalChecker extends
ControllerPeriodicTask<Void> {
- private static final Logger LOGGER =
LoggerFactory.getLogger(OfflineSegmentIntervalChecker.class);
+public class OfflineSegmentValidationManager extends
ControllerPeriodicTask<OfflineSegmentValidationManager.Context> {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(OfflineSegmentValidationManager.class);
private final ValidationMetrics _validationMetrics;
private final boolean _segmentAutoResetOnErrorAtValidation;
+ private final ResourceUtilizationManager _resourceUtilizationManager;
+ private final int _segmentLevelValidationIntervalInSeconds;
+ // Legacy frequency setting maintained for backward compatibility
+ private final int _offlineSegmentIntervalCheckerFrequencyInSeconds;
+ private long _lastSegmentLevelValidationRunTimeMs = 0L;
- public OfflineSegmentIntervalChecker(ControllerConf config,
PinotHelixResourceManager pinotHelixResourceManager,
+ public OfflineSegmentValidationManager(ControllerConf config,
PinotHelixResourceManager pinotHelixResourceManager,
LeadControllerManager leadControllerManager, ValidationMetrics
validationMetrics,
- ControllerMetrics controllerMetrics) {
- super("OfflineSegmentIntervalChecker",
config.getOfflineSegmentIntervalCheckerFrequencyInSeconds(),
- config.getOfflineSegmentIntervalCheckerInitialDelayInSeconds(),
pinotHelixResourceManager,
+ ControllerMetrics controllerMetrics, ResourceUtilizationManager
resourceUtilizationManager) {
+ super("OfflineSegmentIntervalChecker",
config.getOfflineSegmentValidationFrequencyInSeconds(),
Review Comment:
Will change the task name.
I have tried to maintain backward compatibility by also taking the pervious
frequency into consideration under
` private boolean shouldRunSegmentValidation(Properties
periodicTaskProperties, long currentTimeMs) {
`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]