Revision 8b0273a5
ID | 8b0273a5902233655a75881fa2ab7264eb0d82ad |
Use node group locking for replacing disks
This is one of the first opcodes to make use of node group locking. To
get an instance's node groups, the instance's nodes need to be looked
at. Due to a previous design decision nodes are locked after the group,
hence there's no clean locking order. This patch works around that by
first getting the instance's groups without locks, and then verifying
them after actually getting all locks. Rough overview:
- Lock instance
- Get groups of instance's nodes
- Lock groups
- Lock all nodes in groups
- Verify node groups
- Run iallocator
- Release group and unused nodes
- Replace disks, etc.
There are probably too many assertions in the code, but it's locking and
we've been bitten in the past.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Files
- added
- modified
- copied
- renamed
- deleted