problems with hast

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Feb 5 09:47:34 UTC 2012


On Sun, Jan 29, 2012 at 12:35:35AM +0200, Mikolaj Golub wrote:
> Investigating, it looks after r226859, when 'async' mode was added, we have 2
> issues with synchronization from secondary to master (rather very rear case
> normally):
> 
> 1) When the synchronization from secondary to master is running and primary
> gets READ request, the request should be sent to the secondary but actually it
> is lost. As a result READ operation gets stuck. After the syncronization is
> complete the following READ requests, which now can be served by primary, work
> ok.
> 
> 2) In async mode, for syncronization requests, write_complete() function,
> which sends G_GATE_CMD_DONE command to ggate, is called twice and the second
> call fails.
> 
> Artem, did you run async mode? If you did then I suppose you observed the
> second issue. Could you please try the attached patch?

The analysis and fixes look good to me, please go ahead and commit
(small nits below).

> Index: sbin/hastd/primary.c
> ===================================================================
> --- sbin/hastd/primary.c	(revision 230661)
> +++ sbin/hastd/primary.c	(working copy)
> @@ -1255,7 +1255,7 @@ ggate_recv_thread(void *arg)
>  		pjdlog_debug(2,
>  		    "ggate_recv: (%p) Moving request to the send queues.", hio);
>  		refcount_init(&hio->hio_countdown, ncomps);
> -		for (ii = ncomp; ii < ncomps; ii++)
> +		for (ii = ncomp; ncomps != 0; ncomps--, ii++)

I'd prefer not to modify ncomps in the loop, maybe something like this:

		for (ii = ncomp; ii < ncomp + ncomps; ii++)

>  			QUEUE_INSERT1(hio, send, ii);
>  	}
>  	/* NOTREACHED */
> @@ -1326,7 +1326,7 @@ local_send_thread(void *arg)
>  			} else {
>  				hio->hio_errors[ncomp] = 0;
>  				if (hio->hio_replication ==
> -				    HAST_REPLICATION_ASYNC) {
> +				    HAST_REPLICATION_ASYNC && !ISSYNCREQ(hio)) {

Could you move this additional check to separate line?

Thanks!

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20120205/3b41cb28/attachment.pgp


More information about the freebsd-stable mailing list