BRIN autosummarization may need a snapshot It's possible to define BRIN indexes on functions that require a snapshot to run, but the autosummarization feature introduced by commit 7526e10224f0 fails to provide one. This causes autovacuum to leave a BRIN placeholder tuple behind after a failed work-item execution, making such indexes less efficient. Repair by obtaining a snapshot prior to running the task, and add a test to verify this behavior.
Author: Álvaro Herrera <[email protected]> Reported-by: Giovanni Fabris <[email protected]> Reported-by: Arthur Nascimento <[email protected]> Backpatch-through: 13 Discussion: https://postgr.es/m/[email protected] Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3c7b47974ec7332a2bb98cf51888dd4a4f367506 Modified Files -------------- src/backend/postmaster/autovacuum.c | 2 ++ src/test/modules/brin/t/01_workitems.pl | 39 +++++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-)
