Commit d5cd389c authored by Iustin Pop's avatar Iustin Pop
Browse files

Release all node locks during disk replace

This patch extends commit 7ea7bcf6

 by releasing all node locks in disk
replace for the early release mode. The rationale behind this is:

- LUCreateInstance already releases all node locks while waiting for
  disk synchronization, and does an instance startup later
- WaitForSync only runs (for disk template 'drbd') 'lvs' and read
  /proc/drbd on the primary node, which should be (modulo bugs in LVM)
  safe for parallel run

In any case, the worst I could foresee is a node having N lvs commands
run in parallel on it, while being a primary for disk storage. Based on
create instance doing this safely, and the fact that burnin with more
than two instances per node is safe, I think this can be applied.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 9122e60a
......@@ -7012,10 +7012,9 @@ class TLReplaceDisks(Tasklet):
self.lu.LogStep(cstep, steps_total, "Removing old storage")
cstep += 1
self._RemoveOldStorage(self.target_node, iv_names)
# only release the lock if we're doing secondary replace, since
# we use the primary node later
if self.target_node != self.instance.primary_node:
self._ReleaseNodeLock(self.target_node)
# WARNING: we release both node locks here, do not do other RPCs
# than WaitForSync to the primary node
self._ReleaseNodeLock([self.target_node, self.other_node])
# Wait for sync
# This can fail as the old devices are degraded and _WaitForSync
......@@ -7170,7 +7169,11 @@ class TLReplaceDisks(Tasklet):
self.lu.LogStep(cstep, steps_total, "Removing old storage")
cstep += 1
self._RemoveOldStorage(self.target_node, iv_names)
self._ReleaseNodeLock([self.target_node, self.new_node])
# WARNING: we release all node locks here, do not do other RPCs
# than WaitForSync to the primary node
self._ReleaseNodeLock([self.instance.primary_node,
self.target_node,
self.new_node])
# Wait for sync
# This can fail as the old devices are degraded and _WaitForSync
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment