rocksdb-delete-files-in-range · shipping · also DeleteFilesInRange, DeleteFilesInRanges

RocksDB DeleteFilesInRange

RocksDB DeleteFilesInRange removes eligible SST files contained in a key interval rather than inserting a range tombstone.

Related Observatory article: RocksDB DeleteFilesInRange on hesela.com

This is not an alias for DeleteRange. In v9.7.3, include_end defaults to true, L0 files remain, and older snapshots may lose access to removed data. Boundary-crossing files can leave matching keys behind. [1]

The implementation searches levels below L0, selects a contained group, skips files already being compacted and records selected removals in a version edit. If nothing is selected, it can return OK without deleting a file. This is a file-selection outcome, not proof of complete logical deletion or physical erasure. [2]

Selection also accounts for adjacent files sharing a user-key endpoint. The upstream DeleteFileRangeFileEndpointsOverlapBug test retains an older version in one file and a newer version in its neighbor; removing only the latter could reveal the old value. This regression is evidence of why containment alone is insufficient, not a newly discovered defect in v9.7.3. [3] [4]

A file-deletion pause is a separate control over obsolete-file removal, not a freeze of the logical database state. Compactions can continue while removal is paused; preserving a pathname alone does not preserve its role in current reads. [6]

Relations

related
Range tombstone, Sorted string table, RocksDB read snapshot, RocksDB file-deletion pause

Advantages

  • Whole-file removal can avoid rewriting data that is eligible for deletion. [2]

Limitations

  • File boundaries, L0 contents and concurrent compaction can leave data in the requested interval. [1, 2]
  • This API does not preserve all earlier snapshot reads. [1]

Citations

  1. RocksDB v9.7.3. convenience.h: DeleteFilesInRange contract. (accessed 2026-10-23)
  2. RocksDB v9.7.3. DBImpl::DeleteFilesInRanges: selection, compaction exclusions and version edits. (accessed 2026-10-23)
  3. RocksDB v9.7.3. VersionStorageInfo::GetCleanInputsWithinInterval and endpoint grouping. (accessed 2026-10-23)
  4. RocksDB v9.7.3. DBDeleteFileRangeTest: range boundaries, L0 and shared-endpoint regression. (accessed 2026-10-23)
  5. RocksDB v9.7.3. db.h: nested file-deletion pauses and live-copy enumeration. (accessed 2026-10-23)

Further reading

  1. LSM tombstones: deleted is not yet reclaimed (accessed 2026-10-23)
Sources & caveats
  • Version-scoped source review of the v9.7.3 API, implementation and upstream tests; RocksDB was not executed by Hesela in this review.
  • No measured reclamation latency, reclaimed-byte count, performance result or media-sanitization guarantee.

JSON: /data/terms/rocksdb-delete-files-in-range.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. RocksDB DeleteFilesInRange. Hesela. 2026-10-23. https://hesela.dev/terms/rocksdb-delete-files-in-range/