Remove checking of DRBD metadata for validity
authorIustin Pop <iustin@google.com>
Fri, 23 Jan 2009 12:36:28 +0000 (12:36 +0000)
committerIustin Pop <iustin@google.com>
Fri, 23 Jan 2009 12:36:28 +0000 (12:36 +0000)
commit3b5596402bbe33d34a52dc7db8e3636527fc25cd
treef6d7cfa4d6a6b2a283811bdfc8ba7c6824fab99d
parentc723c1630a69167ff29c42f7f866bbb8b589cffd
Remove checking of DRBD metadata for validity

Currently the DRBD code checks that the metadata devices are valid
before creation, initial disk attachment and add children.

However, the process for checking validity requires a free DRBD minor,
and this conflict with parallel checking.

There are at least three possible solutions:
  - serialize all checks, which means we reduce parallelism and need
    extra locks
  - don't pass a valid minor number, but one like “/dev/drbd256” (which
    is invalid); this works for current version of DRBD, but since it's
    not guaranteed to remain so it doesn't look nice
  - don't do the checking at all, and rely on “drbdsetup ... disk ...”
    to fail by itself

The reason for checking metadata was that in 1.2, this was much cheaper
than trying to activate devices (and the subsequent iteration over the
minors). However, in 2.0, they have the same cost, so we can choose
option 3: just remove the explicit checking and rely on drbdsetup and
the kernel to fail.

Since DRBD8._InitMeta still requires a minor number, the two places
where this is run are handled as follows:
  - Create: we just use our own (unused currently) minor number
  - AddChildren: we keep using FindUnusedMinor, with the caveat that
    this function (used by replace-disks -n ...) cannot be yet
    parallelized

Reviewed-by: ultrotter
lib/bdev.py
lib/cmdlib.py