Skip to content

KR.ADMIN DROP-CLUSTER

Removes an entire cluster’s metadata from FoundationDB.

KR.ADMIN DROP-CLUSTER <cluster-name>
KR.ADMIN DROP-CLUSTER <cluster-name> <token>
ParameterTypeDescription
cluster-namestringName of the cluster to drop. Must match the cluster name in the running node’s configuration.
tokenstringConfirmation token returned by Phase 1. Required to execute the actual deletion (Phase 2).
  • Phase 1 (no token): Bulk string. A UUID confirmation token valid for 60 seconds.
  • Phase 2 (with token): Simple string. Returns OK on success.

This is a two-phase command designed to prevent accidental deletion of an entire cluster.

Phase 1: Request token

Calling DROP-CLUSTER with only the cluster name validates that the name matches the running node’s configured cluster name and returns a single-use UUID token. The token expires after 60 seconds.

Requesting a new token for the same cluster invalidates any previously issued token.

Phase 2: Confirm deletion

Calling DROP-CLUSTER with both the cluster name and the token validates the token and, if valid, recursively removes the cluster’s entire directory tree from the FoundationDB directory layer. This includes all shard metadata, member records, namespace directories, volume metadata, and any other data stored under the cluster’s directory prefix.

The token is consumed on any Phase 2 attempt, regardless of whether the token is valid, expired, or mismatched. The operator must request a new token from Phase 1 to retry.

Important notes:

  • This command only removes metadata from FoundationDB. Local disk files (volume segments) are not affected and must be cleaned up manually by the administrator.
  • Multiple Kronotop clusters can coexist on a single FoundationDB instance. This command removes only the specified cluster; other clusters are unaffected.
  • After dropping a cluster, the node is in an inconsistent state. The administrator should stop all nodes that belonged to the dropped cluster.
  • Requires cluster initialization.
ErrorCondition
ERR cluster has not been initialized yetThe cluster must be initialized first.
ERR cluster name does not matchThe provided cluster name does not match the node’s configured cluster name.
ERR no pending drop-cluster token for this clusterNo token has been requested, or the token was already consumed.
ERR drop-cluster token has expiredThe token’s 60-second TTL has elapsed.
ERR invalid drop-cluster tokenThe provided token does not match the issued token.

Phase 1: Request a confirmation token

127.0.0.1:3320> KR.ADMIN DROP-CLUSTER my-cluster
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Phase 2: Confirm and drop the cluster

127.0.0.1:3320> KR.ADMIN DROP-CLUSTER my-cluster a1b2c3d4-e5f6-7890-abcd-ef1234567890
OK

Wrong cluster name:

127.0.0.1:3320> KR.ADMIN DROP-CLUSTER wrong-name
(error) ERR cluster name does not match

Reusing a consumed token:

127.0.0.1:3320> KR.ADMIN DROP-CLUSTER my-cluster a1b2c3d4-e5f6-7890-abcd-ef1234567890
(error) ERR no pending drop-cluster token for this cluster