Updated on 2025-01-09 GMT+08:00

Commands for Modifying a Release

Function

The alter-publication command is used to modify a fine-grained DR release.

Syntax

python3 $GPHOME/script/DisasterFineGrained.py -t alter-publication --disaster-object-list-file <disaster-object-file> --config-file <configFile> [--force-alter]

Parameter Description

Long Option

Short Option

Data Type

Description

Range

Default Value

Example

-t

N/A

String

The interface supports multiple functions. alter-publication updates a release.

  • -t generate-config
  • -t prepare
  • -t create-publication
  • -t alter-publication
  • -t cancel-publication
  • -t get-current-disaster

N/A

-t alter-publication

--disaster-object-list-file

N/A

String

DR object list file.

N/A

N/A

--disaster-object-list-file /home/userA/disaster_object_list.txt

--config-file

N/A

String

Path of the dual-cluster DR configuration file.

NOTE:

N/A

N/A

--config-file /home/userA/config.ini

--force-alter

N/A

Boolean Value

This parameter is optional. It forcibly modifies a release even if there is a parameter conflict. For example, if a schema has been released and the file contains schema.table, you need to cancel the release of the schema and release schema.table again. If this parameter is not used, a message is displayed to the user.

N/A

N/A

--force-alter

Usage Guide

  • The alter-publication command must be executed on the active node of the active cluster. After the current backup process is complete, this command stops the subsequent periodic backup.
  • The --disaster-object-list-file parameter in the alter-publication command must be set to a new incremental DR object.
  • DR objects that fail to be released are written into $HOME/config/fail_disaster_object.txt after the command is executed.
  • If the input parameter includes --force-alter, and the schema has already been released, and the file contains schema.table, you must cancel the release of the schema and then release schema.table again. If this parameter is not used, a message is displayed to the user.
  • The updated publication parameter file is stored in $HOME/config/pub.list by default.
  • You need to manually create the DR object list file --disaster-object-list-file. The file format is as follows:
    db_name   //DB level
    db_name.schema_name   //Schema level
    Level db_name.schema_name.table_name  //Table level

Example Command

Modify a release task.

python3 $GPHOME/script/DisasterFineGrained.py -t alter-publication --disaster-object-list-file $HOME/config/disaster_object_list.txt --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini

System Response

[perfadm@ecs-env-2988 config]$ python3 $GPHOME/script/DisasterFineGrained.py -t alter-publication --disaster-object-list-file $HOME/config/disaster_object_list.txt --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini
[Start ESL disaster fine grained process]
Stop backup loop.
Stop crontab for backup
Stop crontab successfully.
Stop backup successfully.
Start parse disaster object file.
parse disaster object file end, [disaster object num]: 1, [time]: 0.000s.
Start filter disaster object.
filter disaster object end, [db num]: 0, [schema num]: 1, [table num]: 0, [time]: 0.017s.
Start handle conflict.
handle conflict end, [time]: 0.009s.
Start transfer disaster object.
transfer disaster object end, no add disaster object.
Start alter publication.
Start cancel publication.
cancel publication end, no delete disaster object.
Start add publication.
add publication end, no add disaster object.
alter publication end, [time]: 0.000s.
The publication file path: /home/perfadm/config/pub.list
alter publication conflict, if you want to force alter, use '--force_alter' option.
fail disaster object num: 1, fail disaster object file path: /home/perfadm/config/fail_disaster_object.txt.
[Finished ESL disaster fine grained process]