pgsql: Only clear VACUUM's read stream strategy once in failsafe mode

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Only clear VACUUM's read stream strategy once in failsafe mode
Date: 2026-08-07 14:10:47
Message-ID: E1wsLHb-00000000aZs-22Kb@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Only clear VACUUM's read stream strategy once in failsafe mode

112c2683807b4d690 restored failsafe vacuum's abandonment of a buffer
access strategy by clearing the ReadBuffersOperations' strategy
references. But it did so in lazy_scan_heap()'s main loop, meaning it
looped through all the ReadBuffersOperations once per block after
failsafe was engaged. Track it with a local flag and clear the strategy
only once.

Reported-by: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAAKRu_Zse14nSNeCgtnE1LUAH8Of7OmYR%2BCc3O_DAzxt3m6T-g%40mail.gmail.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7c25cdb1ebf64b1e1c9053ca27f9552c9a528a12

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-08-07 15:10:29 pgsql: Fix hot standby accepting connections too early after a crash re
Previous Message Melanie Plageman 2026-08-07 14:06:14 pgsql: Only clear VACUUM's read stream strategy once in failsafe mode