From eefe66b2b2add8a089281b3ed57a4b97d619932a Mon Sep 17 00:00:00 2001 From: Aleksandra Martyniuk Date: Tue, 3 Feb 2026 13:25:23 +0100 Subject: [PATCH] docs: describe conversion to rack-list RF Fixes: SCYLLADB-398 --- docs/cql/ddl.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/cql/ddl.rst b/docs/cql/ddl.rst index 46ee8f8fe5..3cd8c987af 100644 --- a/docs/cql/ddl.rst +++ b/docs/cql/ddl.rst @@ -200,8 +200,6 @@ for two cases. One is setting replication factor to 0, in which case the number The other is when the numeric replication factor is equal to the current number of replicas for a given datacanter, in which case the current rack list is preserved. -Altering from a numeric replication factor to a rack list is not supported yet. - Note that when ``ALTER`` ing keyspaces and supplying ``replication_factor``, auto-expansion will only *add* new datacenters for safety, it will not alter existing datacenters or remove any even if they are no longer in the cluster. @@ -424,6 +422,21 @@ Altering from a rack list to a numeric replication factor is not supported. Keyspaces which use rack lists are :term:`RF-rack-valid ` if each rack in the rack list contains at least one node (excluding :doc:`zero-token nodes `). +.. _conversion-to-rack-list-rf: + +Conversion to rack-list replication factor +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To migrate a keyspace from a numeric replication factor to a rack-list replication factor, provide the rack-list replication factor explicitly in ALTER KEYSPACE statement. The number of racks in the list must be equal to the numeric replication factor. The replication factor can be converted in any number of DCs at once. In a statement that converts replication factor, no replication factor updates (increase or decrease) are allowed in any DC. + +.. code-block:: cql + + CREATE KEYSPACE Excelsior + WITH replication = { 'class' : 'NetworkTopologyStrategy', 'dc1' : 3, 'dc2' : 1} AND tablets = { 'enabled': true }; + + ALTER KEYSPACE Excelsior + WITH replication = { 'class' : 'NetworkTopologyStrategy', 'dc1' : ['RAC1', 'RAC2', 'RAC3'], 'dc2' : ['RAC4']} AND tablets = { 'enabled': true }; + .. _drop-keyspace-statement: DROP KEYSPACE