mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 11:07:31 +01:00
authority: comments name the deadline barrier; gofmt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e9d6e04a7
commit
bbeb8d98aa
5 files changed
+13
-12
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}},
|
||||
|
||||
Reference in new issue
Block a user