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 ccadf73163
that introduced this
This commit is contained in:
parent
260a1f18da
commit
bf8bf6d0bd
|
@ -151,6 +151,7 @@ bthandler(PG_FUNCTION_ARGS)
|
||||||
void
|
void
|
||||||
btbuildempty(Relation index)
|
btbuildempty(Relation index)
|
||||||
{
|
{
|
||||||
|
bool allequalimage = _bt_allequalimage(index, false);
|
||||||
Buffer metabuf;
|
Buffer metabuf;
|
||||||
Page metapage;
|
Page metapage;
|
||||||
|
|
||||||
|
@ -169,7 +170,7 @@ btbuildempty(Relation index)
|
||||||
START_CRIT_SECTION();
|
START_CRIT_SECTION();
|
||||||
|
|
||||||
metapage = BufferGetPage(metabuf);
|
metapage = BufferGetPage(metabuf);
|
||||||
_bt_initmetapage(metapage, P_NONE, 0, _bt_allequalimage(index, false));
|
_bt_initmetapage(metapage, P_NONE, 0, allequalimage);
|
||||||
MarkBufferDirty(metabuf);
|
MarkBufferDirty(metabuf);
|
||||||
log_newpage_buffer(metabuf, true);
|
log_newpage_buffer(metabuf, true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue