mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
fix: let the agreed master leader decide the filer census
This commit is contained in:
1 parent
654b9561f0
commit
baee502f07
8 files changed
+163
-64
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
@@ -25,6 +26,14 @@ func (f *groupFiler) GetFilerConfiguration(context.Context, *filerpb.GetFilerCon
|
||||
type groupMaster struct {
|
||||
masterpb.UnimplementedSeaweedServer
|
||||
filers []string
|
||||
mu sync.Mutex
|
||||
leader string
|
||||
}
|
||||
|
||||
func (m *groupMaster) GetMasterConfiguration(context.Context, *masterpb.GetMasterConfigurationRequest) (*masterpb.GetMasterConfigurationResponse, error) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
return &masterpb.GetMasterConfigurationResponse{Leader: m.leader}, nil
|
||||
}
|
||||
|
||||
func (m *groupMaster) ListClusterNodes(context.Context, *masterpb.ListClusterNodesRequest) (*masterpb.ListClusterNodesResponse, error) {
|
||||
@@ -68,10 +77,14 @@ func TestChunkWiringRefusesAMultiFilerGroup(t *testing.T) {
|
||||
filer := lis.Addr().String()
|
||||
_, fport, _ := net.SplitHostPort(filer)
|
||||
self := "127.0.0.1:8888." + fport // the filer as a master lists it
|
||||
master := &groupMaster{filers: append([]string{self}, c.other...)}
|
||||
m := serve(t, func(s *grpc.Server) {
|
||||
masterpb.RegisterSeaweedServer(s, &groupMaster{filers: append([]string{self}, c.other...)})
|
||||
masterpb.RegisterSeaweedServer(s, master)
|
||||
})
|
||||
_, mport, _ := net.SplitHostPort(m)
|
||||
master.mu.Lock()
|
||||
master.leader = "127.0.0.1:9333." + mport
|
||||
master.mu.Unlock()
|
||||
srv := grpc.NewServer()
|
||||
filerpb.RegisterSeaweedFilerServer(srv, &groupFiler{master: "127.0.0.1:9333." + mport})
|
||||
go func() { _ = srv.Serve(lis) }()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// used by the single-filer startup check.
|
||||
//
|
||||
// Package, service, message names and field numbers are copied verbatim so
|
||||
// the wire format and the gRPC method path (/master_pb.Seaweed/ListClusterNodes)
|
||||
// the wire format and the gRPC method paths (GetMasterConfiguration and ListClusterNodes)
|
||||
// match a real master. Fields the check never reads are omitted; protobuf
|
||||
// keeps them as unknown fields on decode.
|
||||
//
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// used by the single-filer startup check.
|
||||
//
|
||||
// Package, service, message names and field numbers are copied verbatim so
|
||||
// the wire format and the gRPC method path (/master_pb.Seaweed/ListClusterNodes)
|
||||
// the wire format and the gRPC method paths (GetMasterConfiguration and ListClusterNodes)
|
||||
// match a real master. Fields the check never reads are omitted; protobuf
|
||||
// keeps them as unknown fields on decode.
|
||||
//
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// used by the single-filer startup check.
|
||||
//
|
||||
// Package, service, message names and field numbers are copied verbatim so
|
||||
// the wire format and the gRPC method path (/master_pb.Seaweed/ListClusterNodes)
|
||||
// the wire format and the gRPC method paths (GetMasterConfiguration and ListClusterNodes)
|
||||
// match a real master. Fields the check never reads are omitted; protobuf
|
||||
// keeps them as unknown fields on decode.
|
||||
//
|
||||
|
||||
@@ -36,18 +36,11 @@ var (
|
||||
singleFilerAttempt = 5 * time.Second
|
||||
)
|
||||
|
||||
// CheckSingleFiler asks the filer for its masters and filer group
|
||||
// (filer_pb.SeaweedFiler/GetFilerConfiguration), then asks every master for
|
||||
// the filers registered in that group (master_pb.Seaweed/ListClusterNodes,
|
||||
// client_type "filer"). It passes only in a round where EVERY master
|
||||
// answered, none refused, and at least one listed exactly the configured
|
||||
// filer. Any master listing another filer, or several, refuses at once,
|
||||
// whichever master answers first. A master that did not answer, for any
|
||||
// reason and at any time, leaves the round unconfirmed, and the masters are
|
||||
// asked again; so is a round where no master lists the target yet. The bound
|
||||
// only ends the asking: then the start is refused (fail closed), naming the
|
||||
// masters that did not answer. There is no clock in the verdict: a chunk
|
||||
// volume does not start while any master is unreachable.
|
||||
// CheckSingleFiler asks the filer for its masters and filer group, then
|
||||
// requires every master to report the same leader. Only that leader's
|
||||
// ListClusterNodes answer decides the census. Missing answers, leader
|
||||
// disagreement and an empty leader listing retry within the startup bound.
|
||||
// The leader listing another filer or several refuses immediately.
|
||||
func (c *SWFS) CheckSingleFiler(ctx context.Context) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, singleFilerWait)
|
||||
defer cancel()
|
||||
@@ -77,45 +70,89 @@ func (c *SWFS) CheckSingleFiler(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// singleFilerRound asks every master once. It refuses when any master lists
|
||||
// several filers or a filer other than the target; it passes only when every
|
||||
// master answered, none refused, and at least one lists exactly the target;
|
||||
// otherwise it asks for another round. tried keeps each master's answer,
|
||||
// unanswered the masters that did not answer in this round.
|
||||
// singleFilerRound requires all configured masters to answer and agree.
|
||||
// A follower's list cannot confirm or refuse the census: only the leader
|
||||
// owns the registered filer list. Unknown views retry, never admit.
|
||||
func (c *SWFS) singleFilerRound(ctx context.Context, cfg *filerpb.GetFilerConfigurationResponse, tried, unanswered *[]string) (bool, error) {
|
||||
*tried, *unanswered = (*tried)[:0], (*unanswered)[:0]
|
||||
group := cfg.GetFilerGroup()
|
||||
sawTarget := false
|
||||
leader := ""
|
||||
reports := make(map[string]string)
|
||||
complete := true
|
||||
for _, m := range cfg.GetMasters() {
|
||||
addr, err := grpcAddress(m)
|
||||
if err != nil {
|
||||
*tried = append(*tried, fmt.Sprintf("%s: %v", m, err))
|
||||
*unanswered = append(*unanswered, m)
|
||||
complete = false
|
||||
continue
|
||||
}
|
||||
actx, cancel := context.WithTimeout(ctx, singleFilerAttempt)
|
||||
nodes, err := listFilers(actx, addr, group)
|
||||
reported, err := masterLeader(actx, addr)
|
||||
cancel()
|
||||
if err != nil {
|
||||
// Its view is unknown, whatever the reason and whenever it
|
||||
// happened: the round is not confirmed (asking the rest still
|
||||
// finds a refusal).
|
||||
*tried = append(*tried, fmt.Sprintf("%s: no answer: %v", addr, err))
|
||||
*tried = append(*tried, fmt.Sprintf("%s: leader report: %v", addr, err))
|
||||
*unanswered = append(*unanswered, addr)
|
||||
complete = false
|
||||
continue
|
||||
}
|
||||
switch {
|
||||
case len(nodes) > 1:
|
||||
return false, fmt.Errorf("%w: filer group %q has %d filers %v (master %s)", ErrNotSingleFiler, group, len(nodes), nodes, addr)
|
||||
case len(nodes) == 1 && !c.isTarget(ctx, nodes[0]):
|
||||
return false, fmt.Errorf("%w: master %s lists filer %s in group %q, not the configured %s", ErrNotSingleFiler, addr, nodes[0], group, c.cfg.FilerGRPC)
|
||||
case len(nodes) == 1:
|
||||
sawTarget = true
|
||||
default:
|
||||
*tried = append(*tried, addr+": lists no filer in group "+strconv.Quote(group)+" yet")
|
||||
reports[addr] = reported
|
||||
*tried = append(*tried, fmt.Sprintf("%s: leader %s", addr, reported))
|
||||
if leader == "" {
|
||||
leader = reported
|
||||
} else if leader != reported {
|
||||
complete = false
|
||||
}
|
||||
}
|
||||
return sawTarget && len(*unanswered) == 0, nil
|
||||
if !complete || leader == "" || ctx.Err() != nil {
|
||||
return false, nil
|
||||
}
|
||||
// A seed list can omit the elected leader. It must answer for itself too.
|
||||
if _, ok := reports[leader]; !ok {
|
||||
actx, cancel := context.WithTimeout(ctx, singleFilerAttempt)
|
||||
own, err := masterLeader(actx, leader)
|
||||
cancel()
|
||||
if err != nil || own != leader {
|
||||
*tried = append(*tried, fmt.Sprintf("leader %s self-report %q: %v", leader, own, err))
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
actx, cancel := context.WithTimeout(ctx, singleFilerAttempt)
|
||||
nodes, err := listFilers(actx, leader, cfg.GetFilerGroup())
|
||||
cancel()
|
||||
if err != nil || ctx.Err() != nil {
|
||||
*tried = append(*tried, fmt.Sprintf("leader %s list: %v", leader, err))
|
||||
return false, nil
|
||||
}
|
||||
switch {
|
||||
case len(nodes) > 1:
|
||||
return false, fmt.Errorf("%w: filer group %q has %d filers %v (leader %s)", ErrNotSingleFiler, cfg.GetFilerGroup(), len(nodes), nodes, leader)
|
||||
case len(nodes) == 1 && !c.isTarget(ctx, nodes[0]):
|
||||
return false, fmt.Errorf("%w: leader %s lists filer %s in group %q, not the configured %s", ErrNotSingleFiler, leader, nodes[0], cfg.GetFilerGroup(), c.cfg.FilerGRPC)
|
||||
case len(nodes) == 1:
|
||||
return ctx.Err() == nil, nil
|
||||
default:
|
||||
*tried = append(*tried, leader+": lists no filer in group "+strconv.Quote(cfg.GetFilerGroup())+" yet")
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
// masterLeader reads SeaweedFS GetMasterConfigurationResponse.leader (field 5).
|
||||
// The master derives this from its own Raft topology, not from filer lists.
|
||||
func masterLeader(ctx context.Context, addr string) (string, error) {
|
||||
conn, err := link.Dial(addr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer conn.Close()
|
||||
resp, err := masterpb.NewSeaweedClient(conn).GetMasterConfiguration(ctx, &masterpb.GetMasterConfigurationRequest{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
leader, err := grpcAddress(resp.GetLeader())
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("invalid leader %q: %w", resp.GetLeader(), err)
|
||||
}
|
||||
return leader, nil
|
||||
}
|
||||
|
||||
// isTarget reports whether a filer address listed by a master is the
|
||||
|
||||
@@ -3,6 +3,7 @@ package chunkstore
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -231,25 +232,39 @@ func TestCheckSingleFilerPasses(t *testing.T) {
|
||||
if err := c.CheckSingleFiler(context.Background()); err != nil {
|
||||
t.Fatalf("two masters, both favourable: %v", err)
|
||||
}
|
||||
// Every configured master must answer; a healthy leader cannot hide
|
||||
// an unreachable or partitioned former leader.
|
||||
c, _ = cluster(t, "", func(string) *nodesMaster { return &nodesMaster{stall: true} }, lists("self"))
|
||||
refusedAtBound(t, "stalled first master", c)
|
||||
f := &configFiler{}
|
||||
c, self := startConfigFiler(t, f)
|
||||
f.mu.Lock()
|
||||
f.masters = []string{deadAddress(t), startMaster(t, &nodesMaster{filers: []string{self}})}
|
||||
f.mu.Unlock()
|
||||
refusedAtBound(t, "dead first master", c)
|
||||
|
||||
}
|
||||
|
||||
// Refusals, in both master orders: several filers, or another filer listed
|
||||
// as the sole filer while the target is not registered, refuse at once,
|
||||
// whichever master answers first.
|
||||
// Only the agreed leader's list decides, regardless of master order.
|
||||
func TestCheckSingleFilerRefusesAnotherOrSeveralFilers(t *testing.T) {
|
||||
shortBounds(t)
|
||||
c, _ := cluster(t, "", lists("self", "10.0.0.2:8888"))
|
||||
refusedAtOnce(t, "two filers", c, "10.0.0.2:8888")
|
||||
c, _ = cluster(t, "", lists("10.9.9.9:8888"))
|
||||
refusedAtOnce(t, "another sole filer, target not registered", c, "10.9.9.9:8888")
|
||||
c, _ = cluster(t, "", lists("self"), lists("self", "10.0.0.2:8888"))
|
||||
refusedAtOnce(t, "first master favourable, second lists two", c, "10.0.0.2:8888")
|
||||
c, _ = cluster(t, "", lists("self", "10.0.0.2:8888"), lists("self"))
|
||||
refusedAtOnce(t, "first master lists two, second favourable", c, "10.0.0.2:8888")
|
||||
c, _ = cluster(t, "", lists("self"), lists("10.9.9.9:8888"))
|
||||
refusedAtOnce(t, "masters disagree on the sole filer", c, "10.9.9.9:8888")
|
||||
c, _ = cluster(t, "", lists("10.9.9.9:8888"), lists("self"))
|
||||
refusedAtOnce(t, "masters disagree on the sole filer, reversed", c, "10.9.9.9:8888")
|
||||
refusedAtOnce(t, "another sole filer", c, "10.9.9.9:8888")
|
||||
c, ms := cluster(t, "", lists(), lists("self", "10.0.0.2:8888"))
|
||||
cfg, err := c.fc.GetFilerConfiguration(context.Background(), &filerpb.GetFilerConfigurationRequest{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
leader := cfg.Masters[1]
|
||||
ms[1].mu.Lock()
|
||||
ms[1].leader = leader
|
||||
ms[1].mu.Unlock()
|
||||
ms[0].mu.Lock()
|
||||
ms[0].leader = leader
|
||||
ms[0].mu.Unlock()
|
||||
refusedAtOnce(t, "second master is the leader and lists two", c, "10.0.0.2:8888")
|
||||
}
|
||||
|
||||
// Distinct scoped IPv6 addresses are different filers; the zone counts, and
|
||||
@@ -383,6 +398,43 @@ func TestGRPCAddress(t *testing.T) {
|
||||
// Followers keep no authoritative filer list; their reported leader decides.
|
||||
func TestSingleFilerCensusUsesTheAgreedLeader(t *testing.T) {
|
||||
shortBounds(t)
|
||||
t.Run("one-leader-two-empty-followers", func(t *testing.T) {
|
||||
c, ms := cluster(t, "", lists("self"), lists(), lists())
|
||||
if err := c.CheckSingleFiler(context.Background()); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if ms[1].callCount() != 0 || ms[2].callCount() != 0 {
|
||||
t.Fatal("queried follower lists")
|
||||
}
|
||||
})
|
||||
for _, agrees := range []bool{true, false} {
|
||||
t.Run(fmt.Sprintf("leader-outside-seed-list/agrees=%t", agrees), func(t *testing.T) {
|
||||
f := &configFiler{}
|
||||
c, self := startConfigFiler(t, f)
|
||||
leader := &nodesMaster{filers: []string{self}}
|
||||
leaderAddr := startMaster(t, leader)
|
||||
follower := &nodesMaster{}
|
||||
followerAddr := startMaster(t, follower)
|
||||
follower.mu.Lock()
|
||||
follower.leader = leaderAddr
|
||||
follower.mu.Unlock()
|
||||
if !agrees {
|
||||
leader.mu.Lock()
|
||||
leader.leader = followerAddr
|
||||
leader.mu.Unlock()
|
||||
}
|
||||
f.mu.Lock()
|
||||
f.masters = []string{followerAddr}
|
||||
f.mu.Unlock()
|
||||
if agrees {
|
||||
if err := c.CheckSingleFiler(context.Background()); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
refusedAtBound(t, "leader does not confirm itself", c)
|
||||
}
|
||||
})
|
||||
}
|
||||
t.Run("leader-two-followers-empty", func(t *testing.T) {
|
||||
c, _ := cluster(t, "", lists("self", "10.0.0.2:8888"), lists(), lists())
|
||||
refusedAtOnce(t, "leader lists two", c, "10.0.0.2:8888")
|
||||
|
||||
@@ -336,7 +336,7 @@ stateDiagram-v2
|
||||
| Fenced | Drained, Acked | the stop callback succeeded; only then, and only when revoked, the acknowledgement is sent; a call that got no answer (`DeadlineExceeded`, `Unavailable`) is made again until the lease deadline, any other answer is final | `core/host/volume/workspace_lease.go` `drain`, `retryableAckError` | `INV-WS-REVOKE-ACK-001`, `INV-WS-REVOKE-ACK-RETRY-001` |
|
||||
| (start) | Attaching, Refused | the volume's host lock `/run/sw-block/locks/<volume id>.lock` is taken before the store opens; held by another live process, or its directory or file cannot be created or opened, refuses (`storage.ErrWALStoreLocked`, `ErrVolumeLockDirUnavailable`) | `core/frontend/durable/provider.go` `DurableProvider.lockVolumeOnHost` (from `ensureHandle`) | `INV-WS-ONE-PROCESS-PER-HOST-001` |
|
||||
| Attaching | Refused | a local root from another claim or behind HEAD's position (`layout.ErrStaleLocalRoot`): final typed refusal with a cure, no serving or retry | `core/frontend/durable/provider_layout.go` `startLayoutRoot`; `provider_chunk.go` `recoverChunk`, `chunkAuthorityWait` | `INV-WS-STALE-LOCAL-ROOT-001` |
|
||||
| (startup) | Refused | `--chunk-filer` is not the only filer of its group: a master lists another filer or several, or no master lists it within 60 s (`ErrNotSingleFiler`) | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring` | `INV-WS-SINGLE-FILER-001` |
|
||||
| (startup) | Refused | The agreed leader lists another filer or several; or all configured masters cannot agree and confirm exactly the target within 60 s (`ErrNotSingleFiler`) | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring` | `INV-WS-SINGLE-FILER-001` |
|
||||
| Claiming | Holder | Start validates the local root against the HEAD it conditionally updates; a fresh root seeds before claim, an ordinary reopen keeps its acknowledged local WAL and HEAD identity; guest I/O waits for assignment and claim | `core/frontend/chunkstore/layout/start.go` `Start`; `core/frontend/chunkstore/layout/claim.go` `RunClaim`; `core/frontend/durable/provider_layout.go` `startLayoutRoot` | `INV-WS-CLAIM-BEFORE-SERVE-001`, `INV-SNAPK-HEAD-WRITE-001` |
|
||||
| Claiming | Detached (non-serving) | a same-epoch detached HEAD refuses Start without changing its sealed image; a higher-epoch claimant retains that image | `core/frontend/chunkstore/layout/start.go` `Start`; `core/frontend/chunkstore/layout/claim.go` `Claim` | `INV-WS-SEALED-REOPEN-001` |
|
||||
| Claiming | Holder, or not installed | an unknown transition outcome is resolved by its claim/session identity and the current HEAD; no unverified local success | `core/frontend/chunkstore/layout/claim.go` `RunClaim`; `core/frontend/chunkstore/layout_remote.go` `LayoutRemote.CASHead` | `INV-WS-CAS-UNKNOWN-001` |
|
||||
@@ -831,7 +831,7 @@ Notes:
|
||||
| `INV-WS-STALE-LOCAL-ROOT-001` | An old or rolled-back local root is refused by `layout.Start` before serving; synchronous and deferred attach end without retry and report the typed stale-root error and cure. A fresh root at its own epoch likewise ends with `ErrMissingLocalRoot` and its cure. | M4 Claiming → Refused | `core/frontend/durable/provider_layout.go` `startLayoutRoot`; `core/frontend/durable/provider_chunk.go` `recoverChunk`, `chunkAuthorityWait`; `core/frontend/durable/provider_startup.go` `endChunkStartup` | `TestLayoutProviderRefusesEmptyOwnEpochAndRemountedOldRoot`, `TestFinalLayoutStartRefusalTable` (`core/frontend/durable/provider_layout_test.go`, `provider_layout_start_class_test.go`) | — | ACTIVE |
|
||||
| `INV-WS-ONE-PROCESS-PER-HOST-001` | One host runs at most one live blockvolume per volume: each takes the volume's exclusive host lock before its store opens and holds it until the store closes; a second is refused before it opens anything, whatever its `--durable-root`. | M4 (start) → Attaching, Refused | `core/frontend/durable/provider.go` `DurableProvider.lockVolumeOnHost` | `TestOneLiveProcessPerVolumePerHost`, `TestHostVolumeLockDirectoryCreatedOrRefused`, `TestHostVolumeLockRefusesNonDirectoryLockPath`, `TestHostVolumeLockTakesReadOnlyLockFile` (`core/frontend/durable/one_process_per_volume_test.go`); `TestHostVolumeLockCreatesParent0755AndLocks0700`, `TestHostVolumeLockKeepsExistingDirectoryModes` (`core/frontend/durable/volume_lock_parent_mode_test.go`); `TestVolumeLockDirTestOnlyRefusedUnderSystemd` (`cmd/blockvolume/volume_lock_flag_test.go`) | — | ACTIVE |
|
||||
| `INV-CHUNK-LEASE-REQUIRED-001` | Blockvolume refuses walstore-chunk startup without --workspace-lease before any host or store is opened. The refusal names concurrent acknowledging writers and acknowledged-write loss after a forced move; plain walstore startup is unchanged. | M4 startup → Refused | `cmd/blockvolume/main.go` `parseFlags` | `TestChunkVolumeRequiresWorkspaceLeaseBeforeStart` | — | ACTIVE |
|
||||
| `INV-WS-SINGLE-FILER-001` | A chunk volume starts only when `--chunk-filer` is its group's only filer, confirmed in a round where every master answered: a master listing another filer or several refuses at once; an unanswered master leaves the round unconfirmed; 60 s unconfirmed is refused. A startup census, not a fence. | M4 (startup) → Refused | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring`; `cmd/sw-block/chunk.go` `refuseUnlessSingleFiler` | `TestCheckSingleFilerRefusesAnotherOrSeveralFilers`, `TestCheckSingleFilerFailsClosed`, `TestCheckSingleFilerNeedsEveryMasterToAnswer`, `TestIsTargetComparesScopedAddresses`, `TestCheckSingleFilerPasses` (`core/frontend/chunkstore/single_filer_test.go`), `TestChunkWiringRefusesAMultiFilerGroup` (`cmd/blockvolume/single_filer_test.go`), `TestOpsChunk_WritingCommandsRunTheSingleFilerCheck` (`cmd/sw-block/chunk_start_check_test.go`), `TestOpsChunk_StartCheckRefusesAnUnparsableMaster` (`cmd/sw-block/chunk_single_filer_unanswered_test.go`), `TestOpsChunk_VerifyRunsTheSingleFilerCheck` (`cmd/sw-block/chunk_verify_test.go`) | — | ACTIVE |
|
||||
| `INV-WS-SINGLE-FILER-001` | Startup requires all configured masters to answer and agree on a leader; only that leader listing exactly the target filer admits. Followers' lists do not decide. Unknown views retry within 60 s. This census does not fence later filer registration. | M4 (startup) → Refused | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring`; `cmd/sw-block/chunk.go` `refuseUnlessSingleFiler` | `TestSingleFilerCensusUsesTheAgreedLeader`; `TestCheckSingleFilerRefusesAnotherOrSeveralFilers`, `TestCheckSingleFilerFailsClosed`, `TestCheckSingleFilerFavourableThenStalledRefuses`, `TestIsTargetComparesScopedAddresses`, `TestCheckSingleFilerPasses` (`core/frontend/chunkstore/single_filer_test.go`), `TestChunkWiringRefusesAMultiFilerGroup` (`cmd/blockvolume/single_filer_test.go`), `TestOpsChunk_WritingCommandsRunTheSingleFilerCheck` (`cmd/sw-block/chunk_start_check_test.go`), `TestOpsChunk_VerifyRunsTheSingleFilerCheck` (`cmd/sw-block/chunk_verify_test.go`) | — | ACTIVE |
|
||||
| `INV-WS-LEASE-REGRANT-001` | Re-grant after expiry keeps the same holder and epoch, with no pending move or revocation, a certain store, and one durable write after the horizon/deadline plus skew barrier. Restart begins a new session and voids the old; ordinary reopen keeps HEAD identity (epoch, holder, claim) unchanged. | M2 Expired → Granted; M9 Start | `core/authority/workspace_lease_view.go` `regrantWorkspaceLease`; `core/authority/workspace.go` `forcedMoveBarrierLocked`; `core/frontend/chunkstore/layout/start.go` `Start` | `TestWorkspaceLeaseExpiredSameHolderRegrantIsDurable`, `TestWorkspaceLeaseRegrantWaitsForFullSkew`, `TestWorkspaceLeaseRegrantDefeatsAlreadyPassedForcedPreflight`, `TestWorkspaceLeaseForcedIssueDefeatsOldHolderRegrant`, `TestWorkspaceLeaseRegrantWaitsForDurabilityAndLatchesFailure` (`core/authority/workspace_regrant_test.go`); `TestWorkspaceLeaseRegrantPreservesLocalLogThroughFirstCut` (`core/authority/workspace_regrant_storage_test.go`); `TestStart_OwnEpochFreshRootRefusedBeforeClaim`, `TestStart_OwnEpochSameRootContinues` (`core/frontend/chunkstore/layout/start_test.go`); `TestClaim_WritesItsClaimID`, `TestRunClaim_VoidsTheOldSession` (`core/frontend/chunkstore/layout/claim_test.go`); `TestLocalReopenClaimsBeforeServing` (`core/frontend/durable/provider_reopen_belt_test.go`) | `WorkspaceRegrant` `NoDualServingInc`, `RegrantNoLoss`, `DiskCoversMemory`; `INV-SNAPK-START-ROOT-001` | ACTIVE |
|
||||
| `INV-WS-LEASE-001` | A host admits frontend I/O and cuts only under an unexpired lease for its exact `{volume, replica, epoch}`; a fenced guard never reopens, even on a late renewal reply. | M4 lease guard: Valid → Fenced | `core/host/volume/workspace_lease.go` `permits`, `Refresh` | `TestWorkspaceLeaseExpiryFencesWithoutTimerAndCannotReopen`, `TestWorkspaceDelayedRenewalCannotUndoExpiry` (`core/host/volume/workspace_lease_test.go`); `TestWorkspaceHostRequiresLeaseBeforeFrontendAndCut` (`core/host/volume/workspace_runtime_test.go`); `TestWorkspacePausedGranteeRefusedAtAttach` (`core/host/master/workspace_paused_grantee_test.go`) | `WorkspaceTakeover` `NoDualServing` | ACTIVE |
|
||||
| `INV-WS-REVOKE-ACK-001` | A host acknowledges a revocation only after its frontend and cuts have stopped; a cancelled or expired drain sends no acknowledgement. | M4 lease guard: Revoking → Acked | `core/host/volume/workspace_lease.go` `drain` | `TestWorkspaceRevocationAckOnlyAfterFrontendAndCutsStop` (`core/host/volume/workspace_lease_test.go`); `TestWorkspaceHostCancelOrExpiryDuringRevokeDrainNeverACKs` (`core/host/volume/workspace_runtime_test.go`); `TestWorkspaceRevocationAckOutlastsTheMastersBoundedSteps`, `TestWorkspaceRevocationAckIsCutAtTheLeaseDeadline` (`core/host/volume/workspace_ack_budget_test.go`); `TestWorkspaceRevocationAckIsAskedAgainAfterALostAnswer`, `TestWorkspaceCloseoutFitsTheUnitsStopBudget` (`cmd/blockvolume/process_exit_ack_retry_test.go`) | `WorkspaceTakeover` `CleanNoLoss` | ACTIVE |
|
||||
|
||||
@@ -441,18 +441,15 @@ The `--chunk-*` and `--workspace-lease` flags are refused unless
|
||||
`--durable-impl=walstore-chunk`; leave them at their defaults otherwise.
|
||||
|
||||
`--chunk-filer` must name the only filer of its filer group. At startup
|
||||
blockvolume asks that filer for its masters, then every master for the
|
||||
filers in the group. It starts only when, in one round, every master
|
||||
answers, none lists another filer or several, and at least one lists
|
||||
exactly that filer. Any master listing another filer, or several, refuses at
|
||||
once. If a master does not answer, or no master lists the filer yet (a fresh
|
||||
filer registers with its master some seconds after it serves), blockvolume
|
||||
asks again every second until 60 s, then refuses, naming the masters that
|
||||
did not answer. A chunk volume therefore does not start while any master of
|
||||
the filer's group is unreachable: start it again once they answer. At start,
|
||||
the leader master listed this filer and no other; a filer added within about
|
||||
15 seconds before the start, or at any time after, is not detected. This is
|
||||
checked at startup only; do not add filers to the group while volumes run.
|
||||
blockvolume asks that filer for its masters, then requires every configured
|
||||
master to answer and name the same leader. Only that leader's list decides:
|
||||
it must contain exactly the configured filer. A follower's empty list is
|
||||
not evidence for or against admission. A leader listing another filer or
|
||||
several refuses at once. Missing master answers, disagreement about the
|
||||
leader, or an empty leader list retry every second within 60 s, then refuse.
|
||||
A fresh filer can take several seconds to register with its leader. This is
|
||||
a startup census only, not a fence against later registration: do not add
|
||||
filers to the group while volumes run.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
Reference in new issue
Block a user