ggupgrade overview
The ggupgrade utility upgrades a Greengage DB cluster in place to the next major version, for example, from Greengage DB 6 to Greengage DB 7.
For the upgrade procedure, see Upgrade a Greengage DB cluster.
Installation
The ggupgrade package is available in the Greengage DB APT repository for Ubuntu 22.04.
If the repository is not configured on a host, add it as described in Install Greengage DB from a package.
On every cluster host, install the package as a user with sudo privileges.
The package depends on Greengage DB 6 and Greengage DB 7, so apt also installs any missing version:
$ sudo apt update
$ sudo apt install ggupgrade
The source code and releases of the utility are available in the ggupgrade repository on GitHub.
Synopsis
ggupgrade initialize { -f | --file } <config_file>
[ -v | --verbose ]
[ --pg-upgrade-verbose ]
[ --seed-dir <directory> ]
ggupgrade execute [ --parent-backup-dirs <directories> ]
[ -v | --verbose ]
[ --pg-upgrade-verbose ]
ggupgrade finalize [ -v | --verbose ]
ggupgrade revert [ -v | --verbose ]
ggupgrade generate --gphome <path> --port <port>
[ --seed-dir <directory> ]
[ --output-dir <directory> ]
ggupgrade apply --gphome <path> --port <port>
--phase { initialize | finalize | revert | stats }
[ --input-dir <directory> ]
ggupgrade config show [ --upgrade-id ]
[ --source-gphome ]
[ --target-gphome ]
[ --target-datadir ]
[ --target-port ]
ggupgrade restart-services
ggupgrade [ <command> ] { -h | --help }
ggupgrade -V | --version
ggupgrade version [ --format { multiline | oneline | json } ]
Description
Overview
The utility upgrades the cluster in place in three phases: initialize (the source cluster keeps running), execute (the cluster is stopped), and finalize (the cluster is stopped).
Run the following commands in this order:
-
initialize— checks the cluster, applies the data migration scripts you select, creates the target cluster, and runspg_upgrade --check. You do not need to initialize the target cluster yourself. -
execute— stops the source cluster and runspg_upgradeon the master. It then copies the upgraded master data directory to the segment hosts and runspg_upgradeon every primary segment. Finally, it starts the upgraded cluster on a temporary port. Mirror segments and the standby master are not upgraded at this step. -
finalize— upgrades the mirror segments and the standby master, if present, and makes the upgraded cluster available on the original port and in the original data directories.
You can return to the original state with revert after initialize or execute, but not after finalize has started.
From the start of initialize until the upgrade is finalized or reverted, do not perform operations on the source cluster.
Do not run queries that modify the target cluster until finalize completes.
These queries make the target cluster inconsistent with the source cluster.
Hub and agents
You run the ggupgrade command on the master host.
The command sends your requests to two types of background processes: the hub and agents.
-
The hub runs on the master host and manages the upgrade. The hub listens on the port set by the hub_port parameter.
-
Agents run on segment hosts and on the standby master host, and perform the upgrade tasks on those hosts. The agents listen on the port set by the agent_port parameter.
The initialize command starts the hub and agents.
The finalize and revert commands stop them.
Do not stop the hub and agents while a ggupgrade command is running, for example, with ggupgrade kill-services.
Upgrade modes
The upgrade mode is set by the mode parameter:
-
copy—pg_upgradecopies the data files of the master and the primary segments into the data directories of the target cluster. The source cluster’s data files remain unchanged even after the target cluster starts at the end ofexecute. Therevertcommand stops the target cluster, deletes its data directories, and starts the source cluster. The source cluster’s data files do not need to be restored. This mode requires disk space for a second copy of the data. -
link—pg_upgradecreates hard links to the data files instead of copying them: the target and the source clusters share the same files on disk. Creating hard links is faster than copying the data files and requires almost no additional disk space. The source cluster’s files start changing duringexecute:pg_upgraderenames thepg_controlfiles on the source master and segments to prevent the source cluster from being started accidentally. After creating the links,pg_upgradealso runsVACUUM FREEZEin every database on the master. Therefore,revertafterexecuterestores the master from the standby master and the primary segments from the mirror segments. If the cluster does not have both a standby and mirrors for all primary segments, you cannot revert afterexecutehas started. In this case, back up the cluster before you runexecute.
Log and script files
On each cluster host, the utility writes its log files to the ~/gpAdminLogs/ggupgrade directory. By default, the generated data migration scripts are saved in the same directory on the master host. The files present on each host depend on the role of the host, as shown by the comments in the following structure:
~/gpAdminLogs/ggupgrade
├── cli_<YYYYMMDD>.log # messages from the ggupgrade command (all hosts)
├── hub_<YYYYMMDD>.log # messages from the hub (master host)
├── agent_<YYYYMMDD>.log # messages from the agents (segment hosts, standby master host)
├── apply_<phase>.log # output of the applied scripts (master host)
├── pg_upgrade_<timestamp> # pg_upgrade output, one directory per run
│ ├── p-1 # master (master host)
│ │ └── ...
│ └── p0, p1, ... # primary segments (segment hosts with primary segments)
│ └── ...
└── data-migration-scripts # master host
├── current # generated scripts: initialize, finalize, revert, stats
│ └── ...
└── archive # archived previous scripts
└── ...
On any error, the command prints a NEXT ACTIONS block with instructions on how to proceed.
The initialize command runs the checks for plpython2u and unique indexes on partitioned tables before pg_upgrade.
If either check finds objects that block the upgrade, it saves a list of these objects in a file in ~/gpAdminLogs/ggupgrade.
The error message includes the full path to this file.
If the pg_upgrade checks on the master fail, the NEXT ACTIONS block points to the pg_upgrade_<timestamp>/p-1 directory.
See p-1/log/pg_upgrade_internal.log for details.
If a check finds objects that block the upgrade, the fatal block in this log includes the name of the file that lists these objects.
Other text files in p-1 may be reports of checks that passed.
If the pg_upgrade checks fail on the master, the segment checks do not run, so no p0, p1, … directories are created for this run.
If pg_upgrade fails on a primary segment, the error message contains only the host name and the content ID of the segment: upgrade primary on host <host> with content <N>: exit status 1.
See pg_upgrade_<timestamp>/p<N>/log/pg_upgrade_internal.log on that host.
If the segment instance failed to start, this log points to pg_upgrade_server.log, which explains the failure.
If pg_upgrade fails on the master during execute, the error message upgrade master: exit status 1 does not include a log path either.
See pg_upgrade_<timestamp>/p-1/log/pg_upgrade_internal.log on the master host.
Depending on the error, also check the following files in pg_upgrade_<timestamp>/p-1:
-
log/pg_upgrade_server.log — the server log if the master failed to start.
-
log/pg_upgrade_utility.log — output from helper utilities.
-
log/pg_upgrade_dump_<oid>.log — schema restore errors for the database with the specified OID.
Output from all hub steps, including the output of pg_upgrade on the master, is always written to hub_<YYYYMMDD>.log.
To also print this output as the command runs, use --verbose.
After finalize or revert, the whole ~/gpAdminLogs/ggupgrade directory is moved to ~/gpAdminLogs/ggupgrade-<upgrade_id>-<timestamp> on each host and keeps the same structure.
When the finalize or revert command applies migration scripts, it writes their output to the apply_<phase>.log files in the archived directory.
If you apply the scripts later with the apply command, the command writes a new apply_<phase>.log file to the ~/gpAdminLogs/ggupgrade directory.
Prerequisites
Make sure that the following requirements are met before you start the upgrade:
-
The source cluster runs Greengage DB 6.32.0 or later when you upgrade to Greengage DB 7.
-
The target version of Greengage DB and the
ggupgradepackage are installed on all cluster hosts, in addition to the source version. -
The extensions that use libraries, for example, PXF, are installed for the target version of Greengage DB on all cluster hosts. Otherwise, the
pg_upgradecheck duringinitializefails atChecking for presence of required libraries. -
When you run
initialize, thePATHandLD_LIBRARY_PATHvariables in thegpadminuser’s environment on all hosts, including the master host, do not include installation directories for the source or target version of Greengage DB. Otherwise,initializestops with one of the following errors on each affected host:on host <host> PATH contains GPHOME on host <host> LD_LIBRARY_PATH contains GPHOMERemove or comment out the lines that source greengage_path.sh from .bashrc and .bash_profile on all hosts, and run
ggupgradein a new shell. -
The shell in which you run
ggupgrade initializeuses the same locale as the cluster databases, for example,LANG=en_US.UTF-8andLC_ALL=en_US.UTF-8. Otherwise, thepg_upgradecheck duringinitializefails with the following error:lc_collate values for database "<name>" do not match: old "<old_locale>", new "<new_locale>" -
All client connections to the source cluster are closed before you run
execute. Prevent clients from reconnecting to the source cluster until the upgrade is finalized or reverted.
Commands
The steps below summarize each command.
- initialize
-
Runs the pre-upgrade checks and prepares the cluster for the upgrade. The upgrade parameters are read from the configuration file.
To review the data migration scripts before they are applied, generate them in advance with the
generatecommand.The
initializecommand is interactive. It shows the parameter values and asks you to confirm them. It also asks whether to archive or keep the existing generated scripts and whichstatsandinitializescripts to apply. Thestatsscripts only collect information about the cluster.Before you run
initialize, do the following:-
Back up the source cluster (see Backup and restore).
-
Run gpcheckcat to check the catalog.
-
Run gpstate with the
-eoption to check that the segments are up and in their preferred roles.
Before you select the scripts, you can review them in the directory shown by the command. For the
initializescripts, selecta(all) to apply them during the upgrade,s(some) to choose specific scripts, orn(none) to check forpg_upgradeerrors without changing the source cluster. If you applied theinitializescripts in advance, selectc(continue) when the command asks about the existing scripts. If you selecta(archive and regenerate) instead, the newfinalizeandrevertscripts do not re-create the objects that theinitializescripts dropped.IMPORTANTThe
initializescripts change the source cluster. For example, they drop primary key, unique, and foreign key constraints and indexes on partitioned tables, change the type oftsquerycolumns totext, and drop the indexes and views that depend on these columns. Apply these scripts during a maintenance window when applications do not access the affected tables. The objects that theinitializescripts drop remain absent until the matchingfinalizeorrevertscripts are applied. Thefinalizescripts re-create only objects supported in the target version.The command performs the following steps:
-
Checks the source cluster for objects that cannot be upgraded to the target version.
-
Generates the data migration scripts and applies the
statsandinitializescripts you select to the source cluster. -
Checks the environment and free disk space on the hosts.
-
Creates the target cluster.
-
Runs the
pg_upgradechecks.
After
initialize, the source cluster is still running, and the target cluster is created but stopped.Options:
--file,--verbose,--pg-upgrade-verbose,--seed-dir -
- execute
-
Performs the main upgrade phase: upgrades the master and the primary segments to the target Greengage DB version. Run this command only during a downtime window. Disconnect all clients first: the command fails if there are active connections to the source cluster.
The command performs the following steps:
-
Checks that there are no active connections to the source cluster.
-
Stops the source cluster.
-
Runs
pg_upgradeon the master. -
Copies the upgraded master data directory to the segment hosts.
-
Runs
pg_upgradeon every primary segment. -
Starts the target cluster on a temporary port.
Mirror segments and the standby master are upgraded during
finalize.Options:
--parent-backup-dirs,--verbose,--pg-upgrade-verbose -
- finalize
-
Completes the upgrade: upgrades the standby master and the mirror segments, if any, and switches the upgraded cluster to the original port and data directories. Run this command only during a downtime window. Disconnect all clients first: the command checks for active connections to the target cluster.
CAUTIONOnce
finalizestarts, you cannot return the cluster to the original state. Before you run the command, check the upgraded cluster.The command is interactive.
The command performs the following steps:
-
Checks that there are no active connections to the target cluster.
-
If the source cluster has mirror segments or a standby master, re-creates them from the upgraded primary segments and master.
-
Switches the upgraded cluster to the original port and data directories.
-
Archives the logs and stops the hub and agents.
-
Applies the
finalizedata migration scripts. -
Asks whether to collect optimizer statistics. If you answer
y, it analyzes the target cluster. If you answern, run vacuumdb with the--all --analyze-in-stagesoptions later.
The source data directories are kept under names with the upgrade ID and the
.oldsuffix, for example, gpseg-1 is renamed to gpseg.<upgrade_id>.-1.old.The
finalizescripts re-create objects such as primary key and foreign key constraints that theinitializescripts dropped. If you skipped these scripts, apply them as described in Apply skipped data migration scripts.To use the upgraded cluster, source the greengage_path.sh file from the target Greengage DB installation in a new shell.
Options:
--verbose -
- revert
-
Returns the cluster to its original state. You can run it after
initializeorexecute, but not afterfinalizehas started. In link mode, if the cluster does not have both a standby master and mirrors for all primary segments, you cannot revert afterexecutehas started.Run this command only during a downtime window. The command is interactive. Apply the
revertscripts only if theinitializescripts were applied. Otherwise, the scripts fail because the objects that they re-create already exist.The command performs the following steps:
-
Checks that there are no active connections to the target cluster.
-
Stops the target cluster and deletes its data directories.
-
If
executehas started inlinkmode, restores the data files of the master and the primary segments from the standby master and the mirror segments. -
Starts the source cluster.
-
Archives the logs and stops the hub and agents.
-
Applies the
revertdata migration scripts.
The
revertscripts re-create the objects that theinitializescripts dropped. If you skipped these scripts and theinitializescripts were applied, apply therevertscripts as described in Apply skipped data migration scripts.Options:
--verbose -
- generate
-
Generates the data migration scripts for all databases in the source cluster. The scripts handle the database objects that require changes for the target version.
The scripts are generated for the objects that exist when you run
generate. If you later create or change objects that cannot be upgraded, rungenerateagain before you apply theinitializescripts.You can apply the scripts from any directory with the
applycommand. If the scripts already exist,generateasks whether to archive them and generate new ones, use the existing scripts, or quit. No downtime is required.Options:
--gphome,--port,--seed-dir,--output-dir - apply
-
Applies the generated data migration scripts for the specified phase to the cluster. Use the scripts generated by the
generateorinitializecommand.The scripts can lock and rewrite tables and drop or re-create indexes and constraints. Apply them during a maintenance window when applications do not access the affected tables. The command asks which scripts to apply.
Options:
--gphome,--port,--phase,--input-dir - config show
-
Shows the upgrade configuration parameters, including the target cluster’s data directory and port. Use it, for example, to connect to the target cluster before
finalize.Available from the start of
initializeuntilfinalizeorrevertcompletes. With a single option, the command shows only the value. Otherwise, it shows each parameter as<name>: <value>.Options:
--upgrade-id,--source-gphome,--target-gphome,--target-datadir,--target-port - restart-services
-
Restarts the hub and agents that are not running. Use it when a command fails because the hub is not running.
The hub stops when the terminal session that started it ends, so keep the session open until a command completes. The error also appears if you reconnect between commands.
Error: connecting to hub on port 7527: context deadline exceededAfter the restart, run the failed command again.
For details on the hub and agents, see Hub and agents.
- version
-
Displays the utility version, like the
-Voption.Options:
--format
Configuration file
The file contains one <parameter> = <value> line per parameter.
Comments start with # and can begin anywhere on a line.
Empty lines are ignored.
Each parameter can appear only once and must have a value.
The package includes a configuration file template.
If you installed ggupgrade from the DEB package, the template is at /opt/greengagedb/ggupgrade/ggupgrade_config.
Example:
source_master_port = 5432
source_gphome = /opt/greengagedb/greengage6
target_gphome = /opt/greengagedb/greengage7
mode = copy
All other parameters use their default values.
- source_master_port
-
(Required) The master port of the source cluster.
- source_gphome
-
(Required) The installation directory for the source version of Greengage DB.
- target_gphome
-
(Required) The installation directory for the target version of Greengage DB.
- mode
-
(Optional) The upgrade mode.
Values:
copy,link
Default:copy - disk_free_ratio
-
(Optional) The fraction of disk space that must be free on the file systems containing the source cluster’s data directories. The utility checks the free space during
initialize. Specify0to skip the disk space check.Values: from
0.0to1.0
Default:0.6forcopymode,0.2forlinkmode - pg_upgrade_jobs
-
(Optional) The number of parallel jobs for
pg_upgrade(the--jobsoption).Default:
4 - use_hba_hostnames
-
(Optional) Whether to use host names instead of IP addresses in the pg_hba.conf files of the target cluster.
Values:
true,false
Default:false - dynamic_library_path
-
(Optional) Paths to append to the value of the dynamic_library_path parameter of the target cluster. Specify them for extensions installed outside their default location.
Default:
$libdir - temp_port_range
-
(Optional) The ports for the target cluster during the upgrade. The range must contain enough free ports for the master, the standby, and all primary and mirror segments.
Values: a comma-separated list of ports and port ranges, for example,
6000,6002-6005
Default:50432-65535 - hub_port
-
(Optional) The hub port. For details, see Hub and agents.
Default:
7527 - agent_port
-
(Optional) The agent port. For details, see Hub and agents.
Default:
6416 - seed_dir
-
(Optional) The directory containing the seed scripts used to generate the data migration scripts. The seed scripts are included in the
ggupgradepackage. For DEB installations, this directory is /opt/greengagedb/ggupgrade/data-migration-scripts.Default: the data-migration-scripts subdirectory in the utility’s installation directory
- parent_backup_dirs
-
(Optional) The parent directories for backups of the master data directory. The backups are created in the .ggupgrade subdirectory of these directories on the master host and the segment hosts. By default, the parent directories of the data directories are used, for example, /data1/master for /data1/master/gpseg-1.
Set this parameter if the default directories cannot be created or do not have enough free space. Specify a single path, such as
/data1/backup, to use it on all hosts, or<host1>:<dir1>,<host2>:<dir2>,…pairs, where the first host must be the master host and the list must include all segment hosts.gpadminmust have permission to create these directories. The utility creates and checks them duringinitialize, so any errors appear before the source cluster is stopped. The --parent-backup-dirs option forexecuteoverrides this parameter.
Options
- -f | --file <config_file>
-
Applies to: initialize
(Required) The configuration file that contains the upgrade parameters. See Configuration file for the format and parameters. This option can be combined only with
--verbose,--pg-upgrade-verbose, and--seed-dir. - --parent-backup-dirs <directories>
-
Applies to: execute
(Optional) The parent directories for the upgrade backups. Overrides the parent_backup_dirs parameter in the configuration file. For the value format and the default directories, see the description of that parameter. The utility creates and checks the directories specified with
--parent-backup-dirsonly duringexecute, after the source cluster is stopped. - -v | --verbose
-
Applies to: initialize, execute, finalize, revert
(Optional) Print the output of the utilities that
ggupgradecalls (gpstop,gpstart,pg_upgrade, and so on) and the duration of each step.The output of these utilities can contain messages marked as errors or warnings even when a step succeeds, for example, while the standby is being created. Check the status of each step instead:
[COMPLETE]or[FAILED]. - --pg-upgrade-verbose
-
Applies to: initialize, execute
(Optional) Run
pg_upgradewith the--verboseoption. Requires--verbose. - --gphome <path>
-
(Required) The path to the cluster’s Greengage DB installation. There is no default: the utility does not read the
GPHOMEenvironment variable. - --port <port>
-
(Required) The master port of the Greengage DB cluster. There is no default: the utility does not read the
PGPORTenvironment variable. - --seed-dir <directory>
-
Applies to: initialize, generate
(Optional) The directory with the seed scripts used to generate the data migration scripts. For
initialize, this option overrides the seed_dir parameter in the configuration file. For the default directory, see the description of that parameter. - --output-dir <directory>
-
Applies to: generate
(Optional) The directory for the generated data migration SQL files. The default is $HOME/gpAdminLogs/ggupgrade/data-migration-scripts.
The scripts are written to the current subdirectory, grouped by phase. The
initializecommand always uses the default directory, regardless of this option. If you applied theinitializescripts from the directory set by--output-dir, apply the correspondingfinalizeorrevertscripts from the same directory with theapplycommand. - --phase <phase>
-
Applies to: apply
Values:initialize,finalize,revert,stats(Required) The data migration phase for which the scripts are applied.
The
initialize,finalize, andrevertscripts change the cluster. Thestatsscripts only collect cluster statistics, such as the number of segments, tables, and indexes. - --input-dir <directory>
-
Applies to: apply
(Optional) The directory containing the generated data migration SQL files. Specify the directory that contains the current subdirectory. The default is $HOME/gpAdminLogs/ggupgrade/data-migration-scripts.
- --upgrade-id
-
Applies to: config show
(Optional) Show the upgrade identifier. The identifier is included in the names of the archived log directories and the
.oldsource data directories. - --source-gphome
-
Applies to: config show
(Optional) Show the installation directory for the source version of Greengage DB.
- --target-gphome
-
Applies to: config show
(Optional) Show the installation directory for the target version of Greengage DB.
- --target-datadir
-
Applies to: config show
(Optional) Show the data directory of the target master.
- --target-port
-
Applies to: config show
(Optional) Show the port of the target master.
- -h | --help
-
Display help for the utility. If you specify a command before the option, display help for that command.
- --format { multiline | oneline | json }
-
Applies to: version
(Optional) The format of the version information. The default is
multiline. You can also use this option with-V. - -V | --version
-
Display the utility version.
Examples
Basic upgrade procedure
The following example upgrades a Greengage DB 6 cluster to Greengage DB 7 in copy mode.
The utility generates and applies the data migration scripts itself.
Run initialize in a shell without the Greengage DB environment loaded.
For the complete procedure, including preparation and checks, see Upgrade a Greengage DB cluster.
-
Create the configuration file ~/ggupgrade_config:
source_master_port = 5432 source_gphome = /opt/greengagedb/greengage6 target_gphome = /opt/greengagedb/greengage7 mode = copy -
Prepare the cluster for the upgrade:
$ ggupgrade initialize --file ~/ggupgrade_config --verbose -
Upgrade the master and the primary segments:
$ ggupgrade execute --verbose -
Check the upgraded cluster. To get the data directory and the port of the target cluster, run:
$ ggupgrade config show --target-datadir --target-port -
Complete the upgrade:
$ ggupgrade finalize --verbose
To return the cluster to its original state, run revert instead of finalize:
$ ggupgrade revert --verbose
Upgrade with manually applied scripts
Use this procedure to review the data migration scripts and apply the initialize scripts in advance, for example, during a separate maintenance window.
Create the configuration file as in the basic procedure.
-
Generate the scripts and review them in the ~/gpAdminLogs/ggupgrade/data-migration-scripts/current directory:
$ ggupgrade generate --gphome /opt/greengagedb/greengage6 --port 5432 -
Apply the
initializescripts to the source cluster. When the command asks which scripts to apply, selecta(all):$ ggupgrade apply --gphome /opt/greengagedb/greengage6 --port 5432 \ --phase initialize -
Prepare the cluster for the upgrade. When the command asks about the existing scripts, select
c(continue). When it asks whichinitializescripts to apply, selectn(none), because you have already applied them:$ ggupgrade initialize --file ~/ggupgrade_config --verbose -
Upgrade the master and the primary segments:
$ ggupgrade execute --verbose -
Check the upgraded cluster. To get the data directory and the port of the target cluster, run:
$ ggupgrade config show --target-datadir --target-port -
Complete the upgrade:
$ ggupgrade finalize --verbose
If you skipped the migration scripts when running the finalize command, apply them as described in Apply skipped data migration scripts.
Generate the data migration scripts
Run generate in advance, for example, to review the scripts before initialize applies them or to see which objects the upgrade changes:
$ ggupgrade generate --gphome /opt/greengagedb/greengage6 --port 5432
Write the scripts to a custom directory, for example, to apply them later with the apply command (see --output-dir):
$ ggupgrade generate --gphome /opt/greengagedb/greengage6 --port 5432 \
--output-dir ~/migration_scripts
Apply skipped data migration scripts
If you skipped the finalize or revert scripts, apply them after the command completes.
Specify the installation directory for the version of Greengage DB that is running now and the original port.
For the input directory, use the script directory in the upgrade log archive.
The utility shows this path, which is unique for each upgrade, in its instructions for the next steps.
For example, to apply the finalize scripts to the upgraded cluster:
$ ggupgrade apply \
--gphome /opt/greengagedb/greengage7 \
--port 5432 \
--phase finalize \
--input-dir ~/gpAdminLogs/ggupgrade-XJES4G9-fOA-20261019T123609/data-migration-scripts
To apply the skipped revert scripts, specify --phase revert and the installation directory of the source version of Greengage DB.
Recover from an interrupted execute
If the hub stops during execute, for example, because the terminal session closes, postgres processes of the source cluster started by pg_upgrade can remain on the cluster hosts.
In this case, rerunning execute fails with a connection refused error, and revert cannot start the source cluster.
To return the cluster to its original state:
-
Restart the hub and agents:
$ ggupgrade restart-services -
On each cluster host, find the
postgresprocesses of the source cluster left bypg_upgrade. You can identify them by the-boption in the command line:$ ps -ef | grep '[p]ostgres -D' | grep -- ' -b ' -
Stop each such process, specifying its data directory from the
-Doption value, for example:$ /opt/greengagedb/greengage6/bin/pg_ctl stop -D /data1/primary/gpseg0 -m fast -
Return the cluster to its original state:
$ ggupgrade revert --verbose
Show the upgrade configuration
Show all configuration parameters:
$ ggupgrade config show
Show only the target cluster’s data directory and port:
$ ggupgrade config show --target-datadir --target-port
Change the location of the upgrade backups
If the file systems containing the data directories do not have enough free space, specify other directories for the upgrade backups. For the value format and the directory requirements, see the parent_backup_dirs parameter in the configuration file.
Store the backups in the /data1/backup directory on the master host and on the segment hosts:
$ ggupgrade execute --parent-backup-dirs /data1/backup
If the hosts have different disk layouts, specify a directory for each host:
$ ggupgrade execute \
--parent-backup-dirs mdw:/data1/backup,sdw1:/data2/backup,sdw2:/data2/backup
Print the detailed output of pg_upgrade
If a pg_upgrade check or an upgrade step fails, run the command again with the --pg-upgrade-verbose option to print the internal output of pg_upgrade.
For example:
$ ggupgrade initialize --file ~/ggupgrade_config \
--verbose --pg-upgrade-verbose
Display help
To see a command’s description, steps, and options, run it with the --help option:
$ ggupgrade initialize --help
To see the list of commands, run the utility with the same option:
$ ggupgrade --help