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

Commit2e2351b

Browse files
committed
Handle lack of DSM slots in parallel btree build, take 2.
Commit74618e7 added a new check intended to fix a bug, but putit in the wrong place so that parallel btree build was alwaysdisabled. Do the check after we've actually tried to createa DSM segment. Back-patch to 11, like the earlier commit.Reviewed-by: Peter GeogheganDiscussion:https://postgr.es/m/CAH2-WzmDABkJzrNnvf%2BOULK-_A_j9gkYg_Dz-H62jzNv4eKQTw%40mail.gmail.com
1 parent9a85860 commit2e2351b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,14 +1353,6 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request)
13531353
pcxt=CreateParallelContext("postgres","_bt_parallel_build_main",
13541354
request);
13551355

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-
13641356
scantuplesortstates=leaderparticipates ?request+1 :request;
13651357

13661358
/*
@@ -1404,6 +1396,16 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request)
14041396
/* Everyone's had a chance to ask for space, so now create the DSM */
14051397
InitializeParallelDSM(pcxt);
14061398

1399+
/* If no DSM segment was available, back out (do serial build) */
1400+
if (pcxt->seg==NULL)
1401+
{
1402+
if (IsMVCCSnapshot(snapshot))
1403+
UnregisterSnapshot(snapshot);
1404+
DestroyParallelContext(pcxt);
1405+
ExitParallelMode();
1406+
return;
1407+
}
1408+
14071409
/* Store shared build state, for which we reserved space */
14081410
btshared= (BTShared*)shm_toc_allocate(pcxt->toc,estbtshared);
14091411
/* Initialize immutable state */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp