Re: pgsql: Add a view to show the stats of subscription workers.

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: pgsql: Add a view to show the stats of subscription workers.
Дата
Msg-id CAA4eK1KL3UpM4J-q-GOAhJBW-yRM9j4ujh75esdguRSCHpWB1Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: Add a view to show the stats of subscription workers.  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-committers
On Tue, Nov 30, 2021 at 12:46 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Tue, Nov 30, 2021 at 3:04 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
>
> FWIW, I'm still not investigating why "replication origin with OID 2
> is already active for PID 23706" occurred.
>

I think I know why this error occurred. In process 23706 (which is
doing table sync for one of the tables) after allocating replication
origin with OID 2, we have inserted the entry for same in
pg_replication_origin and associated it with that session. Now, an
expected error happened (Copy failure) which rolled back the
transaction where we allocated and inserted the origin with OID 2.
Before session 23706 could exit where we will disassociate the
replication origin state from the current process, a new process
(table sync for another table) allocated the replication origin OID 2
and tried to associate with its session where it gets the error
(replication origin with OID 2
is already active for PID 23706). The next time it tried there was no
such concurrent process to hold the OID and it succeeded. I think this
is all as per our current implementation of table sync worker. We just
need to be careful in the new test.

I'll review your patch next.

-- 
With Regards,
Amit Kapila.



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: pgsql: Add a view to show the stats of subscription workers.
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: pgsql: Add a view to show the stats of subscription workers.