Help Center/ Document Database Service/ FAQs/ Resource and Disk Management/ Why Does Available Disk Space Not Increase After Data Is Deleted?
Updated on 2023-01-18 GMT+08:00

Why Does Available Disk Space Not Increase After Data Is Deleted?

Operations such as write, update, and delete (including index insert and delete) are actually converted to write operations in the background. When data of an instance in use is deleted, the disk space is not reclaimed. Such unreclaimed disk space is called disk fragments. When new data is inserted, these fragments are reused without applying for new disk space. Different underlying storage engines (RocksDB and WiredTiger) vary according to specific scenarios.

After deleting data, RocksDB directly converts the delete operation to append write. After a certain amount of redundant data is accumulated, the background compact thread is automatically triggered to merge and aggregate data of multiple versions to release redundant disk space. You are advised to wait for the system to automatically reclaim the disk space. If the disk space usage is high and close to the read-only threshold, contact Huawei technical support.

After deleting data, WiredTiger merges and aggregates data of multiple versions, causing disk space fragments. However, WiredTiger does not return the disk space to the operating system. WiredTiger marks the disk space for subsequent writes of the current collection, the reserved disk space is preferentially used for subsequent writes of the collection. To release the disk space, run the compact command. (Note: This command blocks normal services and is disabled by default.)