All of lore.kernel.org
 help / color / mirror / Atom feed
* [Drbd-dev] Cstate stays in "Disconnecting" after Heartbeat link down and up
@ 2006-10-05 21:37 Montrose, Ernest
  2006-10-06 13:18 ` Philipp Reisner
  0 siblings, 1 reply; 3+ messages in thread
From: Montrose, Ernest @ 2006-10-05 21:37 UTC (permalink / raw)
  To: drbd-dev

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

Hi all,
If I do an ifdown and an ifup on the heartbeat link drbd goes into
CS:Disconnecting .  I cannot manually recover until a reboot. Should the
state be "StandAlone" instead? I include a patch that seems to work for
me.

A side question:
Should drbd notice when the link comes up?  He does not seem to.

Thanks.

EM--


[-- Attachment #2: drbd_receiver_CS.patch --]
[-- Type: application/octet-stream, Size: 636 bytes --]

Index: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	(revision 4894)
+++ trunk/drbd/drbd_receiver.c	(working copy)
@@ -625,7 +625,7 @@
 	if (err) {
 		ERR("Unable to bind sock2 (%d)\n", err);
 		sock_release(sock2);
-		drbd_force_state(mdev,NS(conn,Disconnecting));
+		drbd_force_state(mdev,NS(conn,StandAlone));
 		return NULL;
 	}
 
@@ -2821,7 +2821,7 @@
 		}
 		if( h < 0 ) {
 			WARN("Discarding network configuration.\n");
-			drbd_force_state(mdev,NS(conn,Disconnecting));
+			drbd_force_state(mdev,NS(conn,StandAlone));
 		}
 	} while ( h == 0 );
 

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

* Re: [Drbd-dev] Cstate stays in "Disconnecting" after Heartbeat link down and up
  2006-10-05 21:37 [Drbd-dev] Cstate stays in "Disconnecting" after Heartbeat link down and up Montrose, Ernest
@ 2006-10-06 13:18 ` Philipp Reisner
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Reisner @ 2006-10-06 13:18 UTC (permalink / raw)
  To: drbd-dev; +Cc: Montrose, Ernest

Am Donnerstag, 5. Oktober 2006 23:37 schrieb Montrose, Ernest:
> Hi all,
> If I do an ifdown and an ifup on the heartbeat link drbd goes into
> CS:Disconnecting .  I cannot manually recover until a reboot. Should the
> state be "StandAlone" instead? I include a patch that seems to work for
> me.
>

Hi Ernest,

You patch did not fix the root case of the problem. The source of the
problem was the missing dec_net() in drbd_try_connect().

That lead to the receiver thread hang in 
wait_event( ...,atomic_read(&mdev->net_cnt) == 0 ) in drbd_disconnect() .

Therefore the receiver thread did not terminate and could not set
the state finally to StandAlone.

see http://lists.linbit.com/pipermail/drbd-cvs/2006-October/001306.html

PS: Regarding the state-engine, you should always request a state
    of "Disconnecting", and let the exiting receiver set it finally
    to "StandAlone".

> A side question:
> Should drbd notice when the link comes up?  He does not seem to.
>

No, we do not do that. In case we discover that we can not bind()
our address we give up.

-phil
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :

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

* RE: [Drbd-dev] Cstate stays in "Disconnecting" after Heartbeat link down and up
@ 2006-10-06 13:29 Montrose, Ernest
  0 siblings, 0 replies; 3+ messages in thread
From: Montrose, Ernest @ 2006-10-06 13:29 UTC (permalink / raw)
  To: Philipp Reisner, drbd-dev

Phil,
Thanks!  I did not think that my patch was the proper fix :)  Thank you for explaining this.  This will help our understanding of the Cstate machine.

As for DRBD not noticing the link Up, I accept the current behavior.  Some external monitor should notice and wake up drbd. I wanted to confirm though.

EM--

-----Original Message-----
From: Philipp Reisner [mailto:philipp.reisner@linbit.com] 
Sent: Friday, October 06, 2006 9:19 AM
To: drbd-dev@linbit.com
Cc: Montrose, Ernest
Subject: Re: [Drbd-dev] Cstate stays in "Disconnecting" after Heartbeat link down and up

Am Donnerstag, 5. Oktober 2006 23:37 schrieb Montrose, Ernest:
> Hi all,
> If I do an ifdown and an ifup on the heartbeat link drbd goes into
> CS:Disconnecting .  I cannot manually recover until a reboot. Should the
> state be "StandAlone" instead? I include a patch that seems to work for
> me.
>

Hi Ernest,

You patch did not fix the root case of the problem. The source of the
problem was the missing dec_net() in drbd_try_connect().

That lead to the receiver thread hang in 
wait_event( ...,atomic_read(&mdev->net_cnt) == 0 ) in drbd_disconnect() .

Therefore the receiver thread did not terminate and could not set
the state finally to StandAlone.

see http://lists.linbit.com/pipermail/drbd-cvs/2006-October/001306.html

PS: Regarding the state-engine, you should always request a state
    of "Disconnecting", and let the exiting receiver set it finally
    to "StandAlone".

> A side question:
> Should drbd notice when the link comes up?  He does not seem to.
>

No, we do not do that. In case we discover that we can not bind()
our address we give up.

-phil
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :

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

end of thread, other threads:[~2006-10-06 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 21:37 [Drbd-dev] Cstate stays in "Disconnecting" after Heartbeat link down and up Montrose, Ernest
2006-10-06 13:18 ` Philipp Reisner
  -- strict thread matches above, loose matches on Subject: below --
2006-10-06 13:29 Montrose, Ernest

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.