pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexey Ermakov <alexey.ermakov@dataegret.com>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16016: deadlock with startup process, AccessExclusiveLock on pg_statistic's toast table
Date: Sat, 02 Nov 2019 11:10:06 -0400
Message-ID: <30149.1572707406@sss.pgh.pa.us> (raw)
In-Reply-To: <5DBBF7B5.6040002@dataegret.com>
References: <16016-ed0345229ddc484c@postgresql.org>
	<158201568991600@myt5-2a1eccb4c218.qloud-c.yandex.net>
	<21601.1569179167@sss.pgh.pa.us>
	<5DBBF7B5.6040002@dataegret.com>

Alexey Ermakov <alexey.ermakov@dataegret.com> writes:
> On 9/23/19 01:06, Tom Lane wrote:
>> If you have a test case, could you collect stack traces from each
>> of the stuck processes?  That would eliminate a lot of hypothesizing.

> I reproduced Sergei's test case on postgresql 11.5, replica hung up 
> almost immediately after pgbench ran.

> stack trace of startup process 9907:
> #0  0x00007fdff4a025b3 in __select_nocancel () at 
> ../sysdeps/unix/syscall-template.S:84
> #1  0x00005608fde0c6cd in pg_usleep (microsec=<optimized out>) at 
> /build/postgresql-11-d6c2wG/postgresql-11-11.5/build/../src/port/pgsleep.c:56
> #2  0x00005608fdc94126 in WaitExceedsMaxStandbyDelay () at 
> /build/postgresql-11-d6c2wG/postgresql-11-11.5/build/../src/backend/storage/ipc/standby.c:201
> #3  ResolveRecoveryConflictWithVirtualXIDs (waitlist=0x5608fe46a450, 
> reason=reason@entry=PROCSIG_RECOVERY_CONFLICT_SNAPSHOT) at 
> /build/postgresql-11-d6c2wG/postgresql-11-11.5/build/../src/backend/storage/ipc/standby.c:262

This does not look like a deadlock: the startup process is just biding
its time until the standby delay timeout elapses, after which it's
gonna kill the conflicting queries.

It is, perhaps, arguable that it's a damn bad idea to allow
max_standby_streaming_delay or max_standby_archive_delay to be
set to "forever".

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <30149.1572707406@sss.pgh.pa.us>
Permalink:  ../30149.1572707406@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30149.1572707406@sss.pgh.pa.us

 · 

reply

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alexey.ermakov@dataegret.com, sk@zsrv.org
  Subject: Re: BUG #16016: deadlock with startup process, AccessExclusiveLock on pg_statistic's toast table
  In-Reply-To: <30149.1572707406@sss.pgh.pa.us>
  References: <16016-ed0345229ddc484c@postgresql.org> <158201568991600@myt5-2a1eccb4c218.qloud-c.yandex.net> <21601.1569179167@sss.pgh.pa.us> <5DBBF7B5.6040002@dataegret.com> <30149.1572707406@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