Commit dec88196 authored by Iustin Pop's avatar Iustin Pop
Browse files

Improve error reporting for small clusters



When doing a two-node allocation on a cluster/group in which only one
node is online, or a one-node allocation without any online nodes, we
didn't show a valid error mesage. The patch changes tryAlloc to "fail
hard" in this case, to make the failure explicit.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarBalazs Lecz <leczb@google.com>
parent 9b1584fc
......@@ -607,14 +607,18 @@ tryAlloc nl _ inst 2 =
concatAllocs cstate $ allocateOnPair nl inst p s
) emptySolution ok_pairs
in return $ annotateSolution sols
in if null ok_pairs -- means we have just one node
then fail "Not enough online nodes"
else return $ annotateSolution sols
tryAlloc nl _ inst 1 =
let all_nodes = getOnline nl
sols = foldl' (\cstate ->
concatAllocs cstate . allocateOnSingle nl inst
) emptySolution all_nodes
in return $ annotateSolution sols
in if null all_nodes
then fail "No online nodes"
else return $ annotateSolution sols
tryAlloc _ _ _ reqn = fail $ "Unsupported number of allocation \
\destinations required (" ++ show reqn ++
......
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