mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-07 12:09:26 +02:00
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 commit42288174
. Backpatch: 12-, just like commit42288174
This commit is contained in:
parent
4f70e0910e
commit
5f95664e19
@ -7084,10 +7084,10 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
|
|||||||
xid_horizon_prefetch_buffer(rel, &prefetch_state, 1);
|
xid_horizon_prefetch_buffer(rel, &prefetch_state, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
LockBuffer(buf, BUFFER_LOCK_SHARE);
|
||||||
|
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
maxoff = PageGetMaxOffsetNumber(page);
|
maxoff = PageGetMaxOffsetNumber(page);
|
||||||
|
|
||||||
LockBuffer(buf, BUFFER_LOCK_SHARE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user