Skip to content

Commit 5f95664

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 4f70e09 commit 5f95664

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
@@ -7084,10 +7084,10 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
70847084
xid_horizon_prefetch_buffer(rel, &prefetch_state, 1);
70857085
#endif
70867086

7087+
LockBuffer(buf, BUFFER_LOCK_SHARE);
7088+
70877089
page = BufferGetPage(buf);
70887090
maxoff = PageGetMaxOffsetNumber(page);
7089-
7090-
LockBuffer(buf, BUFFER_LOCK_SHARE);
70917091
}
70927092

70937093
/*

0 commit comments

Comments
 (0)