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

hail: add an extra safety check in relocate



If we select the primary as new secondary, better to fail than return
wrong data to Ganeti.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
(cherry picked from commit f25508be

)
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent f39d39b6
......@@ -283,6 +283,8 @@ processRelocate gl nl il idx 1 exndx = do
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
......
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