postgresql/src/backend
Michael Paquier 9511fb37ac Reset indisreplident for an invalid index in DROP INDEX CONCURRENTLY
A failure when dropping concurrently an index used in a replica identity
could leave in pg_index an index marked as !indisvalid and
indisreplident.  Reindexing this index would switch back indisvalid to
true, and if the replica identity of the parent relation was switched to
use a different index, it would be possible to finish with more than one
index marked as indisreplident.  If that were to happen, this could mess
up with the relation cache as an incorrect index could be used for the
replica identity.

Indexes marked as invalid are discarded as candidates for the replica
identity, as of RelationGetIndexList(), so similarly to what is done
with indisclustered, resetting indisreplident when the index is marked
as invalid keeps things consistent.  REINDEX CONCURRENTLY's swapping
already resets the flag for the old index, while the new index inherits
the value of the old index to-be-dropped, so only DROP INDEX was an
issue.

Even if this is a bug, the sequence able to reproduce a problem requires
a failure while running DROP INDEX CONCURRENTLY, something unlikely
going to happen in the field, so no backpatch is done.

Author: Michael Paquier
Reviewed-by: Dmitry Dolgov
Discussion: https://postgr.es/m/20200827025721.GN2017@paquier.xyz
2020-08-30 14:14:34 +09:00
..
access Fix code for re-finding scan position in a multicolumn GIN index. 2020-08-27 17:36:13 -04:00
bootstrap Be more careful about marking catalog columns NOT NULL by default. 2020-07-21 13:03:48 -04:00
catalog Reset indisreplident for an invalid index in DROP INDEX CONCURRENTLY 2020-08-30 14:14:34 +09:00
commands Fix ALTER TABLE's scheduling rules for AT_AddConstraint subcommands. 2020-08-22 12:34:17 -04:00
executor Be more careful about the shape of hashable subplan clauses. 2020-08-14 22:14:03 -04:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Fix a few typos in JIT comments and README 2020-08-21 09:33:56 +12:00
lib Use pg_bitutils for HyperLogLog. 2020-07-30 09:14:23 -07:00
libpq code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
main Clean up includes of s_lock.h. 2020-06-18 19:41:05 -07:00
nodes Suppress unnecessary RelabelType nodes in yet more cases. 2020-08-19 14:07:49 -04:00
optimizer Fixup some misusages of bms_num_members() 2020-08-26 10:51:36 +12:00
parser Fix handling of CREATE TABLE LIKE with inheritance. 2020-08-21 15:00:47 -04:00
partitioning Fix yet another issue with step generation in partition pruning. 2020-08-07 14:45:00 +09:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Add huge_page_size setting for use on Linux. 2020-07-17 14:33:00 +12:00
postmaster Extend the BufFile interface. 2020-08-26 07:36:43 +05:30
regex Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
replication snapshot scalability: cache snapshots using a xact completion counter. 2020-08-17 21:08:30 -07:00
rewrite Add missing invocations to object access hooks 2020-05-23 14:03:04 +09:00
snowball code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
statistics Fixup some misusages of bms_num_members() 2020-08-26 10:51:36 +12:00
storage Fix comment in procarray.c 2020-08-27 16:40:34 +09:00
tcop Fix handling of CREATE TABLE LIKE with inheritance. 2020-08-21 15:00:47 -04:00
tsearch Fix recently-introduced performance problem in ts_headline(). 2020-07-31 11:43:12 -04:00
utils Extend the BufFile interface. 2020-08-26 07:36:43 +05:30
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00