pg_upgrade: disable singleton user check for segments
pg_upgrade change to support Greenplum cluster upgrade(gpupgrade): pg_upgrade is subordinate to the overall scheme which will essentially force the master's catalog tables onto the segments. So this check that the target cluster only has one user isn't appropriate for a Greenplum cluster segment.
@@ -196,7 +196,14 @@ check_new_cluster(void)
* We only allow the install user in the new cluster because other defined
* users might match users defined in the old cluster and generate an
* error during pg_dump restore.
+ *
+ * However, in Greenplum, if we are upgrading a segment, its users have
+ * already been replicated to it from the master via gpupgrade. Hence,
+ * we only need to do this check for the QD. In other words, the
+ * Greenplum cluster upgrade scheme will overwrite the QE's schema
+ * with the QD's schema, making this check inappropriate for a QE upgrade.
*/
+ if (user_opts.segment_mode == DISPATCHER)
if (new_cluster.role_count != 1)
pg_log(PG_FATAL, "Only the install user can be defined in the new cluster.\n");
