Do we support upgrade of logical replication?

From: vignesh C <vignesh21(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Do we support upgrade of logical replication?
Date: 2021-03-10 10:33:38
Message-ID: CALDaNm2-SRGHK0rqJQu7rGiS4hDAb7Nib5HbojEN5ubaXGs2CA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was reviewing logical decoding of two-phase transactions feature,
while reviewing the feature I was checking if there is any impact on
publisher/subscriber upgrade.

I checked the existing pg_upgrade behaviour with logical replication.
I made a logical replication data instance with publisher and
subscriber with subscriber subscribed to a table. Then I tried
upgrading publisher and subscriber individually. After upgrade I
noticed the following:

1) Pg_logical/mappings files were not copied in the upgraded data folder:
------------------------------------------------------------------
Pg_logical contents in old data folder:
publisher/pg_logical/replorigin_checkpoint
publisher/pg_logical/mappings:
map-32cb-4df-0_1767088-225-225
publisher/pg_logical/snapshots:
0-1643650.snap

New upgraded data folder:
publisher1/pg_logical/replorigin_checkpoint
publisher1/pg_logical/mappings:
publisher1/pg_logical/snapshots:

2) Replication slots were not copied:
select * from pg_replication_slots;
slot_name | plugin | slot_type | datoid | database | temporary |
active | active_pid | xmin | catalog_xmin | restart_lsn |
confirmed_flush_lsn | wal_status | safe_wal_size | t
wo_phase
-----------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+-------------+---------------------+------------+---------------+--
---------
(0 rows)

3) The subscriber is in disabled mode in the upgraded data:
select * from pg_subscription;
oid | subdbid | subname | subowner | subenabled | subbinary |
substream | subtwophase | subconninfo |
subslotname | subsynccommit | subpublicati
ons
-------+---------+---------+----------+------------+-----------+-----------+-------------+------------------------------------------+-------------+---------------+-------------
----
16404 | 16401 | mysub | 10 | f | f | f
| f | host=localhost port=5432 dbname=postgres | mysub
| off | {mypub}
(1 row)

4) The pg_subscription_rel contents also were not copied:
select * from pg_subscription_rel;
srsubid | srrelid | srsubstate | srsublsn
---------+---------+------------+----------
(0 rows)

5) While logical decoding of transactions, the decoded changes will be
serialized based on logical_decoding_work_mem configuration. Even
these files were not copied during upgrade.

Do we support upgrading of logical replication, if it is supported
could someone point me to the document link on how to upgrade logical
replication?

Regards,
Vignesh

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2021-03-10 10:56:12 Re: [PATCH] Provide more information to filter_prepare
Previous Message Laurenz Albe 2021-03-10 10:32:02 Re: Confusing behavior of psql's \e