From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Parallel pg_dump's error reporting doesn't work worth squat
Date: Tue, 31 May 2016 12:29:50 -0400
Message-ID: <7445.1464712190@sss.pgh.pa.us> (raw)
In-Reply-To: <20160531.180204.85313767.horiguchi.kyotaro@lab.ntt.co.jp>
References: <20160526.105701.64908801.horiguchi.kyotaro@lab.ntt.co.jp>
<20160526.152559.266074794.horiguchi.kyotaro@lab.ntt.co.jp>
<14603.1464369620@sss.pgh.pa.us>
<20160531.180204.85313767.horiguchi.kyotaro@lab.ntt.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> At Fri, 27 May 2016 13:20:20 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in <14603.1464369620@sss.pgh.pa.us>
>> Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
>>> By the way, the reason of the "invalid snapshot identifier" is
>>> that some worker threads try to use it after the connection on
>>> the first worker closed.
>> ... BTW, I don't quite see what the issue is there.
> The master session died from lack of libz and the failure of
> compressLevel's propagation already fixed. Some of the children
> that started transactions after the master's death will get the
> error.
I don't think I believe that theory, because it would require the master
to not notice the lack of libz before it launches worker processes, but
instead while the workers are working. But AFAICS, while there are worker
processes open, the master does nothing except wait for workers and
dispatch new jobs to them; it does no database work of its own. So the
libz-isn't-there error has to have occurred in one of the workers.
> If we want prevent it perfectly, one solution could be that
> non-master children explicitly wait the master to arrive at the
> "safe" state before starting their transactions. But I suppose it
> is not needed here.
Actually, I believe the problem is in archive_close_connection, around
line 295 in HEAD: once the master realizes that one child has failed,
it first closes its own database connection and only second tries to kill
the remaining children. So there's a race condition wherein remaining
children have time to see the missing-snapshot error.
In the patch I posted yesterday, I reversed the order of those two
steps, which should fix this problem in most scenarios:
https://www.postgresql.org/message-id/7005.1464657274@sss.pgh.pa.us
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, horiguchi.kyotaro@lab.ntt.co.jp
Subject: Re: Parallel pg_dump's error reporting doesn't work worth squat
In-Reply-To: <7445.1464712190@sss.pgh.pa.us>
References: <20160526.105701.64908801.horiguchi.kyotaro@lab.ntt.co.jp> <20160526.152559.266074794.horiguchi.kyotaro@lab.ntt.co.jp> <14603.1464369620@sss.pgh.pa.us> <20160531.180204.85313767.horiguchi.kyotaro@lab.ntt.co.jp> <7445.1464712190@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox