Date: Sun, 5 Feb 2012 10:27:54 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Mikolaj Golub <trociny@freebsd.org> Cc: Artem Kajalainen <artem@kayalaynen.ru>, freebsd-stable@freebsd.org Subject: Re: problems with hast Message-ID: <20120205092753.GA30033@garage.freebsd.pl> In-Reply-To: <86ipjvbglk.fsf@kopusha.home.net> References: <CAGS-ug=KPuuDHTYYcVFrk4D3Q=PhJtEfb4%2B1NknU-Qfu9pJZNw@mail.gmail.com> <86ipjvbglk.fsf@kopusha.home.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)
iEYEARECAAYFAk8uS5gACgkQForvXbEpPzRQPwCfXj+FSNO47V13eoRL1DJwuHWK
zlcAoNBPW26Lz+CvQcs48kYXlFFVBarV
=07jR
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120205092753.GA30033>
