Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] DRBD-8: Patch to fix incorrect split-brain occurrence.
@ 2006-12-19 15:45 Graham, Simon
  2006-12-19 16:13 ` Lars Ellenberg
  0 siblings, 1 reply; 2+ messages in thread
From: Graham, Simon @ 2006-12-19 15:45 UTC (permalink / raw)
  To: drbd-dev

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

In testing, we have run into a case where we unexpectedly get a
split-brain situation - after some investigation I think I have found
the reason - at the end of syncing, the SyncTarget side finishes up by
setting it's UUID info to the same as the Source (in
drbd_resync_finished) - the code that does this checks for connection
state SyncTarget before doing this. 

Now, I have seen that sometimes the resync completes when in PausedSyncT
state - for example, if the last set of blocks is already under way when
we decide to go into the PausedSyncT state - thus it's entirely possible
to enter drbd_resync_finished with connection state PausedSyncT in which
case we do finish up the resync but do not copy the UUID info - this
means that the next time we need to resync, the code determines that we
have a split-brain situation.

In other places in the code, checks are made for either SyncTarget or
PausedSyncT so I propose fixing this (patch attached) the same way -
have drbd_resync_finished check for either SyncTarget OR PausedSyncT.

Simon


[-- Attachment #2: drbd-resync.patch --]
[-- Type: application/octet-stream, Size: 755 bytes --]

Index: src/drbd/drbd_worker.c
===================================================================
--- src/drbd/drbd_worker.c	(revision 7932)
+++ src/drbd/drbd_worker.c	(working copy)
@@ -402,7 +402,8 @@
 	if (mdev->rs_failed) {
 		INFO("            %lu failed blocks\n",mdev->rs_failed);
 
-		if (mdev->state.conn == SyncTarget) {
+		if (mdev->state.conn == SyncTarget || 
+		    mdev->state.conn == PausedSyncT) {
 			dstate = Inconsistent;
 			pdstate = UpToDate;
 		} else {
@@ -412,7 +413,8 @@
 	} else {
 		dstate = pdstate = UpToDate;
 
-		if ( mdev->state.conn == SyncTarget) {
+		if ( mdev->state.conn == SyncTarget || 
+		     mdev->state.conn == PausedSyncT) {
 			if( mdev->p_uuid ) {
 				int i;
 				for ( i=Bitmap ; i<=History_end ; i++ ) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-19 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19 15:45 [Drbd-dev] DRBD-8: Patch to fix incorrect split-brain occurrence Graham, Simon
2006-12-19 16:13 ` Lars Ellenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox