git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 260a1f1)
Fix _bt_allequalimage() call within critical section.
2023年8月23日 15:08:40 +0000 (18:08 +0300)
2023年8月23日 15:12:41 +0000 (18:12 +0300)
_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


diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index ad07b80f758de12f96010b434d8eb8c6e1fd6bef..62bc9917f13a9e057b15f487b4b510954f900731 100644 (file)
--- 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);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /