[Drbd-dev] DRBD8: Split-brain if primary and syncTarget

Montrose, Ernest Ernest.Montrose at stratus.com
Thu Mar 8 23:21:41 CET 2007


Hi all,
 
We are seeing an issue with split brain if one node is syncing as
syncTarget while being Primary.
two node A and B.
* make B primary and the syncTarget
* Start a sync.
* ifdown eth1 to break communication
* ifup eth1.
* then on the node in standalone "drbdadm connect"
We get a split-brain.
 
I think the  problem is that if we are primary and we lose contact from
the other side
we generate a new current UUID which causes a Split-Brain next time we
connect.
This only happens if we are the sync target and we are primary. Perhaps
we 
should not generate a UUID if we were syncing when the disconnect
happen.
Below is a possible patch for this in after_state_ch():

Index: drbd/drbd_main.c
===================================================================
--- drbd/drbd_main.c    (revision 11592)
+++ drbd/drbd_main.c    (working copy)
@@ -901,7 +901,8 @@
                        mdev->p_uuid = NULL;
                }
                if (inc_local(mdev)) {
-                      if (ns.role == Primary &&
mdev->bc->md.uuid[Bitmap] == 0 ) {
+                      if (ns.role == Primary &&
mdev->bc->md.uuid[Bitmap] == 0 &&
+            os.conn < SyncSource ) {
                                /* Only do it if we have not yet done
it... */
                                drbd_uuid_new_current(mdev);
                        }
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linbit.com/pipermail/drbd-dev/attachments/20070308/40de0ab4/attachment.html


More information about the drbd-dev mailing list