On Mon, May 30, 2011 at 05:14:43PM +0200, Michael Hanselmann wrote:
> Signed-off-by: Michael Hanselmann <[email protected]>
> ---
>  lib/cmdlib.py  |  171 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  lib/opcodes.py |   19 ++++++-
>  2 files changed, 188 insertions(+), 2 deletions(-)

Again empty commit message :(

There is one big issue with the design behind this and a small one.

The small one is that you're using two boolean variables that are
mutually exclusive and you have to check/assert every so often for this.
A proper data type would be needed here; in Haskell, it would be:

data EvacMode = EvacPrimaries
              | EvacSecondaries
              | EvacBoth

In Python it should be as usual a frozenset(EVAC_PRI, EVAC_SEC,
EVAC_BOTH).

The big on is that we don't keep the semantics of the old gnt-node
migrate with the new gnt-node evacuate --primaries-only. You do the
logic of primary-only/secondary-only in the LU, but you don't pass this
information to the IAllocator; it could choose not to only migrate the
instance from (A, B) to (B, A), but to put it completely on (C, D) with
2 replace disks interleaved. This ruins the purpose of gnt-node migrate,
which is to restart all instances quickly on a different node (whatever
that is, with DRBD being the secondary).

I think this is because the IAllocator interface for multi-evacuate
doesn't support passing information about what we want to do (compare
with hbal which supports "migrations only" and soon "disk replaces
only"). Either we want to add that information to the iallocator call,
or we shouldn't merge these two concepts (primary and secondary
evacuation).

Note that the currently existing iallocator call (multi-evacuate) is
constrained by design to a single replace-disk, whereas the new
multi-relocate is completely free-form.

thanks,
iustin

Reply via email to