pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Avoid duplicate XIDs at recovery when building initial snapshot
Date: Sat, 1 Dec 2018 08:08:04 +0900
Message-ID: <20181130230804.GC1846@paquier.xyz> (raw)
In-Reply-To: <CANP8+jKCbqqMSBeJFZWM0PT8Zf=ex13oYsN-Bcfze+_dTz-R9w@mail.gmail.com>
References: <20181022174155.wxxu2qt3bcrbrqy5@alap3.anarazel.de>
	<20181022221538.d73yxdypbmmzmi2l@alvherre.pgsql>
	<20181023014338.GA1658@paquier.xyz>
	<20181101060911.GG1727@paquier.xyz>
	<CANP8+jKCbqqMSBeJFZWM0PT8Zf=ex13oYsN-Bcfze+_dTz-R9w@mail.gmail.com>

On Fri, Nov 30, 2018 at 02:55:47PM +0000, Simon Riggs wrote:
> 1df21ddb looks OK to me and was simple enough to backpatch safely.

Thanks for the feedback!

> Seems excessive to say that the WAL record is corrupt, it just contains
> duplicates, just as exported snapshots do. There's a few other imprecise
> things around in WAL, that is why we need the RunningXact data in the first
> place. So we have a choice of whether to remove the duplicates eagerly or
> lazily.
> 
> For GetRunningTransactionData(), we can do eager or lazy, since its not a
> foreground process. I don't object to changing it to be eager in this path,
> but this patch is more complex than 1df21ddb and I don't think we should
> backpatch this change, assuming it is acceptable.

Yes, I would avoid a backpatch for this more complicated one, and
we need a solution for already-generated WAL.  It is not complicated to
handle duplicates for xacts and subxacts however holding ProcArrayLock
for a longer time stresses me as it is already a bottleneck.

> This patch doesn't do it, but the suggestion that we touch
> GetSnapshotData() in the same way so we de-duplicate eagerly is a different
> matter and would need careful performance testing to ensure we don't slow
> down 2PC users.

Definitely.  That's a much hotter code path.  I am not completely sure
if that's an effort worth pursuing either..
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (20+ messages)  latest in thread

Message-ID: <20181130230804.GC1846@paquier.xyz>
Permalink:  ../20181130230804.GC1846@paquier.xyz/
Also on:    postgresql.org/message-id/20181130230804.GC1846@paquier.xyz

 · 

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: michael@paquier.xyz, simon@2ndquadrant.com, alvherre@2ndquadrant.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Avoid duplicate XIDs at recovery when building initial snapshot
  In-Reply-To: <20181130230804.GC1846@paquier.xyz>
  References: <20181022174155.wxxu2qt3bcrbrqy5@alap3.anarazel.de> <20181022221538.d73yxdypbmmzmi2l@alvherre.pgsql> <20181023014338.GA1658@paquier.xyz> <20181101060911.GG1727@paquier.xyz> <CANP8+jKCbqqMSBeJFZWM0PT8Zf=ex13oYsN-Bcfze+_dTz-R9w@mail.gmail.com> <20181130230804.GC1846@paquier.xyz>

* 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