Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+2-1
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)