Thread: Logical replication on two identical databases but diff versions

Logical replication on two identical databases but diff versions

From
Vijaykumar Jain
Date:
Hi,

i have two db servers pg12 and pg14 and they have exactly the same data in all schemas and tables. I tried linking both by setting wal_level=logical and make pg12 publisher and pg14 subscriber (with copy_data = false, create_slot = false, enabled = false)
Then i created a logical replication slot on pg12 and enabled subscription and logical replication was running just fine and all changes from pg12 going to pg14...
Is this expected ? I did not play with any of advancing of lsn anywhere...

If this is expected, that means i can have a pg12 cluster of primary and replica ... then i can take the replica out of cluster , make it writable using pg_promote and then pg_upgrade it to pg14 and then link it like above to old pg12 via logical replication...and then slowly after ensuring no issues, phase out pg12 and replace it with pg14, no downtime upgrade ?

Is this correct? (Of course no schema changes while this is being done) and i set max_wal_size to a large value to retain enough wals.


>>  Is this expected ? 

Yes, this is expected.

>> If this is expected, that means i can have a
>> no downtime upgrade ?

Indeed you can.

>> Is this correct?

This is correct.

On Fri, Jun 17, 2022 at 2:35 PM Vijaykumar Jain <vijaykumarjain.github@gmail.com> wrote:
Hi,

i have two db servers pg12 and pg14 and they have exactly the same data in all schemas and tables. I tried linking both by setting wal_level=logical and make pg12 publisher and pg14 subscriber (with copy_data = false, create_slot = false, enabled = false)
Then i created a logical replication slot on pg12 and enabled subscription and logical replication was running just fine and all changes from pg12 going to pg14...
Is this expected ? I did not play with any of advancing of lsn anywhere...

If this is expected, that means i can have a pg12 cluster of primary and replica ... then i can take the replica out of cluster , make it writable using pg_promote and then pg_upgrade it to pg14 and then link it like above to old pg12 via logical replication...and then slowly after ensuring no issues, phase out pg12 and replace it with pg14, no downtime upgrade ?

Is this correct? (Of course no schema changes while this is being done) and i set max_wal_size to a large value to retain enough wals.


Re: Logical replication on two identical databases but diff versions

From
Vijaykumar Jain
Date:
Thank you, Tim.
I was always trying ways to speed up initial sync, did not know i could try this route.
(*sorry for top post, but hopefully this is the end of thread)

On Sat, Jun 18, 2022, 4:50 AM Tim <timfosho@gmail.com> wrote:
>>  Is this expected ? 

Yes, this is expected.

>> If this is expected, that means i can have a
>> no downtime upgrade ?

Indeed you can.

>> Is this correct?

This is correct.

On Fri, Jun 17, 2022 at 2:35 PM Vijaykumar Jain <vijaykumarjain.github@gmail.com> wrote:
Hi,

i have two db servers pg12 and pg14 and they have exactly the same data in all schemas and tables. I tried linking both by setting wal_level=logical and make pg12 publisher and pg14 subscriber (with copy_data = false, create_slot = false, enabled = false)
Then i created a logical replication slot on pg12 and enabled subscription and logical replication was running just fine and all changes from pg12 going to pg14...
Is this expected ? I did not play with any of advancing of lsn anywhere...

If this is expected, that means i can have a pg12 cluster of primary and replica ... then i can take the replica out of cluster , make it writable using pg_promote and then pg_upgrade it to pg14 and then link it like above to old pg12 via logical replication...and then slowly after ensuring no issues, phase out pg12 and replace it with pg14, no downtime upgrade ?

Is this correct? (Of course no schema changes while this is being done) and i set max_wal_size to a large value to retain enough wals.