Skip to content

Commit bf8bf6d

Browse files
committed
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/6e5bbc08-cdfc-b2b3-9e23-1a914b9850a9@iki.fi Backpatch-through: 16, like commit ccadf73 that introduced this
1 parent 260a1f1 commit bf8bf6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/nbtree/nbtree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ bthandler(PG_FUNCTION_ARGS)
151151
void
152152
btbuildempty(Relation index)
153153
{
154+
bool allequalimage = _bt_allequalimage(index, false);
154155
Buffer metabuf;
155156
Page metapage;
156157

@@ -169,7 +170,7 @@ btbuildempty(Relation index)
169170
START_CRIT_SECTION();
170171

171172
metapage = BufferGetPage(metabuf);
172-
_bt_initmetapage(metapage, P_NONE, 0, _bt_allequalimage(index, false));
173+
_bt_initmetapage(metapage, P_NONE, 0, allequalimage);
173174
MarkBufferDirty(metabuf);
174175
log_newpage_buffer(metabuf, true);
175176

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy