Increased replication in TiKV cluster, but storage use did not increase after applying

77 Views Asked by At

I am running a TiKV v7.2.0 cluster, which was deployed with tiup with server_configs.pd.replication.max-replicas: 1 configured in topology. After storing about 8TB of data in the cluster, I edited the config to increase max-replicas to 2 with tiup cluster edit-config [clustername] and applied the change. It went through the nodes and did a rolling re-deploy of the config and restart of services.

I expected my disk usage to double, as it re-balances all the keys and copies each one to another node to match the new replication factor 2. In reality, no disk or network activity occurred and no growth in dataset size.

Perhaps it seems the changed config only affects newly-stored data and not existing? How can I get the cluster to repair or rebalance or whatever is needed to replicate the existing data?

2

There are 2 best solutions below

1
On

“max-replicas” can only be prime number(1, 3, or 5). So the setting update has no effect.

0
On

you can try to use pd-ctl and follow the instruction 'scheduler describe balance-region-scheduler' https://docs.pingcap.com/tidb/stable/pd-control#scheduler-show--add--remove--pause--resume--config--describe to show the process of the region balancing.