Gray Upgrade
Scenarios
You can use gray upgrade to upgrade your GaussDB instance if a version upgrade is required for new functions or issue rectification. You can either select auto-commit after the upgrade or perform a rolling upgrade.
- In the auto-commit mode, all standby DNs are upgraded first and then primary DNs and CNs in sequence. After the upgrade is complete, the upgrade is automatically committed.
- The rolling upgrade mode is also known as the upgrade observation mode. In this mode, the system enters the observation state after the upgrade is complete. During this period, you can observe the service status and either commit or roll back the upgrade based on service status.
- Distributed instances are upgraded by shard. For details, see Upgrading a Distributed Instance.
- Centralized instances are upgraded by AZ. For details, see Upgrading a Centralized Instance.
Operation Process
Step |
Description |
---|---|
Before an upgrade, check the instance status and whether monitoring metrics such as the CPU usage, memory usage, and disk usage of the instance are normal. |
|
Select either auto-commit after the upgrade or perform a rolling upgrade. You can upgrade a single instance or multiple instances in batches as required. |
|
After the upgrade is complete, check the instance status, backup creation status, and instance connectivity, and whether you can add, delete, update, and query data in the instance. |
Precautions
- The DN disk usage cannot be greater than the configured disk usage threshold minus 10%.
To check the current DN disk usage, go to the metric monitoring page on the management console.
To obtain the disk usage threshold, contact technical support.
- Version upgrade is unavailable if instance nodes are in an abnormal state.
- The rolling upgrade mode supports manual rollback, but the auto-commit mode does not support manual rollback.
- During an upgrade or rollback, the following operations cannot be performed: scaling up storage, changing specifications, backing up data, resetting passwords, rebooting instances, and deleting instances.
- You are advised to perform an upgrade during off-peak hours because there are more idle CPU, disk, and memory resources.
- If upgrade auto-commit is used for a major version upgrade, log archiving will be disabled before the upgrade, and you cannot use archive logs for PITR, which may result in data loss.
- If rolling upgrade is used for a major version upgrade, full backup cannot be triggered during the upgrade, and differential backup may fail. Manual full backups cannot be created until the upgrade operations in all AZs are complete during the rolling upgrade and observation period. Archive logs are still generated before the upgrade is committed, and you can use archive logs for PITR to prevent data loss. In the upgrade commit phase, log archiving is disabled.
- If the upgrade fails, the system automatically rolls back the instance to the source version. You can contact Huawei Cloud technical support, and Huawei Cloud engineers will help you upgrade the instance if necessary.
- Services are interrupted for about 10 seconds during the upgrade of primary DNs and during the upgrade of CNs.
- After the upgrade is complete, an automated backup task will be triggered and log archiving will be enabled. However, an automated backup task will not be triggered in the case of minor version upgrades.
Log archiving is available only for instances of versions later than V2.0-2.2.
Example minor version upgrade: from V2.0-1.a.x to V2.0-1.a.y or from V2.0-2.a.x to V2.0-2.a.y
Example major version upgrade: from V2.0-1.x to V2.0-2.x or from V2.0-2.x to V2.0-2.y
Step 1: Perform a Pre-upgrade Check
Before an upgrade, check the instance status and whether monitoring metrics such as the CPU usage, memory usage, and disk usage of the instance are normal.
- Check instance status.
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page and choose .
- On the Instances page, check whether the target instance is available.
Figure 1 Instance status
If the instance is in an abnormal state, contact Huawei Cloud technical support.
- Check monitoring metrics.
- Click in the upper left corner of the page, and choose Management & Governance > Cloud Eye.
- In the navigation pane, choose Cloud Service Monitoring > GaussDB.
- On the Cloud Service Monitoring page, click the target instance to go to the metric monitoring page.
- On the DB Instance tab, view the value of Instance Disk Usage to check whether the disk usage is insufficient.
- On the Node tab, view the value of CPU Usage to check whether the CPU usage remains high for a long time.
- On the Node tab, view the value of Memory Usage to check whether the memory usage increases sharply.
If any of the metrics are abnormal, contact Huawei Cloud technical support.
Step 2: Perform the Upgrade
You can select auto-commit after the upgrade or perform a rolling upgrade for gray upgrade as required.
[Method 1: upgrading a single instance]
- Click in the upper left corner of the page and choose .
- On the Instances page, click More in the Operation column of the target instance and choose Upgrade.
- In the Upgrade Instance dialog box, select Gray upgrade for Upgrade Method.
- Select Auto-commit for Action.
Figure 2 Upgrading an instance
- Select the target version, enter confirm, and click OK.
- Check the upgrade result on the Instances page.
- During the upgrade, the instance status is Upgrading version.
- After the upgrade is complete, the instance status changes to Available.
- Click in the upper left corner of the page and choose .
- On the Instances page, select the target instances and click Batch Upgrade.
Figure 3 Batch upgrade
- In the Batch Upgrade dialog box, select Gray upgrade for Upgrade Method.
- Select Auto-commit for Action.
- Select the target version, enter confirm, and click OK.
Figure 4 Auto-commit of a gray upgrade
- Check the upgrade result on the Instances page.
- During the upgrade, the instance status is Upgrading version.
- After the upgrade is complete, the instance status changes to Available.
[Method 1: upgrading a single instance]
- Upgrading a distributed instance
- Click in the upper left corner of the page and choose .
- On the Instances page, click More in the Operation column of the target instance and choose Upgrade.
Alternatively, click the target instance name to go to the Basic Information page. In the Configuration area, click Upgrade Instance in the field.
Figure 5 Basic information
- In the Upgrade Instance dialog box, select Gray upgrade for Upgrade Method.
- Select Rolling upgrade for Action.
- Set Shards to Upgrade, select a target version, enter confirm, and click OK.
Figure 6 Upgrading a distributed instance
- Check the upgrade result on the Instances page.
- During the upgrade, the instance status is Upgrading version.
- After the upgrade is complete, the instance status changes to Observing version upgrade.
- Check that all shards are upgraded and services are running properly before committing the upgrade.
In the Upgrade Instance dialog box, select Commit for Action, select a target version, enter confirm, and click OK.
Figure 7 Committing an upgrade
- Upgrading a centralized instance
- Click in the upper left corner of the page and choose .
- On the Instances page, click More in the Operation column of the target instance and choose Upgrade.
Alternatively, click the target instance name to go to the Basic Information page. In the Configuration area, click Upgrade Instance in the field.
Figure 8 Basic information
- In the Upgrade Instance dialog box, select Gray upgrade for Upgrade Method.
- Select Rolling upgrade for Action.
- Set AZs to Upgrade, select a target version, enter confirm, and click OK.
Figure 9 Upgrading a centralized instance
You can upgrade a single AZ or multiple AZs at a time as needed.
- Check the upgrade result on the Instances page.
- During the upgrade, the instance status is Upgrading version.
- After the upgrade is complete, the instance status changes to Observing version upgrade.
- Check that all AZs are upgraded and services are running properly before committing the upgrade.
In the Upgrade Instance dialog box, select Commit for Action, select a target version, enter confirm, and click OK.
Figure 10 Committing an upgrade
- Click in the upper left corner of the page and choose .
- On the Instances page, select the target instances and click Batch Upgrade.
Figure 11 Batch upgrade
- In the Batch Upgrade dialog box, select Gray upgrade for Upgrade Method.
- Select Rolling upgrade for Action.
- Select the target version, enter confirm, and click OK.
Figure 12 Rolling upgrade of a gray upgrade
In a rolling upgrade, all AZs or shards of the selected instances are upgraded by default.
- Check the upgrade result on the Instances page.
- During the upgrade, the instance status is Upgrading version.
- After the upgrade is complete, the instance status changes to Observing version upgrade.
- Check that all shards or AZs are upgraded and services are running properly before committing the upgrade.
In the Batch Upgrade dialog box, select Commit for Action, select a target version, enter confirm, and click OK.
Figure 13 Committing a batch gray upgrade
Step 3: Verify the Upgrade
After the upgrade is complete, check the instance status, backup creation status, and instance connectivity, and whether you can add, delete, update, and query data in the instance.
- On the Instances page, check whether Status of the target instance is Available.
- On the Instances page, click the name of the target instance. On the Basic Information page that is displayed, check whether the value of in the Configuration area is the target version.
- Check that the automated backup triggered after the upgrade is successfully created.
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the navigation pane, choose Backups. Check that a backup has been created and the backup status is Completed.
- Check that the instance is properly connected and you can add, delete, update, and query data in the instance.
- Log in to the database. For details, see Connecting to an Instance Through DAS.
- Go to the SQL Query page.
Figure 14 SQL query
- Create a database.
CREATE DATABASE database name;
In this example, run the following command to create a database named db_tpcds:
CREATE DATABASE db_tpcds;
Switch to the newly created database in the upper left corner.
Figure 15 Switching to the new database
- Create a table and add, delete, update, and query data in the table.
- Create a schema.
- Create a table named mytable that has only one column. The column name is firstcol and the column type is integer.
CREATE TABLE myschema.mytable (firstcol int);
- Insert data into the table.
- View the data in the table.
SELECT * FROM myschema.mytable;
| firstcol | ---+----------+ 1 | 100 |
- Update data in the table.
- View the data in the table again.
SELECT * FROM myschema.mytable;
| firstcol | ---+----------+ 1 | 200 |
- Delete the table.
Rollback Operations
During upgrade observation, if a rollback is required due to service reasons or the upgrade using the rolling upgrade mode fails, you can manually roll back the upgrade by performing the steps in this section.
- If the rollback is successful, you can perform the upgrade again.
- If the rollback fails, you can perform the rollback again.
If the problem persists, contact Huawei Cloud technical support, and Huawei Cloud engineers will help you upgrade the instance if necessary.
- In the Upgrade Instance dialog box, select Rollback for Action, select a target version, enter confirm, and click OK.
- On the Instances page, check the rollback status. After the rollback is complete, the instance status changes to Available.
- On the Instances page, click the name of the target instance. On the Basic Information page that is displayed, check that the value of in the Configuration area is the source version, that is, the version before upgrade.
- Check that the instance is properly connected and you can add, delete, update, and query data in the instance.
- Log in to the database. For details, see Connecting to an Instance Through DAS.
- Go to the SQL Query page.
Figure 16 SQL query
- Create a database.
CREATE DATABASE database_name;
In this example, run the following command to create a database named db_tpcds:
CREATE DATABASE db_tpcds;
Switch to the newly created database in the upper left corner.
Figure 17 Switching to the new database
- Create a table and add, delete, update, and query data in the table.
- Create a schema.
- Create a table named mytable that has only one column. The column name is firstcol and the column type is integer.
CREATE TABLE myschema.mytable (firstcol int);
- Insert data into the table.
- View data in the table.
SELECT * FROM myschema.mytable;
| firstcol | ---+----------+ 1 | 100 |
- Update data in the table.
- View the data in the table again.
SELECT * FROM myschema.mytable;
| firstcol | ---+----------+ 1 | 200 |
- Drop the table.
- On the Instances page, select the target instances and click Batch Upgrade.
- In the Batch Upgrade dialog box, select Rollback for Action, select a target version, enter confirm, and click OK.
- On the Instances page, check the rollback status. After the rollback is complete, the instance status changes to Available.
- On the Instances page, click the name of the target instance. On the Basic Information page that is displayed, check that the value of in the Configuration area is the source version, that is, the version before upgrade.
- Check that the instance is properly connected and you can add, delete, update, and query data in the instance.
- Log in to the database. For details, see Connecting to an Instance Through DAS.
- Go to the SQL Query page.
Figure 18 SQL query
- Create a database.
CREATE DATABASE database_name;
In this example, run the following command to create a database named db_tpcds:
CREATE DATABASE db_tpcds;
Switch to the newly created database in the upper left corner.
Figure 19 Switching to the new database
- Create a table and add, delete, update, and query data in the table.
- Create a schema.
- Create a table named mytable that has only one column. The column name is firstcol and the column type is integer.
CREATE TABLE myschema.mytable (firstcol int);
- Insert data into the table.
- View data in the table.
SELECT * FROM myschema.mytable;
| firstcol | ---+----------+ 1 | 100 |
- Update data in the table.
- View the data in the table again.
SELECT * FROM myschema.mytable;
| firstcol | ---+----------+ 1 | 200 |
- Drop the table.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot