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

Commitc4a2041

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 parent842a23e commitc4a2041

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
@@ -1257,14 +1257,6 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request)
12571257
pcxt=CreateParallelContext("postgres","_bt_parallel_build_main",
12581258
request, true);
12591259

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

12701262
/*
@@ -1308,6 +1300,16 @@ _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, int request)
13081300
/* Everyone's had a chance to ask for space, so now create the DSM */
13091301
InitializeParallelDSM(pcxt);
13101302

1303+
/* If no DSM segment was available, back out (do serial build) */
1304+
if (pcxt->seg==NULL)
1305+
{
1306+
if (IsMVCCSnapshot(snapshot))
1307+
UnregisterSnapshot(snapshot);
1308+
DestroyParallelContext(pcxt);
1309+
ExitParallelMode();
1310+
return;
1311+
}
1312+
13111313
/* Store shared build state, for which we reserved space */
13121314
btshared= (BTShared*)shm_toc_allocate(pcxt->toc,estbtshared);
13131315
/* Initialize immutable state */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp