pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Relax overly strict assertion
Date: Tue, 12 Feb 2019 21:59:25 +0000
Message-ID: <E1gtg5N-0005Rd-AF@gemulon.postgresql.org> (raw)

Relax overly strict assertion

Ever since its birth, ReorderBufferBuildTupleCidHash() has contained an
assertion that a catalog tuple cannot change Cmax after acquiring one.  But
that's wrong: if a subtransaction executes DDL that affects that catalog
tuple, and later aborts and another DDL affects the same tuple, it will
change Cmax.  Relax the assertion to merely verify that the Cmax remains
valid and monotonically increasing, instead.

Add a test that tickles the relevant code.

Diagnosed by, and initial patch submitted by: Arseny Sher
Co-authored-by: Arseny Sher
Discussion: https://postgr.es/m/874l9p8hyw.fsf@ars-thinkpad

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/45ed482f1a899dbf5b0db13686d817718ae8cf97

Modified Files
--------------
contrib/test_decoding/expected/ddl.out          | 18 ++++++++++++++++++
contrib/test_decoding/sql/ddl.sql               | 13 +++++++++++++
src/backend/replication/logical/reorderbuffer.c | 14 +++++++++-----
3 files changed, 40 insertions(+), 5 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1gtg5N-0005Rd-AF@gemulon.postgresql.org>
Permalink:  ../E1gtg5N-0005Rd-AF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gtg5N-0005Rd-AF@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Relax overly strict assertion
  In-Reply-To: <E1gtg5N-0005Rd-AF@gemulon.postgresql.org>
  References: <E1gtg5N-0005Rd-AF@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