Skip to content

Commit 7b063ff

Browse files
committed
Search for SLRU page only in its own bank
One of the two slot scans in SlruSelectLRUPage was not walking only the slots in the specific bank where the buffer could be; change it to do that. Oversight in 53c2a97. Author: Sergey Sargsyan <sergey.sargsyan.2001@gmail.com> Discussion: https://postgr.es/m/18582-5f301dd30ba91a38@postgresql.org
1 parent 2793ace commit 7b063ff

File tree

1 file changed

+1
-1
lines changed
  • src/backend/access/transam

1 file changed

+1
-1
lines changed

src/backend/access/transam/slru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ SlruSelectLRUPage(SlruCtl ctl, int64 pageno)
11841184
Assert(LWLockHeldByMe(SimpleLruGetBankLock(ctl, pageno)));
11851185

11861186
/* See if page already has a buffer assigned */
1187-
for (int slotno = 0; slotno < shared->num_slots; slotno++)
1187+
for (int slotno = bankstart; slotno < bankend; slotno++)
11881188
{
11891189
if (shared->page_status[slotno] != SLRU_PAGE_EMPTY &&
11901190
shared->page_number[slotno] == pageno)

0 commit comments

Comments
 (0)