Skip to content

Commit 32d6287

Browse files
Get heap page max offset with buffer lock held.
On further reflection it seems better to call PageGetMaxOffsetNumber() after acquiring a buffer lock on the page. This shouldn't really matter, but doing it this way is cleaner. Follow-up to commit 4228817. Backpatch: 12-, just like commit 4228817
1 parent 4228817 commit 32d6287

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/access/heap/heapam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7075,10 +7075,10 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
70757075
xid_horizon_prefetch_buffer(rel, &prefetch_state, 1);
70767076
#endif
70777077

7078+
LockBuffer(buf, BUFFER_LOCK_SHARE);
7079+
70787080
page = BufferGetPage(buf);
70797081
maxoff = PageGetMaxOffsetNumber(page);
7080-
7081-
LockBuffer(buf, BUFFER_LOCK_SHARE);
70827082
}
70837083

70847084
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy