Freeing up space on physical devices
When the disk space is used up, the database may start responding to all queries with an error. To keep the database healthy, we recommend deleting a part of the data or adding block store volumes to extend the cluster.
Below are instructions that can help you add or free up disk space.
Defragment a VDisk
When working with the DB, internal VDisk fragmentation is done. You can find out the percentage of fragmentation on the VDisk monitoring page. We do not recommend that you perform defragmentation of VDisks that are fragmented by 20% or less.
According to the failure model, the cluster survives the loss of two VDisks in the same group without data loss. If all VDisks in the group are up and there are no VDisks with the error or replication status, then deleting data from one VDisk will result in the VDisk recovering it in a compact format. Please keep in mind that data storage redundancy will be decreased until automatic data replication is complete.
During data replication, the load on all the group's VDisks increases, and response times may deteriorate.
View the fragmentation coefficient on the VDisk page in the viewer.
If its value is more than 20%, defragmentation can help free up VDisk space.
Check the status of the group that hosts the VDisk. There should be no VDisks that are unavailable or in the error or replication status in the group.
You can view the status of the group in the viewer.
Run the wipe command for the VDisk.
All data stored on a VDisk will be permanently deleted, whereupon the VDisk will begin restoring the data by reading them from the other VDisks in the group.
ydbd admin blobstorage group reconfigure wipe --domain <Domain number> --node <Node ID> --pdisk <pdisk-id> --vslot <Slot number>
You can view the details for the command in the viewer.
If the block store volume is running out of space, you can apply defragmentation to the entire block store volume.
Check the health of the groups in the cluster. There shouldn't be any problem groups on the same node with the problem block store volume.
Log in via SSH to the node hosting this block store volume
Check if you can restart the process.
Stop the process
sudo systemctl stop ydbd
Format the block store volume
sudo ydbd admin blobstorage disk obliterate <path to the store volume part label>
Run the process
sudo systemctl start ydbd
Moving individual VDisks from full block store volumes
If defragmentation doesn't help free up space on the block store volume, you can move individual VDisks.