test: v1.0.0 fixtures of the master's stores, generated on the tag

Generated on the v1.0.0 tag checkout (25a3b755), on Linux: the lifecycle
stores (volume records, placements, node inventory, deletion
reservations, bindings), the authority store (lines and lost ranges) and
the store attestations. Today's stores write the same files (volume
records compared with their store-minted layout ids blanked) and read
them as the same records; each file's blob hash is pinned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-28 13:10:35 -08:00
1 parent b3e4677d4d
commit 9cf08758e1
16 files changed
+114 -3

No files matched your search

@@ -85,7 +85,11 @@ func goldenAuthorityFiles(t *testing.T, root string) map[string][]byte {
// goldenAuthorityAtV100 is each fixture file's git blob hash as written on
// the v1.0.0 tag checkout.
var goldenAuthorityAtV100 = map[string]string{}
var goldenAuthorityAtV100 = map[string]string{
"v1.lostrange.json": "cb4200c2742a7c784d4eb2d1beed61a212053608",
"v1.v3auth.json": "88642d0ed99d19635e1ff3d2bd2082ecc319643e",
"v2.v3auth.json": "fb7a6a3cd8d2c81c955fc130566f6ae93c677c91",
}
func TestAuthorityGoldenFilesAreTheV100Files(t *testing.T) {
files := goldenAuthorityFiles(t, goldenAuthorityDir)
@@ -0,0 +1,12 @@
# v1.0.0 authority store files of the master
Generated once by `TestWriteGoldenV100Authority` (`golden_v100_test.go`), run with `SW_GOLDEN_WRITE` on a checkout of the tag **v1.0.0**, commit **bef007fddf341944faa2eb0ed36e1b3aefda96e8**, on Linux (these stores sync their directories). The inputs are fixed. The files are never regenerated on main.
They are the durable authority lines (`*.v3auth.json`) and the forced-move lost ranges (`*.lostrange.json`).
A master upgraded first reads these files. The checks:
- the store writes the same files for the same inputs;
- the store reads the files back as the same records;
- each file's git blob hash matches the one written on the tag.
A failing check is fixed by restoring the store, or by the format path (a version bump, and a refusal of the old format first), never by rewriting a fixture.
@@ -0,0 +1 @@
{"v":1,"volume":"v1","ranges":[{"RequestID":"move-1","NewEpoch":3,"OldReplicaID":"r1","OldEpoch":2,"LostAfterLSN":40,"LostUntilNS":1795800000000000000}],"checksum":"a2b34e21a39a638f9e5662e2ae52300c8701d50a3630d24f5ed580c6581e1486"}
@@ -0,0 +1 @@
{"v":1,"body":{"VolumeID":"v1","ReplicaID":"r1","Epoch":3,"EndpointVersion":2,"DataAddr":"10.0.0.1:7001","CtrlAddr":"10.0.0.1:7002","WriteSeq":7,"Incarnation":"inc-1"},"checksum":"20f0b340cc25c0b05ea23be12b3b29b0a30b87a4d90d9ca476304285386ea013"}
@@ -0,0 +1 @@
{"v":1,"body":{"VolumeID":"v2","ReplicaID":"r1","Epoch":1,"EndpointVersion":1,"DataAddr":"10.0.0.2:7001","CtrlAddr":"10.0.0.2:7002","WriteSeq":1},"checksum":"9babb9679cb24f04bc3ef6ddee97405dbdf0990f65701aba52e4abc17b734e6b"}
@@ -23,7 +23,7 @@ const goldenAttestationFix = "the store-attestation file format changed from v1.
// goldenAttestationAtV100 is store-attestations.json's git blob hash as
// written on the v1.0.0 tag checkout.
const goldenAttestationAtV100 = "ATTESTATION_HASH"
const goldenAttestationAtV100 = "b151a79ebf529518e4d86542204c6df99e7c64b5"
// goldenAttestations writes the file under dir through the store's own
// steps: a volume opened for two replicas and its first ready noted, then
@@ -0,0 +1,10 @@
# v1.0.0 store-attestation file of the master
Generated once by `TestWriteGoldenV100Attestations` (`golden_v100_test.go`), run with `SW_GOLDEN_WRITE` on a checkout of the tag **v1.0.0**, commit **bef007fddf341944faa2eb0ed36e1b3aefda96e8**, on Linux (these stores sync their directories). The inputs are fixed. The files are never regenerated on main.
A master upgraded first reads these files. The checks:
- the store writes the same files for the same inputs;
- the store reads the files back as the same records;
- each file's git blob hash matches the one written on the tag.
A failing check is fixed by restoring the store, or by the format path (a version bump, and a refusal of the old format first), never by rewriting a fixture.
@@ -0,0 +1 @@
{"v1":{"primary":"r1","epoch":3,"stores":{"r1":"11111111111111111111111111111111","r2":"22222222222222222222222222222222"},"initial":["r1","r2"]},"v2":{"primary":"r1","epoch":1,"stores":{"r1":"33333333333333333333333333333333"}}}
@@ -112,7 +112,14 @@ func goldenFiles(t *testing.T, root string) map[string][]byte {
// goldenStoresAtV100 is each fixture file's git blob hash as written on the
// v1.0.0 tag checkout.
var goldenStoresAtV100 = map[string]string{}
var goldenStoresAtV100 = map[string]string{
"bindings/bindings.json": "58547b1c1fc3ba5dd9c932b8264a6b64fe457f98",
"deletions/reservations.json": "82ccb05e41bee851282f1ccea667bbe5ea364f3a",
"nodes/node-a.json": "091a3e2da07d2ebfafc667f31a00cee3bc095566",
"placements/v1.json": "6d7fb9781db7032dc716ab61eef8bc4103988110",
"volumes/t1.json": "717358b423edcc94c50a279161791e955503137c",
"volumes/v1.json": "673ec9e0c943a1c50e0454cc24054412fc9ef62c",
}
// The fixtures are the files written on the v1.0.0 tag.
func TestLifecycleGoldenFilesAreTheV100Files(t *testing.T) {
@@ -0,0 +1,14 @@
# v1.0.0 lifecycle store files of the master
Generated once by `TestWriteGoldenV100Stores` (`golden_v100_test.go`), run with `SW_GOLDEN_WRITE` on a checkout of the tag **v1.0.0**, commit **bef007fddf341944faa2eb0ed36e1b3aefda96e8**, on Linux (these stores sync their directories). The inputs are fixed. The files are never regenerated on main.
The stores are volume records (`volumes/`), placement intents (`placements/`), node inventory (`nodes/`), deletion reservations (`deletions/`) and workspace bindings (`bindings/`).
A volume record's layout ids are minted at random by the store (CreateVolume refuses a given one). The write check therefore compares volume records with those ids blanked; every other byte of every file is compared as written.
A master upgraded first reads these files. The checks:
- the store writes the same files for the same inputs;
- the store reads the files back as the same records;
- each file's git blob hash matches the one written on the tag.
A failing check is fixed by restoring the store, or by the format path (a version bump, and a refusal of the old format first), never by rewriting a fixture.
@@ -0,0 +1 @@
{"v1":[{"volume_id":"v1","server_id":"node-a","data_addr":"10.0.0.1:7001","ctrl_addr":"10.0.0.1:7002"},{"volume_id":"v1","server_id":"node-b","data_addr":"10.0.0.2:7001","ctrl_addr":"10.0.0.2:7002","retired":true,"retired_epoch":3}]}
@@ -0,0 +1 @@
{"going":{"volume_id":"going","state":"admitted","tokens":["del-2"]},"gone":{"volume_id":"gone","state":"committed","tokens":["del-1"]}}
@@ -0,0 +1,10 @@
{
"server_id": "node-a",
"addr": "10.0.0.1:7000",
"data_addr": "10.0.0.1:7001",
"ctrl_addr": "10.0.0.1:7002",
"labels": {
"zone": "z1"
},
"seen_at": "2026-11-28T08:00:00Z"
}
@@ -0,0 +1,15 @@
{
"volume_id": "v1",
"desired_rf": 1,
"slots": [
{
"server_id": "node-a",
"pool_id": "pool-0",
"replica_id": "r1",
"source": "existing_replica",
"data_addr": "10.0.0.1:7001",
"ctrl_addr": "10.0.0.1:7002",
"nvme_listen_port": 4420
}
]
}
@@ -0,0 +1,19 @@
{
"spec": {
"volume_id": "t1",
"layout_id": "9292513c52dc3869a745d15610c970d0",
"size_bytes": 1073741824,
"block_size": 4096,
"chunk_bytes": 4194304,
"source_volume": "v1",
"source_layout_id": "8ba950d8dcd72d13ff1cf6d6731644b2",
"source_snapshot": "daily",
"create_request_id": "restore-1",
"replication_factor": 1,
"protocol": "iscsi",
"pvc_name": "data",
"pvc_namespace": "ns",
"pvc_uid": "uid-1",
"pv_name": "pv-1"
}
}
@@ -0,0 +1,14 @@
{
"spec": {
"volume_id": "v1",
"layout_id": "8ba950d8dcd72d13ff1cf6d6731644b2",
"size_bytes": 1073741824,
"block_size": 4096,
"chunk_bytes": 4194304,
"replication_factor": 1,
"protocol": "nvme",
"frontend_transport": "tcp"
},
"attached_to": "node-a",
"store_ready": true
}