~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

harness: the upgrade run on 0.5.0's data, its spaces carried

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:harness/upgrade-0.5.0

The upgrade run now starts the server on 0.5.0's data, written again from the v0.5.0 tag as the release guide asks; it was still 0.1.0's. The spec now says what the server does with spaces across upgrades: they're carried from the spaces mark on, and only 0.1.0's, from before the mark, are let go.

Claude Opus 5.5 · high

What changes

Spec and guide.

  • spec/STORE.md, "Upgrades", gains a Spaces. paragraph. An account's spaces state is carried from the mark {"t":"spaces","v":1} on, which begins every account's log from 0.2.0 on. What a version wrote before the mark, in a log with no mark or a table of the format before, is let go on first load, along with blobs only those spaces held.
  • "How it is checked" now holds the space reads of 0.5.0's data like every other read, and names the let-go path as the server's own tests'.
  • docs/guide/operating.md, "Upgrades", the change file, and the comments in store.rs and checkpoint/unmarked.rs say the same.

Harness. harness/checks/upgrade.mjs used to skip the space reads and expect none. It now reads the first account's space (listSpaces, getSpace, listMembers, and the space's listRecords, listRepoOps and getLatestCommit) and holds each to the previous version's answer. harness/upgrade/ is written again by the v0.5.0 binary: 4 accounts and 59 reads, the six space reads among them.

Why

The old rule ("spaces are not carried across versions") failed against 0.5.0's data, which is marked and does carry its spaces. The rule was really the mark's: only data from before the mark, 0.1.0's, loses its spaces.

How it was checked

  • Passes. node compare.mjs --upgrade with today's build on 0.5.0's data passes, all six space reads compared on both data directories.
  • Bites. With the server's replay of space entries planted away, it fails on alice listSpaces. The server is put back.
  • Server tests. The let-go path for unmarked data is covered by the server's own tests (spaces_before_the_mark_are_let_go, a_table_of_the_version_before_is_folded_once). No data the harness keeps predates the mark.
Asked for changes

This pull rebuilds the upgrade fixture from v0.5.0. Before, it was 0.1.0's. It also makes the upgrade run hold the first account's six space reads to the previous version's answers, and it rewrites spec/STORE.md and docs/guide/operating.md to say spaces are carried across upgrades.

The harness part is sound. It stops skipping the space reads, and it stops checking that none come back. Every read now has to match, and a read the old version never answered fails. That makes the check stricter. The fixture's space reads in reads.json are real 200 answers (policy, members, records, ops, commit), not errors, so the check has something to bite on.

The spec and docs part removes a rule the server still follows. The pull body says "nothing in the server ever did that on purpose", but the server does drop old spaces deliberately, in crates/pds-server/src/checkpoint/unmarked.rs:

  • Every account log starts with a mark, {"t":"spaces","v":1}.
  • On first load, spaces state from before the mark is let go: anything in an unmarked log, or in a table of the older format that checkpoint/before.rs reads. So are blobs that only those spaces held.
  • The tests spaces_before_the_mark_are_let_go and a_table_of_the_version_before_is_folded_once check this.

0.5.0's data passes only because 0.5.0 already writes the mark. A data directory from before the mark existed (0.1.0's) still loses its spaces on upgrade. After this pull, spec/ says nothing about that behaviour. Meanwhile crates/pds-server/src/store.rs:131 ("Spaces are not carried across versions", citing STORE.md "Upgrades") and checkpoint/unmarked.rs:1-2 say the opposite of what the spec now says. Since crates/ is built from spec/ alone, the spec should describe what the server does.

What to change:

  1. In spec/STORE.md, under "Upgrades", say that spaces are carried. Also say what happens to spaces state written before the mark (data from releases before 0.5.0, if that's where it starts): it is let go on first load, along with blobs only it held. Alternatively, state outright that such data isn't supported.
  2. Change the comments in store.rs and unmarked.rs that cite the old rule so they match.
  3. Make the change file match: an upgrade from the previous release keeps spaces, but data from before the mark doesn't.

Not read line by line: the regenerated fixture's binary and log files (harness/upgrade/clean/**, harness/upgrade/killed/**) and most of plc.json and reads.json. They are written by the v0.5.0 binary, and I checked only that they have the space reads.

spec/STORE.mdlines 403 to 410Outdated
`checkAccountStatus`, `getPreferences` and `listAppPasswords`; the
firehose from cursor `0`, every frame's bytes; and the spaces
(`SPACES.md`), carried as the rest is: the first account's `listSpaces`,
its memberspace's `getSpace` and `listMembers`, and the space's
`listRecords`, `listRepoOps` and `getLatestCommit`. Then a record written
to the first account must commit at a later `rev`, its `#commit` event
after the last `seq` the previous version made and its `since` that
version's last `rev`, and an account must be made.
review.knotless.dev

This removes the only text in spec/ about spaces across versions, but the server still drops them on purpose for data without the spaces mark. See crates/pds-server/src/checkpoint/unmarked.rs: spaces state before {"t":"spaces","v":1}, or in a table of the older format, is let go on first load, along with blobs only it held. 0.5.0's data passes because 0.5.0 writes the mark; 0.1.0's would still lose its spaces. Please say in "Upgrades" what is carried and what isn't. Also update store.rs:131 and unmarked.rs:1-2, which still say spaces are not carried and cite this page.

chadtmiller.com

Right, and my pull body was wrong: the mark lets spaces go on purpose. STORE.md, "Upgrades", now has a Spaces. paragraph: spaces state is carried from the mark {"t":"spaces","v":1} on, which begins every account's log from 0.2.0 on (5af4c0f; v0.2.0 through v0.5.0 have checkpoint/unmarked.rs). What came before it, in a log with no mark or a table of the format before, is let go on first load, along with blobs only those spaces held. "Not checked by the harness" names that path as the server's own tests'. The comments in store.rs and unmarked.rs now say the same. (80c5bf0)

.changeset/spaces-carried.mdline 7Outdated
# Spaces are carried across upgrades
A server upgraded on its data directory keeps its spaces, as it keeps everything else: their records, members and history answer as they did before the upgrade. The spec and guides used to say spaces were dropped on an upgrade; that was never something the server did on purpose, and it no longer says so.
review.knotless.dev

"keeps its spaces, as it keeps everything else" goes too far for an upgrade from a data directory without the spaces mark: its spaces are still let go (checkpoint/unmarked.rs). Say which releases' data keeps its spaces. Also, "never something the server did on purpose" isn't accurate: the mark exists to do exactly that.

chadtmiller.com

Fixed: the change file now says data written by 0.2.0 or later keeps its spaces, and 0.1.0's, from before the mark, are let go with any blob only they held. I've dropped the "never on purpose" claim. (80c5bf0)

Approved

This pull rebuilds the upgrade fixture from v0.5.0 and makes the upgrade run hold the first account's six space reads to the previous version's answers. It also changes the spec, the guide and the comments to say that spaces are carried across upgrades from the spaces mark on.

Everything I asked for last round is done, in 80c5bf0:

  1. Spec. spec/STORE.md, "Upgrades", now has a Spaces paragraph. It names the mark {"t":"spaces","v":1} and says it begins every account's log from 0.2.0 on. Spaces state from before the mark, in an unmarked log or a table of the older format, is let go on first load, along with blobs only those spaces held. "How it is checked" now lists that let-go path as not checked by the harness, because the server's own tests cover it and no harness data predates the mark. That is an honest gap, not a loosened check.
  2. Comments. store.rs and checkpoint/unmarked.rs now cite the rule the spec gives.
  3. Docs and change file. docs/guide/operating.md and .changeset/spaces-carried.md both say that data from 0.2.0 on keeps its spaces and 0.1.0's does not.

I checked the "0.2.0 on" claim against the tags. checkpoint/unmarked.rs and its MARK are in v0.2.0 but not in v0.1.0.

The harness change is as I judged it last round. Every read must now match, and any extra read fails, so the check is stricter. The checks that have finished on this head pass (docs and citations; store-bench-small was skipped because it touches none of its paths). gates was still running when I looked.

Not read line by line: the regenerated fixture's binary and log files (harness/upgrade/clean/**, harness/upgrade/killed/**) and most of plc.json and reads.json. The v0.5.0 binary writes them, and this round's commit doesn't touch them.

All checks have passed

3 passed, 1 skipped

Merged as 4366c2d