pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fred Habash <fmhabash@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Autovacuum Hung Due to Bufferpin
Date: Wed, 11 Jan 2023 10:32:10 -0500
Message-ID: <493122.1673451130@sss.pgh.pa.us> (raw)
In-Reply-To: <CADpeV5xH6pjTO-fX8gufAXN2r_09C6WVNsDdriWpWV5tkyV-Ug@mail.gmail.com>
References: <CADpeV5xH6pjTO-fX8gufAXN2r_09C6WVNsDdriWpWV5tkyV-Ug@mail.gmail.com>

Fred Habash <fmhabash@gmail.com> writes:
> pg_locks shows no blockers while this is happening. This view shows a
> constant 13 sessions running SELECT statements on this table posting
> AccessShareLock. Of course, these is also the AV sessions
> with ShareUpdateExclusiveLock
> ...
> Why is AV blocked by bufferpin given the fact that this table does not get
> an DML changes. It is purely read only. What can be done to resolve this?

Apparently there has been some DML on it in the past, leaving dead rows
that vacuum now needs to clean up --- but it needs a transient buffer
lock for long enough to do that.  If you have a constant stream of readers
it will never be able to get that lock.  You'll need to find a way to
momentarily block those readers.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <493122.1673451130@sss.pgh.pa.us>
Permalink:  ../493122.1673451130@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/493122.1673451130@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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, fmhabash@gmail.com
  Subject: Re: Autovacuum Hung Due to Bufferpin
  In-Reply-To: <493122.1673451130@sss.pgh.pa.us>
  References: <CADpeV5xH6pjTO-fX8gufAXN2r_09C6WVNsDdriWpWV5tkyV-Ug@mail.gmail.com> <493122.1673451130@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