RF changes in v19.2

HI Team,

​How to see RF value in the cluster level and how to change at the cluster level.

Thanks ,
Raj

To view the current replication factor, see Configure Replication Zones | CockroachDB Docs

To change the replication factor, see Configure Replication Zones | CockroachDB Docs

Hi @Amruta ,

Thanks for the reply ,

Cloud please explain for the below commands, as per the documents Zone configuration mean ?

As per my understanding we are not created zone in our setup.

SHOW ZONE CONFIGURATION FOR RANGE default;
ALTER RANGE default CONFIGURE ZONE USING num_replicas = 5, gc.ttlseconds = 100000;

Thanks ,
Raj

Oh…sorry…should have specified this earlier. The num_replicas parameter is the number of replicas in the zone. To see the current replication factor, run the SHOW ZONE CONFIGURATION command and see the value for num_replicas. To change the replication factor, use the ALTER RANGE..CONFIGURE ZONE command and set the num_replicas parameter to the replication factor you want.

Hi Raj,

I’ll just add to Amruta’s response.

You can specify zone configurations at several different levels – they act as a hierarchy from least specific to most specific… If you don’t specify any configs, then the config that will affect things by default is the “default range” (i.e., ALTER RANGE default CONFIGURE ZONE USING ...).

You may decide you want to apply different settings in your cluster by specifying something like ALTER DATABASE my_db CONFIGURE ZONE USING .... In doing so, you’ve created a more specific config that only applies to a certain database. You can also specify configs at a per-table level.

If you run SHOW ZONE CONFIGURATIONS;, you can see ALL the configs and kind of figure out which one is the most specific to your database, table, etc.

Jim