postgresql/contrib/amcheck
Peter Geoghegan d088ba5a5a nbtree: Allocate new pages in separate function.
Split nbtree's _bt_getbuf function is two: code that read locks or write
locks existing pages remains in _bt_getbuf, while code that deals with
allocating new pages is moved to a new, dedicated function called
_bt_allocbuf.  This simplifies most _bt_getbuf callers, since it is no
longer necessary for them to pass a heaprel argument.  Many of the
changes to nbtree from commit 61b313e4 can be reverted.  This minimizes
the divergence between HEAD/PostgreSQL 16 and earlier release branches.

_bt_allocbuf replaces the previous nbtree idiom of passing P_NEW to
_bt_getbuf.  There are only 3 affected call sites, all of which continue
to pass a heaprel for recovery conflict purposes.  Note that nbtree's
use of P_NEW was superficial; nbtree never actually relied on the P_NEW
code paths in bufmgr.c, so this change is strictly mechanical.

GiST already took the same approach; it has a dedicated function for
allocating new pages called gistNewBuffer().  That factor allowed commit
61b313e4 to make much more targeted changes to GiST.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CAH2-Wz=8Z9qY58bjm_7TAHgtW6RzZ5Ke62q5emdCEy9BAzwhmg@mail.gmail.com
2023-06-10 14:08:25 -07:00
..
expected Remove io prefix from pg_stat_io columns 2023-04-21 07:21:50 +09:00
sql Remove io prefix from pg_stat_io columns 2023-04-21 07:21:50 +09:00
t Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore Add .gitignore to contrib/amcheck. 2017-03-09 22:45:24 -05:00
Makefile Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.2--1.3.sql Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck.control Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
verify_heapam.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
verify_nbtree.c nbtree: Allocate new pages in separate function. 2023-06-10 14:08:25 -07:00