pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: ENOSPC FailedAssertion("!(RefCountErrors == 0)"
Date: Mon, 16 Jul 2018 10:39:26 -0400
Message-ID: <20436.1531751966@sss.pgh.pa.us> (raw)
In-Reply-To: <20180716131337.usestwjviwwocpyz@alap3.anarazel.de>
References: <20180627233939.GA10276@telsasoft.com>
	<20180628020432.GB11054@paquier.xyz>
	<7317.1531694923@sss.pgh.pa.us>
	<20180716131337.usestwjviwwocpyz@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2018-07-15 18:48:43 -0400, Tom Lane wrote:
>> So basically, WAL replay hits an error while holding a buffer pin, and
>> nothing is done to release the buffer pin, but AtProcExit_Buffers thinks
>> something should have been done.

> I think there's a few other cases where we hit this. I've seen something
> similar from inside checkpointer / BufferSync(). I'd be surprised if
> bgwriter couldn't be triggered into the same.

Hm, yeah, on reflection it's pretty obvious that those are hazard cases.

> I'm pretty sure that we do *not* force a panic on all nonzero-exit-code
> cases for other subprocesses.

That's my recollection as well -- mostly, we just start a new one.

So I said I didn't want to do extra work on this, but I am looking into
fixing it by having these aux process types run a ResourceOwner that can
be told to clean up any open buffer pins at exit.  We could be sure the
coverage is complete by dint of removing the special-case code in
resowner.c that allows buffer pins to be taken with no active resowner.
Then CheckForBufferLeaks can be left as-is, ie something we do only
in assert builds.

			regards, tom lane




view thread (15+ messages)  latest in thread

Message-ID: <20436.1531751966@sss.pgh.pa.us>
Permalink:  ../20436.1531751966@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20436.1531751966@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, michael@paquier.xyz, pryzby@telsasoft.com
  Subject: Re: ENOSPC FailedAssertion("!(RefCountErrors == 0)"
  In-Reply-To: <20436.1531751966@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