To prevent Kafka from malfunctioning, the Aiven platform detects when the available disk space in Kafka services is running low.


If any of the nodes in the service exceeds the critical threshold of disk usage, the access control list (ACL) that isĀ used to authorize API requests by Kafka clients is updated on all nodes to prevent operations that would increase disk usage. Such operations include:

  • The Write and IdempotentWrite operations that clients use to produce new messages

  • The CreateTopics operation that creates one or more topics, each carrying some overhead on disk

When the ACL blocks write operations, clients see an error similar to the following example from the python-kafka client:

TopicAuthorizationFailedError: [Error 29] TopicAuthorizationFailedError: mytopic

Actions to make more space available

Upgrade to a larger service plan

  1. Log in to the Aiven web console and select your service.

  2. On the Overview page, scroll down to Service plan and click Upgrade plan.

  3. Select your new service plan and click Upgrade.
    This launches new nodes with more disk space. As data is moved from the old nodes to the new ones, disk usage returns to an acceptable level and the ACL is updated to allow write operations again.

You can also use the Aiven CLI client to upgrade your service plan.

Delete one or more topics

  1. Log in to the Aiven web console and select your service.

  2. Click the Topics tab.

  3. Click Actions > Remove for any topics that you no longer need.

  4. Click Remove to confirm that you want to delete the topic.
    This deletes the entire topic and frees up the used disk space. It may take up to a few minutes before the Kafka log cleaner starts removing the data files from disk. After that, the ACL is update to allow write operations again.

You can also use the Aiven CLI client or the DeleteTopics request via API from any native Kafka client to delete topics. Note that you must use an admin-level user account for the connection.

Decrease retention time/size

Another way to make more space available without deleting an entire topic is to reduce the retention time or size for one or more topics. If you know how old the oldest messages are in a topic, you can lower the retention time for the topic to make more space available:

  1. Log in to the Aiven web console and select your service.

  2. Click the Topics tab.

  3. Click a topic that you want to edit.
    In the Topic info view, check how much space the topic is currently using. Make note of the current retention time.

  4. In the Topic info view, click Modify.

  5. If there is no field for Retention ms, select it from the drop-down menu.

  6. Change the Retention ms value to a suitable value in milliseconds.
    Note: Using a lower value for the retention time only makes more space available if there are messages in the topic that are older than the given value.
    The Kafka log cleaner starts removing data from disk within a few minutes. After that, the ACL is update to allow write operations again.

You can also use the Aiven CLI client with admin permissions to change the retention.bytes topic configuration parameter to something lower than the current size for the topic.

Learn how Aiven simplifies working with Apache Kafka:


Did this answer your question?