]> granicus.if.org Git - postgresql/commit
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 18 Apr 2018 16:07:37 +0000 (12:07 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 18 Apr 2018 16:07:37 +0000 (12:07 -0400)
commit94a898f69c8399314c322bb560ea7ddbf877ccba
treecf317ede7ddddd9898ec4fa2a8c688c96da2a1c2
parent3397c67272e26b0cda172db1f820a5c4a6aec8d6
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

Commit 54eff5311 did not account for the possibility that we'd have
a transaction snapshot due to default_transaction_isolation being
set high enough to require one.  The transaction snapshot is enough
to hold back our advertised xmin and thus risk deadlock anyway.
The only way to get rid of that snap is to start a new transaction,
so let's do that instead.  Also throw in an assert checking that we
really have gotten to a state where no xmin is being advertised.

Back-patch to 9.4, like the previous commit.

Discussion: https://postgr.es/m/CAMkU=1ztk3TpQdcUNbxq93pc80FrXUjpDWLGMeVBDx71GHNwZQ@mail.gmail.com
src/backend/commands/indexcmds.c