From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-general@postgresql.org
Subject: Re: backends stuck in "startup"
Date: Wed, 22 Nov 2017 13:27:12 -0500
Message-ID: <27867.1511375232@sss.pgh.pa.us> (raw)
In-Reply-To: <20171122064702.GQ5668@telsasoft.com>
References: <20171121230926.GA17194@telsasoft.com>
<20171121234027.b4n4jlsfda42qb6r@alap3.anarazel.de>
<20171122064702.GQ5668@telsasoft.com>
Justin Pryzby <pryzby@telsasoft.com> writes:
> On Tue, Nov 21, 2017 at 03:40:27PM -0800, Andres Freund wrote:
>> Could you try stracing next time?
> I straced all the "startup" PIDs, which were all in futex, without exception:
If you've got debug symbols installed, could you investigate the states
of the LWLocks the processes are stuck on?
My hypothesis about a missed memory barrier would imply that there's (at
least) one process that's waiting but is not in the lock's wait queue and
has MyProc->lwWaiting == false, while the rest are in the wait queue and
have MyProc->lwWaiting == true. Actually chasing through the list
pointers would be slightly tedious, but checking MyProc->lwWaiting,
and maybe MyProc->lwWaitMode, in each process shouldn't be too hard.
Also verify that they're all waiting for the same LWLock (by address).
I recognize Andres' point that on x86 lock-prefixed instructions should
be full memory barriers, and at least on my Linux machines, there do
seem to be lock-prefixed instructions in the fast paths through sem_wait
and sem_post. But the theory fits the reported evidence awfully well,
and we have no other theory that fits at all.
[ in an earlier post: ]
> BTW this is a VM run on a hypervisor managed by our customer:
> DMI: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 06/22/2012
Hmm. Can't avoid the suspicion that that's relevant somehow.
regards, tom lane
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, pryzby@telsasoft.com, andres@anarazel.de
Subject: Re: backends stuck in "startup"
In-Reply-To: <27867.1511375232@sss.pgh.pa.us>
References: <20171121230926.GA17194@telsasoft.com> <20171121234027.b4n4jlsfda42qb6r@alap3.anarazel.de> <20171122064702.GQ5668@telsasoft.com> <27867.1511375232@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