Check Detail
When the migration type is set to incremental migration, you need to check the following conditions. Otherwise, verification will fail.
The wal_level of the source database must be logical.
The parameters max_replication_slots and max_wal_senders of the source database must be greater than the total number of libraries to be migrated (reserved additional number of connections).
The persistence attribute of tables to be migrated in the source database must be p (permanent table). Otherwise, replication is not supported, and logical migration cannot be done.
unlogged tables cannot exist in tables to be migrated. Otherwise, they cannot be migrated.
Migrate tables with a primary key. Otherwise, inconsistent data results may occur. It is not recommended that users migrate tables without a primary key.
If the table to be migrated has no primary key and no copyable flag (i.e., the REPLICA IDENTITY attribute is set to NOTHING), the validation task will raise an alarm.
If the table to be migrated has no primary key and contains field types (json/point/polygon/txid_snapshot/xml) that cannot use the = operator, the verification will fail. You need to repair the table without a primary key according to the prompt or uncheck the primary key table. Otherwise, you cannot continue the task.
Remediation Method
Modifying wal_level/max_replication_slots/max_wal_senders Parameters
Follow these steps to modify parameters wal_level, max_replication_slots, and max_wal_senders.
1. Log in to the source database.
Note:
If the source database is a self-built database, you need to log in to the running server of the database and enter the main data directory of the database, which is generally $PGDATA.
If the source database is another CloudDB, please use the parameter modification method of the relevant cloud platform.
If modifications are needed for the parameters of the target instance, please handle it through online support. 2. Normally enter the postgresql.conf file, open this file, and modify the corresponding parameter.
wal_level = logical
max_replication_slots = 10 //Change according to actual conditions
max_wal_senders = 10 //Change according to actual conditions
3. After modification, restart the database instance.
4. Log in to the database instance and use the following command to check whether the parameter values are set correctly:
postgres=> select name,setting from pg_settings where name='wal_level';
name | setting
-----------+---------
wal_level | logical
(1 row)
postgres=> select name,setting from pg_settings where name='max_replication_slots';
name | setting
-----------------------+---------
max_replication_slots | 10
(1 row)
postgres=> select name,setting from pg_settings where name='max_wal_senders';
name | setting
-----------------+---------
max_wal_senders | 10
(1 row)
5. Re-run the verification task.
Modifying REPLICA IDENTITY Attribute of Table to Be Migrated
Generally, it is not recommended to migrate tables without a primary key, which may result in inconsistent data. If the table to be migrated has no primary key and does not contain a copyable identification (i.e., the REPLICA IDENTITY attribute is set to NOTHING), the validation task will raise an alarm.
A warning has occurred. It is recommended that users refer to the following method to modify the attribute parameters of the table.
ALTER TABLE schemaName.tableName REPLICA IDENTITY FULL;