The 58k-rename TVShows apply on the spinning array spent most of its wall time in
journal durability, not in renames: one fsync per rename, and on top of it a
quadratic Journal.already() scan over a record list that grows all run.
Change
Journal indexes move intents by (src, dst); already() is O(1).
--batch N (default 64): write N intents → fsync once → perform those N
renames. The durability rule is now per batch instead of per move, and it is
unchanged in kind: no rename runs before its own intent is on disk, so a
crash mid-batch replays that batch and resumes.
--batch 1 reproduces the old per-move flush.
Tests
tests/media_relayout.bats:
an apply interrupted mid-batch loses nothing — the rerun completes every move;
batching changes no final path and no journal line.
Full suite green (781 tests). Docs: the --batch paragraph in serverAppConfigs-docs/Dankserver/Media Relayout.md.
## Why
The 58k-rename TVShows apply on the spinning array spent most of its wall time in
journal durability, not in renames: one `fsync` per rename, and on top of it a
quadratic `Journal.already()` scan over a record list that grows all run.
## Change
- `Journal` indexes move intents by `(src, dst)`; `already()` is O(1).
- `--batch N` (default 64): write N intents → `fsync` once → perform those N
renames. The durability rule is now per batch instead of per move, and it is
unchanged in kind: **no rename runs before its own intent is on disk**, so a
crash mid-batch replays that batch and resumes.
- `--batch 1` reproduces the old per-move flush.
## Tests
`tests/media_relayout.bats`:
- an apply interrupted mid-batch loses nothing — the rerun completes every move;
- batching changes no final path and no journal line.
Full suite green (781 tests). Docs: the `--batch` paragraph in
`serverAppConfigs-docs/Dankserver/Media Relayout.md`.
---
cwd: /home/blank/.omp/wt/apply-batch · session: 2026-10-30T23-38-45-297Z_01a18f2e-18b1-7573-bcd5-ac99636f8bcb
The 58k-rename apply on the spinning array spent most of its wall time in
fsyncs: one durability flush per rename, and a quadratic `Journal.already()`
scan over a growing record list on top of it. Both are the journal's, not the
renames'.
- `Journal` indexes move intents by (src, dst) so `already()` is O(1).
- `--batch N` (default 64) writes N intents, fsyncs once, then performs those
N renames. The invariant is unchanged: no rename runs before its own intent
is durable, so a crash mid-batch replays the batch and resumes.
- Tests: a mid-batch kill loses nothing and the rerun completes; batching
changes no final path and no journal line.
dank
merged commit 3344b51fbd into main2026-10-31 18:20:17 -07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
The 58k-rename TVShows apply on the spinning array spent most of its wall time in
journal durability, not in renames: one
fsyncper rename, and on top of it aquadratic
Journal.already()scan over a record list that grows all run.Change
Journalindexes move intents by(src, dst);already()is O(1).--batch N(default 64): write N intents →fsynconce → perform those Nrenames. The durability rule is now per batch instead of per move, and it is
unchanged in kind: no rename runs before its own intent is on disk, so a
crash mid-batch replays that batch and resumes.
--batch 1reproduces the old per-move flush.Tests
tests/media_relayout.bats:Full suite green (781 tests). Docs: the
--batchparagraph inserverAppConfigs-docs/Dankserver/Media Relayout.md.cwd: /home/blank/.omp/wt/apply-batch · session: 2026-10-30T23-38-45-297Z_01a18f2e-18b1-7573-bcd5-ac99636f8bcb