Commit 74e89a14 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix ReplaceSecondary moves for offline nodes

The addition of a new secondary on a node is doing two memory tests:
- in strict mode, reject if we get into N+1 failure
- reject if the new instance memory is greater than the free memory (not
  available memory) on the node

The last check is designed to ensure that, irrespective of the other
secondary instances on this node, we are able to failover/migrate the
newly-added instance.

However, we should allow this, if the instances comes from an offline
node, which doesn't offer anything (not even disk replication).
Therefore this patch makes this check conditional on the strict mode.
parent 49d977db
......@@ -409,7 +409,7 @@ addSecEx force t inst pdx =
in case () of
_ | new_dsk <= 0 -> T.OpFail T.FailDisk
| mDsk t > new_dp && strict -> T.OpFail T.FailDisk
| Instance.mem inst >= old_mem -> T.OpFail T.FailMem
| Instance.mem inst >= old_mem && strict -> T.OpFail T.FailMem
| new_failn1 && not (failN1 t) && strict -> T.OpFail T.FailMem
| otherwise ->
let new_slist = iname:sList t
......
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