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

Commitdba6e75

Browse files
committed
Fix ReinitializeParallelDSM to tolerate finding no error queues.
Commitd466335 changed things sothat shm_toc_lookup would fail with an error rather than silentlyreturning NULL in the hope that such failures would be reportedin a useful way rather than via a system crash. However, itoverlooked the fact that the lookup of PARALLEL_KEY_ERROR_QUEUEin ReinitializeParallelDSM is expected to fail when no DSM segmentwas created in the first place; in that case, we end up with abackend-private memory segment that still contains an entry forPARALLEL_KEY_FIXED but no others. Consequently a benign failureto initialize parallelism can escalate into an elog(ERROR);repair.Discussion:http://postgr.es/m/CA+Tgmob8LFw55DzH1QEREpBEA9RJ_W_amhBFCVZ6WMwUhVpOqg@mail.gmail.com
1 parentec7629d commitdba6e75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/access/transam/parallel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,10 @@ ReinitializeParallelDSM(ParallelContext *pcxt)
399399
fps=shm_toc_lookup(pcxt->toc,PARALLEL_KEY_FIXED, false);
400400
fps->last_xlog_end=0;
401401

402-
/* Recreate error queues. */
402+
/* Recreate error queues (if they exist). */
403403
error_queue_space=
404-
shm_toc_lookup(pcxt->toc,PARALLEL_KEY_ERROR_QUEUE, false);
404+
shm_toc_lookup(pcxt->toc,PARALLEL_KEY_ERROR_QUEUE, true);
405+
Assert(pcxt->nworkers==0||error_queue_space!=NULL);
405406
for (i=0;i<pcxt->nworkers;++i)
406407
{
407408
char*start;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp