mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Remove btree page items after page unlink
Currently, page unlink leaves remaining items "as is", but replay of corresponding WAL-record re-initializes page leaving it with no items. For the sake of consistency, this commit makes primary delete all the items during page unlink as well. Thanks to this change, we now don't mask contents of deleted btree page for WAL consistency checking. Discussion: https://postgr.es/m/CAPpHfdt_OTyQpXaPJcWzV2N-LNeNJseNB-K_A66qG%3DL518VTFw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Peter Geoghegan
This commit is contained in:
@ -2864,11 +2864,8 @@ palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum)
|
||||
* As noted at the beginning of _bt_binsrch(), an internal page must have
|
||||
* children, since there must always be a negative infinity downlink
|
||||
* (there may also be a highkey). In the case of non-rightmost leaf
|
||||
* pages, there must be at least a highkey. Deleted pages on replica
|
||||
* might contain no items, because page unlink re-initializes
|
||||
* page-to-be-deleted. Deleted pages with no items might be on primary
|
||||
* too due to preceding recovery, but on primary new deletions can't
|
||||
* happen concurrently to amcheck.
|
||||
* pages, there must be at least a highkey. The exceptions are deleted
|
||||
* pages, which contain no items.
|
||||
*
|
||||
* This is correct when pages are half-dead, since internal pages are
|
||||
* never half-dead, and leaf pages must have a high key when half-dead
|
||||
|
Reference in New Issue
Block a user