pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix nextXid tracking bug on standbys (9.5-11 only).
Date: Thu, 12 Mar 2020 05:19:47 +0000
Message-ID: <E1jCGG3-0004zF-9q@gemulon.postgresql.org> (raw)

Fix nextXid tracking bug on standbys (9.5-11 only).

RecordKnownAssignedTransactionIds() should never move
nextXid backwards.  Before this commit, that could happen
if some other code path had advanced it without advancing
latestObservedXid.

One consequence is that a well timed XLOG_CHECKPOINT_ONLINE
could cause hot standby feedback messages to get confused
and report an xmin from a future epoch, potentially allowing
vacuum to run too soon on the primary.

Repair, by making sure RecordKnownAssignedTransactionIds()
can only move nextXid forwards.

In release 12 and master, this was already done by commit
2fc7af5e, which consolidated similar code and straightened
out this bug.  Back-patch to supported releases before that.

Author: Eka Palamadai <ekanatha@amazon.com>
Discussion: https://postgr.es/m/98BB4805-D0A2-48E1-96F4-15014313EADC@amazon.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e8cad2da36adff877c81d8c336d7c28ed19ebae

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1jCGG3-0004zF-9q@gemulon.postgresql.org>
Permalink:  ../E1jCGG3-0004zF-9q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jCGG3-0004zF-9q@gemulon.postgresql.org

 · 

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: tmunro@postgresql.org
  Subject: Re: pgsql: Fix nextXid tracking bug on standbys (9.5-11 only).
  In-Reply-To: <E1jCGG3-0004zF-9q@gemulon.postgresql.org>
  References: <E1jCGG3-0004zF-9q@gemulon.postgresql.org>

* 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