postgres.git / summary / log / commit / refs

commit    6322a028fa437669022473be8af39bbd89b644c3
Author:   Andres Freund <andres@anarazel.de>
Date:     Wed Mar 11 21:26:38 2026 +0000

    bufmgr: Fix use of wrong variable in GetPrivateRefCountEntrySlow()
    
    Unfortunately, in 30df61990c67, I made GetPrivateRefCountEntrySlow() set a
    wrong cache hint when moving entries from the hash table to the faster array.
    There are no correctness concerns due to this, just an unnecessary loss of
    performance.
    
    Noticed while testing the index prefetching patch.
    
    Discussion: https://postgr.es/m/CAH2-Wz=g=JTSyDB4UtB5su2ZcvsS7VbP+ZMvvaG6ABoCb+s8Lw@mail.gmail.com


src/backend/storage/buffer/bufmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 6ded968e163..027a59a68ca 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -469,7 +469,7 @@ GetPrivateRefCountEntrySlow(Buffer buffer, bool do_move) free->data = res->data; PrivateRefCountArrayKeys[ReservedRefCountSlot] = buffer; /* update cache for the next lookup */ - PrivateRefCountEntryLast = match; + PrivateRefCountEntryLast = ReservedRefCountSlot; ReservedRefCountSlot = -1; [parent: 547c15f9f876]