Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] DRBD8: Resync of device PauseSync state does not resume after an I/O error.
@ 2007-02-26 21:30 Montrose, Ernest
  2007-03-02 13:33 ` Philipp Reisner
  0 siblings, 1 reply; 4+ messages in thread
From: Montrose, Ernest @ 2007-02-26 21:30 UTC (permalink / raw)
  To: drbd-dev

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

Hi all,
Looks like what's going on is that on an I/O error during resync (on the
sync source), the io error handler set the new state to 
"Connected" and after_state_ch() is not called but scheduled it seems.
Next time after_state_ch()
is called the conn state is "Connected" for both old and new and the
disk state is Diskless.
We do not cal resume_next_sg() for this combination of state.  Could it
be as simple as this patch?

Index: drbd/drbd_main.c
===================================================================
--- drbd/drbd_main.c    (revision 10812)
+++ drbd/drbd_main.c    (working copy)
@@ -1009,7 +1009,8 @@
        // A resync finished or aborted, wake paused devices...
        if ( (os.conn > Connected && ns.conn <= Connected) ||
            (os.peer_isp && !ns.peer_isp) ||
-            (os.user_isp && !ns.user_isp) ) {
+            (os.user_isp && !ns.user_isp) ||
+        (ns.conn <= Connected && ns.disk == Diskless)) {
                resume_next_sg(mdev);
        }

[-- Attachment #2: Type: text/html, Size: 6007 bytes --]

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

* Re: [Drbd-dev] DRBD8: Resync of device PauseSync state does not resume after an I/O error.
  2007-02-26 21:30 [Drbd-dev] DRBD8: Resync of device PauseSync state does not resume after an I/O error Montrose, Ernest
@ 2007-03-02 13:33 ` Philipp Reisner
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Reisner @ 2007-03-02 13:33 UTC (permalink / raw)
  To: drbd-dev; +Cc: Montrose, Ernest

Am Montag, 26. Februar 2007 22:30 schrieb Montrose, Ernest:
> Hi all,
> Looks like what's going on is that on an I/O error during resync (on the
> sync source), the io error handler set the new state to
> "Connected" and after_state_ch() is not called but scheduled it seems.
> Next time after_state_ch()
> is called the conn state is "Connected" for both old and new and the
> disk state is Diskless.
> We do not cal resume_next_sg() for this combination of state.  Could it
> be as simple as this patch?

Hi Ernest,

Ok, I now understand what was going on there. The __drbd_chk_io_error()
functions sets the disk to failed.
As a consequence in _drbd_set_state:

	if( ns.conn > Connected && (ns.disk <= Failed || ns.pdsk <= Failed )) {
		warn_sync_abort=1;
		ns.conn = Connected;
	}

The ns gets set to Connected. But the after_state_ch() is not called nor
scheduled...


I propose to fix it with this patch. Could you please test this patch?
If this patches fixes the issue as well ?

--- drbd_int.h  (revision 2773)
+++ drbd_int.h  (working copy)
@@ -1473,7 +1473,8 @@
        case Detach:
        case CallIOEHelper:
                if (mdev->state.disk > Failed) {
-                       _drbd_set_state(_NS(mdev,disk,Failed),ChgStateHard);
+                       _drbd_set_state(_NS(mdev,disk,Failed),
+                                       ChgStateHard|ScheduleAfter);
                        ERR("Local IO failed. Detaching...\n");
                }
                break;

In case it does, I will commit this, since it is the more generic fix 
to the issue. 

-Phil
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria        http://www.linbit.com :

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

* RE: [Drbd-dev] DRBD8: Resync of device PauseSync state does not resume after an I/O error.
@ 2007-03-02 13:35 Montrose, Ernest
  0 siblings, 0 replies; 4+ messages in thread
From: Montrose, Ernest @ 2007-03-02 13:35 UTC (permalink / raw)
  To: Philipp Reisner, drbd-dev

Phil,
No problem...I will test it and let you know.

EM--

-----Original Message-----
From: Philipp Reisner [mailto:philipp.reisner@linbit.com] 
Sent: Friday, March 02, 2007 8:33 AM
To: drbd-dev@linbit.com
Cc: Montrose, Ernest
Subject: Re: [Drbd-dev] DRBD8: Resync of device PauseSync state does not
resume after an I/O error.

Am Montag, 26. Februar 2007 22:30 schrieb Montrose, Ernest:
> Hi all,
> Looks like what's going on is that on an I/O error during resync (on
the
> sync source), the io error handler set the new state to
> "Connected" and after_state_ch() is not called but scheduled it seems.
> Next time after_state_ch()
> is called the conn state is "Connected" for both old and new and the
> disk state is Diskless.
> We do not cal resume_next_sg() for this combination of state.  Could
it
> be as simple as this patch?

Hi Ernest,

Ok, I now understand what was going on there. The __drbd_chk_io_error()
functions sets the disk to failed.
As a consequence in _drbd_set_state:

	if( ns.conn > Connected && (ns.disk <= Failed || ns.pdsk <=
Failed )) {
		warn_sync_abort=1;
		ns.conn = Connected;
	}

The ns gets set to Connected. But the after_state_ch() is not called nor
scheduled...


I propose to fix it with this patch. Could you please test this patch?
If this patches fixes the issue as well ?

--- drbd_int.h  (revision 2773)
+++ drbd_int.h  (working copy)
@@ -1473,7 +1473,8 @@
        case Detach:
        case CallIOEHelper:
                if (mdev->state.disk > Failed) {
-
_drbd_set_state(_NS(mdev,disk,Failed),ChgStateHard);
+                       _drbd_set_state(_NS(mdev,disk,Failed),
+                                       ChgStateHard|ScheduleAfter);
                        ERR("Local IO failed. Detaching...\n");
                }
                break;

In case it does, I will commit this, since it is the more generic fix 
to the issue. 

-Phil
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria        http://www.linbit.com :

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

* RE: [Drbd-dev] DRBD8: Resync of device PauseSync state does not resume after an I/O error.
@ 2007-03-02 15:26 Montrose, Ernest
  0 siblings, 0 replies; 4+ messages in thread
From: Montrose, Ernest @ 2007-03-02 15:26 UTC (permalink / raw)
  To: Philipp Reisner, drbd-dev

Phil,
I just tested it! The patch works just fine. Please check it in.

EM--

-----Original Message-----
From: Philipp Reisner [mailto:philipp.reisner@linbit.com] 
Sent: Friday, March 02, 2007 8:33 AM
To: drbd-dev@linbit.com
Cc: Montrose, Ernest
Subject: Re: [Drbd-dev] DRBD8: Resync of device PauseSync state does not
resume after an I/O error.

Am Montag, 26. Februar 2007 22:30 schrieb Montrose, Ernest:
> Hi all,
> Looks like what's going on is that on an I/O error during resync (on
the
> sync source), the io error handler set the new state to
> "Connected" and after_state_ch() is not called but scheduled it seems.
> Next time after_state_ch()
> is called the conn state is "Connected" for both old and new and the
> disk state is Diskless.
> We do not cal resume_next_sg() for this combination of state.  Could
it
> be as simple as this patch?

Hi Ernest,

Ok, I now understand what was going on there. The __drbd_chk_io_error()
functions sets the disk to failed.
As a consequence in _drbd_set_state:

	if( ns.conn > Connected && (ns.disk <= Failed || ns.pdsk <=
Failed )) {
		warn_sync_abort=1;
		ns.conn = Connected;
	}

The ns gets set to Connected. But the after_state_ch() is not called nor
scheduled...


I propose to fix it with this patch. Could you please test this patch?
If this patches fixes the issue as well ?

--- drbd_int.h  (revision 2773)
+++ drbd_int.h  (working copy)
@@ -1473,7 +1473,8 @@
        case Detach:
        case CallIOEHelper:
                if (mdev->state.disk > Failed) {
-
_drbd_set_state(_NS(mdev,disk,Failed),ChgStateHard);
+                       _drbd_set_state(_NS(mdev,disk,Failed),
+                                       ChgStateHard|ScheduleAfter);
                        ERR("Local IO failed. Detaching...\n");
                }
                break;

In case it does, I will commit this, since it is the more generic fix 
to the issue. 

-Phil
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria        http://www.linbit.com :

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

end of thread, other threads:[~2007-03-02 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-26 21:30 [Drbd-dev] DRBD8: Resync of device PauseSync state does not resume after an I/O error Montrose, Ernest
2007-03-02 13:33 ` Philipp Reisner
  -- strict thread matches above, loose matches on Subject: below --
2007-03-02 13:35 Montrose, Ernest
2007-03-02 15:26 Montrose, Ernest

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