Commit 2072221f authored by Iustin Pop's avatar Iustin Pop
Browse files

hbal: handle empty node groups



This patch changes an internal assert (which can only be triggered
when a node group is empty) into properly handling this case (and
returning empty node/instance lists).

While we could handle this in the backend (Cluster.splitNodeGroup)
this would actually mean than we change the behaviour for a cluster
with just two node groups, once of which is empty (where today we
don't require a node group argument).
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 65c9591c
......@@ -308,10 +308,9 @@ main = do
Just grp ->
case lookup (Group.idx grp) ngroups of
Nothing -> do
-- TODO: while this is unlikely to happen, log here the
-- actual group data to help debugging
hPutStrLn stderr "Internal failure, missing group idx"
exitWith $ ExitFailure 1
-- This will only happen if there are no nodes assigned
-- to this group
return (Group.name grp, (Container.empty, Container.empty))
Just cdata -> return (Group.name grp, cdata)
unless oneline $ printf "Group size %d nodes, %d instances\n"
......
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