This page covers common questions about the cold data archiving feature in PolarDB for MySQL.
Errors
The following table lists common errors and their solutions.
| Error message | Cause | Solution |
|---|---|---|
[Data Lifecycle Management] DLM storage engine is not support. The value of polar_dlm_storage_mode is OFF. | Cold data archiving is not enabled on the cluster. | Enable cold data archiving in the PolarDB console. For details, see Enable cold data archiving. |
[Data Lifecycle Management] errmsg: Not allowd archive the archived table. | The target table is already archived. Archiving an archived table is not supported. | Check whether the table is already archived before running archiving statements. |
OSS error: error message: The OSS Access Key Id you provided does not exist in our records | The temporary access credential has expired, making the AccessKey pair invalid. | Use the AccessKey pair to apply for new temporary access credentials from your app server via STS. For details, see Use temporary credentials provided by STS to access OSS. For other OSS error: messages, see OSS error codes. |
ERROR 8185 (HY000): Change partition not support archive to engine CSV | The cold data archiving feature for partitioned tables is in canary release and is not enabled on your account. | Go to Quota Center, enter the quota ID polardb_mysql_hybrid_partition to find the quota name, and click Apply in the Actions column. |
Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables. | Archived tables in CSV or ORC format do not support transactions. If a stored procedure involves an archived table, global transaction identifiers (GTID) inconsistency may occur even if no actual write operations are performed. | Change the storage engine to X-Engine, which reduces storage costs and keeps all tables transactional. |
The last packet successfully received from the server was 15,287 milliseconds ago. The last packet sent successfully to the server was 15,287 milliseconds ago. | The restoration process exceeded the client timeout threshold. | Increase the minimum PolarDB Capacity Unit (PCU) specification of your cluster, then re-run the restoration task. |
Check whether data is archived
Use either of the following methods to check whether a table or partition is archived.
Method 1: Run a SQL statement
Run SHOW CREATE TABLE table_name;:
For a common table: if
STORAGE OSSorCONNECTION='default_oss_server'is displayed, the data is archived.For a partitioned table: if
ENGINE=CSVorENGINE=ORCis displayed for partitions, the data is archived.
Method 2: Check in the console
Log on to the PolarDB console. Find the cluster and click its ID. In the left-side navigation pane, choose Settings and Management > Cold Data Archiving. If the table name appears in the list, the data is archived to OSS.
If the Cold Data Archiving menu does not appear after you enable the feature, wait a few minutes and refresh the page.
Archived data operations
Query archived cold data
Common tables: Query the same way as hot data. No changes to the access method are required.
Partitioned tables: See Query data in a hybrid partitioned table.
Modify archived cold data
Cold data archived to OSS in CSV or ORC format cannot be modified directly. To modify it:
Run
ALTER TABLE table_name ENGINE=InnoDB;to import the table data from OSS to PolarStore.Modify the data in PolarStore.
Run
ALTER TABLE t ENGINE = CSV STORAGE OSS;to archive the modified data back to OSS.
For details, see Import data from OSS tables to PolarStore.
Delete archived cold data
Use a privileged account to delete archived cold data.
To delete archived cold data:
Run
DROP TABLEto delete the archived table from PolarDB.Run
CALL dbms_oss.delete_table_file('database_name', 'table_name');to delete the archived cold data from OSS.
Download archived cold data
Downloading archived cold data directly is not supported. To request download access, go to Quota Center, enter the quota ID polardb_mysql_download_oss to find the quota name, and click Apply in the Actions column.
View the size of archived cold data
View the size in the PolarDB console or by querying cold data tables directly on the cluster. For details, see View information about the cold data archived in OSS.
Size and format
How does archiving affect table size?
The archived size depends on the original storage engine and the archive format:
| Scenario | Effect on size |
|---|---|
| InnoDB table without indexes | Smaller — data is compressed during archiving. |
| InnoDB table with indexes | Significantly smaller — indexes are removed during archiving. |
| X-Engine table | May be larger — OSS compression may not match X-Engine's built-in compression. |
| CSV format vs. ORC format | CSV archived data may be larger than ORC archived data. ORC provides a higher compression ratio. |
For information about archiving in CSV format, see Manually archive cold data in the CSV format.
Does the original table still consume storage after archiving?
No. After archiving, PolarDB retains only the table metadata. The actual data is stored in OSS and does not consume cluster storage.
Why is the archived table not visible in the console after archiving an empty table?
For an empty table, no CSV file is generated in OSS after archiving, so no information about the table appears in the console.
Why can't I see archived cold data in my own OSS?
PolarDB stores cold data in its default OSS, not your Alibaba Cloud OSS account. You can only view archived cold data in the PolarDB console.
Automatic archiving
How is automatic archiving triggered?
Automatic archiving is triggered by Data Lifecycle Management (DLM) lifecycle events. For details, see Data lifecycle management (DLM).
Where are the logs for automatically archived data?
Logs are stored in the mysql.dlm_progress table. Any account with permissions on MySQL databases can query it. For the table schema, see mysql.dlm_progress table.
How do I view the current automatic archiving policy?
Archiving policies are stored in the mysql.dlm_policies table. Any account with permissions on MySQL databases can query it. For the table schema, see mysql.dlm_policies table.
Other questions
How long does renaming an archived table take?
When you rename a table archived to OSS, file information in OSS is modified at a rate of about 100 Mbit/s. Estimate the duration based on the total size of the archived data.
Can I archive data to my own OSS?
No. PolarDB cold data archiving uses its default OSS only. To export data to your own OSS, run the SELECT INTO OSSOUTFILE statement. For details, see Serially export local tables to OSS.
What do I do if my PolarDB for MySQL cluster version is too old for cold data archiving?
Upgrade your cluster to the latest version. For details, see Version management.