Re: pg_background (and more parallelism infrastructure patches)

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: pg_background (and more parallelism infrastructure patches)
Дата
Msg-id CA+TgmoYYqzz8DuNziiy=h4PmEajWRgzo=s+xA3-gwBdUYboG_g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_background (and more parallelism infrastructure patches)  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Mon, Sep 8, 2014 at 1:09 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> > Don't you need a PG_TRY block here to reset pq_mq_busy?
>>
>> No.  If shm_mq_sendv is interrupted, we can't use the shm_mq any more.
>> But since that should only happen if an interrupt arrives while the
>> queue is full, I think that's OK.
>
> I think here not only on interrupt, but any other error in this
> function shm_mq_sendv() path (one example is WaitLatch())
> could lead to same behaviour.

Probably true.  But I think we generally count on that to be no-fail,
or close to it, so I'm not really worried about it.

>> (Think about the alternatives: if
>> the queue is full, we have no way of notifying the launching process
>> without waiting for it to retrieve the results, but it might not do
>> that right away, and if we've been killed we need to die *now* not
>> later.)
>
> So in such cases what is the advise to users, currently they will
> see the below message:
> postgres=# select * from pg_background_result(5124) as (x int);
> ERROR:  lost connection to worker process with PID 5124
>
> One way is to ask them to check logs, but what about if they want
> to handle error and take some action?

They have to check the logs.  To reiterate what I said before, there
is no reasonable way to both have the background worker terminate
quickly and also guarantee that the full error message is received by
the process that started it.  You have to pick one, and I stick by the
one I picked.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: bad estimation together with large work_mem generates terrible slow hash joins
Следующее
От: Robert Haas
Дата:
Сообщение: Re: pg_background (and more parallelism infrastructure patches)