Re: Tables getting stuck at 's' state during logical replication

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Tables getting stuck at 's' state during logical replication
Дата
Msg-id CALj2ACVG7bjgEmFiAs+8ZEz4wBm64VGMVYSyLGwv5zKvXcSEmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Tables getting stuck at 's' state during logical replication  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Tue, May 9, 2023 at 4:38 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Fri, May 5, 2023 at 7:27 PM Padmavathi G <padma9.9.1999@gmail.com> wrote:
> >
> > Some background on the setup on which I am trying to carry out the upgrade:
> >
> > We have a pod in a kubernetes cluster which contains the postgres 11 image. We are following the logical
replicationprocess for upgrade 
> >
> > Steps followed for logical replication:
> >
> > 1. Created a new pod in the same kubernetes cluster with the latest postgres 15 image
> > 2. Created a publication  (say publication 1) in the old pod including all tables in a database
> > 3. Created a subscription (say subscription 1) in the new pod for the above mentioned publication
> > 4. When monitoring the subscription via pg_subscription_rel in the subscriber, I noticed that out of 45 tables 20
werein the 'r' state and 25 were in 's' state and they remained in the same state for almost 2 days, there was no
improvementin the state. But the logs showed that the tables which had 's' state also had "synchronization workers for
<table_name>finished". 
> >
>
> I think the problem happened in this step where some of the tables
> remained in 's' state. It is not clear why this could happen because
> apply worker should eventually update these relations state to 'r'. If
> this is reproducible, we can try two things to further investigate the
> issue: (a) Disable and Enable the subscription once and see if that
> helps; (b) try increasing the LOG level to DEBUG2 and see if we get
> any useful LOG message.

It looks like the respective apply workers for the tables whose state
was 's' are not able to get to UpdateSubscriptionRelState with
SUBREL_STATE_READY. In addition to what Amit suggested above, is it
possible for you to reproduce this problem on upstream (reproducing on
HEAD cool otherwise PG 15 enough) code? If yes, you can add custom
debug messages to see what's happening.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [PATCH] Add native windows on arm64 support
Следующее
От: Xiaoran Wang
Дата:
Сообщение: Re: [PATCH] Use RelationClose rather than table_close in heap_create_with_catalog