pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-committers@lists.postgresql.org, Peter Geoghegan <pg@bowt.ie>
Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary.
Date: Thu, 28 Mar 2019 05:28:47 -0700
Message-ID: <20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de> (raw)
In-Reply-To: <CA+hUKGLCwPF0S4Mk7S8qw+DK0Bq65LueN9rofAA3HHSYikW-Zw@mail.gmail.com>
References: <E1h8w5d-0006c7-16@gemulon.postgresql.org>
	<CA+hUKGLCwPF0S4Mk7S8qw+DK0Bq65LueN9rofAA3HHSYikW-Zw@mail.gmail.com>

On 2019-03-28 17:34:52 +1300, Thomas Munro wrote:
> On Wed, Mar 27, 2019 at 1:06 PM Andres Freund <andres@anarazel.de> wrote:
> > Compute XID horizon for page level index vacuum on primary.
> 
> Hi Andres,
> 
> I have a virtual machine running FreeBSD 12.0 on i386 on which
> contrib/test_decoding consistently self-deadlocks in the "rewrite"
> test, with the stack listed below.  You can see that we wait for a
> share lock that we already hold exclusively.  Peter Geoghegan spotted
> the problem: this code path shouldn't access syscache, or at least not
> for a catalog table.  He suggested something along these lines:
> 
> --- a/src/backend/access/heap/heapam.c
> +++ b/src/backend/access/heap/heapam.c
> @@ -6977,7 +6977,10 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
>          * simplistic, but at the moment there is no evidence of that
> or any idea
>          * about what would work better.
>          */
> -       io_concurrency =
> get_tablespace_io_concurrency(rel->rd_rel->reltablespace);
> +       if (IsCatalogRelation(rel))
> +               io_concurrency = 1;
> +       else
> +               io_concurrency =
> get_tablespace_io_concurrency(rel->rd_rel->reltablespace);
>         prefetch_distance = Min((io_concurrency) + 10, MAX_IO_CONCURRENCY);

Hm, good catch.  I don't like this fix very much (even if it were
commented), but I don't have a great idea right now.  I'm mildly
inclined to take effective_io_concurrency into account even if we can't
use get_tablespace_io_concurrency - that should be doable from a
locking POV.

Do you want to apply the above?

- Andres





view thread (30+ messages)  latest in thread

Message-ID: <20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de>
Permalink:  ../20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de

 · 

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-committers@postgresql.org
  Cc: andres@anarazel.de, thomas.munro@gmail.com, pg@bowt.ie
  Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary.
  In-Reply-To: <20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de>
  References: <E1h8w5d-0006c7-16@gemulon.postgresql.org> <CA+hUKGLCwPF0S4Mk7S8qw+DK0Bq65LueN9rofAA3HHSYikW-Zw@mail.gmail.com> <20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de>

* 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