gpupgrade execute command has completed successfully, it has finished all the upgrade tasks it is able to perform on the master and primary segment. The source Greenplum Database cluster is stopped, the target cluster is running with upgraded master and primary segments, and the source standby master and mirror segments are unchanged. During finalize phase, the upgrade process completes the master standby and mirrors updates.
The following table summarises the cluster state before and after
|Before Finalize||After Finalize|
|Master||DOWN||UP and populated||DOWN||UP|
|Primaries||DOWN||UP and populated||DOWN||UP|
gpupgrade finalize command performs the following steps:
Here are some steps you can follow to verify the target Greenplum Database cluster before you make the decision to finalize the upgrade. As always, be sure to document all changes you make to the system so that you have a record you can refer to later, if needed.
Set up your environment to access the target cluster. See Connecting to the Target Cluster. You may also need to set up the environment in scripts or configuration files that you run while testing the target cluster.
gpstate to see the status of the cluster. The master instance and primary segment instances should be up. The standby master and mirror segments are not added to the cluster until you run
gpcheckcat to verify the system catalog.
Merge needed entries from the
pg_hba.conf authentication file in the source cluster master directory into the
pg_hba.conf file in the target cluster master directory.
The upgrade has installed the default
postgresql.conf file and updated the master port. Review the
postgresql.conf file in the source master directory for any server configuration parameters you need to apply to the target cluster. See System Configuration Parameter Changes for parameters that have been added, removed, or modified between Greenplum Database 5 and Greenplum Database 6.
Run any test scripts you have available to verify the upgraded database. Make sure to test all of your standard transactions against the target database and to verify the results.
Test user applications against the upgraded databases.
Check for any open connections to the target Greenplum database and close any applications that might be trying to access the cluster.
gpupgrade finalize will check for open connections and output an error if it finds any.
gpupgrade finalize command.
$ gpupgrade finalize
The utility displays a summary message and waits for user confirmation before proceeding:
You are about to finalize a major-version upgrade of Greenplum. This should be done only during a downtime window. ... WARNING: Do not perform operations on the source and target clusters until gpupgrade is finalized or reverted. Continue with gpupgrade finalize? Yy|Nn:
gpupgrade displays progress as it executes the upgrade tasks:
Finalize in progress. Upgrading standby master... [COMPLETE] Upgrading mirror segments... [IN PROGRESS]
The status of each step can be COMPLETE, FAILED, SKIPPED, or IN PROGRESS. SKIPPED indicates that the command has been run before and the step has already been executed.
When the finalize process has completed,
gpupgrade reports the master listen port and master data directory for the source and target cluster:
Finalize in progress. Upgrading mirror segments... [COMPLETE] Upgrading standby master... [COMPLETE] Waiting for cluster to be ready... [COMPLETE] Stopping target cluster... [COMPLETE] Updating target master catalog... [COMPLETE] Updating data directories... [COMPLETE] Updating target master configuration files... [COMPLETE] Starting target cluster... [COMPLETE] Waiting for cluster to be ready... [COMPLETE] Stopping target cluster... [COMPLETE] Archiving log directories... [COMPLETE] Deleting state directories on the segments... [COMPLETE] Stopping hub and agents... [COMPLETE] Deleting master state directory... [COMPLETE] Finalize completed successfully. The target cluster has been upgraded to Greenplum 6.21.0 The source cluster is not running. If copy mode was used you may start the source cluster, but not at the same time as the target cluster. To do so configure different ports to avoid conflicts. You may delete the source cluster to recover space from all hosts. All source cluster data directories end in "68wVro6SnHs.<contentID>.old". MASTER_DATA_DIRECTORY=/data/gpdata/master/gpseg.68wVro6SnHs.-1.old The gpupgrade logs can be found on the master and segment hosts in /home/gpadmin/gpAdminLogs/gpupgrade-68wVro6SnHs-2022-06-14T06:32 NEXT ACTIONS ------------ To use the upgraded cluster: 1. Update any scripts to source /usr/local/greenplum-db-target/greenplum_path.sh 2. If applicable, update the greenplum-db symlink to point to the target install location: /usr/local/greenplum-db -> /usr/local/greenplum-db-target 3. In a new shell start the upgraded cluster. source /usr/local/greenplum-db-target/greenplum_path.sh MASTER_DATA_DIRECTORY=/data/gpdata/master/gpseg-1 PGPORT=5432 gpstart -a Execute the “post-finalize” data migration scripts, and recreate any additional tables, indexes, and roles that were dropped or altered to resolve migration issues.
Reset your environment to access the cluster using the same master data directory and master port number you used for the source cluster.
greenplum_path.sh file in the target Greenplum Database installation directory.
Review any remaining actions from the
pg_upgrade checks during the
initialize phase. For example, Tsvector user columns.
gpstate now should show that the master, standby master, primary segments, and mirror segments are all running.
In link mode, when upgrading the mirror segments, the following error may occur:
Error: Finalize: rpc error: code = Unknown desc = substep "UPGRADE_MIRRORS": 4 errors occurred: * rpc error: code = Unknown desc = 2 errors occurred: * Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2] * Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
To resolve this, run the following commands in a separate shell:
$ source /usr/local/greenplum-db-6*/greenplum_path.sh $ gpssh-exkeys -f all_hosts $ gpstart -a -d $(gpupgrade config show --target-datadir)
gpupgrade finalize command has completed successfully and the new Greenplum Database cluster is up and running, run the optional
gpupgrade-migration-sql-executor.bash post-finalize script. For more details on the migration scripts, see gpupgrade Migration Scripts.
gpupgradedoes not restore source cluster statistics to the target cluster. Run
analyzeafter successful completion of
gpupgrade finalize, to restore statistics. Be sure to account for the additional downtime required to recreate statistics on the target cluster.
You can now proceed with the gpupgrade Post-upgrade Phase.