Commit 1a705513 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic
Browse files

Run drbdsetup syncer only on network attach



As late as DRBD 8.3.11, the drbdsetup syncer command has a bug causing
nodes to hang from time to time, requiring manual intervention to fix.
The use of the command cannot be avoided, but the incidence of use can
be reduced.

By invoking the command only when the network part of a DRBD device is
configured, activate-disks and similar commands can avoid invoking the
troublesome command. This patch does this by moving the invocation from
Assemble to _AssembleNet.

Works towards fixing issue 650.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 7b5f0674
...@@ -453,6 +453,21 @@ class DRBD8Dev(base.BlockDev): ...@@ -453,6 +453,21 @@ class DRBD8Dev(base.BlockDev):
except utils.RetryTimeout: except utils.RetryTimeout:
base.ThrowError("drbd%d: timeout while configuring network", minor) base.ThrowError("drbd%d: timeout while configuring network", minor)
# Once the assembly is over, try to set the synchronization parameters
try:
# The minor may not have been set yet, requiring us to set it at least
# temporarily
old_minor = self.minor
self._SetFromMinor(minor)
sync_errors = self.SetSyncParams(self.params)
if sync_errors:
base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
(self.minor, utils.CommaJoin(sync_errors)))
finally:
# Undo the change, regardless of whether it will have to be done again
# soon
self._SetFromMinor(old_minor)
@staticmethod @staticmethod
def _GetNetFamily(minor, lhost, rhost): def _GetNetFamily(minor, lhost, rhost):
if netutils.IP6Address.IsValid(lhost): if netutils.IP6Address.IsValid(lhost):
...@@ -805,11 +820,6 @@ class DRBD8Dev(base.BlockDev): ...@@ -805,11 +820,6 @@ class DRBD8Dev(base.BlockDev):
# the device # the device
self._SlowAssemble() self._SlowAssemble()
sync_errors = self.SetSyncParams(self.params)
if sync_errors:
base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
(self.minor, utils.CommaJoin(sync_errors)))
def _SlowAssemble(self): def _SlowAssemble(self):
"""Assembles the DRBD device from a (partially) configured device. """Assembles the DRBD device from a (partially) configured device.
......
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