During this phase, you run the gpupgrade finalize command that upgrades the Greenplum segment mirrors and standby master.

Caution

Once you run gpupgrade finalize, you cannot use gpupgrade revert. gpupgrade will not be able to restore the original 5.x Greenplum cluster.

The following table summarizes the cluster state before and after gpupgrade finalize runs:

Before Finalize After Finalize
Source Target Source Target
Master DOWN UP and populated DOWN UP
Standby DOWN Non Existent DOWN UP
Primaries DOWN UP and populated DOWN UP
Mirrors DOWN Non Existent DOWN UP

Workflow Summary

The gpupgrade finalize command performs the following substeps:

  • Checks for active connections on the target cluster.
  • Upgrades the mirror segments.
  • Upgrades the standby master.
  • Waits for the cluster to be ready.
  • Stops the target cluster.
  • Updates the target master catalog.
  • Updates the data directories.
  • Updates the target master configuration files.
  • Starts the target cluster.
  • Waits for cluster to be ready.
  • Archives log directories.
  • Deletes internal backup directories on the segments.
  • Deletes state directories on the segments.
  • Stops hub and agent processes.
  • Executes finalize data migration SQL scripts.
  • Deletes master state directory.

Run gpupgrade finalize

Run the gpupgrade finalize command from the Greenplum master:

gpupgrade finalize --verbose

The utility displays a summary message and waits for user confirmation before proceeding. Then it proceeds to run the different substeps and displays its progress on the screen:

Checking active connections on target cluster...                   [COMPLETE]
Upgrading mirror segments...                                       [COMPLETE]
Upgrading standby master...                                        [COMPLETE]

The utility prompts you to run the Finalize data migration SQL scripts, if applicable. It displays all the scripts that it needs to apply, along with an explanation of what they do. The tool provides several options: none, some and all. Apply the provided scripts to get any database objects that were modified or dropped during gpupgrade initialize back to their original state.

To resolve any [FAILED] substeps review the screen error comments and recommendations, and visit Troubleshooting and Debugging.

When the finalize process has completed, gpupgrade reports the master listen port and master data directory for the source and target cluster.

About Source Cluster Directories

The gpupgrade finalize command renames the target directory names to the original names of their corresponding source directories. It also renames the original source data directories to:

<segmentPrefix>.<upgradeID>.<contentId>.old

Where:

  • <segmentPrefix> is the segment prefix string specified when the source Greenplum Database system was initialized. This is typically gpseg.
  • <upgradeID> is the 10-character string generated by gpupgrade for this upgrade instance.
  • <contentId> is the database content ID for the segment. The master segment instance content ID is always −1.
  • .old indicates that the directory is no longer the currently active data directory.

The gpupgrade finalize command archives all the log files of the upgrade process in the $HOME/gpAdminLogs/gpupgrade directory by renaming the directory with a timestamp, in the format $HOME/gpAdminLogs/gpupgrade-<upgradeID>-<timestamp>.

Using Your Upgraded Cluster

Perform the following steps to connect to your target cluster:

  1. Update any scripts that source greenplum_path.sh to use the new path <target-gpdb-install-dir>/greenplum_path.sh.

  2. In a new shell, reset the target cluster environment to use the original master data directory and master port number you were using in the source cluster, and source the greenplum_path.sh file in the target Greenplum Database installation directory:

    source <target-gpdb-install-dir>/greenplum_path.sh
    export MASTER_DATA_DIRECTORY="<data_directory_path>"
    export PGPORT=<port_number>
    
  3. Run gpstate. It should now show that the master, standby master, primary segments, and mirror segments are all running.

  4. Connect to the database.

Next Steps

Once the gpupgrade finalize command has completed successfully and the new Greenplum Database cluster is up and running, follow the steps summarized in Perform the Post-Upgrade Actions.

check-circle-line exclamation-circle-line close-line
Scroll to top icon