From 1d20825d6983bbdfa42df126875d0d3cc98d6f7c Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 15:23:30 +0100 Subject: [PATCH] =?UTF-8?q?nfs-server=20reads=20who=20holds=20a=20seat=20t?= =?UTF-8?q?hrough=20the=20placement=20client=20and=20the=20seat's=20state?= =?UTF-8?q?=20name,=20not=20go/delivery=20(B5e;=20ADR=200634=20=C2=A71,=20?= =?UTF-8?q?=C2=A74;=20issue=201966)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- modules/nfs-server/cmd/nfs-server/backup.go | 4 ++-- modules/nfs-server/cmd/nfs-server/main.go | 14 ++++++++++---- modules/nfs-server/cmd/nfs-server/manifest_test.go | 3 ++- modules/nfs-server/go.mod | 2 ++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/nfs-server/cmd/nfs-server/backup.go b/modules/nfs-server/cmd/nfs-server/backup.go index b5dc9059f..46989ee2d 100644 --- a/modules/nfs-server/cmd/nfs-server/backup.go +++ b/modules/nfs-server/cmd/nfs-server/backup.go @@ -19,7 +19,7 @@ import ( "encoding/json" "fmt" "git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings" - "git.novox.be/novox/mesh-sdk/go/delivery" + assignerclient "git.novox.be/novox/mesh-contracts/placement/go/clients/meshmoduleassignerclient" "os" "path" "sort" @@ -51,7 +51,7 @@ type BackupFromBus struct { // (clause 3). A machine whose backup seat nobody holds, and no readings at all, are errors: never an empty list read as // "nothing to fear". func BackupFrom(machine string, keys map[string][]byte, readings []diskreadings.Reading) (string, []string, error) { - holders, err := delivery.HoldersOf(keys, BackupSeat, machine) + holders, err := assignerclient.HoldersOf(keys, BackupSeat, machine) if err != nil { return "", nil, err } diff --git a/modules/nfs-server/cmd/nfs-server/main.go b/modules/nfs-server/cmd/nfs-server/main.go index f936f1bdf..d5e367f11 100644 --- a/modules/nfs-server/cmd/nfs-server/main.go +++ b/modules/nfs-server/cmd/nfs-server/main.go @@ -13,6 +13,7 @@ import ( "context" "encoding/json" "fmt" + mesh "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner" "os" "os/signal" "sort" @@ -24,7 +25,6 @@ import ( "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/delivery" "git.novox.be/novox/mesh-sdk/go/views" ) @@ -51,7 +51,7 @@ func main() { return } m := Here() - seats.Follow(delivery.AssignerModule, delivery.SeatHoldersState, SeatHoldersTool) + seats.Follow(assignerModule, mesh.StateSeatHolders, SeatHoldersTool) seats.Start(context.Background()) go ShareExports(m) if err := stdio.Serve("", append(Tools(m), seats.Tools("nfs_server")...)); err != nil { @@ -124,14 +124,20 @@ func readingsOf(node string) ([]diskreadings.Reading, error) { } // SeatHoldersTool is the assigner's read tool of who holds which seat, which the manifest invokes (ADR 0615). -const SeatHoldersTool = delivery.AssignerModule + ".assigner_read_seat_holders" +// assignerModule is the holder of the seat mesh-module-assigner whose seat-holders view this module follows: the one name +// of it here, the same as its manifest's `consumes` and `invokes` carry (the manifest test holds them equal). +const assignerModule = "mesh-delivery-assigner" + +const SeatHoldersTool = assignerModule + ".assigner_read_seat_holders" // seats is the picture of the placement seat's state of who holds which seat: asked of the assigner once and followed by // its events, never read from its state (ADR 0615). var seats = &views.Reader{Module: "nfs-server", Findings: meshconditionsclient.FindingWriter{State: stdio.State("findings")}, Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}, Logf: func(f string, a ...any) { fmt.Fprintf(os.Stderr, "nfs-server: "+f+"\n", a...) }} // seatHolderKeys is the placement seat's state of who holds which seat, every key. -func seatHolderKeys() (map[string][]byte, error) { return seats.Values(delivery.SeatHoldersRead) } +func seatHolderKeys() (map[string][]byte, error) { + return seats.Values(assignerModule + "." + mesh.StateSeatHolders) +} // TakeWants reads every node's `mounts` state from the bus and writes what is asked of this machine to // the wants file, for the root process. When the bus does not answer, the last wants stay. diff --git a/modules/nfs-server/cmd/nfs-server/manifest_test.go b/modules/nfs-server/cmd/nfs-server/manifest_test.go index 74d7f98f2..a33f95cc8 100644 --- a/modules/nfs-server/cmd/nfs-server/manifest_test.go +++ b/modules/nfs-server/cmd/nfs-server/manifest_test.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings" + mesh "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner" "os" "regexp" "sort" @@ -151,7 +152,7 @@ func TestTheManifestCarriesGrantsTheRosterTheWantsAndTheRemovalOrder(t *testing. if len(full.Reads) != 2 || full.Reads[0] != diskreadings.ReadingsRead || full.Reads[1] != MountsState { t.Errorf("reads: %v", full.Reads) } - if len(full.Invokes) != 2 || full.Invokes[0] != SeatHoldersTool || full.Invokes[1] != "seat:mesh-hand-acts.hand-act" || len(full.Consumes) != 1 || full.Consumes[0] != "mesh-delivery-assigner.views.seat-holders" { + if len(full.Invokes) != 2 || full.Invokes[0] != SeatHoldersTool || full.Invokes[1] != "seat:mesh-hand-acts.hand-act" || len(full.Consumes) != 1 || full.Consumes[0] != assignerModule+".views."+mesh.StateSeatHolders { t.Errorf("invokes %v, consumes %v", full.Invokes, full.Consumes) } roster := full.Facts["machines"] diff --git a/modules/nfs-server/go.mod b/modules/nfs-server/go.mod index cfb81f689..eca20497a 100644 --- a/modules/nfs-server/go.mod +++ b/modules/nfs-server/go.mod @@ -5,6 +5,8 @@ go 1.26.0 require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261104174359-05b3e2e1b94f require ( + git.novox.be/novox/mesh-contracts/placement/go/clients/meshmoduleassignerclient v0.0.0-00010101000000-000000000000 + git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/go v0.0.0-20261104174344-ae5266e77639 // indirect