gpdb
gpdb copied to clipboard
pg_upgrade: add func to check if guc setting is removed
Gucs/settings can be applied to certain databses or roles and are stored in pg_db_role_settings Upgrade would also to restore these settings on target cluster Some of these settings are removed in newer version and will cause upgrade to fail. This happens during metadata restore on the target cluster because pg_restore will error trying to apply these settings, and would fail since these settings are not present anymore. This is not ideal as we could be many hours into upgrade before a removed guc causes pg_upgrade to fail In order to detect such removed gucs, we go through all the settings applied/present in pg_db_role_settings. This view contains all gucs set to a non-default value by the user for a certain database/role. Each guc is then checked if it is removed or not by comparing with the list of all_removed_gucs. If it is, we then notify that the guc is not present in GPDB7 and ask them to reset the guc.
6X removed gucs list PR: https://github.com/greenplum-db/gpdb/pull/17372 Gpupgrade test PR: https://github.com/greenplum-db/gpupgrade/pull/912
Will need to add the corresponding test to https://github.com/greenplum-db/gpupgrade . When you do, please add the link to this PR message.