Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6I6b-0000Id-NK for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Nov 2016 14:19:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c6I6b-0006P4-A0 for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Nov 2016 14:19:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c6I5w-0005gF-5U for pgsql-bugs@postgresql.org; Mon, 14 Nov 2016 14:18:48 +0000 Received: from mail.windfish.net ([23.253.200.25]) by magus.postgresql.org with esmtps (TLS1.1:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1c6I5s-0006vS-MQ for pgsql-bugs@postgresql.org; Mon, 14 Nov 2016 14:18:47 +0000 Received: by mail.windfish.net (Postfix, from userid 33) id 5F153769B9; Mon, 14 Nov 2016 09:18:42 -0500 (EST) To: Amit Kapila Subject: Re: BUG #14420: Parallel worker segfault X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_3ebba8fe651c9f809c00e07e1cdafbe1" Date: Mon, 14 Nov 2016 09:18:42 -0500 From: Rick Otten Cc: PostgreSQL Bugs In-Reply-To: References: <20161111220657.8761.83720@wrigleys.postgresql.org> <23d5d401864407121a11571797701e2e@www.windfish.net> Message-ID: <8029759f8564c4960af1d15a544a8826@www.windfish.net> X-Sender: rotten@windfish.net User-Agent: Roundcube Webmail/1.0.3 X-Pg-Spam-Score: -4.7 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --=_3ebba8fe651c9f809c00e07e1cdafbe1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sorry about forgetting to CC the bugs list when I replied. I've enabled "-c", and made sure my PGDATA directory has enough space to collect a full core image. If we get one, I'll let you know. There were a lot of queries happening at the time of the seg fault. The only new or unusual one that I am aware of was doing a UNION ALL, between two nearly identical queries, where one side was doing a parallel query scan, and the other side wasn't. I had just refactored it from using an "OR" operand in the WHERE clause because it was much faster that way. Since Friday I ran another 1M or so of those queries, but it hasn't seg faulted again. On 2016-11-12 02:18, Amit Kapila wrote: > On Sat, Nov 12, 2016 at 9:32 AM, Rick Otten wrote: > > Please keep pgsql-bugs in the loop. It is important to keep everyone > in the loop not only because it is a way to work in this community, > but also because others can see something which I or you can't see. > >> PostgreSQL was not started with the "-c" option. I'll look into enabling that before this happens again. > > makes sense. > >> I'll read more from the other debugging article and see if there is anything I can do there as well. Thanks. There were no files generated and dropped in PGDATA this time, unfortunately. Sorry, I know this isn't much to go on, but it is all I know at this time. There wasn't much else that wasn't routine in the logs before or after the two lines I pasted below other than a bunch of warnings for the the 30 or 40 transactions that were in progress followed by this: > > Okay, I think we can't get anything from these logs. I think once > core is available, we can try to find the reason, but it would be much > better if we can generate an independent test to reproduce this > problem. One possible way could be to find the culprit query. You > might want to log long-running queries, as parallelism will generally > be used for such queries. > >> 2016-11-11 21:31:26.292 UTC WARNING: terminating connection because of crash of another server process 2016-11-11 21:31:26.292 UTC DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2016-11-11 21:31:26.292 UTC HINT: In a moment you should be able to reconnect to the database and repeat your command. 2016-11-11 21:31:26.301 UTC WARNING: terminating connection because of crash of another server process 2016-11-11 21:31:26.301 UTC DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. 2016-11-11 21:31:26.301 UTC HINT: In a moment you should be able to reconnect to the database and repeat your command. 2016-11-11 21:31:30.762 UTC [unknown] x.x.x.x [unknown] LOG: connection received: host=x.x.x.x port=47692 2016-11-11 21:31:30.762 UTC clarivoy x.x.x.x some_user FATAL: the database system is in recovery mode 2016-11-11 21:31:31.766 UTC LOG: all server processes terminated; reinitializing 2016-11-11 21:31:33.526 UTC LOG: database system was interrupted; last known up at 2016-11-11 21:29:28 UTC 2016-11-11 21:31:33.660 UTC LOG: database system was not properly shut down; automatic recovery in progress 2016-11-11 21:31:33.674 UTC LOG: redo starts at 1DD/4F5A0320 2016-11-11 21:31:33.957 UTC LOG: unexpected pageaddr 1DC/16AEC000 in log segment 00000001000001DD00000056, offset 11452416 2016-11-11 21:31:33.958 UTC LOG: redo done at 1DD/56AEB7F8 2016-11-11 21:31:33.958 UTC LOG: last completed transaction was at log time 2016-11-11 21:31:26.07448+00 2016-11-11 21:31:34.705 UTC LOG: MultiXact member wraparound protections are now enabled 2016-11-11 21:31:34.724 UTC LOG: autovacuum launcher started 2016-11-11 21:31:34.725 UTC LOG: database system is ready to accept connections After that the database was pretty much back to normal. Because everything connects from various pgbouncer instances running elsewhere, they quickly reconnected and started working again without having to restart any applications or services. --=_3ebba8fe651c9f809c00e07e1cdafbe1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

Sorry about forgetting to CC the bugs list when I replied.

I've enabled "-c", and made sure my PGDATA directory has enough space to= collect a full core image.  If we get one, I'll let you know.

There were a lot of queries happening at the time of the seg fault. &nbs= p;The only new or unusual one that I am aware of was doing a UNION ALL, bet= ween two nearly identical queries, where one side was doing a parallel quer= y scan, and the other side wasn't.  I had just refactored it from usin= g an "OR" operand in the WHERE clause because it was much faster that way= =2E

Since Friday I ran another 1M or so of those queries, but it hasn't seg = faulted again.

 

On 2016-11-12 02:18, Amit Kapila wrote:

On Sat, Nov 12, 2016 at 9:32 AM, Rick Otten <rotten@windfish.net> wrote:

Please keep pgsql-bugs in the loop.  It is important to keep everyone
in the loop not only because it is a way to work in this community,
but also because others can see something which I or you can't see.
PostgreSQL was not started with the "-c" option= =2E I'll look into enabling that before this happens again.
makes sense.
I'll read more from the other debugging article a= nd see if there is anything I can do there as well. Thanks. There were no f= iles generated and dropped in PGDATA this time, unfortunately. Sorry, I kno= w this isn't much to go on, but it is all I know at this time. There wasn't= much else that wasn't routine in the logs before or after the two lines I = pasted below other than a bunch of warnings for the the 30 or 40 transactio= ns that were in progress followed by this:
Okay, I think we can't get anything from these logs.  I think once
core is available, we can try to find the reason, but it would be much
better if we can generate an independent test to reproduce this
problem.  One possible way could be to find the culprit query.  You
might want to log long-running queries, as parallelism will generally
be used for such queries.
2016-11-11 21:31:26.292 UTC WARNING: terminating = connection because of crash of another server process 2016-11-11 21:31:26= =2E292 UTC DETAIL: The postmaster has commanded this server process to roll= back the current transaction and exit, because another server process exit= ed abnormally and possibly corrupted shared memory. 2016-11-11 21:31:26.292= UTC HINT: In a moment you should be able to reconnect to the database and = repeat your command. 2016-11-11 21:31:26.301 UTC WARNING: terminating conne= ction because of crash of another server process 2016-11-11 21:31:26.301 UT= C DETAIL: The postmaster has commanded this server process to roll back the= current transaction and exit, because another server process exited abnorm= ally and possibly corrupted shared memory. 2016-11-11 21:31:26.301 UTC HINT= : In a moment you should be able to reconnect to the database and repeat yo= ur command. 2016-11-11 21:31:30.762 UTC [unknown] x.x.x.x [unknown] LOG: co= nnection received: host=3Dx.x.x.x port=3D47692 2016-11-11 21:31:30.762 UTC = clarivoy x.x.x.x some_user FATAL: the database system is in recovery mode 2= 016-11-11 21:31:31.766 UTC LOG: all server processes terminated; reinitiali= zing 2016-11-11 21:31:33.526 UTC LOG: database system was interrupted; last= known up at 2016-11-11 21:29:28 UTC 2016-11-11 21:31:33.660 UTC LOG: datab= ase system was not properly shut down; automatic recovery in progress 2016-= 11-11 21:31:33.674 UTC LOG: redo starts at 1DD/4F5A0320 2016-11-11 21:31:33= =2E957 UTC LOG: unexpected pageaddr 1DC/16AEC000 in log segment 00000001000= 001DD00000056, offset 11452416 2016-11-11 21:31:33.958 UTC LOG: redo done a= t 1DD/56AEB7F8 2016-11-11 21:31:33.958 UTC LOG: last completed transaction = was at log time 2016-11-11 21:31:26.07448+00 2016-11-11 21:31:34.705 UTC LO= G: MultiXact member wraparound protections are now enabled 2016-11-11 21:31= :34.724 UTC LOG: autovacuum launcher started 2016-11-11 21:31:34.725 UTC LO= G: database system is ready to accept connections After that the database w= as pretty much back to normal. Because everything connects from various pgb= ouncer instances running elsewhere, they quickly reconnected and started wo= rking again without having to restart any applications or services.

 

--=_3ebba8fe651c9f809c00e07e1cdafbe1--