Resumable Remote Compaction
RocksDB remote compaction workers can now checkpoint progress and resume interrupted jobs instead of restarting from scratch. After each completed output SST, the worker writes a delta-encoded progress record holding the resume internal key and the completed file metadata to the output directory. It skips checkpoints where resuming would be unsafe, such as range deletions spanning a file boundary or adjacent files sharing a user key. To enable it, set allow_resumption=true in OpenAndCompactOptions and reuse the same output_directory across retries; the REMOTE_COMPACT_RESUMED_BYTES ticker reports how much output was reused.
Related posts
- FIFO KV-Ratio Compaction for BlobDB-Backed TTL Workloads
RocksDB Blog hardMasterRocksDB 11.0 adds a KV-ratio intra-L0 compaction picker for FIFO compaction with integrated BlobDB. It targets workloads with large values, point lookups and TTL or size-bounded expiry. The old cost-based picker compares SST sizes against write_buffer_size, so BlobDB's tiny SSTs never stop growing. The new picker derives a target SST size from max_data_files_size × (SST bytes / total bytes) ÷ level0_file_num_compaction_trigger, then merges files through geometric size tiers until they graduate. This keeps blob files untouched and SST rewrite cost logarithmic, at the cost of some intermediate tier files lingering in L0.
- Husky: Efficient compaction at Datadog scale
Datadog Engineering hardMasterHusky, Datadog's observability event store layered over object storage, keeps query cost low by controlling fragment count and layout through streaming compaction. Writers flush small sorted fragments into time-bucketed tables. Compactors lazily run size-tiered k-way merges, waiting until a few dozen fragments are available, which cuts CPU and object-store API costs by an order of magnitude. Metadata is swapped atomically in FoundationDB. A custom columnar format with per-column headers and fixed-size row groups lets each compaction use one GET per input, saturate the CPU and run in bounded memory, and sort schemas let queries skip fragments using only their metadata.
- Grafana Mimir Compaction: From Bottleneck to Savings
Wise Engineering mediumAdeptAfter migrating from Thanos to Grafana Mimir at about 6 million samples per second, Wise found its compactor quietly falling behind on its largest tenant. The result was a two-month backlog of roughly 250k uncompacted blocks, with block metadata sync taking around 9 hours, and it showed up as higher query errors and latency, bloated S3 storage and extra cross-AZ traffic. Giving the compactor more CPU and memory and tuning its config parameters in staging cleared the backlog. That cut S3 usage by 70%, cross-AZ transfer by 40% and query latency by about 90%. The main lesson is to alert on per-tenant block growth and compaction health, because the default mixin dashboards and alerts did not flag the problem.
- Litestream Revamped: SQLite Replication
Fly.io mediumAdeptLitestream is being reworked around ideas from LiteFS. It replaces the raw-WAL "shadow WAL" with transaction-aware LTX files, sorted page changesets that can be compacted LSM-style, so point-in-time restores no longer replay every intermediate page write. Conditional writes in S3 and Tigris provide a time-based lease that guarantees a single writer per destination without Consul, which removes the need for multiple "generations" and makes failover and replica resync simpler. Planned additions are a VFS-based read-replica layer that fetches and caches pages straight from object storage, and wildcard replication of hundreds or thousands of databases from one process.
- Range Tombstone Conversion: Faster Scans Over Long Runs of Deletes
RocksDB Blog hardMasterRocksDB 11.3.0 adds range tombstone conversion: when a read iterator walks a run of contiguous point tombstones with no live key between them, it inserts one redundant range tombstone [first_tombstone_key, next_live_key) into the memtable at the iterator's snapshot sequence number. Later scans then skip the run in one hop instead of O(N) steps. Only the iterator can do this safely, because it merges every memtable and SST level, while flush and compaction see only part of the LSM and could shadow live keys at other levels. The feature is off by default and enabled with the dynamic option min_tombstones_for_range_conversion. db_bench shows ~99x faster forward and ~368x faster reverse scans over delete-heavy data, with no regression when there are no tombstones.