Research notes / Database recovery
RocksDB: a WAL sync is not a memtable flush
Updated / Source review / API reference: RocksDB v10.10.1
An atomic batch, a synchronized log and a completed memtable flush answer different questions. With manual WAL buffering, even a successful SyncWAL() does not imply that the buffer was written to the WAL file. [4]
On this page24 sections
RocksDB is the engine, not a server protocol
RocksDB is an embedded key-value storage engine with an LSM design. Applications use it as a library; it can be a component of a database server without being that server itself. Its design offers trade-offs among read, write and space amplification, not one workload-independent performance guarantee. [54]
The FAST 2021 experience paper separates the local storage engine from application-level replication and recovery policy. [9] This distinction also helps interpret filesystem integrations: ZenFS maps files onto zoned storage. Hesela's inference: a recovered file mapping alone is not proof that an application's acknowledged transaction survived; the WAL and MANIFEST answer separate database-recovery questions.
Atomic visibility is not durable acknowledgment
A WriteBatch applies a group of edits atomically. The write's synchronization policy is separate: ordinary asynchronous acknowledgment can precede persistent storage, while a synchronous write waits for synchronization. Neither operation requires every changed entry to have reached an SST file. [2]
RocksDB column families partition one database into separately configurable key spaces. They have separate memtables and table files but share the WAL; a batch can span families. They are not independent databases or replicas. [1]
Four calls, three distinct boundaries
| Operation | Boundary crossed | Not implied |
|---|---|---|
FlushWAL(false) | Internal WAL buffer to its file. | Power-loss durability or SST creation. |
SyncWAL() | WAL file synchronization. | Draining a manually buffered WAL. |
FlushWAL(true) | Buffer drain followed by WAL synchronization. | Memtable flush or a backup. |
Flush(options, families) | Selected memtables to SST files. | Atomic grouping unless enabled. |
With manual_wal_flush=true and non-sync writes, records can remain in RocksDB's own memory. Thus the familiar process-crash argument based on surviving OS buffers no longer applies to those buffered records. [3]
The pinned API recommends FlushWAL(true) for the combined operation. It also warns that a later SyncWAL() is not identical to writing with sync=true: visibility can precede the later synchronization. [4]
A later WAL sync cannot supply an omitted record
Consider two successful writes to distinct keys in the same database. Write A uses disableWAL=true, sync=false; write B uses disableWAL=false, sync=true. If A remains only in a memtable when the process crashes, B's synchronized WAL record cannot reconstruct A's omitted update. A background or explicit memtable flush could independently persist A, so B's success alone is not evidence that A is durable. This is an illustration of the documented contract, not a crash-test result. [56]
Do not obtain B by only changing sync on A's options. In the pinned v10.10.1 write path, combining sync=true with disableWAL=true returns InvalidArgument. Check the returned status: a rejected write is not an acknowledged durable write. [55]
The no-WAL cross-family trap
Illustrative reasoning, not an observed crash: one batch inserts an object in a data family and its lookup entry in an index family, with WAL disabled. If only the data family reaches persistent tables before a crash, recovery lacks the matching index update. Atomic application of the batch did not establish atomic persistence across independently flushed families. [6]
Atomic flush groups the selected families' installation in MANIFEST. Automatic atomic flush covers all families; manual flush requires the application to name the participants. It is not needed for this cross-family recovery property when all relevant writes are WAL-protected. [6]
Do not turn that into a universal transaction guarantee. A single-family flush still targets one family. A successful asynchronous request is not completed work: FlushOptions::wait controls waiting. The options header also cautions that later WAL-enabled writes can replay independently of the atomic flush. [4] [5]
MANIFEST tracks the database state, not another copy of every value
The MANIFEST records version edits describing database state. CURRENT names the active manifest log. For an atomic group, recovery waits for the complete set of version edits before applying it; it does not install a partial group. [7]
Hesela's inference: finding an SST file in a directory is insufficient to establish that recovery includes it in the database. User-data logging and metadata installation solve different problems. Do not rename, delete or reconstruct recovery files by guessing from filenames; use supported backup and recovery tooling.
Who notices a missing WAL?
A checksum can reject damaged bytes that are read; it cannot by itself inventory an absent file. RocksDB's WAL-tracking design addresses that gap. Gaps in numbered filenames are not proof of loss: WAL and MANIFEST use a shared number space. Enabling tracking later does not retroactively validate old, untracked logs. [23]
In v10.10.1, MANIFEST-based WAL tracking (track_and_verify_wals_in_manifest) defaults to off. It records synchronization of closed WALs, not synchronization of the live WAL by SyncWAL()or sync=true writes. The header excludes secondary instances. [5]
| Recorded and observed state | This check's outcome |
|---|---|
| No recorded synced size | Skip this WAL's presence and size checks. |
| Tracked WAL absent | Report corruption. |
| File shorter than recorded size | Report corruption. |
| File equal to or longer than recorded size | Pass this size comparison, not every recovery check. |
The comparison is a minimum-size check, not exact-size equality. The implementation does not read file contents here; equal-length damage is outside this check. Upstream tests cover missing and shortened WALs. We inspected those tests but did not execute the RocksDB suite. [24] [25]
Ordinary recovery runs this inventory check before WAL replay and returns its error. best_efforts_recovery bypasses it because that path does not recover WALs. Reopening with MANIFEST tracking disabled also clears previously tracked WAL metadata; disabling validation is not a repair. [26]
Do not confuse this option with track_and_verify_wals: the same release labels that separate predecessor-WAL mechanism experimental, defaults it to off and warns of incompatibility with RepairDB(). [5] Nor does selecting a stricter WAL replay mode invent an inventory of untracked files. Recovery policy and evidence of completeness are separate questions. [23]
Hesela's operational inference: preserve the original recovery material, record both tracking options and the recovery mode, and investigate the first reported missing file or size mismatch before attempting salvage on a copy. A successful open alone cannot certify that every acknowledged write survived.
A quiet family can keep a shared WAL alive
A WAL can still be required after a busy family flushes because it contains unflushed entries from another family. RocksDB uses max_total_wal_size to trigger flushing that can release older logs. A large WAL footprint alone therefore does not prove that compaction is failing. [8]
Keep the diagnostic questions separate: which family's recovery still needs the log, which memtables await flushing, and which SST runs await compaction? This is a source-derived troubleshooting distinction, not a measured performance improvement.
A write stall is not a durability boundary
RocksDB uses write stall for backpressure that either delays or stops writes. A slowdown reduces admission rate; a full stop waits for the blocking condition to clear. One column family's trigger can affect writes across the DB, even though its memtables and SST files are separate. This is not evidence of disk failure. [10]
For level-based compaction, the pinned implementation checks three pressures: unflushed immutable memtables, L0 file count and estimated compaction work. Stop conditions take precedence over slowdown conditions. Its L0 and pending-compaction triggers require automatic compactions to be enabled; memtable pressure remains relevant when they are disabled. This is a version-scoped explanation, not advice to disable compaction. [11]
Keep the controls distinct: max_write_buffer_number limits buffer count, not individual buffer size. The L0 thresholds count files, while soft_pending_compaction_bytes_limit and hard_pending_compaction_bytes_limit apply to estimated rewrite work. Increasing a limit allows more backlog; it does not itself add processing capacity. [12]
| Property | What it describes | Do not infer |
|---|---|---|
rocksdb.estimate-pending-compaction-bytes | Estimated rewrite work to restore level-size targets; valid for level-based compaction. | Occupied disk space, free capacity or exact future physical I/O. |
rocksdb.actual-delayed-write-rate | Current delayed write rate; zero when delay is inactive. | A device-bandwidth measurement. |
rocksdb.is-write-stopped | Whether the DB write controller is currently stopped. | That every other latency source has disappeared when it is false. |
The pending-compaction estimate is not a WAL backlog. Read it alongside the affected family's flush and compaction state. The configured delayed_write_rate counts user-request bytes before compression per second, and RocksDB may reduce the effective rate further. [4] [5]
SILK: protecting writes also requires background progress
SILK is an author-published RocksDB research prototype, not a current RocksDB configuration preset. Its repository identifies the benchmark entry points separately from the implementation. [39]
The ATC 2019 design uses quiet periods for maintenance, prioritizes flushes and L0 compactions, and can preempt deeper compactions. Preemption can invalidate partial work, which is then discarded. A fixed background cap is therefore not equivalent to coordinating which work progresses. [37]
The pinned scheduler checks a high-priority compaction branch before its background-pause return. That branch uses the default column family's L0 count plus queue and flush conditions. A pause flag alone does not describe every scheduling path. This is code inspection, not an executed trace or proof of fairness across arbitrary column families. [38]
| Observation | Check alongside it | Not established |
|---|---|---|
| Lower foreground latency | Pending compaction work over the same interval. | That the workload remains sustainable. |
| More permitted backlog | Memtable, L0 and deeper-level pressure separately. | More processing capacity. |
| A successful write | The WAL and synchronization policy used. | Durability from scheduling priority. |
Why reads can spike with writes: in the paper's RocksDB experiment, blocked writes held up reads in the worker queues, even though reads and writes follow different data-access paths. The evaluation generates arrivals in an open loop and times requests from the load-generator side, including waiting and processing. A read-latency spike therefore need not identify slow storage reads alone. This last diagnostic inference is Hesela's; the queueing observation concerns the studied threading architecture, not every RocksDB application. [37]
Read the measurement contract: the paper reports one-second p99 windows including queueing, with compression and commit logging disabled. Its long-peak tests eventually degrade. These are historical workload-specific results, not a durable-write speedup or an overload guarantee. [37]
For a new comparison, keep the acknowledgment contract fixed and report arrivals, completions, latency and backlog on aligned intervals. This is Hesela's proposed evaluation checklist, not a SILK replication. No new benchmark was run.
MatrixKV: name the baseline before quoting a speedup
MatrixKV changes compaction granularity; it is not simply a larger write buffer. The author artifact is a RocksDB 5.18.3 fork requiring PMDK, not a current RocksDB preset. [51] [52]
| System | p99 |
|---|---|
| MatrixKV | 405 |
| RocksDB-L0-NVM | 786 |
| NoveLSM | 2080 |
| RocksDB-SSD | 11055 |
The abstract's baseline ordering differs from Table 2. Dividing each baseline by 405 gives approximately 1.94 for RocksDB-L0-NVM, 5.14 for NoveLSM and 27.30 for RocksDB-SSD. Keep those labels attached; these are historical comparisons, not general latency guarantees. [51]
Check the executable workload too: the pinned script assigns test_all_size=81920000000 beside a #8G comment. Dividing by its 4096-byte value size requests 20,000,000 operations: 81.92 decimal GB of value bytes, excluding keys and storage overhead. That is not a count of distinct random keys or final database bytes. [53]
The script also removes its configured database files and requests system cache dropping. We inspected it without executing it. For reproduction, isolate the paths and record actual options; a comment is not a workload specification. [53] Inspect the evidence record.
Refusing a stall does not make a write asynchronous
With WriteOptions::no_slowdown=true, a write that would wait for a recognized slowdown or stop can return Status::Incomplete(). That status is not a successful acknowledgment. The application must handle it explicitly; a bounded queue, rejection or controlled retry is an application policy, not a durability promise. [5]
This option does not eliminate mutex, writer-coordination or WAL-sync waits elsewhere in the pinned write path. It is neither a universally nonblocking API nor an end-to-end latency limit. [13] It also does not choose sync or disableWAL. Admission control and recovery guarantees remain separate. [5]
Hesela's diagnostic inference: correlate returned statuses and stall reasons with per-family backlog, then record the WAL policy separately. A shared WriteBufferManager can also couple stalls across participating databases, so separate DB objects alone need not establish independent admission domains. [10] No throughput or crash experiment is reported here.
A shared memory budget can join separate write-stall domains
A WriteBufferManager can account for memtables belonging to several column families or DB instances in one process. With a positive budget and allow_stall=true, pressure can stop writers in participating databases. Separate DB objects therefore do not by themselves isolate admission. In v10.10.1, this stall option defaults to false; the threshold test includes equality with the budget. [14]
Supplying a block cache lets the manager charge memtable allocations through dummy cache reservations. These are accounting entries, not another copy of the keys and values. The implementation can retain a reservation after memory falls to reduce reservation churn. Consequently, adding the full cache charge to memtable usage can double-count an overlapping budget; neither number alone measures process resident memory. [15]
There are two distinct switches: a zero constructor budget disables this manager's size-based flush and stall decisions, but cache charging can remain enabled. It does not disable the database's other flush triggers. Do not interpret that setting, or a positive soft budget, as a hard process-memory cap. [14] The pinned allocation path also absorbs a cache-reservation failure rather than undoing the allocation. [15]
Hesela's operational inference: record which DBs share the manager, whether stalling is enabled, which cache carries reservations, and what each reported memory number includes. Then investigate flush progress separately from compaction backlog. Disabling these stalls is not evidence that memory pressure or write latency has disappeared.
A read snapshot is not a checkpoint or backup
The word snapshot hides three different recovery contracts. This comparison uses the ordinary read-snapshot API and v10.10.1 capture interfaces; it is not a crash experiment.
| Mechanism | Retained state and boundary |
|---|---|
| Read snapshot | Read view under snapshot-preserving settings. Does not survive a DB restart. [16] |
| Checkpoint | Directory that can be opened as a DB. May share SST and blob files with the source. [17] |
| BackupEngine | Managed recovery points with backup IDs. Backups may share files within their repository. [19] |
In the same DB, use a successful GetSnapshot() result in ReadOptions::snapshot for repeated reads of that view. Check for null and eventually call ReleaseSnapshot(); do not use the handle afterward. [4] With snapshot-preserving settings, flush and compaction retain needed versions. This retains a logical view, not a promised set of SST filenames. [16]
That stability is conditional. With unordered_write=true (default false), pending lower-sequence writes can become visible after acquisition. [5] An application CompactionFilter can also change or remove snapshot-visible data. Review both settings before relying on an immutable view. [21]
Hesela's operational inference: when investigating delayed reclamation, record outstanding snapshots as well as compaction progress. Releasing a snapshot removes that read-view requirement; it does not promise immediate physical-space reclamation.
A new directory need not contain independent files
CreateCheckpoint() hard-links SST and blob files on the same filesystem and copies them otherwise; required metadata files are copied. The default log_size_for_flush=0 triggers flushing of every column family. Raising that threshold can omit recent unflushed writes made without WAL protection. The optional sequence-number result is a guaranteed included sequence, not necessarily the latest one. [17]
Hesela's failure-boundary inference: another pathname on the same filesystem does not protect against loss of that filesystem. A checkpoint is useful capture material, but independent recovery also depends on where it is retained and whether it can actually be opened and used.
Backup creation and verification have separate switches
In CreateBackupOptions, flush_before_backup defaults to false. With WAL disabled, set it to true so unflushed values are not omitted. BackupEngineOptions::sync defaults to true; turning it off weakens the documented crash guarantee for the new backup or restore. [18]
File sharing here is between backups: unchanged SST and blob files can be reused, while each recovery point has its own metadata. This is different from a checkpoint's hard links to live database files. [19] Hesela's inference: multiple backup IDs in one repository do not establish multiple independent failure domains.
VerifyBackup(id) defaults to checking file presence and size, without checksum comparison. VerifyBackup(id, true) also checks checksums. [18] The implementation checks backup files; it does not start the application. [20] A passing result therefore does not replace a restore test. Keep the backup ID, flush and sync settings, verification mode, destination failure domain and restore-test outcome in the recovery record.
When was the expected checksum created?
Checking a copy against a checksum first calculated from that copy cannot establish that the source was already correct. RocksDB's full-file checksum design records a digest and its algorithm in MANIFEST when an SST is created. It also addresses a different problem from block checksums: a wrong but internally valid SST can pass its own block checks. [22]
In v10.10.1, the backup creation path requests stored source checksums when the DB factory is FileChecksumGenCrc32cFactory. Compatible per-file metadata is needed for comparison with that earlier baseline. A custom factory is not automatically covered by this path. [20]
There is a second scope limit: incremental creation can reuse a shared backup file and its previous checksum without rereading the file. A new successful backup therefore need not detect later corruption in reused material. Run checksum verification separately; count recovery points independently from integrity checks. [20]
Dong and colleagues' FAST 2021 paper distinguishes block, file, handoff and key-value integrity. Its section 5 explains why protecting only files leaves earlier in-memory corruption outside that boundary. This is a historical engineering report, not evidence that every protection is enabled in a present deployment. [9, pp. 40-41]
Hesela's review checklist: record the checksum's origin and algorithm, the files actually reread, the backup ID and the application checks after restoration. A successful byte-level comparison is not proof of a business invariant, an independent failure domain or a tested recovery time.
Which copy did checksum verification read?
ReadOptions::verify_checksums=true does not promise a fresh read of every value from its SST file. The option requests verification under the file's checksum type; a lookup can use a resident block. Setting fill_cache=false suppresses filling the block cache, not lookup of entries already there. In the pinned reader, cache lookup precedes the insertion condition. These are source-inspected contracts, not an executed corruption experiment. [27] [28]
| Operation or setting | Relevant boundary | Not established |
|---|---|---|
Get with checksum verification | Uses the file's checksum type for fetched blocks; resident data can satisfy the lookup. | Current SST bytes were reread. |
fill_cache=false | Controls cache insertion, not existing-entry lookup. | A cold-cache scan. |
DB::VerifyChecksum() | Traverses current SSTs using the supplied read options, rather than an application-key scan. | A cache-free physical-media read or application recovery. |
block_protection_bytes_per_key | Separate protection constructed when blocks enter memory; checked per key. | A prior on-disk checksum or an external truth reference. |
The dedicated SST verifier constructs a table reader and walks indexed data blocks through BlockFetcher instead of doing an application-key scan. The fetcher still accepts configured persistent-cache hits. With verify_checksums=true (the default), serialized hits run trailer verification; an uncompressed hit returns before that comparison. A cache implementation may provide its own checks. This is not evidence that all persistent caches are unchecked, or that the optional cache is enabled by default. [29] [30] [28] [31]
The name DB::VerifyChecksum() does not itself force the comparison on. In v10.10.1, it forwards the supplied ReadOptions to SST verification. With verify_checksums=false, the data-block fetcher skips its trailer checksum comparison. Structural parsing and I/O can still report errors; this is not a claim that every damaged file will pass. Keep verification enabled, and inspect the stored algorithm, when the intended evidence is a payload-dependent checksum comparison. [29] [30] [28] [31]
Even with verification enabled, the algorithm matters. VerifyBlockChecksum takes the checksum type from the SST footer. For kNoChecksum, ComputeBuiltinChecksum returns constant zero and does not hash the payload. The reader still compares the stored trailer value after removing its context modifier; it does not simply skip the comparison. A changed trailer or structural error can still fail, but success is not evidence of a payload-dependent check. [34] [35]
BlockBasedTableOptions::checksum defaults to kXXH3 in this release and selects the algorithm for newly created table files. Reopening with that option does not retrofit older SSTs: the reader uses each file's recorded type. Inventory those types, not only the current writer setting. This remains a source-level conclusion, not a measured corruption-detection rate. [36]
block_protection_bytes_per_key controls per-key protection for blocks loaded into memory and defaults to zero bytes per key in this release. Its reference is created on block load, so its purpose is detecting later memory corruption, not establishing the original application's intended value. This setting is separate from memtable_protection_bytes_per_key and write-batch WriteOptions::protection_bytes_per_key; enabling one does not establish that the others are enabled. [32]
Version matters. FAST 2021 described per-key protection as work in progress after identifying a gap above file I/O. The authors' July 2022 report described write and recovery coverage in RocksDB 7.4 while explicitly excluding in-memory data blocks from that implementation. Those historical statements do not replace the v10.10.1 block option inspected here. [9, section 5] [33]
Hesela's inference: record the API, effective read options, checksum reference, covered file set and cache layers. A valid comparison can concern a different copy from the one whose health you want to establish. Preserve originals and use isolated test copies for fault injection; these findings do not justify modifying an open production SST or clearing shared caches.
TRIAD: reusing log bytes does not remove recovery obligations
TRIAD combines hot-key retention, deferred compaction and log reuse. Its TRIAD-LOG design turns a commit log plus a sorted latest-offset index into an L0 table. Values avoid another flush write, but the index still needs persistence; hot entries retained in memory are logged again. This is the ATC 2017 design, not a current RocksDB option. [40, section 4]
The author README lists --disable_wal=false. Its pinned WriteOptions independently defaults sync to false. These defaults do not prove every experiment's configuration. Record synchronization separately before interpreting a throughput result as durable-write performance. [41] [42]
The paper computes (F + C) / F, where F is flushed bytes and C compacted bytes. It is not whole-engine output divided by application input. Its skewed-workload discussion explicitly separates fewer total bytes from an unchanged ratio. [40, sections 5.1 and 5.3]
| Case | F (B) | C (B) | F + C (B) | (F + C) / F | (F + C) / A |
|---|---|---|---|---|---|
| Baseline | 100 | 400 | 500 | 5 | 5 |
| Reduced output | 20 | 80 | 100 | 5 | 1 |
Hesela's arithmetic illustration: both rows yield 5 under the paper's denominator, while the counted output falls from 500 B to 100 B. The last column is only the counted component per input byte, not total database amplification or NAND wear. A zero F makes the flush-normalized ratio undefined. Keep numerator, denominator and omitted writes visible. The database write-amplification definition uses an explicitly stated input boundary.
We reviewed the full paper and pinned source; we did not execute TRIAD or reproduce its performance results. This example establishes an accounting distinction, not a speedup, crash guarantee or device measurement.
SpanDB: faster log placement does not collapse completion boundaries
SpanDB combines parallel logging with a fast NVMe tier and larger capacity storage. Its placement policy redirects new SST files; changing the boundary does not instantly relocate all existing files. [SpanDB, sections 3-4]
The pinned logger clears a completion flag before submission, polls the queue pair, then publishes completed log requests. A device-error completion exits the process. The write call uses zero I/O flags; this call alone does not establish the device's power-loss persistence behavior. [Pinned logger]
| Observation | What it establishes | Still separate |
|---|---|---|
| Submission returns zero | The request was submitted. | Device completion. |
| Successful callback | The device reported completion. | Application request completion. |
| Logger queues the request | Logging work can advance. | Final database processing. |
Log tag numbers distinguish recycled pages from current log contents. That recovery argument assumes atomic 4 KiB writes. The paper evaluates RocksDB 6.5.1 with YCSB and LinkBench; its results are not measurements of the v10.10.1 API discussed above. [Sections 4.2-5]
Recovery: page identity, entry length and checksum are separate
On raw storage, old bytes remain when a log-page group is reused. The paper's log tag number identifies the MemTable generation of a page; metadata records closed groups' address ranges. Recycling follows a MemTable flush, not merely recognition of its tag. [Section 4.2, pp. 22-23]
At revision 9a82d5a5, ReadFromSPDK treats an unexpected tag in the active log as an end marker; closed logs instead use their recorded end address. CreateWAL records the preceding log's end, while DeleteLog removes obsolete descriptors and writes the metadata page. These are distinct lifecycle decisions: recognizing a page is not permission to reclaim it. [Recovery source] [Metadata lifecycle]
A method name can also overstate what has been verified. LogEntry::Check compares the assembled byte count with the declared entry size; it does not calculate a checksum. The pinned SPDKLoggingRecover hands reconstructed bytes to WriteBatch, whereas ordinary file-log recovery constructs log::Reader with checksum verification enabled. This does not establish identical validation in the two recovery paths. [Entry check] [Replay paths]
The engineering consequence is to verify the actual recovery path before carrying upstream RocksDB integrity claims into this prototype. A matching tag establishes page identity under the design's write assumptions; a complete byte count establishes length. Neither observation alone proves payload integrity or atomic recovery of a multi-page entry. These are source-review limits, not an observed data-loss incident or a reproduced corruption test.
Do not generalize the paper's single-process SPDK restriction to every SPDK configuration. Current driver documentation supports multiple processes sharing a device, but applications must coordinate logical-block access. A queue pair may be used by only one thread at a time. Submission is asynchronous; polling delivers completion callbacks. [Driver contract]
The author artifact requires device binding and a hugepage budget larger than its cache allocation. Reproducing it therefore needs a dedicated test device and an explicit configuration record; the setup is not safe to run blindly against a host's data disk. [Artifact setup]
Hesela's review is source inspection, not a SpanDB execution, power-loss experiment or benchmark reproduction. For an engineering comparison, record device cache policy, atomic-write support, error handling and the exact acknowledgment boundary before comparing speed.
Why the FAST paper permits different WAL policies
Dong, Kryczka, Jin and Stumm's FAST 2021 experience paper describes RocksDB's architecture and operational lessons, including synchronous, buffered and disabled WAL modes. A surrounding distributed system may already maintain a recovery log, making duplicate logging avoidable. That context does not show that an arbitrary standalone database can safely disable its WAL. [9, sections 2.2 and 4]
Section 4 also explains why shard-local resource limits are insufficient when many instances share a host: the authors distinguish local and shared controllers, and distinguish one-process deployments from coordination across processes. A shared C++ manager is not itself a cross-process memory governor. [9, section 4, p. 38]
This is an engineering experience report, not a randomized comparison of crash probabilities across those modes. We reviewed the architecture and WAL-treatment discussion, not a reproducible power-failure dataset. The article's inference is to compare performance only after matching the acknowledgment and recovery contracts.
LevelDB: an atomic batch is not a read-modify-write transaction
LevelDB is an embedded library for ordered byte-array keys and values, without a built-in SQL engine or client-server service. The documented model allows one process at a time to open a database, with multiple threads sharing its DB object. This comparison inspects release 1.23, not a claim about the latest version. [LevelDB identity]
Its log, memtable, sorted tables and MANIFEST explain the family resemblance to RocksDB; they do not make the two engines' APIs interchangeable. The table below separates guarantees in LevelDB's own API. [File layout]
| Mechanism | What it establishes | What remains separate |
|---|---|---|
WriteBatch | Ordered mutations applied atomically. | Validation of a preceding read or application read-modify-write isolation. [Batch API] |
| Explicit snapshot | A shared point-in-time view for related reads. | A durable backup or validation of a subsequent write. [DB API] |
sync=true | A synchronization request to the log's storage implementation before successful acknowledgement. | SSTable creation, read isolation or backend-independent power-loss protection. [Write path] |
Consider this API-derived schedule, with no intervening writes: A reads a counter as 0; B also reads 0; A writes 1 in an atomic batch; B writes 1 in another. The final value is 1, even if both writes request synchronization. The earlier reads are not conditions in either batch. Protect the whole read-modify-write operation with application coordination; a stronger synchronization setting cannot detect the stale read. This is illustrative reasoning, not an observed concurrency test. [Batch API] [DB API]
Atomic writes also do not turn separate default Get calls into one multi-key read snapshot. With a null ReadOptions::snapshot, each read selects its own implicit snapshot, so a batch between the calls can produce a before-and-after pair. Reusing one explicit snapshot solves that read-view problem, not the stale-read write problem above. The snapshot must belong to the same database and remain unreleased while those reads use it. Snapshot handles are transient state, not independent recovery copies. [Read options] [Snapshot lifetime]
In the inspected write path, logging precedes the requested WritableFile::Sync, which precedes memtable insertion. Successful synchronization therefore need not wait for an SSTable. [Write path] The default sync=false can acknowledge before persistent storage. [Write options]
A failed log synchronization has a different boundary from a successful one. In the same 1.23 write path, a log Sync error prevents memtable insertion and records a background error that stops subsequent writes. The appended record may nevertheless reappear after reopening, or may be absent. Treat this outcome as uncertain, not a guaranteed rollback; recovery and application-level reconciliation remain separate from acknowledging success. This general uncertainty follows source inspection; the bounded fixture below tests only one possible recovery outcome. [Synchronization error path]
The storage implementation matters: LevelDB's shipped in-memory Env keeps file contents in heap memory and returns success from Sync without persistence. The flag cannot make that backend durable. For a file-backed deployment, document the selected environment, filesystem and device synchronization contract before interpreting an acknowledgement as power-loss protection. This is source inspection, not a hardware durability measurement. [In-memory implementation]
Native check: an error acknowledgement can precede recovery
Hesela compiled the pinned LevelDB 1.23 source and wrapped only its WAL files. For one armed Sync, the wrapper first called the default backend and checked its success, then returned an injected IOError to LevelDB. The test did not damage a log or make the underlying synchronization fail. It changed the acknowledgement after synchronization. Each case used a fresh database and an initial key=old write. [Code and method]
| Case | Update status | Live read | Reopened read |
|---|---|---|---|
| Synchronous control | OK | new | new |
| Error after successful backend Sync | IOError | old | new |
| Asynchronous write, fault armed | OK; injection not reached | new | new |
In the injected case, a subsequent write also failed and its key remained absent after reopen. Both controls accepted that later write. The probe produced the same three case outcomes with and without NDEBUG; its explicit checks remain active in both builds. These are deterministic control cases, not independent samples of a device failure rate. [Recorded results]
The asynchronous control was deliberately closed normally; a later synchronous write could also flush earlier records. Its reopened value therefore says nothing about power-loss durability of sync=false. The injected case demonstrates recovery despite an error, not every outcome of a real fsync failure. It used no power cut, process crash or failing physical device. A caller should reconcile an uncertain operation rather than assume that retrying a non-idempotent action cannot duplicate its effect.
The OSDI 2014 study All File Systems Are Not Created Equal explored constructed crash states and application-specific checkers, including LevelDB 1.10 and 1.15. Its dependence on workloads, versions and persistence models is a reason to name the test boundary explicitly. Our 1.23 acknowledgement fixture is not an ALICE replication and does not establish whether historical crash vulnerabilities remain present. [Paper, sections 3.1, 3.6 and 4]
Reproduce or inspect the method and source pin, C++ probe, machine-readable observations and artifact checksums. The API-derived read-modify-write schedule above remains separate and was not executed by this fixture.
A recovery review needs a precise boundary
Record the engine version, WAL policy, manual-buffer setting, selected families, batch boundary, waiting policy, returned errors and the external log, if any. For write pressure, also record the affected families, pending flushes, L0 files, compaction estimate, returned statuses, shared memory controllers and actual admission state. Test process exit separately from host failure. A completed call cannot establish that hardware honored its persistence contract.
Continue with WAL and checkpoint guarantees, deletion versus reclamation and LSM read and compaction costs. The glossary defines a memtable separately from an SSTable.
Sources and limits
Primary-source comparison of RocksDB project documentation, v10.10.1 API and implementation, and the FAST 2021 experience paper, with explicit failure-model distinctions. The SILK addition reviews the ATC 2019 paper and a pinned author prototype; no new benchmark. The TRIAD addition reviews ATC 2017 and pinned author write options; its byte-counter table is hypothetical arithmetic. The SpanDB addition reviews FAST 2021, pinned author code and the SPDK driver contract; no prototype execution. The recovery follow-up distinguishes page tags, entry-length checks and the separate file-log reader at the same pinned revision. The MatrixKV addition checks ATC 2020 Table 2 against its abstract and statically inspects the pinned benchmark script; no execution. The engine-identity addition checks the same pinned revision and the official FAQ for mixed logged/unlogged writes; no native experiment. The LevelDB comparison reviews the 1.23 API, write path and in-memory Env; its interleavings are source-derived examples, not engine experiments. No RocksDB engine experiment, power-loss test, benchmark or paper reproduction was performed. Pinned headers describe v10.10.1, not a claim about the newest release; storage must honor synchronization.
- RocksDB project. Column Families: atomic writes and shared WAL.
- RocksDB project. Basic Operations: atomic updates and synchronous writes.
- RocksDB project. WAL Performance: non-sync and manually buffered modes.
- RocksDB v10.10.1. db.h: flush contracts and diagnostic properties.
- RocksDB v10.10.1. options.h: buffering, atomic flush, write policy and snapshot immutability.
- RocksDB project. Atomic flush: grouped persistence and explicit column-family selection.
- RocksDB project. MANIFEST: CURRENT, VersionEdits and atomic groups.
- RocksDB project. Write Ahead Log: lifecycle and flush triggers.
- Siying Dong, Andrew Kryczka, Yanqin Jin and Michael Stumm. Evolution of Development Priorities in Key-value Stores Serving Large-scale Applications: The RocksDB Experience. FAST 2021, pp. 33-49; sections 2.2, 4 and 5.
- RocksDB project. Write Stalls: causes, scope and admission behavior.
- RocksDB v10.10.1. ColumnFamilyData::GetWriteStallConditionAndCause.
- RocksDB v10.10.1. Column-family write-buffer and compaction thresholds.
- RocksDB v10.10.1. DelayWrite and write preprocessing.
- RocksDB v10.10.1. WriteBufferManager: budget, optional stalls and cache charging.
- RocksDB v10.10.1. WriteBufferManager implementation: reservations and stall release.
- RocksDB project. Snapshot: lifetime, read visibility and compaction retention.
- RocksDB v10.10.1. checkpoint.h: file capture and flush threshold.
- RocksDB v10.10.1. backup_engine.h: backup creation, synchronization and verification.
- RocksDB project. How to backup RocksDB: sharing, restore and backup metadata.
- RocksDB v10.10.1. backup_engine.cc: VerifyBackup implementation.
- RocksDB v10.10.1. compaction_filter.h: snapshot-visible data caveat.
- RocksDB project. Full File Checksum and Checksum Handoff: SST identity and checksum provenance.
- RocksDB project. Track WAL in MANIFEST: missing logs, numbering and upgrade coverage.
- RocksDB v10.10.1. WalSet::CheckWals: synced-size, presence and lower-bound checks.
- RocksDB v10.10.1. WalSet tests for missing and shortened logs (source inspected, not executed).
- RocksDB v10.10.1. DB recovery: WAL inventory check, best-efforts bypass and tracking disablement.
- RocksDB v10.10.1 options.h: ReadOptions checksum and cache-insertion controls.
- RocksDB v10.10.1 BlockBasedTable: cache lookup and VerifyChecksumInBlocks.
- RocksDB v10.10.1 DBImpl::VerifyChecksumInternal: current SST traversal.
- RocksDB v10.10.1 VerifySstFileChecksumInternal: table-reader construction.
- RocksDB v10.10.1 BlockFetcher: uncompressed, serialized and file read paths.
- RocksDB v10.10.1 advanced_options.h: block_protection_bytes_per_key.
- Bi and Kryczka: Per Key-Value Checksum (18 July 2022), User API and Feature Design; version-scoped write/recovery coverage.
- RocksDB v10.10.1 VerifyBlockChecksum: footer algorithm, context-adjusted trailer comparison.
- RocksDB v10.10.1 ComputeBuiltinChecksum: payload-independent kNoChecksum result.
- RocksDB v10.10.1 BlockBasedTableOptions: checksum selection for new SST files.
- Balmau, Dinu, Zwaenepoel, Gupta, Chandhiramoorthi and Didona. SILK: Preventing Latency Spikes in Log-Structured Merge Key-Value Stores. USENIX ATC 2019, pp. 753-766; sections 4.2, 5, 6.1 and 6.4.
- SILK author prototype, commit 35385f14b6d3948c75914c1571e92897280a483e: high-priority scheduling before the background-compaction pause check.
- SILK author README at 35385f14b6d3948c75914c1571e92897280a483e: prototype identity and benchmark entry points.
- Balmau et al. TRIAD. USENIX ATC 2017, pp. 363-375; sections 4.1-4.3 and 5.1-5.3.
- TRIAD author prototype, pinned README: benchmark controls and enabled WAL.
- TRIAD author prototype, pinned WriteOptions: synchronization and WAL defaults.
- Chen, Ruan, Li, Ma and Xu. SpanDB. USENIX FAST 2021, pp. 17-32, sections 3-5.
- SpanDB 9a82d5a5: SPDKWrite callback and logger completion processing, lines 98-244.
- SpanDB 9a82d5a5: author artifact setup, hugepage budget and test configuration.
- SPDK NVMe driver: asynchronous submission, queue-pair ownership and multi-process limitations.
- SpanDB 9a82d5a5: active-log tag checks and entry assembly in ReadFromSPDK and ProcessData.
- SpanDB 9a82d5a5: LogEntry::Check compares accumulated and declared byte counts.
- SpanDB 9a82d5a5: SPDKLoggingRecover and ordinary RecoverLogFiles use different input readers.
- SpanDB 9a82d5a5: DeleteLog, CreateWAL and WriteMetadata lifecycle.
- Yao et al. MatrixKV. USENIX ATC 2020, pp. 17-31, sections 3-5; Table 2 distinguishes the baselines.
- MatrixKV be2d2627: author README and RocksDB version.
- MatrixKV be2d2627: benchmark arguments, value budget and host-changing cleanup.
- RocksDB v10.10.1 README: library identity and LSM design.
- RocksDB v10.10.1 DBImpl::WriteImpl: incompatible sync/disableWAL options.
- RocksDB FAQ: a synchronous write after a WAL-disabled update.
- LevelDB 1.23 README: ordered key-value library, features and limitations
- LevelDB 1.23 user guide: atomic batches, synchronization, concurrency and snapshots
- LevelDB 1.23 options: key ordering, per-read snapshot and write synchronization
- LevelDB 1.23 WriteBatch: ordered atomic mutations and synchronization requirements
- LevelDB 1.23 DB API: reads, writes and transient snapshot lifetime
- LevelDB 1.23 DBImpl::Write: log, requested sync and memtable insertion
- LevelDB 1.23 in-memory Env: heap-backed files and no-op synchronization
- LevelDB 1.23 implementation overview: logs, memtables, sorted tables and MANIFEST
- Hesela: LevelDB Sync acknowledgement fixture, source, controls and limitations
- Pillai et al.: All File Systems Are Not Created Equal, OSDI 2014, sections 3.1, 3.6 and 4 (historical LevelDB versions)
Recovery sources checked 14 October 2026; write-stall contracts checked 15 October 2026; capture APIs checked 17 October 2026; WAL inventory implementation checked 18 October 2026; checksum read paths checked 1 November 2026. The pinned release is an inspection target, not a latest-version claim.