LUGroupVerifyDisks: Use node allocation lock
authorMichael Hanselmann <hansmi@google.com>
Fri, 23 Nov 2012 03:39:46 +0000 (04:39 +0100)
committerMichael Hanselmann <hansmi@google.com>
Wed, 5 Dec 2012 11:00:33 +0000 (12:00 +0100)
See comment in code.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/cmdlib.py

index 92b881d..a795c4f 100644 (file)
@@ -3685,6 +3685,12 @@ class LUGroupVerifyDisks(NoHooksLU):
       locking.LEVEL_INSTANCE: [],
       locking.LEVEL_NODEGROUP: [],
       locking.LEVEL_NODE: [],
+
+      # This opcode is acquires all node locks in a group. LUClusterVerifyDisks
+      # starts one instance of this opcode for every group, which means all
+      # nodes will be locked for a short amount of time, so it's better to
+      # acquire the node allocation lock as well.
+      locking.LEVEL_NODE_ALLOC: locking.ALL_SET,
       }
 
   def DeclareLocks(self, level):