# Logical Disk: commit, flush and recovery

The useful question is not just whether a group of changes is indivisible.
Ask which version recovery may return, and what action makes that version durable.

## A two-block example

Start with two existing blocks, `inode=0` and `directory=0`. Treat their values
as consistency markers, not actual filesystem structures. Both should become 1
together. The teaching model deliberately schedules no background flushing.

| Schedule before crash | Recovered inode | Recovered directory |
| --- | ---: | ---: |
| Begin, write both, EndARU | 0 | 0 |
| Begin, write both, EndARU, Flush | 1 | 1 |
| Begin, write both, Flush while still open | 0 | 0 |
| Simple write inode, Flush, simple write directory | 1 | 0 |

These are exact outcomes of this model, not measured failure rates. The first
row is a counterexample to treating commit as a durability acknowledgement.
The third tests whether flushing is mistakenly implemented as committing an
open group. The fourth is a negative control: separate atomic writes need not
preserve a multi-block invariant.

Run the dependency-free tests with Node:

```sh
node --test model.test.mjs
```

A minimal call:

```js
import { replay } from "./model.mjs";
console.log(replay([
  ["begin"], ["write", "inode", 1], ["write", "directory", 1],
  ["end"], ["crash"],
]).at(-1));
```

## Scope

This is a deterministic state-machine illustration of the 1996 version classes,
restricted to one active ARU and two pre-existing blocks. It has no allocation,
list operations, conflicting writers, partial flush failure, media errors,
background writes or physical persistence mechanism. It is not a reproduction
of LLD, a power-cut test, or proof of an implementation. The exhaustive test
covers crash prefixes and an inserted successful flush at each boundary of the
single example, not arbitrary storage executions.

## Evidence and historical boundaries

[Logical Disk](/terms/logical-disk/) covers placement and the 1993 interface.
[Atomic recovery unit](/terms/atomic-recovery-unit/) covers the later version,
allocation and concurrency boundaries. Stable identifiers, placement hints,
access control and transaction isolation answer different questions.

The 1993 MINIX evaluation did not exercise ARUs. The 1996 evaluation still used
a single-threaded MINIX client; support for concurrency is not evidence of
multi-client scalability. No historical timing or memory-price result is
extrapolated to a present-day drive.

Primary sources:
- [de Jonge, Kaashoek and Hsieh, SOSP 1993](https://www.cs.tufts.edu/~nr/cs257/archive/wilson-hsieh/logical-disk.pdf), sections 2-5.
- [Grimm, Hsieh, de Jonge and Kaashoek, ICDCS 1996](https://pdos.csail.mit.edu/archive/ld/arus.ps), sections 3-5, Figures 1-2.
- [MIT PDOS bibliography](https://pdos.csail.mit.edu/publications/): 14th SOSP, pages 15-28, and 16th ICDCS, pages 26-37.

The old LD project index labels SOSP as the thirteenth symposium; the current
group bibliography and the 1996 paper's reference list agree on the fourteenth.
DOIs are omitted because publisher metadata was not confirmed in this review.
Source retrieval date and SHA-256 digests are in [sources.json](sources.json).
The papers are linked, not redistributed.
