Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a57960
)
Get heap page max offset with buffer lock held.
author
Peter Geoghegan
<pg@bowt.ie>
Thu, 31 Dec 2020 01:21:41 +0000
(17:21 -0800)
committer
Peter Geoghegan
<pg@bowt.ie>
Thu, 31 Dec 2020 01:21:41 +0000
(17:21 -0800)
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
src/backend/access/heap/heapam.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/access/heap/heapam.c
b/src/backend/access/heap/heapam.c
index 4e25622b4a3af0bb6433344d80cdcf0db1ffc442..6bd49d0025236418cb1b1a82d9b73c46f959f672 100644
(file)
--- a/
src/backend/access/heap/heapam.c
+++ b/
src/backend/access/heap/heapam.c
@@
-7042,10
+7042,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);
}
/*