| From: | Noah Misch <noah(at)leadboat(dot)com> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transact |
| Date: | 2021-01-30 08:36:48 |
| Message-ID: | E1l5lkO-0004a9-2Y@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/179775135b41a0640ec8b378b2699dca00d3a49a
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(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Eisentraut | 2021-01-30 08:51:16 | pgsql: Allow GRANTED BY clause in normal GRANT and REVOKE statements |
| Previous Message | Noah Misch | 2021-01-30 08:36:47 | pgsql: Fix error with CREATE PUBLICATION, wal_level=minimal, and new ta |