Skip to content

Commit

Permalink
Adding a logs to report missing top state beyond threshold set as wel…
Browse files Browse the repository at this point in the history
…l top state recovered on same instance. (apache#2553)


Co-authored-by: Rahul Rane <[email protected]>
  • Loading branch information
rahulrane50 and rahulrane50 authored Jul 12, 2023
1 parent b6ca0f4 commit a0df597
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void process(ClusterEvent event) throws Exception {
// TODO: remove this if-else after splitting controller
if (cache instanceof WorkflowControllerDataProvider) {
throw new StageException("TopStateHandoffReportStage can only be used in resource pipeline");
}
}
updateTopStateStatus((ResourceControllerDataProvider) cache, clusterStatusMonitor,
resourceMap, currentStateOutput, lastPipelineFinishTimestamp);
}
Expand Down Expand Up @@ -317,12 +317,18 @@ private void reportTopStateHandoffFailIfNecessary(ResourceControllerDataProvider
String partitionName = partition.getPartitionName();
MissingTopStateRecord record = missingTopStateMap.get(resourceName).get(partitionName);
long startTime = record.getStartTimeStamp();
if (startTime > 0 && System.currentTimeMillis() - startTime > durationThreshold && !record
.isFailed()) {
long missingDuration = System.currentTimeMillis() - startTime;
if (startTime > 0 && missingDuration > durationThreshold && !record.isFailed()) {
record.setFailed();
missingTopStateMap.get(resourceName).put(partitionName, record);
// Since top state handoff has not completed yet we can't log helix top state latency but can log since how long
// top state is missing.
LogUtil.logInfo(LOG, _eventId, String.format(
"Missing top state for partition %s beyond %s time. Graceful: %s",
partitionName, missingDuration, false));
if (clusterStatusMonitor != null) {
clusterStatusMonitor.updateMissingTopStateDurationStats(resourceName, 0L, 0L, false, false);
clusterStatusMonitor.updateMissingTopStateDurationStats(resourceName, 0L, 0L,
false, false);
}
}
}
Expand Down

0 comments on commit a0df597

Please sign in to comment.