Re: Parallel Seq Scan

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Parallel Seq Scan
Дата
Msg-id CAA4eK1KoCDrBy-iFeujnYw6K1h5wMGSMnbWB=vnMq8YvKtVyqQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parallel Seq Scan  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: Parallel Seq Scan  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, Mar 13, 2015 at 2:12 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>
> On 13-03-2015 PM 05:32, Amit Langote wrote:
> > On 12-03-2015 PM 11:46, Amit Kapila wrote:
> >> [parallel_seqscan_v10.patch]
> >
> > There may be a bug in TupleQueueFunnelNext().
> >
> > 1) I observed a hang with stack looking like:
> >
> > #0  0x00000039696df098 in poll () from /lib64/libc.so.6
> > #1  0x00000000006f1c6a in WaitLatchOrSocket (latch=0x7f29dc3c73b4,
> > wakeEvents=1, sock=-1, timeout=0) at pg_latch.c:333
> > #2  0x00000000006f1aca in WaitLatch (latch=0x7f29dc3c73b4, wakeEvents=1,
> > timeout=0) at pg_latch.c:197
> > #3  0x000000000065088b in TupleQueueFunnelNext (funnel=0x17b4a20, nowait=0
> > '\000', done=0x17ad481 "") at tqueue.c:269
> > #4  0x0000000000636cab in funnel_getnext (funnelstate=0x17ad3d0) at
> > nodeFunnel.c:347
> > ...
> > <snip>
> >
> > 2) In some cases, there can be a segmentation fault with stack looking like:
> >
> > #0  0x000000396968990a in memcpy () from /lib64/libc.so.6
> > #1  0x00000000006507e7 in TupleQueueFunnelNext (funnel=0x263c800, nowait=0
> > '\000', done=0x2633461 "") at tqueue.c:233
> > #2  0x0000000000636cab in funnel_getnext (funnelstate=0x26333b0) at
> > nodeFunnel.c:347
> > #3  0x0000000000636901 in ExecFunnel (node=0x26333b0) at nodeFunnel.c:179
> > ...
> > <snip>
> >
> > I could get rid of (1) and (2) with the attached fix.
>
> Hit send too soon!
>
> By the way, the bug seems to be exposed only with a certain pattern/sequence
> of workers being detached (perhaps in immediate successive) whereby the
> funnel->nextqueue remains incorrectly set.
>

I think this can happen if funnel->nextqueue is greater than funnel->nqueues.
Please see if attached patch fixes the issue, else could you share the
scenario in more detail where you hit this issue.


> The patch attached this time.
>
> By the way, when I have asserts enabled, I hit this compilation error:
>
> createplan.c: In function ‘create_partialseqscan_plan’:
> createplan.c:1180: error: ‘Path’ has no member named ‘path’
>
> I see following line there:
>
>     Assert(best_path->path.parent->rtekind == RTE_RELATION);
>

Okay, will take care of this.

Thanks.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Julien Tachoires
Дата:
Сообщение: Re: patch : Allow toast tables to be moved to a different tablespace
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Proposal : REINDEX xxx VERBOSE