BUCKET.PURGE
Permanently deletes a bucket and all its data (hard delete). This is the second phase of bucket deletion.
Overview
Section titled “Overview”Before permanently deleting a bucket, BUCKET.PURGE enforces a distributed sync barrier to ensure cluster-wide
consistency. This barrier waits for all shards to confirm they have observed the bucket’s “removed” status (set by
BUCKET.REMOVE).
The barrier mechanism prevents data races in a distributed environment:
- Background workers (index maintenance, replication) may still be processing the bucket
- Other cluster nodes may have pending operations or cached references
- Without coordination, purging could cause errors or inconsistent state
If any shard has not yet observed the removal, the barrier fails with BARRIERNOTSATISFIED. When this happens, the
command automatically notifies all cluster members of the removal to accelerate propagation, and you should retry the
purge. In most cases, a single retry is sufficient.
Syntax
Section titled “Syntax”BUCKET.PURGE <bucket>Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
bucket | string | Yes | Name of the bucket to permanently delete. The bucket must be marked for removal first using BUCKET.. |
Return Value
Section titled “Return Value”Returns OK on success.
Errors
Section titled “Errors”| Error Code | Description |
|---|---|
NOSUCHBUCKET | The specified bucket does not exist. |
ERR | The bucket is not marked for removal. You must call BUCKET. first. |
BARRIERNOTSATISFIED | Not all shards have observed the removal. Retry the command. |
Examples
Section titled “Examples”Permanently delete a removed bucket:
> BUCKET.REMOVE usersOK
> BUCKET.PURGE usersOKAttempting to purge without removing first:
> BUCKET.PURGE users(error) ERR Bucket 'users' is not removedHandling barrier not satisfied:
> BUCKET.REMOVE usersOK
> BUCKET.PURGE users(error) BARRIERNOTSATISFIED Barrier not satisfied: not all shards observed version ...
> BUCKET.PURGE usersOK