Subject: RE: [PoC] pg_upgrade: allow to upgrade publisher node

From: "Hayato Kuroda (Fujitsu)" <[email-masked]>
Date: Mon, 28 Aug 2023 05:23:10 +0000

Dear Dilip,

Thank you for reading the thread!

> I haven't read this thread in detail, but I have one high-level design
> question.  The upgrade of the replication slot is default or is it
> under some GUC?

I designed that logical slots were upgraded by default.

> because if it is by default then some of the users
> might experience failure in some cases e.g. a) wal_level in the new
> cluster is not logical b) If this new check
> check_old_cluster_for_confirmed_flush_lsn() fails due to confirm flush
> LSN is not at the latest shutdown checkpoint.  I am not sure whether this
> is a problem or could be just handled by documenting this behavior.

I think it should be done by default to avoid WAL hole. If we do not provide the
upgrading by default, users may forget to specify the option. After sometime
he/she would notice that slots are not migrated and would create slots at that time,
but this leads data loss of subscriber. The inconsistency between nodes is really
bad. Developers requested to enable by default [1].

Moreover, checking related with logical slots are skipped when slots are not defined
on the old cluster. So it do not affect when users do not use logical slots.

Also, we are considering that an option for excluding slots is introduced after
committed once [2].

[1]: https://www.postgresql.org/message-id/ad83b9f2-ced3-c51c-342a-cc281ff562fc%40postgresql.org
[2]: https://www.postgresql.org/message-id/CAA4eK1KxP%2BgogYOsTHbZVPO7Pp38gcRjEWUxv%2B4X3dFept3z3A%40mail.gmail.com

Best Regards,
Hayato Kuroda
FUJITSU LIMITED