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

Commit1fcf62e

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 parentde01777 commit1fcf62e

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
@@ -1352,6 +1352,15 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request)
13521352
Assert(request>0);
13531353
pcxt=CreateParallelContext("postgres","_bt_parallel_build_main",
13541354
request);
1355+
1356+
/* If no DSM segment was available, back out (do serial build) */
1357+
if (pcxt->seg==NULL)
1358+
{
1359+
DestroyParallelContext(pcxt);
1360+
ExitParallelMode();
1361+
return;
1362+
}
1363+
13551364
scantuplesortstates=leaderparticipates ?request+1 :request;
13561365

13571366
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp