Further fixes concerning drbd port release
authorDimitris Aragiorgis <dimara@grnet.gr>
Mon, 2 Apr 2012 18:27:35 +0000 (21:27 +0300)
committerMichael Hanselmann <hansmi@google.com>
Wed, 11 Apr 2012 16:34:49 +0000 (18:34 +0200)
commit42f25b0b95b023177459f921b55f3c336b434f1b
tree47037d514a2116cd15c9e4adf8e87d19362ad74d
parent2522b7c40826fdfea19b70999ef00b778049df86
Further fixes concerning drbd port release

Commit 3b3b1bc does not entirely fix the bug introduced in commit
f396ad8. It fixes consistency of config data in permanent storage, but
does not ensure consistency in data held in runtime memory of masterd.

The bug of duplicate ports is still triggered when LUInstanceRemove()
invokes _RemoveDisks() and this returns False (in case
call_blockdev_remove RPC fails). The drbd ports get returned in the
pool, but execution is aborted and RemoveInstance() is never invoked.

Due to the fact that port handling is not done with
TemporaryReservationManager, ensure that ports are released, only if
disk related config data is deleted.

In _RemoveDisks() release ports only if all RPCs succeed.

Extend _RemoveDisks() to include ignore_failures argument passed by
_RemoveInstance() to handle the ports appropriately.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
lib/cmdlib.py