Commit 32d6287d authored by Peter Geoghegan's avatar Peter Geoghegan

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
parent 42288174
......@@ -7075,10 +7075,10 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
xid_horizon_prefetch_buffer(rel, &prefetch_state, 1);
#endif
LockBuffer(buf, BUFFER_LOCK_SHARE);
page = BufferGetPage(buf);
maxoff = PageGetMaxOffsetNumber(page);
LockBuffer(buf, BUFFER_LOCK_SHARE);
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment