LGTM, thanks.
On Wed, Jan 22, 2014 at 12:51 PM, Hrvoje Ribicic <[email protected]> wrote: > 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: Hrvoje Ribicic <[email protected]> > --- > lib/storage/drbd.py | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py > index 5642f29..3073b69 100644 > --- a/lib/storage/drbd.py > +++ b/lib/storage/drbd.py > @@ -453,6 +453,21 @@ class DRBD8Dev(base.BlockDev): > except utils.RetryTimeout: > 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 > def _GetNetFamily(minor, lhost, rhost): > if netutils.IP6Address.IsValid(lhost): > @@ -805,11 +820,6 @@ class DRBD8Dev(base.BlockDev): > # the device > 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): > """Assembles the DRBD device from a (partially) configured device. > > -- > 1.8.5.3 > > -- Thomas Thrainer | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
