Re: REINDEX CONCURRENTLY unexpectedly fails
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Manuel Rigger <rigger.manuel@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-01-15T01:39:03Z
Lists: pgsql-bugs
Attachments
- reindex-conc-temp-v5.patch (text/x-diff) patch v5
On Tue, Jan 14, 2020 at 11:41:11PM +0200, Heikki Linnakangas wrote: > I'm not a fan of all those changes in RangeVarCallbackForDropRelation() to > ensure that you get an AccessExclusiveLock to begin with. It gets pretty > complicated, and it feels like you need to special-case temporary tables in > dozen different places. I liked the v3 of this patch better. It's true that > you're upgrading the ShareUpdateExclusiveLock to AccessExclusiveLock, but > since it's a temporary table, there really should be no other backend > holding a lock on it. Thanks for taking the time to share your opinion. That was as well my feeling with the peanut and the sledgehammer. I liked the peanuts, but not the hammer part. There are still some parts I liked about v4 (doc wording, tweaks about the shape of RelationSupportsConcurrentIndexing and its use in assertions, setting up the concurrent flag in RemoveRelation and use an assert in index_drop is also cleaner), so I kept a good portion of v4. Attached is an updated patch, v5, that removes the parts enforcing the lock when looking at the relation OID based on its RangeVar. Any thoughts? -- Michael
Commits
-
Fix concurrent indexing operations with temporary tables
- d76652edc56f 9.4.26 landed
- c39f45598177 9.5.21 landed
- ef33edeb5835 9.6.17 landed
- 9055344b495f 10.12 landed
- 5b4b07fa9ac3 11.7 landed
- 817a1b88ac66 12.2 landed
- a904abe2e284 13.0 landed