The full usage of the data disk is uncommon in OceanBase Database. However, once the data disk is fully occupied, the system cannot perform minor compaction, major compaction, and memory release. This results in the failure of data write to the cluster.
Emergency procedure
You can use one of the following methods to release the space of the data disk:
If the OBServer node hosts multiple tenants, you can scale out OBServer nodes and migrate the resource unit.
Scale out OBServer nodes
You can increase the number of OBServer nodes in the OceanBase Cloud Platform (OCP) console or by using the command-line tool. For more information, see Add an OBServer node.
Migrate the resource unit
To manually migrate the resource unit to the added OBServer, log on to the OCP console and double-click the unit specification next to the tenant name. For more information, see View the resources of a cluster. Resource units can be migrated only in the same zone.
Notice
Before you migrate a unit, disable the automatic load balancing feature of OceanBase Database. Otherwise, the unit is migrated back to the original location.
If you cannot migrate the unit or add OBServer nodes, use one of the following three methods:
Increase the maximum data disk usage of the OceanBase cluster.
ALTER system SET datafile_disk_percentage = 98;The default value of the parameter is
95. You can increase the value to release some space.Modify the maximum versions of data retained for the OceanBase cluster.
ALTER system SET max_kept_major_version_number = 1;The default value of the parameter is
2. You can set the value to1to release some space.Notice
Reset the parameters to the default values after the issue is resolved. This way, you can modify the values again in case of another emergency.
Delete some redundant data, tables, or indexes, and empty the recycle bin. Once the data is cleared from the recycle bin, it cannot be recovered. Proceed with caution.