durable: keep the attach level next to the attach

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-12-01 23:32:54 -08:00
1 parent 4184e30af4
commit 4c0e826f7d
2 files changed
+11 -11

No files matched your search

@@ -623,6 +623,17 @@ type layoutRemoteCapabilities interface {
// closeBoundRemote ends every remote call when the provider closes, so a
// shutdown never waits on the remote for an attach or a cut. While an
// attach runs, its calls also end with the attach caller's context.
// attachFormatLevel is the chunk layer's format level from the assignment's:
// 0 (also when absent) keeps a v1.0 store on v1.0; 1 lets the attach
// upgrade it. A higher level than this binary knows is read as 1, the
// highest format it writes.
func attachFormatLevel(assigned uint32) uint8 {
if assigned >= 1 {
return 1
}
return 0
}
// SetHeadFormat forwards the attaching layer's HEAD format to the
// remote it wraps (storage.ChunkHeadFormatter), so the wrapper never hides
// it: a remote that does not take it writes as it always did.
@@ -19,17 +19,6 @@ func initializeLayoutRoot(ws *storage.WALStore) error {
return ws.SetLayoutIdentity(hex.EncodeToString(id[:]), true)
}
// attachFormatLevel is the chunk layer's format level from the assignment's:
// 0 (also when absent) keeps a v1.0 store on v1.0; 1 lets the attach
// upgrade it. A higher level than this binary knows is read as 1, the
// highest format it writes.
func attachFormatLevel(assigned uint32) uint8 {
if assigned >= 1 {
return 1
}
return 0
}
// grantedLayoutLine carries the actual assignment accepted by the volume
// host. The master issues a higher epoch only after its clean proof or forced
// lease barrier; the grant is the proof, not a local clock or a HEAD read.