When the disk space of a compute node or coordinator node reaches its limit, the entire AnalyticDB for PostgreSQL instance is locked in a read-only state. To restore write access, free disk space by using TRUNCATE or DROP, and the instance automatically unlocks within about five minutes.
Check whether the instance is locked
Connect to the instance and run the following command:
SHOW rds_force_trans_ro_non_sup;must be superuser to examine "rds_force_trans_ro_non_sup". In that case, check the instance lock status on the AnalyticDB for PostgreSQL console instead.| Value | Meaning |
|---|---|
on | The instance is locked and read-only |
off | The instance is not locked |
Check table sizes
To identify large tables for cleanup, run the following query:
SELECT pg_size_pretty(pg_total_relation_size('test'));Replace test with the actual table name.
Clear data to free disk space
While the instance is locked, the following DDL and DCL operations are supported:
TRUNCATE -- Remove all rows from a table.
DROP -- Delete a table entirely.
GRANT -- Modify table permissions.
Use TRUNCATE or DROP on large tables until disk usage falls within the threshold.
pg_xlog, which consumes additional disk space.Verify the instance is unlocked
After disk space falls within the threshold, the instance automatically unlocks within about five minutes. To confirm, re-run the lock status check:
SHOW rds_force_trans_ro_non_sup;A value of off confirms the instance is no longer locked and write operations are restored.