Detect and fix visibility map corruption in more cases Move VM corruption detection and repair into heap page pruning. This allows VM repair during on-access pruning, not only during vacuum.
Also, expand corruption detection to cover pages marked all-visible that contain dead tuples and tuples inserted or deleted by in-progress transactions, rather than only all-visible pages with LP_DEAD items. Pinning the correct VM page before on-access pruning is cheap when compared to the cost of actually pruning. The vmbuffer is saved in the scan descriptor, so a query should only need to pin each VM page once, and a single VM page covers a large number of heap pages. Author: Melanie Plageman <[email protected]> Reviewed-by: Andres Freund <[email protected]> Reviewed-by: Chao Li <[email protected]> Reviewed-by: Kirill Reshke <[email protected]> Discussion: https://postgr.es/m/bqc4kh5midfn44gnjiqez3bjqv4zogydguvdn446riw45jcf3y%404ez66il7ebvk Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4f7ecca84ddacbce27bdff3b78981a2bd9c9b242 Modified Files -------------- src/backend/access/heap/pruneheap.c | 221 ++++++++++++++++++++++++++++++++--- src/backend/access/heap/vacuumlazy.c | 89 +------------- src/include/access/heapam.h | 12 ++ src/tools/pgindent/typedefs.list | 1 + 4 files changed, 221 insertions(+), 102 deletions(-)
