If we select the primary as new secondary, better to fail than return
wrong data to Ganeti.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit
f25508bef4e85032f0468e5a6f0f8930ff154e66)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
snode = Instance.sNode inst
when (snode == sorig) $
fail "Internal error: instance didn't change secondary node?!"
+ when (snode == pnode) $
+ fail "Internal error: selected primary as new secondary?!"
nodes' <- if (nodes == [pnode, snode])
then return [snode] -- only the new secondary is needed