The incremental online backup feature enables backing up all data of a running YMatrix database cluster at a specific point in time by saving it into files according to predefined rules. The backed-up data ensures completeness and consistency of the database at that specific point in time.
Furthermore, from all files of a given backup, a functional YMatrix database cluster can be restored, with content identical to the original cluster at the specified point in time.
Based on the essential full backup creation capability, the incremental online backup feature provides support for creating incremental backups.
A full backup copies all data from the entire database cluster. Creating a full backup imposes certain resource usage overhead on the running database. However, restoring a database cluster from a full backup is fast. An incremental backup captures only changes made to the original cluster after a previously created full backup. Creating an incremental backup has minimal impact on the running database. However, restoring a database cluster from an incremental backup is slower than from a full backup. In practice, combining both methods balances the operational impact on the original cluster and the speed of recovery from backups.
1. Backup File Storage
Incremental online backup files are stored on the machines of the original database cluster, under the directory /mxarchive_<original database cluster ID>. Each machine uses this directory to store backup files generated from its local database segment. The directory structure is as follows:
/mxarchive_<original_cluster_ID>
├── 1 (dbid of the segment in the original cluster)
│ ├── basebackup (stores the basebackup tarball of the original cluster)
│ │ └── <basebackup_version> (a full backup version)
│ │ └── base.tar (tarball created by pg_basebackup; if compression is enabled, it will be base.tar.gz)
│ ├── wal (stores WAL segment files)
│ ├── history (stores WAL history files)
│ ├── backup (stores backup files created by pg_basebackup for full backups)
│ └── misc (stores broken WAL segment files caused by cluster failover/failback)
├── 2
│ └── ... (same structure as above)
└── 3
└── ... (same structure as above)
2. Version Information Management
Version information for incremental online backups is stored on the machine hosting the master node of the original database cluster, using an SQLite database file located at /mxarchive_<original database cluster ID>/metadata/mxarchive.db.
Note!
When configuring the database cluster to use the incremental online backup feature, the cluster must be in a normal running state.
All operations related to the incremental online backup feature must be performed on the master host, using the database cluster management usermxadminas the user executing themxarchivecommand.
1. Feature Initialization
Log in to the master host and run the following command as the mxadmin user:
$ mxarchive init
Sample output:
$ mxarchive init
2025-04-09:14:16:12.561 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Fetch deployment information of cluster: baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:16:12.565 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:16:12.570 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Initialize local archive storage on every host ...
2025-04-09:14:16:12.599 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Finished initializing local archive storage.
2025-04-09:14:16:14.799 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Finished mxarchive initialization for database cluster: baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:16:14.799 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Please check /mxarchive_baz8hPk6Rn27YsFrq7pN3E on each host for archive local storage.
2025-04-09:14:16:14.799 mxarchive_init:mxadmin:iv-ydt9heyeioxjd1u57imv:019030-[INFO]:-Please restart database cluster to make GUC changes to take effect.
2. Configure Backup File Directory
After initialization, each cluster host will have a /mxarchive_<Database cluster ID ID> directory for storing backup files. You may adjust disk placement as needed (e.g., configure symbolic links from segment directories to actual storage disks).
Note!
After configuration, ensure the original directory structure remains unchanged.
3. Restart the Cluster
After completing backup storage configuration, restart the database cluster to activate the backup functionality. Use mxstop to restart:
$ mxstop -arf
After restart, WAL segment files begin appearing in the wal subdirectories under each segment's directory in the backup location. You can now proceed to create new backup versions.
When creating the first backup version, a full backup must be created. Subsequent backup creations can be either full or incremental, based on requirements.
Use the following command to create a full backup version:
$ mxarchive backup --type full
To reduce disk usage during full backup creation, you can enable compression:
$ mxarchive backup --type full --compress
Sample output:
$ mxarchive backup --type full
2025-04-09:14:17:16.105 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Fetch meta for cluster baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:17:16.109 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:17:16.115 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Start to generate full version: 20250409_061716
2025-04-09:14:17:16.115 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Check current size of database cluster ...
2025-04-09:14:17:16.170 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-It takes 55.113584ms to query DB size
2025-04-09:14:17:16.170 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished checking database cluster's database size.
2025-04-09:14:17:16.170 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Start to run pg_basebackup on every shard. This might take some time ...
2025-04-09:14:17:16.170 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Start to run base backup on all shards ...
2025-04-09:14:17:27.594 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-It takes 11.423554784s to run basebackup on every shard
2025-04-09:14:17:27.594 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished running pg_basebackup on every shard.
2025-04-09:14:17:27.594 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Start to create global restore point: 20250409_061716
2025-04-09:14:17:29.861 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished creating global restore point: 20250409_061716
2025-04-09:14:17:29.862 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Collecting WAL file names for global restore point: 20250409_061716
2025-04-09:14:17:29.877 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/18000100 is 000000010000000000000006
2025-04-09:14:17:29.877 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/140000A0 is 000000010000000000000005
2025-04-09:14:17:29.877 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/140000A0 is 000000010000000000000005
2025-04-09:14:17:29.877 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/140000A0 is 000000010000000000000005
2025-04-09:14:17:29.879 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/140000A0 is 000000010000000000000005
2025-04-09:14:17:29.880 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/140000A0 is 000000010000000000000005
2025-04-09:14:17:29.883 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-WAL file name for LSN 0/140000A0 is 000000010000000000000005
2025-04-09:14:17:29.883 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished collecting WAL file names for global restore point: 20250409_061716
2025-04-09:14:17:29.883 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Switching WAL segment files for archiving ...
2025-04-09:14:17:33.561 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/18000150 in file 000000010000000000000006 for shard -1
2025-04-09:14:17:33.561 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/140000F0 in file 000000010000000000000005 for shard 0
2025-04-09:14:17:33.561 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/140000F0 in file 000000010000000000000005 for shard 1
2025-04-09:14:17:33.561 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/140000F0 in file 000000010000000000000005 for shard 2
2025-04-09:14:17:33.561 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/140000F0 in file 000000010000000000000005 for shard 3
2025-04-09:14:17:33.562 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/140000F0 in file 000000010000000000000005 for shard 4
2025-04-09:14:17:33.562 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[DEBUG]:-Returned LSN is 0/140000F0 in file 000000010000000000000005 for shard 5
2025-04-09:14:17:33.562 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished switching WAL segment files for archiving.
2025-04-09:14:17:33.562 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Collecting data needed to be preserved for archiving this version ...
2025-04-09:14:17:36.647 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished collecting data needed to be preserved for archiving this version.
2025-04-09:14:17:36.647 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Saving version information into metadata storage ...
2025-04-09:14:17:36.651 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Finished saving version information into metadata storage.
2025-04-09:14:17:36.651 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019553-[INFO]:-Succeed in generating full archive: 20250409_061716
Use the following command to create an incremental backup version:
$ mxarchive backup --type incr
Sample output:
$ mxarchive backup --type incr
2025-04-09:14:18:45.666 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Fetch meta for cluster baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:18:45.670 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:18:45.676 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Start to generate incremental version 20250409_061845
2025-04-09:14:18:45.676 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Check current size of database cluster ...
2025-04-09:14:18:45.738 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-It takes 61.690291ms to query DB size
2025-04-09:14:18:45.738 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Finished checking database cluster's database size.
2025-04-09:14:18:45.738 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Check latest full archive version ...
2025-04-09:14:18:45.739 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-It takes 907.545µs to find latest basebackup version: 20250409_061716
2025-04-09:14:18:45.739 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Found latest full archive version: 20250409_061716
2025-04-09:14:18:45.739 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Start to create global restore point: 20250409_061716
2025-04-09:14:18:45.776 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Finished creating global restore point: 20250409_061716
2025-04-09:14:18:45.776 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Collecting WAL file names for global restore point: 20250409_061716
2025-04-09:14:18:45.787 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/18000C28 is 000000010000000000000006
2025-04-09:14:18:45.792 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/18000AA8 is 000000010000000000000006
2025-04-09:14:18:45.792 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/18000CE8 is 000000010000000000000006
2025-04-09:14:18:45.793 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/18000B68 is 000000010000000000000006
2025-04-09:14:18:45.793 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/18000C28 is 000000010000000000000006
2025-04-09:14:18:45.794 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/18000BA8 is 000000010000000000000006
2025-04-09:14:18:45.794 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-WAL file name for LSN 0/1C000758 is 000000010000000000000007
2025-04-09:14:18:45.796 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Finished collecting WAL file names for global restore point: 20250409_061716
2025-04-09:14:18:45.796 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Switching WAL segment files for archiving ...
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/1C000770 in file 000000010000000000000007 for shard -1
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/18000D38 in file 000000010000000000000006 for shard 0
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/18000C78 in file 000000010000000000000006 for shard 1
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/18000AF8 in file 000000010000000000000006 for shard 2
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/18000BB8 in file 000000010000000000000006 for shard 3
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/18000C78 in file 000000010000000000000006 for shard 4
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[DEBUG]:-Returned LSN is 0/18000BF8 in file 000000010000000000000006 for shard 5
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Finished switching WAL segment files for archiving.
2025-04-09:14:18:47.779 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Collecting data needed to be preserved for archiving this version ...
2025-04-09:14:18:50.838 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Finished collecting data needed to be preserved for archiving this version.
2025-04-09:14:18:50.838 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Saving version information into metadata storage ...
2025-04-09:14:18:50.842 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Finished saving version information into metadata storage.
2025-04-09:14:18:50.842 mxarchive_backup:mxadmin:iv-ydt9heyeioxjd1u57imv:019939-[INFO]:-Succeed in generating incremental archive: 20250409_061845 based on full archive: 20250409_061716
--- SPLIT ---
After creating a backup version, you can view all existing backup versions. The version number of a backup is represented as a timestamp string. Use the following command to list current versions:
$ mxarchive list
The output is similar to the following:
$ mxarchive list
2025-04-09:14:19:44.752 mxarchive_list:mxadmin:iv-ydt9heyeioxjd1u57imv:020147-[INFO]:-Fetch deployment information of cluster: baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:19:44.757 mxarchive_list:mxadmin:iv-ydt9heyeioxjd1u57imv:020147-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:19:44.765 mxarchive_list:mxadmin:iv-ydt9heyeioxjd1u57imv:020147-[INFO]:-|
version | base backup version | type | start at
20250409_061716 | 20250409_061716 | full | 2025-04-09 14:17:16
20250409_061845 | 20250409_061716 | incr | 2025-04-09 14:18:45
To view more detailed information, use the --detail parameter.
$ mxarchive list --detail
The output is similar to the following:
$ mxarchive list --detail
2025-04-09:14:20:15.514 mxarchive_list:mxadmin:iv-ydt9heyeioxjd1u57imv:020322-[INFO]:-Fetch deployment information of cluster: baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:20:15.519 mxarchive_list:mxadmin:iv-ydt9heyeioxjd1u57imv:020322-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:20:15.529 mxarchive_list:mxadmin:iv-ydt9heyeioxjd1u57imv:020322-[INFO]:-|
version | base backup version | type | start at | end until | base backup size | WAl size | archive size | DB size
20250409_061716 | 20250409_061716 | full | 2025-04-09 14:17:16 | 2025-04-09 14:17:36 | 322 MB | 940 MB | 1.3 GB | 308 MB
20250409_061845 | 20250409_061716 | incr | 2025-04-09 14:18:45 | 2025-04-09 14:18:50 | 322 MB | 1.4 GB | 1.7 GB | 311 MB
This operation does not require the original database cluster to be running.
After creating a backup version, you can restore a database cluster from any backup version. Follow these steps:
1. Initialize Data Directory
Before starting recovery, prepare the data directory structure for the restored cluster. Run the following command on each host in the cluster to create the required directories:
Note!
This command has changed compared to version 6.3.X: In version 6.4.X, the<version>parameter is added to specify the backup version to be restored.
$ mxarchive reactivate init <version>
Sample output:
$ mxarchive reactivate init 20250409_061845
2025-04-09:14:21:11.301 mxarchive_reactivate_init:mxadmin:iv-ydt9heyeioxjd1u57imv:020483-[INFO]:-Fetch deployment information of cluster baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:21:11.305 mxarchive_reactivate_init:mxadmin:iv-ydt9heyeioxjd1u57imv:020483-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:21:11.310 mxarchive_reactivate_init:mxadmin:iv-ydt9heyeioxjd1u57imv:020483-[INFO]:-Initialize local archive reactivation storage on every host ...
2025-04-09:14:21:11.341 mxarchive_reactivate_init:mxadmin:iv-ydt9heyeioxjd1u57imv:020483-[INFO]:-Finished mxarchive reactivation initialization, and the root directory for data directory is: /mxdata_20250409142111
This will output the data directory path used for cluster recovery. You must record this path.
2. Configure Data Directory
If different segments require different disk storage locations, adjust the final disk location of files within the directory using the same method as configuring backup file directories during cluster setup. Note that:
Note!
The original directory structure must remain unchanged after configuration.
3. Recover Cluster
After completing data directory configuration, restore a new database cluster from a specified version using the following command:
$ mxarchive reactivate <version> \
--data-dir <recorded data directory from initialization> \
--port-base <starting TCP port available for the new cluster>
Note!
Ports from--port-baseto--port-base + Nmust not be occupied by other applications on any host.
Sample output:
$ mxarchive reactivate 20250409_061845 --data-dir /mxdata_20250409142111 --port-base 8000
2025-04-09:14:22:40.772 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Fetch deployment information of cluster baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:22:40.776 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:22:40.781 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Query metadata for version 20250409_061845
2025-04-09:14:22:40.783 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[VERBOSE]:-It takes 1.9975ms to query metadata for version 20250409_061845
2025-04-09:14:22:40.783 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Copy data of version 20250409_061845 from archive storage to new reactivation directory /mxdata_20250409142111
2025-04-09:14:22:50.121 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[VERBOSE]:-It takes 9.337559569s to copy data to new reactivation directory for every shard
2025-04-09:14:22:50.121 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Try to only activated master ...
2025-04-09:14:22:51.726 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Start rewriting gp_segment_configuration ...
2025-04-09:14:22:51.734 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Stop activated master ...
2025-04-09:14:22:56.216 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-Start to setup activated database ...
2025-04-09:14:23:02.867 mxarchive_reactivate:mxadmin:iv-ydt9heyeioxjd1u57imv:020750-[INFO]:-It takes 22.085693839s in total to reactivate a new database from archive version 20250409_061845
Now you can connect to the new database cluster using psql:
$ psql postgres -p 8000
psql (12.12)
Type "help" for help.
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir
------+---------+------+----------------+------+--------+------+-------------------------+-------------------------+---------------------------------------
1 | -1 | p | p | n | u | 8000 | iv-ydt9heyeioxjd1u57imv | iv-ydt9heyeioxjd1u57imv | /mxdata_20250409142111/master/mxseg-1
6 | 0 | p | p | n | u | 8001 | iv-ydt9heyeiowh2yp2bv0q | iv-ydt9heyeiowh2yp2bv0q | /mxdata_20250409142111/primary/mxseg0
7 | 1 | p | p | n | u | 8002 | iv-ydt9heyeiowh2yp2bv0q | iv-ydt9heyeiowh2yp2bv0q | /mxdata_20250409142111/primary/mxseg1
4 | 2 | p | p | n | u | 8003 | iv-ydt9heyeio5i3z3meox2 | iv-ydt9heyeio5i3z3meox2 | /mxdata_20250409142111/primary/mxseg2
5 | 3 | p | p | n | u | 8004 | iv-ydt9heyeio5i3z3meox2 | iv-ydt9heyeio5i3z3meox2 | /mxdata_20250409142111/primary/mxseg3
2 | 4 | p | p | n | u | 8005 | iv-ydt9heyeioxjd1u57imv | iv-ydt9heyeioxjd1u57imv | /mxdata_20250409142111/primary/mxseg4
3 | 5 | p | p | n | u | 8006 | iv-ydt9heyeioxjd1u57imv | iv-ydt9heyeioxjd1u57imv | /mxdata_20250409142111/primary/mxseg5
(7 rows)
This operation does not require the original database cluster to be running.
When a backup version is no longer needed for recovery, it can be deleted from the backup repository. Use the following command:
$ mxarchive delete <version_to_delete>
Sample output:
$ mxarchive delete 20250409_062624
2025-04-09:14:28:00.505 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Start to delete archive versions: [20250409_062624]
2025-04-09:14:28:00.506 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Are you sure to delete archive versions: [20250409_062624]? [y|N]
y
2025-04-09:14:28:02.337 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-User confirmed to delete archive versions: [20250409_062624]
2025-04-09:14:28:02.337 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Fetch deployment information of cluster: baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:28:02.342 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Get cluster meta from ETCD
2025-04-09:14:28:02.347 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Fetch metadata information of cluster's archive: baz8hPk6Rn27YsFrq7pN3E
2025-04-09:14:28:02.349 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Finished fetching metadata information of cluster's archive.
2025-04-09:14:28:02.349 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Start to delete version information from metadata: [20250409_062624]
2025-04-09:14:28:02.352 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Deleted information of version: 20250409_062624
2025-04-09:14:28:02.352 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Finished deleting version information from metadata.
2025-04-09:14:28:02.352 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Check basebackups that might need to be cleanup ...
2025-04-09:14:28:02.352 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Finished checking basebackups that need to be cleanup.
2025-04-09:14:28:02.352 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-No basebackup need to be deleted.
2025-04-09:14:28:02.352 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Start to check WAL files that might need to be deleted ...
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Finished checking WAL files that need to be deleted.
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Delete WAL files of each segment until given position:
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: -1 / WAL Segment File: 000000010000000000000005
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: 0 / WAL Segment File: 000000010000000000000004
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: 1 / WAL Segment File: 000000010000000000000004
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: 2 / WAL Segment File: 000000010000000000000004
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: 3 / WAL Segment File: 000000010000000000000004
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: 4 / WAL Segment File: 000000010000000000000004
2025-04-09:14:28:02.353 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Shard ID: 5 / WAL Segment File: 000000010000000000000004
2025-04-09:14:28:02.400 mxarchive_delete:mxadmin:iv-ydt9heyeioxjd1u57imv:022489-[INFO]:-Finished deleting WAL files of each segment.
Note!
Each execution of the delete command removes any backup files that are no longer needed by any remaining backup versions. To save disk space, delete backup versions that are no longer required for recovery.
To delete multiple versions, specify them in a single command:
$ mxarchive delete <version_1> <version_2> <...>
The following limitations apply to version v6.4.X and will be improved in future releases.
Incremental online backup in this version has limited support for tablespace functionality:
Backup
Recovery
CREATE TABLESPACE or DROP TABLESPACE operations occur between a full backup and a subsequent incremental backup, that incremental version and all later incrementals cannot be correctly restored.Incremental online backup does not support scenarios where the topology of the source cluster changes after backup configuration, such as adding mirrors, initializing standby masters, or expanding the cluster.