summaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/nbtree.c
diff options
context:
space:
mode:
authorPeter Geoghegan2021-12-09 01:24:45 +0000
committerPeter Geoghegan2021-12-09 01:24:45 +0000
commitbcf60585e6e0e95f0b9e5d64c7a6edca99ec6e86 (patch)
treeb9791886d37b9fe9712874a4affbb8141f266424 /src/backend/access/nbtree/nbtree.c
parent6f0e6ab04de5f52e4e0872d3ace2bb6a35e8b0b1 (diff)
Standardize cleanup lock terminology.
The term "super-exclusive lock" is a synonym for "buffer cleanup lock" that first appeared in nbtree many years ago. Standardize things by consistently using the term cleanup lock. This finishes work started by commit 276db875. There is no good reason to have two terms. But there is a good reason to only have one: to avoid confusion around why VACUUM acquires a full cleanup lock (not just an ordinary exclusive lock) in index AMs, during ambulkdelete calls. This has nothing to do with protecting the physical index data structure itself. It is needed to implement a locking protocol that ensures that TIDs pointing to the heap/table structure cannot get marked for recycling by VACUUM before it is safe (which is somewhat similar to how VACUUM uses cleanup locks during its first heap pass). Note that it isn't strictly necessary for index AMs to implement this locking protocol -- several index AMs use an MVCC snapshot as their sole interlock to prevent unsafe TID recycling. In passing, update the nbtree README. Cleanly separate discussion of the aforementioned index vacuuming locking protocol from discussion of the "drop leaf page pin" optimization added by commit 2ed5b87f. We now structure discussion of the latter by describing how individual index scans may safely opt out of applying the standard locking protocol (and so can avoid blocking progress by VACUUM). Also document why the optimization is not safe to apply during nbtree index-only scans. Author: Peter Geoghegan <[email protected]> Discussion: https://postgr.es/m/CAH2-WzngHgQa92tz6NQihf4nxJwRzCV36yMJO_i8dS+2mgEVKw@mail.gmail.com Discussion: https://postgr.es/m/CAH2-WzkHPgsBBvGWjz=8PjNhDefy7XRkDKiT5NxMs-n5ZCf2dA@mail.gmail.com
Diffstat (limited to 'src/backend/access/nbtree/nbtree.c')
-rw-r--r--src/backend/access/nbtree/nbtree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index bd6d6b1cc93..dfce06dc49f 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -1161,9 +1161,9 @@ backtrack:
nhtidslive;
/*
- * Trade in the initial read lock for a super-exclusive write lock on
- * this page. We must get such a lock on every leaf page over the
- * course of the vacuum scan, whether or not it actually contains any
+ * Trade in the initial read lock for a full cleanup lock on this
+ * page. We must get such a lock on every leaf page over the course
+ * of the vacuum scan, whether or not it actually contains any
* deletable tuples --- see nbtree/README.
*/
_bt_upgradelockbufcleanup(rel, buf);