From f38478b26f5942814e25faf2a3bde43f11f3edc2 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 24 Oct 2007 14:41:54 +0000
Subject: [PATCH] Allow DRBD8 to sync after sb1-pri with no changes

Currently the way we shutdown or startup disks seems to make DRBD8
unhappy. Until we rewrite the sequence of (de)activation, allow DRBD to
connect after a sb1-pri condition with no changes to the data.

Reviewed-by: imsnah
---
 lib/bdev.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/bdev.py b/lib/bdev.py
index 76c6da1ad..0352ca846 100644
--- a/lib/bdev.py
+++ b/lib/bdev.py
@@ -1806,8 +1806,10 @@ class DRBD8(BaseDRBD):
     """
     lhost, lport, rhost, rport = net_info
     args = ["drbdsetup", cls._DevPath(minor), "net",
-            "%s:%s" % (lhost, lport), "%s:%s" % (rhost, rport),
-            protocol]
+            "%s:%s" % (lhost, lport), "%s:%s" % (rhost, rport), protocol,
+            "-A", "discard-zero-changes",
+            "-B", "consensus",
+            ]
     if dual_pri:
       args.append("-m")
     if hmac and secret:
-- 
GitLab