In the event that your PostgreSQL service runs out of disk space, the service will start malfunctioning, and this will also prevent backups from being properly created. 

In order to prevent this from happening, Aiven will automatically detect when your service is running out of free space and prevent further writes to it by setting:

default_transaction_read_only  to  ON; 

At this point clients will start encountering errors like cannot execute CREATE TABLE in a read-only transaction .

Actions to make more space available

Upgrade to a larger plan

This can be done from the Aiven console or with Aiven CLI client. New nodes with more disk space are launched. Once the data is on the new nodes with more disk space the disk usage will return to below the critical level and default_transaction_read_only  is set automatically to OFF by the system to allow writes again.

Delete data

You can also delete data from your database, but since your service is set in read-only mode, deletes will also be prevented. There are two ways you can work around this:

  1. You can change the transaction mode to read write for your session by running SET default_transaction_read_only = OFF;  and then you are able to delete data from within your session.
  2. You can use our API and send a POST request to<project>/service/<service_name>/enable-writes which will enable writes for the next 15 minutes, enabling you to free up space.

If you upgrade your service temporarily to delete data, you may have to wait for the next backup to complete before you can downgrade to a smaller plan.

Did this answer your question?