From: | Peter Geoghegan <pg(at)bowt(dot)ie> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Harden nbtree page deletion. |
Date: | 2021-02-04 23:43:44 |
Message-ID: | E1l7oHo-0002Su-Fg@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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 efada2b8e92) 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.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c34787f910585f82320f78b0afd53a6a170aa229
Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 64 ++++++++++++++++++++++---------------
1 file changed, 38 insertions(+), 26 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-02-05 00:12:29 | pgsql: Fix YA incremental sort bug. |
Previous Message | Heikki Linnakangas | 2021-02-04 15:41:18 | pgsql: Fix small error in COPY FROM progress reporting. |