> Few comments: > 1) We will be able to override the value of max_slot_wal_keep_size by > using --new-options like '--new-options "-c > max_slot_wal_keep_size=val"': > + /* > + * Use max_slot_wal_keep_size as -1 to prevent the WAL removal by the > + * checkpointer process. If WALs required by logical replication > slots > + * are removed, the slots are unusable. This setting prevents the > + * invalidation of slots during the upgrade. We set this option when > + * cluster is PG17 or later because logical replication slots > can only be > + * migrated since then. Besides, max_slot_wal_keep_size is > added in PG13. > + */ > + if (GET_MAJOR_VERSION(cluster->major_version) >= 1700) > + appendPQExpBufferStr(&pgoptions, " -c > max_slot_wal_keep_size=-1"); > > Should there be a check to throw an error if this option is specified > or do we need some documentation that this option should not be > specified?
I have tested the above scenario. We are able to override the max_slot_wal_keep_size by using '--new-options "-c max_slot_wal_keep_size=val"'. And also with some insert statements during pg_upgrade, old WAL file were deleted and logical replication slots were invalidated. Since the slots were invalidated replication was not happening after the upgrade. Thanks, Shlok Kumar Kyal