Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2c56b3a

Browse files
committed
Handle lack of DSM slots in parallel btree build.
If no DSM slots are available, a ParallelContext can still becreated, but its seg pointer is NULL. Teach parallel btree buildto cope with that by falling back to a regular non-parallel build,to avoid crashing with a segmentation fault.Back-patch to 11, where parallel CREATE INDEX landed.Reported-by: Nicola ContuReviewed-by: Peter GeogheganDiscussion:https://postgr.es/m/CA%2BhUKGJgJEBnkuODBVomyK3MWFvDBbMVj%3Dgdt6DnRPU-5sQ6UQ%40mail.gmail.com
1 parenta5b652f commit2c56b3a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,15 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request)
12561256
Assert(request>0);
12571257
pcxt=CreateParallelContext("postgres","_bt_parallel_build_main",
12581258
request, true);
1259+
1260+
/* If no DSM segment was available, back out (do serial build) */
1261+
if (pcxt->seg==NULL)
1262+
{
1263+
DestroyParallelContext(pcxt);
1264+
ExitParallelMode();
1265+
return;
1266+
}
1267+
12591268
scantuplesortstates=leaderparticipates ?request+1 :request;
12601269

12611270
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp