diff --git a/seaweed-block/cmd/blockvolume/main.go b/seaweed-block/cmd/blockvolume/main.go index bce3c98905..5ce9c726ae 100644 --- a/seaweed-block/cmd/blockvolume/main.go +++ b/seaweed-block/cmd/blockvolume/main.go @@ -1685,19 +1685,20 @@ func hostConfig(f flags, readyCh chan<- adapter.AssignmentInfo) volume.Config { ident = storeident.Of(f.durableRoot) } return volume.Config{ - MasterAddr: f.masterAddr, - ServerID: f.serverID, - VolumeID: f.volumeID, - ReplicaID: f.replicaID, - DataAddr: f.dataAddr, - CtrlAddr: f.ctrlAddr, - HeartbeatInterval: f.hbInterval, - RecoverTimeout: f.recoverTimeout, - ReadyMarker: readyCh, - EnableT1Readiness: f.enableT1Readiness, - WorkspaceLease: f.workspaceLease, - RF1Only: rf1Only(f), - StorageIdentity: ident, + MasterAddr: f.masterAddr, + LinesNameTheirProcess: true, + ServerID: f.serverID, + VolumeID: f.volumeID, + ReplicaID: f.replicaID, + DataAddr: f.dataAddr, + CtrlAddr: f.ctrlAddr, + HeartbeatInterval: f.hbInterval, + RecoverTimeout: f.recoverTimeout, + ReadyMarker: readyCh, + EnableT1Readiness: f.enableT1Readiness, + WorkspaceLease: f.workspaceLease, + RF1Only: rf1Only(f), + StorageIdentity: ident, } } diff --git a/seaweed-block/core/authority/authority.go b/seaweed-block/core/authority/authority.go index b1574e359c..4fac0ae685 100644 --- a/seaweed-block/core/authority/authority.go +++ b/seaweed-block/core/authority/authority.go @@ -123,7 +123,7 @@ type Publisher struct { // incarnationOf is the latest process incarnation a replica reports // (SetIncarnationSource); its own lock, never taken under mu. incarnationMu sync.RWMutex - incarnationOf func(volumeID, replicaID string) string + incarnationOf func(volumeID, replicaID, dataAddr, ctrlAddr string) string mu sync.Mutex state map[subKey]assignmentState @@ -471,9 +471,10 @@ func (p *Publisher) closeAllSubscriptions() { // non-zero Epoch. The structural non-forgeability test in // authority_test.go enforces this boundary at repo scope. // SetIncarnationSource gives the publisher the latest process incarnation -// each replica reports, for asks that do not name one (see -// AssignmentAsk.Incarnation). nil (the default) records what asks name. -func (p *Publisher) SetIncarnationSource(of func(volumeID, replicaID string) string) { +// reported by the slot an ask targets (its replica at its endpoints), for +// asks that do not name one (see AssignmentAsk.Incarnation). nil (the +// default) records what asks name. +func (p *Publisher) SetIncarnationSource(of func(volumeID, replicaID, dataAddr, ctrlAddr string) string) { p.incarnationMu.Lock() p.incarnationOf = of p.incarnationMu.Unlock() @@ -500,7 +501,7 @@ func (p *Publisher) applyWithWorkspaceMove(ask AssignmentAsk, grant *workspaceGr of := p.incarnationOf p.incarnationMu.RUnlock() if of != nil { - ask.Incarnation = of(ask.VolumeID, ask.ReplicaID) + ask.Incarnation = of(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr) } } diff --git a/seaweed-block/core/authority/observation_store.go b/seaweed-block/core/authority/observation_store.go index 3f03aad3d4..4283ff4f82 100644 --- a/seaweed-block/core/authority/observation_store.go +++ b/seaweed-block/core/authority/observation_store.go @@ -95,6 +95,20 @@ func (s *ObservationStore) SupersededSlotCount(serverID, volumeID, replicaID str // // NOT authority input. Read-only; safe to call concurrently. func (s *ObservationStore) SlotFact(volumeID, replicaID string) (SlotFact, bool) { + return s.slotFactWhere(volumeID, replicaID, nil) +} + +// SlotFactAt is SlotFact restricted to the reports of the slot at dataAddr +// and ctrlAddr: the process serving those endpoints, never the same +// replica id reported by another host (a workspace move keeps the replica +// id across hosts). +func (s *ObservationStore) SlotFactAt(volumeID, replicaID, dataAddr, ctrlAddr string) (SlotFact, bool) { + return s.slotFactWhere(volumeID, replicaID, func(slot SlotFact) bool { + return slot.DataAddr == dataAddr && slot.CtrlAddr == ctrlAddr + }) +} + +func (s *ObservationStore) slotFactWhere(volumeID, replicaID string, match func(SlotFact) bool) (SlotFact, bool) { if volumeID == "" || replicaID == "" { return SlotFact{}, false } @@ -119,6 +133,9 @@ func (s *ObservationStore) SlotFact(volumeID, replicaID string) (SlotFact, bool) if slot.VolumeID != volumeID || slot.ReplicaID != replicaID { continue } + if match != nil && !match(slot) { + continue + } if slotExpired(slot, obs, now) { continue } diff --git a/seaweed-block/core/authority/restart_endpoint_version_test.go b/seaweed-block/core/authority/restart_endpoint_version_test.go index 4e51adef48..04242e3521 100644 --- a/seaweed-block/core/authority/restart_endpoint_version_test.go +++ b/seaweed-block/core/authority/restart_endpoint_version_test.go @@ -210,7 +210,7 @@ func TestWorkspaceRestartReissueTouchesOnlyTheEndpointVersion(t *testing.T) { func TestPublisher_AskWithoutAProcessIsIssuedForTheReportedOne(t *testing.T) { pub := NewPublisher(NewStaticDirective(nil)) reported := map[string]string{"r1": "p1", "r2": "q7"} - pub.SetIncarnationSource(func(volumeID, replicaID string) string { return reported[replicaID] }) + pub.SetIncarnationSource(func(volumeID, replicaID, dataAddr, ctrlAddr string) string { return reported[replicaID] }) if err := pub.apply(AssignmentAsk{VolumeID: "v1", ReplicaID: "r1", DataAddr: "d1", CtrlAddr: "c1", Intent: IntentBind}); err != nil { t.Fatal(err) } @@ -287,3 +287,53 @@ func TestWorkspaceLeaseWriteKeepsTheLinesIncarnationAcrossReload(t *testing.T) { t.Fatalf("the unchanged primary was re-issued after reload: EV %d", got.EndpointVersion) } } + +// A workspace move keeps the replica id across hosts, so the source and +// the target both report it, and the source's report may be the newer +// one. The process a line is issued for is the one at the line's +// endpoints: the target's, never the source holder's. +func TestObservationStore_SlotFactAtIsTheProcessAtThoseEndpoints(t *testing.T) { + now := time.Date(2026, 11, 26, 4, 0, 0, 0, time.UTC) + s := NewObservationStore(FreshnessConfig{FreshnessWindow: 30 * time.Second}, func() time.Time { return now }) + ingest := func(server, data, ctrl, incarnation string, at time.Time) { + t.Helper() + if err := s.Ingest(Observation{ServerID: server, ObservedAt: at, + Slots: []SlotFact{{VolumeID: "v", ReplicaID: "r", DataAddr: data, CtrlAddr: ctrl, Incarnation: incarnation}}}); err != nil { + t.Fatal(err) + } + } + ingest("target-host", "t:1", "t:2", "target-proc", now.Add(-2*time.Second)) + ingest("source-host", "s:1", "s:2", "source-proc", now.Add(-time.Second)) // newer + if f, ok := s.SlotFact("v", "r"); !ok || f.Incarnation != "source-proc" { + t.Fatalf("fixture: the newest report is not the source's: %+v", f) + } + if f, ok := s.SlotFactAt("v", "r", "t:1", "t:2"); !ok || f.Incarnation != "target-proc" { + t.Fatalf("at the target's endpoints: %+v %v; want target-proc", f, ok) + } + if _, ok := s.SlotFactAt("v", "r", "t:1", "other:2"); ok { + t.Fatal("a report at other endpoints was taken for the target's") + } +} + +// A line that names no process (its target had no fresh report when it was +// minted) is re-issued once on the target's first report, for that +// process; then nothing more. The volume, configured as production is, +// adopts nothing on the unnamed line meanwhile (TestHost_ApplyFact_ +// UnnamedLineIsNotAdoptedWhereLinesNameTheirProcess), so no session is +// opened on it. +func TestTopologyController_UnnamedLineIsReissuedOnceForTheReportingProcess(t *testing.T) { + g := newBootGraceRig(t) + g.reissued = false + g.line.Incarnation = "" + g.reader.Set("v1", "r1", g.line) + g.submit(r1Slot("r1-a", "d1-old", "c1-old", true)) + ask := nextAskOrFail(t, g.ctrl) + if ask.Intent != IntentRefreshEndpoint || ask.Incarnation != "r1-a" { + t.Fatalf("first report on an unnamed line: %+v; want one refresh for r1-a", ask) + } + g.line.Incarnation, g.line.EndpointVersion = "r1-a", 2 + g.reader.Set("v1", "r1", g.line) + g.now = g.now.Add(time.Second) + g.submit(r1Slot("r1-a", "d1-old", "c1-old", true)) + expectNoNext(t, g.ctrl) +} diff --git a/seaweed-block/core/host/master/host.go b/seaweed-block/core/host/master/host.go index ce28059953..d93a00a707 100644 --- a/seaweed-block/core/host/master/host.go +++ b/seaweed-block/core/host/master/host.go @@ -295,8 +295,8 @@ func New(cfg Config) (*Host, error) { // An ask built outside the controller (a heal, a planned or workspace // move, an operator's request) is issued for the process its target // reports now. - boot.Publisher.SetIncarnationSource(func(volumeID, replicaID string) string { - if f, ok := obs.Store().SlotFact(volumeID, replicaID); ok { + boot.Publisher.SetIncarnationSource(func(volumeID, replicaID, dataAddr, ctrlAddr string) string { + if f, ok := obs.Store().SlotFactAt(volumeID, replicaID, dataAddr, ctrlAddr); ok { return f.Incarnation } return "" diff --git a/seaweed-block/core/host/master/line_incarnation_test.go b/seaweed-block/core/host/master/line_incarnation_test.go index 8a24dac023..47e9be7551 100644 --- a/seaweed-block/core/host/master/line_incarnation_test.go +++ b/seaweed-block/core/host/master/line_incarnation_test.go @@ -42,3 +42,46 @@ func TestLinesNameTheirPrimarysProcess(t *testing.T) { time.Sleep(10 * time.Millisecond) } } + +// Overlapping reports of one replica from two hosts (a workspace move keeps +// the replica id), the source's the newer: a line for the target's +// endpoints is issued for the target's process. +func TestLineForTheTargetsEndpointsNamesTheTargetsProcess(t *testing.T) { + h := newBootGraceMaster(t, Config{}) + defer closeTestMaster(t, h) + now := time.Now().UTC() + for _, r := range []struct { + server, data, ctrl, incarnation string + at time.Time + }{ + {"node-d", "127.0.0.1:19401", "127.0.0.1:19402", "r2-target", now.Add(-time.Second)}, + {"node-b", "127.0.0.1:19201", "127.0.0.1:19202", "r2-source", now}, + } { + if err := h.ObservationHost().Ingest(authority.Observation{ServerID: r.server, ObservedAt: r.at, + Server: authority.ServerFact{Reachable: true, Eligible: true}, + Slots: []authority.SlotFact{{VolumeID: "vol-rf3", ReplicaID: "r2", DataAddr: r.data, CtrlAddr: r.ctrl, + Reachable: true, ReadyForPrimary: true, Eligible: true, Incarnation: r.incarnation}}}); err != nil { + t.Fatal(err) + } + } + if err := h.Controller().SubmitAssignmentAsk(authority.AssignmentAsk{ + VolumeID: "vol-rf3", ReplicaID: "r2", DataAddr: "127.0.0.1:19401", CtrlAddr: "127.0.0.1:19402", + Intent: authority.IntentReassign, Evidence: adapter.PrimaryEvidence{Kind: adapter.PrimaryKindForced}, + }); err != nil { + t.Fatal(err) + } + deadline := time.Now().Add(3 * time.Second) + for { + line, ok := h.Publisher().VolumeAuthorityLine("vol-rf3") + if ok && line.ReplicaID == "r2" { + if line.Incarnation != "r2-target" { + t.Fatalf("line at the target's endpoints issued for %q; want r2-target", line.Incarnation) + } + return + } + if time.Now().After(deadline) { + t.Fatalf("the reassign was not published: %+v", line) + } + time.Sleep(10 * time.Millisecond) + } +} diff --git a/seaweed-block/core/host/volume/host.go b/seaweed-block/core/host/volume/host.go index eef470d643..2b0e8b633e 100644 --- a/seaweed-block/core/host/volume/host.go +++ b/seaweed-block/core/host/volume/host.go @@ -30,6 +30,11 @@ import ( type Config struct { // MasterAddr is the gRPC address of the block master daemon. MasterAddr string + // LinesNameTheirProcess: the master stamps every primary line with the + // process it was issued for, so a line that names no process is not this + // process's either and is not adopted until re-issued. Off, a line that + // names none is adopted (fixtures that build lines by hand). + LinesNameTheirProcess bool // MasterTLS is the mutual-TLS dial option of the master link // (link.ClientCredentials); nil dials plaintext (development mode). MasterTLS grpc.DialOption @@ -1099,7 +1104,7 @@ func (h *Host) applyFact(fact *control.AssignmentFact) { // could equal one of them. Nothing is adopted or recorded (no // assignment, watchdog, replica set or role) until the master re-issues // the line for this process (a new endpoint version). - if inc := fact.GetLineIncarnation(); inc != "" && inc != h.incarnation { + if inc := fact.GetLineIncarnation(); inc != h.incarnation && (inc != "" || h.cfg.LinesNameTheirProcess) { h.log.Printf("blockvolume: volume %s line epoch=%d EV=%d was issued for process %s, this is %s: NOT adopting until it is re-issued", h.cfg.VolumeID, fact.Epoch, fact.EndpointVersion, inc, h.incarnation) return diff --git a/seaweed-block/core/host/volume/line_incarnation_test.go b/seaweed-block/core/host/volume/line_incarnation_test.go index 53af433b84..66ffad8b52 100644 --- a/seaweed-block/core/host/volume/line_incarnation_test.go +++ b/seaweed-block/core/host/volume/line_incarnation_test.go @@ -39,3 +39,29 @@ func TestHost_ApplyFact_LineIssuedForAnotherProcessIsNotAdopted(t *testing.T) { t.Fatalf("the line re-issued for this process: replica sets %d, assignments %d (EV %d); want both at EV 2", r.callCount.Load(), a.callCount.Load(), a.lastInfo.EndpointVersion) } } + +// Where lines name their process (production), a line that names none is +// not this process's either: nothing is adopted until the master re-issues +// it for this process. +func TestHost_ApplyFact_UnnamedLineIsNotAdoptedWhereLinesNameTheirProcess(t *testing.T) { + rec := &orderingRecorder{} + h, a, r := newStubbedHost(t, "vol1", "r1", rec) + h.incarnation = "p1" + h.cfg.LinesNameTheirProcess = true + fact := func(ev uint64, incarnation string) *control.AssignmentFact { + return &control.AssignmentFact{ + VolumeId: "vol1", ReplicaId: "r1", Epoch: 5, EndpointVersion: ev, + DataAddr: "127.0.0.1:1000", CtrlAddr: "127.0.0.1:1001", + PeerSetGeneration: 5<<32 | ev, + LineIncarnation: incarnation, + } + } + h.applyFixtureFact(fact(1, "")) + if r.callCount.Load() != 0 || a.callCount.Load() != 0 { + t.Fatalf("an unnamed line was adopted: replica sets %d, assignments %d", r.callCount.Load(), a.callCount.Load()) + } + h.applyFixtureFact(fact(2, "p1")) + if a.callCount.Load() != 1 || a.lastInfo.EndpointVersion != 2 { + t.Fatalf("the line re-issued for this process: assignments %d (EV %d); want 1 at EV 2", a.callCount.Load(), a.lastInfo.EndpointVersion) + } +} diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index d0e1b2e72c..cdc675c59b 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -694,7 +694,7 @@ Notes: | `INV-AUTH-HOLDER-IDENTITY-001` | A primary holder is the pair (server id, replica id): every site that decides holdership (adopting a fact, lease first grant, renew, re-grant, HEAD claim, superseded exit) compares both; a missing server id is refused, never guessed. | AUTHORITY: PRIMARY holdership (supporting replicas are not holders) | `core/host/volume/host.go` `applyFact`, `IsSuperseded`, `recordOtherLine`; `assignment_holder.go` `assignmentNamesSelf`, `observeForeignHolder`, `refusePrimaryAssignment`; `host.go` `IsSuperseded`; `core/host/master/services.go` `SubscribeAssignments`; `workspace_service.go` `holderMatches`, `RenewWorkspaceLease`, `AckWorkspaceRevoked`; `cmd/blockvolume/chunk_remote.go` `chunkHolder`; `core/frontend/chunkstore/layout/start.go` `Start`, `core/frontend/chunkstore/layout/claim.go` `Claim`; superseded exit covered by #409; `core/host/master/workspace_binding.go` `workspaceLineOwner`, `workspaceSourceHost`; `core/authority/assignment_owner.go` `captureAssignmentOwner`; `core/host/master/services.go` `assignmentFact`; `core/host/master/server_host_identity.go` `refuseServerIDFromOtherHost` (from `ReportHeartbeat`), `refuseWorkspaceHolderHost` (from `holderMatches` and, for a workspace volume, `SubscribeAssignments`), `holderSlotFact` (from `QueryVolumeStatus` and `observationVolume`/`observationReplicas`); `core/csi/master_backend.go` `primaryOwnedFrontends` (a CSI target only from a usable primary frontend); `core/authority/snapshot_builder.go` `expectOwnerForLine` (a moved line's replica facts and endpoint refreshes only from its owner, #425) | `TestAssignmentHolderIdentityRestartedOldProcess`, `TestAssignmentHolderIdentityMatchingServerStillAdopts`, `TestAssignmentHolderIdentityFencesPreviouslyHealthySameReplica`, `TestAssignmentHolderIdentityAdoptsAndWarnsCarriedEndpointMismatch`, `TestAssignmentHolderIdentityForeignStreamOrdering`, `TestAssignmentHolderIdentityForcedMoveRefusesEveryDeliveredVersion`, `TestAssignmentHolderIdentitySameEpochCannotChangeServer` (`core/host/volume/assignment_holder_test.go`); `TestWorkspaceLeaseGuardCarriesHolderServerIdentity` (`core/host/volume/workspace_holder_identity_test.go`); `TestWorkspaceLeaseRequiresHolderServerForGrantRenewAndRegrant`, `TestWorkspaceRevocationACKRequiresHolderServer` (`core/host/master/workspace_holder_identity_test.go`); `TestWorkspaceRPCCleanMovePreservesReplicaIdentity` (`core/host/master/workspace_service_test.go`); HEAD claim: `TestChunkHolderIsServerAndReplica` (`cmd/blockvolume/chunk_remote_test.go`), `TestWALStoreChunk_SameReplicaOnAnotherServerIsFenced` (`core/frontend/durable/provider_chunk_holder_test.go`); superseded exit: covered by #409 (server-id/replica-id pair, never replica alone); supporting replicas are not holders; descriptor identity not in this row; `TestWorkspaceLineOwnerIssuedAndHistorical` (`core/host/master/workspace_line_owner_test.go`), `TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation` (`core/host/master/workspace_lease_horizon_test.go`); `TestAssignmentFactKeepsCapturedMoveOwnerWithoutReadableJournal` (`core/host/master/assignment_fact_owner_test.go`), `TestAssignmentOwnerReservedAndIssuedCapture` (`core/authority/assignment_owner_test.go`), `TestWorkspaceCrashAfterJournalBeforeEpochResumesSameGrant` (`core/authority/workspace_test.go`); `TestServerIDRefusedFromAHostOtherThanItsRegisteredOne`, `TestWorkspaceHolderRefusedFromAnotherHostAtRenewAckAndStream`, `TestPortalAndPrimaryComeFromTheLineServerNotTheFreshestHeartbeat`, `TestDisplayedPrimaryIsTheIssuedHolderNotThePlacementSlot`, `TestStatusListsNoFrontendWhenThePrimaryEvidenceIsMissing`, `TestCSIPublishesNoTargetWhenThePrimaryFrontendIsMissingOrRejected`, `TestDeletionReservedWorkspaceVolumeKeepsTheStreamHostCheck` (`core/host/master/server_host_identity_test.go`); `TestPublishTargetIsPrimaryOwned` (`core/csi/primary_owned_frontend_test.go`). Host scope: registered advertised-host consistency, not process uniqueness; a workspace holder's server id must be registered (no first-seen binding: host addresses change); non-workspace heartbeats from an unregistered id are not checked. Limits: with mutual TLS on, a node may act only for the server id bound to its certificate (`TERM-CALLER-001`; `auth.RequireNode` in `ReportHeartbeat`, `SubscribeAssignments`, `RenewWorkspaceLease`, `AckWorkspaceRevoked`, `QueryVolumeStatus`; `TestNodeActsOnlyForItsOwnServerID`, `core/host/master/auth_red_test.go`), and the registered-host check stays beside it (no NAT or proxy between volume and master in OSS); in development mode (plaintext on loopback, no role file) there is no authentication; `TestBuildSnapshotTakesTheMovedLinesReplicaFromItsOwner` (`core/authority/line_owner_snapshot_test.go`); `TestProcedureForcedMoveWithTheOldHostReturning` (`cmd/blockvolume/procedure_gate_integration_test.go`, tags subprocess chunkstore_integration: every forced-epoch line carries the new owner's endpoints) | `WorkspaceRegrant` `NoForeignAdoption`, `TargetNotFencedByOwnLine` (round 4 pinned simulations only; exhaustive combo10 pending) | ACTIVE | | `INV-AUTH-CALLER-ROLE-001` | With mutual TLS on, every blockmaster gRPC call (unary, and before every stream send) is decided by the caller's certificate and the current role file: an unknown caller is refused UNAUTHENTICATED, a role its method's rule does not admit PERMISSION_DENIED, a method without a rule always. | AUTHORITY: control API callers (people, tools, nodes) | `core/auth/identity.go` `Authenticator.PeerIdentity`, `Authenticator.Reload`; `core/auth/authorize.go` `Rule.Allows`, `UnaryInterceptor`, `StreamInterceptor`, `RequireNode`, `RequireRole`; `core/host/master/authz.go` `masterRules`, `serverAuth`; `core/rpc/link/tls.go` `ServerCredentials`, `ClientCredentials`; `cmd/blockmaster/auth.go` `authFlags.validate`, `authFlags.build` | `TestPeerIdentity`, `TestRoleFileReload` (`core/auth/identity_test.go`); `TestRuleAllows`, `TestRequireNodeAndRole`, `TestUnaryInterceptor`, `TestStreamEndsAtTheReloadThatRevokesItsCaller` (`core/auth/authorize_test.go`); `TestMasterAuthorizationTableCoversEveryMethod` (`core/host/master/authz_test.go`); `TestForcedMoveNeedsAnAdmin`, `TestNodeActsOnlyForItsOwnServerID` (`core/host/master/auth_red_test.go`); `TestMasterLinkMutualTLS` (`core/rpc/link/tls_test.go`); `TestAuthFlags` (`cmd/blockmaster/auth_flags_test.go`); `TestMasterTLSFlags` (`cmd/blockvolume/master_tls_test.go`). Also: a mutating operator or admin method writes its audit attempt before it runs or is refused as audit unavailable (`Rule.Strict`; `TestMasterOperatorMethodsAreStrict` (inverted: a new operator or admin method fails unless strict or named with its reason), `core/host/master/authz_test.go`; `TestStrictCallsNeedTheirAttemptLine`, `core/auth/strict_audit_test.go`), node calls never wait on the audit log; a reload that removes a caller, or changes its role so the method's rule no longer admits it, ends its open streams at the reload; a forced move needs an admin; plaintext listens only on loopback without a role file (development mode). Limits: the audit log records outcomes and decides nothing; the volume process's own HTTP routes stay loopback-only and unauthenticated. | `AuthLease` (exhaustive run pending) | ACTIVE | | `INV-AUTH-EPOCH-MINT-001` | Only the publisher mints epochs; a reassignment takes the per-volume maximum epoch plus one, also after a restart. | M2 Bound → Reassigned | `core/authority/authority.go` `applyWithWorkspaceMove`, `maxPublishedEpochForVolume` | `TestLayoutGrantedEpochIssuerSites`, `TestLayoutEpochEnumerationRejectsANewIssuer`, `TestG8_0_Publisher_ReassignAdvancesPerVolumeEpochAcrossReplicaSlots` (`core/authority/g8_0_authority_failover_test.go`); `TestDurableAuthority_PublisherAdvancesFromReloaded` (`core/authority/authority_restart_test.go`); `TestG9F2_AssignmentRequestShapeHasNoEpochOrEndpointVersion` (`core/host/master/authority_request_bridge_test.go`) | `ControlPlane` `UniqueEpoch` | ACTIVE | -| `INV-AUTH-RESTART-REISSUE-001` | A line records the primary process it was issued for (durable); a current primary reporting another process is re-issued its line at a new endpoint version, and a primary adopts no line issued for another process, so a restarted process never reuses the dead one's sessions. | M1 authority (RefreshEndpoint) | `core/authority/authority.go` `apply`; `core/authority/controller.go` `endpointStale`; `core/host/volume/host.go` `applyFact` | `TestPublisher_RestartedPrimaryGetsANewEndpointVersion`, `TestTopologyController_RestartedPrimaryAtTheSameAddressIsReissued` (`core/authority/restart_endpoint_version_test.go`); `TestHost_ApplyFact_LineIssuedForAnotherProcessIsNotAdopted` (`core/host/volume/line_incarnation_test.go`); `TestRestartedPrimaryAtTheSameEpochIsAdmitted` (`core/replication/primary_restart_session_test.go`) | — | ACTIVE | +| `INV-AUTH-RESTART-REISSUE-001` | A line records the primary process it was issued for (durable); a current primary reporting another process is re-issued its line at a new endpoint version, and a primary adopts no line issued for another process, so a restarted process never reuses the dead one's sessions. | M1 authority (RefreshEndpoint) | `core/authority/authority.go` `applyWithWorkspaceMove` (records the ask's or the source's incarnation); `core/authority/controller.go` `endpointStale`, `sameAsk`; `core/authority/workspace.go` `persistWorkspaceTimedLocked`; `core/authority/observation_store.go` `SlotFactAt`; `core/host/master/host.go` (the source); `core/host/volume/host.go` `applyFact` | `TestPublisher_RestartedPrimaryGetsANewEndpointVersion`, `TestPublisher_AskWithoutAProcessIsIssuedForTheReportedOne`, `TestTopologyController_RestartedPrimaryAtTheSameAddressIsReissued`, `TestTopologyController_QueuedRefreshIsReplacedForANewerProcess`, `TestTopologyController_UnnamedLineIsReissuedOnceForTheReportingProcess`, `TestWorkspaceLeaseWriteKeepsTheLinesIncarnationAcrossReload`, `TestObservationStore_SlotFactAtIsTheProcessAtThoseEndpoints` (`core/authority/restart_endpoint_version_test.go`); `TestLinesNameTheirPrimarysProcess`, `TestLineForTheTargetsEndpointsNamesTheTargetsProcess` (`core/host/master/line_incarnation_test.go`); `TestHost_ApplyFact_LineIssuedForAnotherProcessIsNotAdopted`, `TestHost_ApplyFact_UnnamedLineIsNotAdoptedWhereLinesNameTheirProcess` (`core/host/volume/line_incarnation_test.go`); `TestRestartedPrimaryAtTheSameEpochIsAdmitted` (`core/replication/primary_restart_session_test.go`) | — | ACTIVE | | `INV-AUTH-PERSIST-BEFORE-PUBLISH-001` | With an authority store configured, an assignment is written to the store before memory or any subscriber sees it, a failed write does not publish it, and an unknown outcome (directory fsync after the rename failed) fail-stops blockmaster: see M2 any → (store write first). | M2 any → (store write first) | `core/authority/authority.go` `applyWithWorkspaceMove`; `core/authority/authority_store_file.go` `Put` (`failStopDurabilityUnknown` after a failed directory open or fsync behind the rename, every record; a close error after a good fsync is reported written; Windows keeps its previous behaviour) | `TestDurableAuthority_PutFailureRollsBackInMemoryState` (`core/authority/authority_restart_test.go`); `TestPutFailStopsWhenTheDirectoryFsyncFailsAfterRename`, `TestPutReportsWrittenWhenOnlyTheDirectoryCloseFails` (`core/authority/authority_store_dir_fsync_test.go`) | `ControlPlane` `UniqueEpoch` | ACTIVE | | `INV-AUTH-MOVE-JOURNAL-001` | A workspace move's epoch is issued only after its journal record is durable, and one move request id gets exactly one epoch, also across restarts. | M2 MoveReserved → MoveIssued | `core/authority/workspace.go` `prepareWorkspaceMoveLocked`, `MoveWorkspace`, `sameWorkspaceRequest` | `TestWorkspaceMoveCannotIssueEpochWithoutJournal`, `TestWorkspaceCrashAfterJournalBeforeEpochResumesSameGrant` (`core/authority/workspace_test.go`); `TestWorkspaceReplayedIssueStartsGranteeLease` (`core/authority/workspace_unclaimed_grant_test.go`) | `ControlPlane` `Idempotent`, `JournalComplete` | ACTIVE | | `INV-AUTH-UNCERTAIN-001` | A failed authority write for a workspace volume, a lease extension included, latches uncertainty until a restart reloads the store: later authority changes and new or extended grants for that volume are refused. See M2 any (workspace) → Uncertain and Uncertain → Uncertain (move answer). | M2 any (workspace) → Uncertain; Uncertain → Uncertain (move answer) | `core/authority/authority.go` `applyWithWorkspaceMove`; `core/authority/workspace.go` `persistWorkspaceLocked`; `core/authority/workspace_lease_view.go` `RenewWorkspaceLease`, `extendWorkspaceLease`; `core/authority/workspace.go` `WorkspaceMoveOutcomeError`, `MoveWorkspace`; `core/host/master/workspace_service.go` `MoveWorkspace` | `TestWorkspaceAmbiguousExtensionLatchesUncertainty` (`core/authority/workspace_lease_horizon_test.go`); `TestWorkspaceUncertaintyPrecedesRequestRefusal` (`core/authority/workspace_outcome_uncertain_test.go`), `TestWorkspaceMoveUnknownPrecedesAdmissionRefusals` (`core/host/master/workspace_uncertain_precedence_test.go`), `TestWorkspaceUncertainIssueWriteIsTyped` (`core/authority/workspace_outcome_uncertain_test.go`) | `ControlPlane` `UniqueEpoch`; `WorkspaceMoveOutcome` `NoFalseRefusal`, `CallerEndTyped`, `UncertainReplyClass` | ACTIVE |