From bbeb8d98aa2754c52d2806accbeb57d130b99c1d Mon Sep 17 00:00:00 2001 From: pingqiu Date: Tue, 1 Dec 2026 15:24:06 -0800 Subject: [PATCH] authority: comments name the deadline barrier; gofmt Co-Authored-By: Claude Opus 5.5 --- seaweed-block/core/authority/golden_v100_test.go | 12 ++++++------ seaweed-block/core/authority/workspace_lease_view.go | 4 ++-- seaweed-block/core/authority/workspace_lost_range.go | 3 ++- seaweed-block/core/host/master/journal_isolation.go | 4 ++-- .../host/master/workspace_renewal_slowstore_test.go | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/seaweed-block/core/authority/golden_v100_test.go b/seaweed-block/core/authority/golden_v100_test.go index 2517e58811..772e449247 100644 --- a/seaweed-block/core/authority/golden_v100_test.go +++ b/seaweed-block/core/authority/golden_v100_test.go @@ -158,13 +158,13 @@ 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{ - "workspace/wa.v3auth.json": "954efb2d8afda475ac856c4dc907d7b58cb719eb", - "workspace/wl.v3auth.json": "79dc6696143165fef5b749b9ba81757ba50056b1", + "workspace/wa.v3auth.json": "954efb2d8afda475ac856c4dc907d7b58cb719eb", + "workspace/wl.v3auth.json": "79dc6696143165fef5b749b9ba81757ba50056b1", "workspace/wm.lostrange.json": "a4f9f6a612eba987297def1f40eea5b92214575d", - "workspace/wm.v3auth.json": "c9adcceb41095cf4e5d06f12a442ec4f5fbbc725", - "v1.lostrange.json": "cb4200c2742a7c784d4eb2d1beed61a212053608", - "v1.v3auth.json": "88642d0ed99d19635e1ff3d2bd2082ecc319643e", - "v2.v3auth.json": "fb7a6a3cd8d2c81c955fc130566f6ae93c677c91", + "workspace/wm.v3auth.json": "c9adcceb41095cf4e5d06f12a442ec4f5fbbc725", + "v1.lostrange.json": "cb4200c2742a7c784d4eb2d1beed61a212053608", + "v1.v3auth.json": "88642d0ed99d19635e1ff3d2bd2082ecc319643e", + "v2.v3auth.json": "fb7a6a3cd8d2c81c955fc130566f6ae93c677c91", } func TestAuthorityGoldenFilesAreTheV100Files(t *testing.T) { diff --git a/seaweed-block/core/authority/workspace_lease_view.go b/seaweed-block/core/authority/workspace_lease_view.go index e497d3c143..197096a797 100644 --- a/seaweed-block/core/authority/workspace_lease_view.go +++ b/seaweed-block/core/authority/workspace_lease_view.go @@ -298,7 +298,8 @@ func (p *Publisher) RenewWorkspaceLease(ctx context.Context, volume, holder stri // firstWorkspaceGrant creates a lease synchronously under p.mu (one write per // assignment epoch) for an epoch that has none: a move issue already started // its holder's lease. A host whose first renewal fails does not fence: it has -// no deadline yet and retries. The durable horizon starts at now+1.5*TTL. +// no deadline yet and retries. The record's ExpiresAtNS is now+1.5*TTL, the +// form v1.0.x reads; this process's deadline is now+TTL. func (p *Publisher) firstWorkspaceGrant(ctx context.Context, volume, holder string, epoch uint64) (WorkspaceLease, error) { p.beforeWorkspaceGrantLock("first grant") p.mu.Lock() @@ -396,7 +397,6 @@ func (p *Publisher) newWorkspaceLease(holder string, epoch uint64, now time.Time return &WorkspaceLease{ReplicaID: holder, Epoch: epoch, ExpiresAtNS: now.Add(p.workspaceTTL + p.workspaceTTL/2).UnixNano(), MaxClockSkewNS: int64(p.workspaceSkew(nil))}, now.Add(p.workspaceTTL) } - // LeaseBarrierError is an expired re-grant refused because the forced-move // barrier has not passed. Until is when it passes (master wall time) and // RetryAfter is Until minus the master's time at the refusal, so a client diff --git a/seaweed-block/core/authority/workspace_lost_range.go b/seaweed-block/core/authority/workspace_lost_range.go index 74198aa17a..8b8ada0891 100644 --- a/seaweed-block/core/authority/workspace_lost_range.go +++ b/seaweed-block/core/authority/workspace_lost_range.go @@ -14,7 +14,8 @@ import ( // WorkspaceLostRange records what a forced move abandoned: the old holder's // writes after LostAfterLSN (the HEAD frontier the move keeps) are lost, and // none of them was acknowledged later than LostUntilNS (master time: the -// forced barrier, the lease horizon or restart deadline plus skew). The +// forced barrier: the lease deadline, or after a restart the restart floor, +// plus skew). The // lease carries no write frontier, so the upper bound is a time. // // HeadTimeNS is the kept HEAD entry's filer mtime, read with that HEAD at the diff --git a/seaweed-block/core/host/master/journal_isolation.go b/seaweed-block/core/host/master/journal_isolation.go index 3fa3589884..aa634a45ef 100644 --- a/seaweed-block/core/host/master/journal_isolation.go +++ b/seaweed-block/core/host/master/journal_isolation.go @@ -13,8 +13,8 @@ import ( // journalIsolation tracks nodes whose durable root shares the authority // store's file system. On one ext4 file system every fsync goes through one -// jbd2 journal: a volume's WAL fsync storm delays the authority journal's -// lease extensions, grants clamp to the durable horizon and leases run out. +// jbd2 journal: a volume's WAL fsync storm delays every authority write +// (grants, moves, revocations) behind it. // // The colocated set is the latest heartbeat fact per server (memory only): a // node that moves its durable root off the store's file system leaves the set diff --git a/seaweed-block/core/host/master/workspace_renewal_slowstore_test.go b/seaweed-block/core/host/master/workspace_renewal_slowstore_test.go index 48ed6adcdb..c132afc4bc 100644 --- a/seaweed-block/core/host/master/workspace_renewal_slowstore_test.go +++ b/seaweed-block/core/host/master/workspace_renewal_slowstore_test.go @@ -149,7 +149,7 @@ func TestWorkspaceLeaseGuardSurvivesSlowAuthorityStore(t *testing.T) { }) dir := &skewDirective{asks: make(chan authority.AssignmentAsk, 1)} p := authority.NewPublisher(dir, authority.WithStore(slow), authority.WithWorkspaceLeaseConfig(6*time.Second, nil)) - t.Cleanup(slow.release) // runs before the join above: frees a held Put first + t.Cleanup(slow.release) // runs before the join above: frees a held Put first seedSkewPublisher(t, p, dir) var stops atomic.Int32 g, err := volume.NewWorkspaceLeaseGuard(workspaceRPCView{frontend.Projection{VolumeID: "v", ReplicaID: "r", Epoch: 1, Healthy: true}},