Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,18 @@ private BestPossibleStateOutput compute(ClusterEvent event, Map<String, Resource
.format("Failed to calculate best possible states for %d resources.",
failureResources.size()));

// Fall back to current states for resources that cannot be computed
failureResources.parallelStream().forEach(resourceName -> {
if (currentStateOutput.getCurrentStateMap(resourceName).isEmpty()) {
return;
}
IdealState fakeIS = new IdealState(resourceName);
currentStateOutput.getCurrentStateMap(resourceName).forEach((partition, stateMap) ->
fakeIS.setInstanceStateMap(partition.getPartitionName(), stateMap != null ? stateMap : new HashMap<>())
);
updateBestPossibleStateOutput(output, resourceMap.get(resourceName), fakeIS);
});

return output;
}

Expand Down