postgresql/src/backend
Peter Geoghegan c34787f910 Harden nbtree page deletion.
Add some additional defensive checks in the second phase of index
deletion to detect and report index corruption during VACUUM, and to
avoid having VACUUM become stuck in more cases.  The code is still not
robust in the presence of a circular chain of sibling links, though it's
not clear whether that really matters.  This is follow-up work to commit
3a01f68e.

The new defensive checks rely on the assumption that there can be no
more than one VACUUM operation running for an index at any given time.
Remove an old comment suggesting that multiple concurrent VACUUMs need
to be considered here.  This concern now seems highly unlikely to have
any real validity, since we clearly rely on the same assumption in
several other places.  For example, there are much more recent comments
that appear in the same function (added by commit efada2b8e9) that make
the same assumption.

Also add a CHECK_FOR_INTERRUPTS() to the relevant code path.  Contrary
to comments added by commit 3a01f68e, it is actually possible to handle
interrupts here, at least in the common case where processing takes
place at the leaf level.  We only hold a pin on leafbuf/target page when
stepping right at the leaf level.

No backpatch due to the lack of complaints following hardening added to
the same area by commit 3a01f68e.
2021-02-04 15:42:36 -08:00
..
access Harden nbtree page deletion. 2021-02-04 15:42:36 -08:00
bootstrap Update copyright for 2021 2021-01-02 13:06:25 -05:00
catalog Ensure unlinking of old index file with REINDEX (TABLESPACE) 2021-02-04 17:16:47 +09:00
commands Fix small error in COPY FROM progress reporting. 2021-02-04 17:40:33 +02:00
executor Fix hash partition pruning with asymmetric partition sets. 2021-01-28 13:41:55 -05:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Update copyright for 2021 2021-01-02 13:06:25 -05:00
lib Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq Introduce --with-ssl={openssl} as a configure option 2021-02-01 19:19:44 +09:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Remove [Merge]AppendPath.partitioned_rels. 2021-02-01 14:43:54 -05:00
optimizer Remove [Merge]AppendPath.partitioned_rels. 2021-02-01 14:43:54 -05:00
parser SEARCH and CYCLE clauses 2021-02-01 14:32:51 +01:00
partitioning Remove [Merge]AppendPath.partitioned_rels. 2021-02-01 14:43:54 -05:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Refactor Windows error message for easier translation 2021-02-04 13:31:13 +01:00
postmaster Add pg_stat_database counters for sessions and session time 2021-01-17 13:52:31 +01:00
regex Fix ancient bug in parsing of BRE-mode regular expressions. 2021-01-08 12:16:00 -05:00
replication Clarify comment in tablesync.c 2021-02-04 16:02:31 +09:00
rewrite SEARCH and CYCLE clauses 2021-02-01 14:32:51 +01:00
snowball Update copyright for 2021 2021-01-02 13:06:25 -05:00
statistics Update copyright for 2021 2021-01-02 13:06:25 -05:00
storage Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transactions. 2021-01-30 00:00:27 -08:00
tcop Avoid crash when rolling back within a prepared statement. 2021-02-03 19:38:43 -05:00
tsearch Fix parsing of complex morphs to tsquery 2021-01-31 20:14:29 +03:00
utils Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
.gitignore
Makefile Update copyright for 2021 2021-01-02 13:06:25 -05:00
common.mk
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00