Skip to content
Snippets Groups Projects
Commit f25508be 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>
parent 6f4a2e9d
No related branches found
No related tags found
No related merge requests found
...@@ -283,6 +283,8 @@ processRelocate gl nl il idx 1 exndx = do ...@@ -283,6 +283,8 @@ processRelocate gl nl il idx 1 exndx = do
snode = Instance.sNode inst snode = Instance.sNode inst
when (snode == sorig) $ when (snode == sorig) $
fail "Internal error: instance didn't change secondary node?!" 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]) nodes' <- if (nodes == [pnode, snode])
then return [snode] -- only the new secondary is needed then return [snode] -- only the new secondary is needed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment