pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transact
Date: Sat, 30 Jan 2021 08:36:48 +0000
Message-ID: <E1l5lkO-0004a3-1i@gemulon.postgresql.org> (raw)

Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transactions.

In a cluster having used CREATE INDEX CONCURRENTLY while having enabled
prepared transactions, queries that use the resulting index can silently
fail to find rows.  Fix this for future CREATE INDEX CONCURRENTLY by
making it wait for prepared transactions like it waits for ordinary
transactions.  This expands the VirtualTransactionId structure domain to
admit prepared transactions.  It may be necessary to reindex to recover
from past occurrences.  Back-patch to 9.5 (all supported versions).

Andrey Borodin, reviewed (in earlier versions) by Tom Lane and Michael
Paquier.

Discussion: https://postgr.es/m/2E712143-97F7-4890-B470-4A35142ABC82@yandex-team.ru

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/be843ce29737ee4752fedabe07a75cf9db1e969f

Modified Files
--------------
src/backend/storage/lmgr/lmgr.c                    |  3 +-
src/backend/storage/lmgr/lock.c                    | 43 +++++++++++++---------
src/include/storage/lock.h                         | 17 +++++----
src/test/isolation/Makefile                        | 11 +++---
src/test/isolation/README                          |  6 +--
.../expected/prepared-transactions-cic.out         | 18 +++++++++
.../isolation/specs/prepared-transactions-cic.spec | 37 +++++++++++++++++++
7 files changed, 98 insertions(+), 37 deletions(-)



view thread (14+ messages)  latest in thread

Message-ID: <E1l5lkO-0004a3-1i@gemulon.postgresql.org>
Permalink:  ../E1l5lkO-0004a3-1i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l5lkO-0004a3-1i@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: noah@leadboat.com
  Subject: Re: pgsql: Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transact
  In-Reply-To: <E1l5lkO-0004a3-1i@gemulon.postgresql.org>
  References: <E1l5lkO-0004a3-1i@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