summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2023-08-23 15:08:40 +0000
committerHeikki Linnakangas2023-08-23 15:12:41 +0000
commitbf8bf6d0bddbbaa9dc6c27b383f026273064d2a2 (patch)
tree3614051b694723bda822d98a716ee993e8133182
parent260a1f18dae8729f99cefe4e1f759193fd6bedd0 (diff)
Fix _bt_allequalimage() call within critical section.
_bt_allequalimage() does complicated things, so it's not OK to call it in a critical section. Per buildfarm failure on 'prion', which uses -DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE options. Discussion: https://www.postgresql.org/message-id/[email protected] Backpatch-through: 16, like commit ccadf73163 that introduced this
-rw-r--r--src/backend/access/nbtree/nbtree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index ad07b80f75..62bc9917f1 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -151,6 +151,7 @@ bthandler(PG_FUNCTION_ARGS)
void
btbuildempty(Relation index)
{
+ bool allequalimage = _bt_allequalimage(index, false);
Buffer metabuf;
Page metapage;
@@ -169,7 +170,7 @@ btbuildempty(Relation index)
START_CRIT_SECTION();
metapage = BufferGetPage(metabuf);
- _bt_initmetapage(metapage, P_NONE, 0, _bt_allequalimage(index, false));
+ _bt_initmetapage(metapage, P_NONE, 0, allequalimage);
MarkBufferDirty(metabuf);
log_newpage_buffer(metabuf, true);