From 4c0e826f7db20098196ea2cf07e7e9ca731ed3f1 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Tue, 1 Dec 2026 23:32:54 -0800 Subject: [PATCH] durable: keep the attach level next to the attach Co-Authored-By: Claude Opus 5.5 --- seaweed-block/core/frontend/durable/provider_chunk.go | 11 +++++++++++ .../core/frontend/durable/provider_layout.go | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/seaweed-block/core/frontend/durable/provider_chunk.go b/seaweed-block/core/frontend/durable/provider_chunk.go index 807ed6241a..dba179ff4a 100644 --- a/seaweed-block/core/frontend/durable/provider_chunk.go +++ b/seaweed-block/core/frontend/durable/provider_chunk.go @@ -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. diff --git a/seaweed-block/core/frontend/durable/provider_layout.go b/seaweed-block/core/frontend/durable/provider_layout.go index 35576a68ac..0c193859d9 100644 --- a/seaweed-block/core/frontend/durable/provider_layout.go +++ b/seaweed-block/core/frontend/durable/provider_layout.go @@ -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.