This topic describes the check report of a major engine version upgrade for an ApsaraDB RDS for PostgreSQL instance. It also explains common errors in the report and provides solutions to these errors.
Related upgrade documents
Check items
On the Major Version Upgrade page of the console, click the Upgrade Check tab, and then click View Information for the target check report to view its details.
The check modules and possible errors in the check report are as follows:
Warnings
Check content
During a major engine version upgrade of an RDS instance, the read-only time and the memory and disk resources of the RDS instance are affected by the number of its database objects. If the number of database objects is excessively large and the memory and disk resources are insufficient, the upgrade may fail. In this case, the system provides the recommended memory capacity, recommended minimum memory capacity, and recommended disk size on the Upgrade Check tab.
When you use the zero-downtime solution for an upgrade, the system also checks the number of Sequence tables.
Recommended memory capacity: During a major engine version upgrade, the system can provide concurrent upgrade capabilities for instances that contain multiple databases. If the memory capacity of an RDS instance is greater than or equal to the recommended memory capacity, the RDS instance is immediately upgraded to reduce the read-only time of the RDS instance.
Recommended minimum memory capacity: If the memory capacity of an RDS instance is greater than or equal to the recommended minimum memory capacity, the upgrade will not fail due to insufficient memory resources. However, the read-only time of the RDS instance may be extended because the system upgrades each database of the RDS instance in sequence.
Recommended disk size: During a major engine version upgrade, the system temporarily copies all object definitions, which doubles the consumption of inodes. During the upgrade, if the disk size is less than the recommended disk size, the upgrade may fail.
Sequence table count check (only for zero-downtime mode): During a zero-downtime major engine version upgrade, data is synchronized through logical replication. However, logical replication does not support the synchronization of Sequence tables. Therefore, a brief switchover time is required to complete the synchronization of Sequence tables. In a zero-downtime major engine version upgrade, the switchover time is determined by the number of Sequence tables.
Warnings and solutions
Disk warning
Warning format:
Total disk space: {*} GB; Used disk: {*} GB; Used inodes: {*}; bytes-per-nodes: {*}; Minimum disk space required for upgrade: {*} GB.Possible cause: Too many objects require sufficient disk space.
Solution:
In blue-green deployment mode, you must specify a storage capacity for the new RDS instance that is greater than or equal to the minimum disk size required for an upgrade.
In local upgrade mode, you must expand the storage capacity of the RDS instance that you want to upgrade before the upgrade. The new storage capacity must be greater than or equal to the minimum disk size required for an upgrade. For more information, see Change the configuration.
Memory warning
Warning format:
Current memory: {*} GB; Recommended memory: {*} GB; Minimum memory: {*} GB.Possible cause: Too many objects require sufficient memory to minimize the read-only time of the instance during the upgrade.
Solution:
For blue-green deployments, when you configure upgrade parameters, the memory in the new instance specification must be greater than or equal to the minimum memory requirement.
In local upgrade mode, you must upgrade the specifications of the RDS instance if the memory capacity provided by the instance type is less than the recommended memory capacity. For more information, see Change the configuration.
Subscription warning
Warning format:
The instance has replication slot subscribers. To prevent subscription data inconsistency, see the Alibaba Cloud documentation.Possible cause: The instance has replication slot subscribers. You can check by executing
select * from pg_subscription;.Solution: See Upgrade the database major version for handling.
Sequence warning
Warning format:
Total Sequence tables: {0}. Too many Sequence tables will extend the switchover time for logical replication major version upgrade.Possible cause: The instance contains Sequence tables. You can view all Sequence tables in the database by executing
select * from pg_sequences;.Solution: If there are too many Sequence tables, we recommend that you clone the instance to test the switchover time to ensure it meets your requirements.
Errors
Check content
The system checks whether an unnecessary superuser account is created in the background or an invalid encryption method is configured for a standard account.
The system checks whether the upgrade check fails. If the upgrade check fails, the "pg_upgrade error log" error message is included in the check report.
The system checks whether the pgcrypto extension is installed in the pg_catalog schema.
(Only for zero-downtime mode) The system checks whether the minor engine version of the instance is 20250228 or later.
(Only for zero-downtime mode) The system checks for logical replication incompatibilities. Logical replication cannot synchronize certain database objects, so instances with these objects will not support zero-downtime major version upgrades. If incompatibilities exist, the check report will display the "Logical replication incompatibilities" item.
Errors and solutions
Account error
Error format:
Invalid superuser account: {*}; Invalid account: {*}; Please see the Alibaba Cloud documentation.Possible cause: There are redundant superuser accounts or abnormal standard accounts.
Solution:
For redundant superuser accounts, submit a ticket to contact after-sales service for deletion.
Reset the passwords of the abnormal standard accounts.
Pre-check error
Error format:
pg_upgrade pre-check task failed, need to check [pg_upgrade error log] and [pg_upgrade-related files and errors].Possible cause: Pre-check failed.
Solution: Please refer to pg_upgrade error log to resolve the log issues.
Pgcrypto extension error
Error format:
The pg_crypto extension is installed in schema: pg_catalog in database: {*}, please see the Alibaba Cloud documentation.Possible cause: Because pgcrypto creates functions in pg_catalog that only exist in higher versions, it causes the major version upgrade to fail.
Solution: Delete the pgcrypto extension in each database, and then create the extension in a non-pg_catalog schema.
Minor version error
Error format:
Zero-downtime major version upgrade requires minimum minor version 20250228.Possible cause: The instance's minor engine version is too low.
Solution: Upgrade the minor engine version.
Pg_upgrade error log
Check content
The system checks whether extensions and keywords that are incompatible with the new major engine version exist.
Common errors
Pg_upgrade-related files and errors
loadable_libraries.txt
This file contains the libraries that are incompatible with the new major engine version. You can identify incompatible extensions based on these libraries.
The following information describes the common incompatible extensions and solutions to the incompatibility issues:
tables_with_oids.txt
This file displays a list of tables that were declared with WITH OIDS.
Logical replication incompatibilities
Check content
The system checks whether foreign tables exist.
The system checks whether tables without primary keys or unique keys exist.
The system checks whether materialized views exist.
The system checks whether large objects exist.
The system checks whether logical replication prohibited extensions exist.
The system checks whether the values of parameters related to logical replication meet the requirements.
Incompatibilities and solutions
Foreign table incompatibility
Error format:
Foreign tables in database: {0}. Total databases: {1}.Possible cause: Foreign tables exist.
Solution: Delete the foreign tables.
Execute the following SQL statement in each database of the instance to obtain information about foreign tables.
SELECT COUNT(*) AS count, relkind FROM pg_class WHERE relkind IN ('f') GROUP BY relkind;Execute the following SQL statement to delete foreign tables.
DROP FOREIGN TABLE [ IF EXISTS ] name [ CASCADE | RESTRICT ];
For more information, see Community documentation.
Table without unique key incompatibility
Error format:
Tables without primary key or unique key in database: {0}. Total databases: {1}.Possible cause: Tables without primary keys or unique keys exist.
Solution: Add primary keys or unique keys to the tables.
Execute the following SQL statement in each database of the instance to obtain information about tables without primary keys or unique keys.
SELECT COUNT(*) AS count FROM information_schema.tables t LEFT JOIN information_schema.table_constraints tc ON t.table_name = tc.table_name AND t.table_schema = tc.table_schema AND (tc.constraint_type = 'PRIMARY KEY' OR tc.constraint_type = 'UNIQUE') JOIN pg_class c ON t.table_name = c.relname JOIN pg_namespace ns ON c.relnamespace = ns.oid AND ns.nspname = t.table_schema WHERE t.table_type = 'BASE TABLE' AND tc.constraint_type IS NULL AND t.table_schema NOT IN ('pg_catalog', 'information_schema') AND c.relreplident != 'f';Execute the following SQL statement to set the
REPLICA IDENTITYof the target table toFULL.ALTER TABLE name REPLICA IDENTITY FULL;Execute the following SQL statement to add a primary key or unique key to the target table.
--Primary key constraint ALTER TABLE name ADD CONSTRAINT constrain_name PRIMARY KEY (column_name); --Unique key constraint ALTER TABLE name ADD CONSTRAINT constrain_name UNIQUE (column_name);
For more information, see Community documentation.
Materialized view incompatibility
Error format:
Materialized views in database: {0}. Total databases: {1}.Possible cause: Materialized views exist.
Solution: Delete the materialized views.
Execute the following SQL statement in each database of the instance to obtain materialized views.
SELECT COUNT(*) AS count, relkind FROM pg_class WHERE relkind IN ('m') GROUP BY relkind;Execute the following SQL statement to delete materialized views.
DROP MATERIALIZED VIEW IF EXISTS name;
Large object incompatibility
Error format:
Large objects in database: {0}. Total databases: {1}.Possible cause: Large objects exist.
Solution: Delete the large objects.
Execute the following SQL statement in each database of the instance to obtain large objects.
SELECT COUNT(*) AS count FROM pg_largeobject_metadata;Execute the following SQL statement to delete large objects.
SELECT lo_unlink(largeobject_oid);
Extension incompatibility
Error format:
Logical replication prohibited extensions in database: {0}. Total databases: {1}.Possible cause: The following four prohibited extensions are used: 'pg_partman', 'pg_cron', 'pg_active', and 'pg_logical'.
Solution: Temporarily delete incompatible extensions.
Execute the following SQL statement in each database of the instance to check whether incompatible extensions are installed.
SELECT COUNT(*) AS count FROM pg_extension WHERE extname IN ('pg_partman', 'pg_cron', 'pg_active', 'pglogical');Temporarily delete incompatible extensions.
DROP EXTENSION extension_name;
Parameter incompatibility
Error format:
Logical replication requires wal_level to be logical, max_wal_sender and max_replication_slots to be at least {0}, instance wal_level is: {1}, max_wal_sender is: {2}, max_replication_slots is: {3}.Possible cause: The values of the three parameters do not meet the requirements.
Solution: Modify the parameter values. Note that you may need to restart the instance for the changes to take effect. For more information, see Set the parameters of an instance.
Check report format description
The check report is provided in Chinese and English.