pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Avoid pin scan for replay of XLOG_BTREE_VACUUM
Date: Sun, 10 Jan 2016 11:32:05 -0500
Message-ID: <CA+TgmoY3ztEe8PJnYu_goAmyUXYjDaBbDhf-puBTjADS8GtpfQ@mail.gmail.com> (raw)
In-Reply-To: <E1aHqWV-0004Mo-C9@gemulon.postgresql.org>
References: <E1aHqWV-0004Mo-C9@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Sat, Jan 9, 2016 at 5:13 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> Avoid pin scan for replay of XLOG_BTREE_VACUUM
> Replay of XLOG_BTREE_VACUUM during Hot Standby was previously thought to require
> complex interlocking that matched the requirements on the master. This required
> an O(N) operation that became a significant problem with large indexes, causing
> replication delays of seconds or in some cases minutes while the
> XLOG_BTREE_VACUUM was replayed.
>
> This commit skips the “pin scan” that was previously required, by observing in
> detail when and how it is safe to do so, with full documentation. The pin scan
> is skipped only in replay; the VACUUM code path on master is not touched here.
>
> The current commit still performs the pin scan for toast indexes, though this
> can also be avoided if we recheck scans on toast indexes. Later patch will
> address this.
>
> No tests included. Manual tests using an additional patch to view WAL records
> and their timing have shown the change in WAL records and their handling has
> successfully reduced replication delay.

I suspect I might be missing something here, but I don't see how a
test against rel->rd_rel->relnamespace can work during recovery.
Won't the relcache entry we're looking at here be one created by
CreateFakeRelcacheEntry(), and thus that field won't be valid?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (14+ messages)  latest in thread

Message-ID: <CA+TgmoY3ztEe8PJnYu_goAmyUXYjDaBbDhf-puBTjADS8GtpfQ@mail.gmail.com>
Permalink:  ../CA+TgmoY3ztEe8PJnYu_goAmyUXYjDaBbDhf-puBTjADS8GtpfQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CA+TgmoY3ztEe8PJnYu_goAmyUXYjDaBbDhf-puBTjADS8GtpfQ@mail.gmail.com

 · 

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: robertmhaas@gmail.com, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Avoid pin scan for replay of XLOG_BTREE_VACUUM
  In-Reply-To: <CA+TgmoY3ztEe8PJnYu_goAmyUXYjDaBbDhf-puBTjADS8GtpfQ@mail.gmail.com>
  References: <E1aHqWV-0004Mo-C9@gemulon.postgresql.org> <CA+TgmoY3ztEe8PJnYu_goAmyUXYjDaBbDhf-puBTjADS8GtpfQ@mail.gmail.com>

* 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