Commit d9f5c7b2 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

hspace: support --accept-existing-errors



Make hspace honor the option --accept-existing-errors. If
this option is given, hspace will try to allocate on all
N+1 happy nodes even though this might lead to overfull
groups.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent a58b4e0a
...@@ -70,6 +70,7 @@ options = do ...@@ -70,6 +70,7 @@ options = do
, oVerbose , oVerbose
, oQuiet , oQuiet
, oIndependentGroups , oIndependentGroups
, oAcceptExisting
, oOfflineNode , oOfflineNode
, oMachineReadable , oMachineReadable
, oMaxCpu , oMaxCpu
...@@ -451,6 +452,7 @@ main opts args = do ...@@ -451,6 +452,7 @@ main opts args = do
let verbose = optVerbose opts let verbose = optVerbose opts
machine_r = optMachineReadable opts machine_r = optMachineReadable opts
independent_grps = optIndependentGroups opts independent_grps = optIndependentGroups opts
accept_existing = optAcceptExisting opts
orig_cdata@(ClusterData gl fixed_nl il _ ipol) <- loadExternalData opts orig_cdata@(ClusterData gl fixed_nl il _ ipol) <- loadExternalData opts
nl <- setNodeStatus opts fixed_nl nl <- setNodeStatus opts fixed_nl
...@@ -482,10 +484,13 @@ main opts args = do ...@@ -482,10 +484,13 @@ main opts args = do
(Node.haveExclStorage nl) (Node.haveExclStorage nl)
let (bad_nodes, _) = Cluster.computeBadItems nl il let (bad_nodes, _) = Cluster.computeBadItems nl il
gl' = foldl (flip $ IntMap.adjust Group.setUnallocable) gl gl' = if accept_existing
$ map Node.group bad_nodes then gl
else foldl (flip $ IntMap.adjust Group.setUnallocable) gl
(map Node.group bad_nodes)
grps_remaining = any Group.isAllocable $ IntMap.elems gl' grps_remaining = any Group.isAllocable $ IntMap.elems gl'
stop_allocation = case () of stop_allocation = case () of
_ | accept_existing-> Nothing
_ | independent_grps && grps_remaining -> Nothing _ | independent_grps && grps_remaining -> Nothing
_ | null bad_nodes -> Nothing _ | null bad_nodes -> Nothing
_ -> Just ([(FailN1, 1)]::FailStats, nl, il, [], []) _ -> Just ([(FailN1, 1)]::FailStats, nl, il, [], [])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment