Skip to main content
This feature is in preview and subject to change. To share feedback and/or issues, contact Support.
The DROP VIRTUAL CLUSTER statement removes virtual clusters in order to restart a physical cluster replication (PCR) stream. Virtual clusters are used only as part of the PCR workflow. PCR happens between an active primary cluster and a passive standby cluster that accepts updates from the primary cluster. The unit of replication is a virtual cluster, which is part of the underlying infrastructure in the primary and standby clusters. The CockroachDB cluster has:
  • The system virtual cluster manages the cluster’s control plane and the replication of the cluster’s data. Admins connect to the system virtual cluster to configure and manage the underlying CockroachDB cluster, set up PCR, create and manage a virtual cluster, and observe metrics and logs for the CockroachDB cluster and each virtual cluster.
  • The application virtual cluster manages the cluster’s data plane. Application virtual clusters contain user data and run application workloads.
For more detail, refer to the Physical Cluster Replication Overview.
The DROP VIRTUAL CLUSTER statement will delete all data related to the specified virtual cluster.

Required privileges

DROP VIRTUAL CLUSTER requires one of the following privileges: Use the GRANT SYSTEM statement:

Synopsis

drop_virtual_cluster syntax diagram

Parameters

Examples

Restart a PCR stream

To restart a PCR stream, drop the virtual cluster:
Next, restart the PCR stream with the CREATE VIRTUAL CLUSTER syntax:

Remove a virtual cluster without waiting for garbage collection

Use IMMEDIATE to drop a virtual cluster instead of waiting for data to be garbage collected:

See also