Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"
Дата
Msg-id 32365.1528994120@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
I wrote:
> This appears to be the fault of commit ab7271677, whose authors I've cc'd:
> the stanza starting at about allpaths.c:1672 is bullheadedly creating a
> parallel path whether that's allowed or not.  Fixing it might be as simple
> as adding "rel->consider_parallel" to the conditions there.

Oh, and while I'm bitching: the same commit has created this exceedingly
dangerous coding pattern in create_append_path:

    pathnode->subpaths = list_concat(subpaths, partial_subpaths);

    foreach(l, subpaths)
    {
        Path       *subpath = (Path *) lfirst(l);

Because list_concat() modifies its first argument, this will usually
have the effect that the foreach traverses the partial_subpaths as
well as the main subpaths.  But it's very unclear to the reader whether
that's intended or not.  Worse, if we had *only* partial subpaths so
that subpaths was initially NIL, then the loop would fail to traverse
the partial subpaths, resulting in inconsistent behavior.

It looks to me like traversal of the partial subpaths is the right
thing here, in which case we should do

-    foreach(l, subpaths)
+    foreach(l, pathnode->subpaths)

or perhaps better

-    pathnode->subpaths = list_concat(subpaths, partial_subpaths);
+    pathnode->subpaths = subpaths = list_concat(subpaths, partial_subpaths);

to make the behavior clear and consistent.  But not being familiar
with the partial-subpaths morass, I'm not sure.

            regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: AtEOXact_ApplyLauncher() and subtransactions
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Shared access methods?