New in v23.2:
DROP VIRTUAL CLUSTER statement removes virtual clusters. Virtual clusters are used only as part of the physical cluster replication workflow.
Physical cluster replication 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. Each cluster has:
- The system interface manages the cluster's control plane and the replication of the virtual cluster.
- The virtual cluster manages its own data plane. Users connect to the virtual cluster that contains the application user data.
For more detail, refer to the Physical Cluster Replication Overview.
DROP VIRTUAL CLUSTER statement will delete all data related to the specified virtual cluster.
DROP VIRTUAL CLUSTER requires one of the following privileges:
MANAGEVIRTUALCLUSTERsystem privilege allows the user to run all the related
VIRTUAL CLUSTERSQL statements for physical cluster replication.
GRANT SYSTEM statement:
GRANT SYSTEM MANAGEVIRTUALCLUSTER TO user;
|Drop the virtual cluster if it exists. If it does not exist, do not return an error.
|The name of the virtual cluster.
|Drop the virtual cluster immediately instead of waiting for garbage collection (GC TTL).
Remove a virtual cluster
To remove a virtual cluster from a CockroachDB cluster:
DROP VIRTUAL CLUSTER IF EXISTS application;
Remove a virtual cluster without waiting for garbage collection
IMMEDIATE to drop a virtual cluster instead of waiting for data to be garbage collected:
DROP VIRTUAL CLUSTER IF EXISTS application IMMEDIATE;