Re: pg_upgrade and publication/subscription problem - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: pg_upgrade and publication/subscription problem
Date
Msg-id CAA4eK1KkWLJX7xUVO8Ae0Ljv-Z17B77sNuFOJMTN36uqnXJTpQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_upgrade and publication/subscription problem  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: pg_upgrade and publication/subscription problem
List pgsql-hackers
On Fri, Nov 26, 2021 at 5:47 PM Marcos Pegoraro <marcos@f10.com.br> wrote:
>>
>> So, in short, I think what we need to solve is to get the data from
>> new tables and newly performed writes on old tables. I could think of
>> the following two approaches:
>>
>> Approach-1:
>> 1. Drop subscription and Truncate all tables corresponding to subscription.
>>
>> 2. Create a new subscription for the publication.
>
> If I drop subscription it will drop WAL ou publication side and I lost all changed data between the starting of
pg_upgradeprocess and now.
 
>

On thinking about this point again, it is not clear to me why that
would matter for this particular use case? Basically, when you create
a new subscription, it should copy the entire existing data from the
table directly and then will decode changes from WAL. So, I think in
your case all the changes between pg_upgrade and now should be
directly copied from tables, so probably older WAL won't be required.

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: parallel vacuum comments
Next
From: Amit Kapila
Date:
Subject: Re: Skipping logical replication transactions on subscriber side