Merge pull request #973 from citusdata/fix/964_pg_upgrade_catalog_tables

Fix failures during pg_upgrade
pull/1938/head
Murat Tuncer 2016-11-11 17:33:43 -08:00 committed by GitHub
commit 8f2e61dbfc
2 changed files with 12 additions and 1 deletions

View File

@ -157,6 +157,13 @@ _PG_init(void)
/* initialize transaction callbacks */
RegisterRouterExecutorXactCallbacks();
RegisterShardPlacementXactCallbacks();
/* enable modification of pg_catalog tables during pg_upgrade */
if (IsBinaryUpgrade)
{
SetConfigOption("allow_system_table_mods", "true", PGC_POSTMASTER,
PGC_S_OVERRIDE);
}
}

View File

@ -642,7 +642,8 @@ CitusHasBeenLoaded(void)
}
}
extensionLoaded = extensionPresent && extensionScriptExecuted;
/* we disable extension features during pg_upgrade */
extensionLoaded = extensionPresent && extensionScriptExecuted && !IsBinaryUpgrade;
if (extensionLoaded)
{
@ -653,6 +654,9 @@ CitusHasBeenLoaded(void)
*
* Ensure InvalidateDistRelationCacheCallback will notice those changes
* by caching pg_dist_partition's oid.
*
* We skip these checks during upgrade since pg_dist_partition is not
* present during early stages of upgrade operation.
*/
DistPartitionRelationId();
}