Content-Length: 263605 | pFad | http://github.com/postgrespro/postgres_cluster/commit/55e5352266b1edc943a2a57a5d349aac73bac1a2

75 Get heap page max offset with buffer lock held. · postgrespro/postgres_cluster@55e5352 · GitHub
Skip to content

Commit 55e5352

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 42288174. Backpatch: 12-, just like commit 42288174
1 parent 7a57960 commit 55e5352

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
@@ -7042,10 +7042,10 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
70427042
xid_horizon_prefetch_buffer(rel, &prefetch_state, 1);
70437043
#endif
70447044

7045+
LockBuffer(buf, BUFFER_LOCK_SHARE);
7046+
70457047
page = BufferGetPage(buf);
70467048
maxoff = PageGetMaxOffsetNumber(page);
7047-
7048-
LockBuffer(buf, BUFFER_LOCK_SHARE);
70497049
}
70507050

70517051
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/55e5352266b1edc943a2a57a5d349aac73bac1a2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy