Re: parallel mode and parallel contexts

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: parallel mode and parallel contexts
Дата
Msg-id CA+TgmoazbDuaQ2mWqDHFEDtBqj_rYSn7BQQM=G6jmHT7C3RXJw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: parallel mode and parallel contexts  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: parallel mode and parallel contexts  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On Tue, Jan 6, 2015 at 3:04 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> If you can explain it in more detail in comments and README, I may
> agree. At present, I don't get it and it makes me nervous.
>
> The comment says
> "Only the top frame of the transaction state stack is copied to a parallel
> worker"
> but I'm not sure why.
>
> Top meaning the current subxact or the main xact?
> If main, why are do we need XactTopTransactionId

Current subxact.

I initially thought of copying the entire TransactionStateData stack,
but Heikki suggested (via IM) that I do it this way instead.  I
believe his concern was that it's never valid to commit or roll back
to a subtransaction that is not at the top of the stack, and if you
don't copy the stack, you avoid the risk of somehow ending up in that
state.  Also, you avoid having to invent resource owners for
(sub)transactions that don't really exist in the current process.  On
the other hand, you do end up with a few special cases that wouldn't
exist with the other approach.  Still, I'm pretty happy to have taken
Heikki's advice: it was certainly simple to implement this way, plus
hopefully that way at least one person likes what I ended up with.
:-)

What else needs clarification?

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



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Updating copyright notices to 2015 for PGDG
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Possible typo in create_policy.sgml