From a6304c2101d37c170668087ea548b9524e68b00c Mon Sep 17 00:00:00 2001 From: pingqiu-cpu Date: Wed, 2 Dec 2026 18:05:50 -0800 Subject: [PATCH] feat(geometry): new volumes up to 1 TiB (v1.1) (#757) Interim merge note (spec trace workflow startup_failure on all branches since 22:45Z): branch updated to current main (69c5c6bd); go test (linux) and process-level tests (real binaries) passed on 69c5c6bd; spec-trace-check.sh and public-text-check.sh run locally with the base branch's scripts against this head and body: both pass (Model line now also cites FormatGate.Report for core/host/master/services.go, mapped since the PR was accepted). Code review ACCEPT on e1ed5073; the 1 TiB loaded first-cut measurement on current main passed on both volume formats. --- seaweed-block/.github/workflows/test.yml | 4 +- .../cmd/sw-block/volume_create_test.go | 4 +- seaweed-block/core/geometry/volume_size.go | 34 +++++- .../core/geometry/volume_size_level_test.go | 26 ++++ .../core/geometry/volume_size_release.go | 4 +- .../core/geometry/volume_size_release_test.go | 26 +++- .../master/create_format_level_size_test.go | 113 ++++++++++++++++++ seaweed-block/core/host/master/services.go | 10 ++ .../core/rpc/lifecycleclient/reason.go | 3 + seaweed-block/docs/design/invariants.md | 4 +- seaweed-block/docs/releases/v1.1.md | 10 +- seaweed-block/docs/standalone-deployment.md | 4 +- 12 files changed, 221 insertions(+), 21 deletions(-) create mode 100644 seaweed-block/core/geometry/volume_size_level_test.go create mode 100644 seaweed-block/core/host/master/create_format_level_size_test.go diff --git a/seaweed-block/.github/workflows/test.yml b/seaweed-block/.github/workflows/test.yml index c793a48f61..2fc36d0531 100644 --- a/seaweed-block/.github/workflows/test.yml +++ b/seaweed-block/.github/workflows/test.yml @@ -129,7 +129,7 @@ jobs: - name: Lab build tags stay out of images and releases if: matrix.suite == 'unit' - # swblock_lab_bigvol lifts the 256 GiB create cap and the local + # swblock_lab_bigvol lifts the 1 TiB create cap and the local # headroom refusal for scale rehearsals only; swblock_v11_format turns # on the draft v1.1 store format. The default test run pins the # release cap (TestReleaseBuildKeepsTheCreateCap) and the release @@ -142,7 +142,7 @@ jobs: bash .github/scripts/lab-tag-check-test.sh for tags in swblock_lab_bigvol swblock_v11_format swblock_lab_bigvol,swblock_v11_format; do go vet -tags "$tags" ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/ ./core/storage/ - bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'Lab|Headroom|Revision' ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/ + bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'Lab|Headroom|Revision|LegacyBound' ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/ bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'TestV11FormatFollowsItsOwnTagAlone' ./core/storage/ done diff --git a/seaweed-block/cmd/sw-block/volume_create_test.go b/seaweed-block/cmd/sw-block/volume_create_test.go index e183397368..13f8599eaa 100644 --- a/seaweed-block/cmd/sw-block/volume_create_test.go +++ b/seaweed-block/cmd/sw-block/volume_create_test.go @@ -353,13 +353,13 @@ func testCreateAndPlaceLostReply(t *testing.T, lostReply string) { args[len(args)-1] = "too-large" for i := range args { if args[i] == "--size-bytes" { - args[i+1] = "274877911040" + args[i+1] = "1099511631872" // 1 TiB + 4 KiB } } beforeBindings := bindingCalls.Load() out.Reset() errout.Reset() - if code := run(args, &out, &errout); code != 78 || !strings.Contains(errout.String(), "exceeds the maximum of 274877906944 bytes") || out.Len() != 0 { + if code := run(args, &out, &errout); code != 78 || !strings.Contains(errout.String(), "exceeds the maximum of 1099511627776 bytes") || out.Len() != 0 { t.Fatalf("size refusal: code=%d out=%q err=%q", code, &out, &errout) } if bindingCalls.Load() != beforeBindings { diff --git a/seaweed-block/core/geometry/volume_size.go b/seaweed-block/core/geometry/volume_size.go index f613cbabba..311bbb3a5f 100644 --- a/seaweed-block/core/geometry/volume_size.go +++ b/seaweed-block/core/geometry/volume_size.go @@ -16,17 +16,39 @@ const MaxVolumeBytes uint64 = (16 << 40) - 4096 // created, so a volume that already exists keeps opening under // MaxVolumeBytes. A restore target takes its source's size. // -// 256 GiB is 65,536 chunks of 4 MiB. A cut's commit checks the chunks it -// names within one 2 s conditional update of HEAD; the worst of five -// measured runs verified about 188,000 chunks in that time at 32 requests -// in flight. Halved for the rest of the update (the HEAD write, the -// manifest segments, a loaded or remote filer) and rounded down to a power -// of two, that is 65,536 chunks. +// 1 TiB is 262,144 chunks of 4 MiB. A cut's commit checks its chunks +// before the HEAD update, under the cut's own time limit, and the bounded +// HEAD step does constant work whatever the chunk count (the fixed-limits +// table in docs/design/invariants.md); the 1 TiB gate rows measure it. // // A lab build (the swblock_lab_bigvol tag, volume_size_lab.go) raises it to // MaxVolumeBytes for scale rehearsals; a release build never carries that tag. const MaxNewVolumeBytes uint64 = newVolumeCap +// MaxLegacyFormatVolumeBytes is the largest new volume at cluster format +// level 0. A volume created there keeps the v1.0 store format, whose map +// checkpoint refuses a volume above 256 GiB; a larger one needs format +// level 1 (the finalize), which creates the v1.1 format. +const MaxLegacyFormatVolumeBytes uint64 = 256 << 30 + +// ErrSizeRequiresFormatLevel1 refuses a new volume above +// MaxLegacyFormatVolumeBytes while the cluster's format level is 0. +var ErrSizeRequiresFormatLevel1 = errors.New("size_requires_format_level_1") + +// ValidateNewVolumeSizeAtLevel is ValidateNewVolumeSize at the cluster's +// format level: below level 1 a new volume is also held to +// MaxLegacyFormatVolumeBytes (in any build), refused typed with the cure. +// There is no forced upgrade. +func ValidateNewVolumeSizeAtLevel(size uint64, level uint32) error { + if err := ValidateNewVolumeSize(size); err != nil { + return err + } + if level < 1 && size > MaxLegacyFormatVolumeBytes { + return fmt.Errorf("%w: %d bytes exceeds the maximum of %d bytes at cluster format level 0; finalize the v1.1 format (sw-block cluster finalize-format) for volumes up to %d bytes", ErrSizeRequiresFormatLevel1, size, MaxLegacyFormatVolumeBytes, MaxNewVolumeBytes) + } + return nil +} + // ErrVolumeTooLarge refuses a new volume above MaxNewVolumeBytes. var ErrVolumeTooLarge = errors.New("volume too large") diff --git a/seaweed-block/core/geometry/volume_size_level_test.go b/seaweed-block/core/geometry/volume_size_level_test.go new file mode 100644 index 0000000000..c747c46b0f --- /dev/null +++ b/seaweed-block/core/geometry/volume_size_level_test.go @@ -0,0 +1,26 @@ +package geometry + +import ( + "errors" + "strings" + "testing" +) + +// The size cap follows the cluster's format level: at level 0 a new volume +// is held to 256 GiB (a larger one is refused typed, naming the cure); at +// level 1 a volume above 256 GiB is admitted. Both hold in any build. +func TestANewVolumeAboveTheLegacyBoundNeedsFormatLevel1(t *testing.T) { + const legacy = uint64(256) << 30 + if err := ValidateNewVolumeSizeAtLevel(legacy, 0); err != nil { + t.Fatalf("256 GiB at level 0: %v, want admitted", err) + } + for _, over := range []uint64{4096, 4 << 20, legacy} { + err := ValidateNewVolumeSizeAtLevel(legacy+over, 0) + if !errors.Is(err, ErrSizeRequiresFormatLevel1) || !strings.Contains(err.Error(), "finalize-format") { + t.Fatalf("256 GiB + %d at level 0: %v, want %v naming finalize-format", over, err, ErrSizeRequiresFormatLevel1) + } + if err := ValidateNewVolumeSizeAtLevel(legacy+over, 1); err != nil { + t.Fatalf("256 GiB + %d at level 1: %v, want admitted", over, err) + } + } +} diff --git a/seaweed-block/core/geometry/volume_size_release.go b/seaweed-block/core/geometry/volume_size_release.go index 9e96c44bed..70d4ccfa22 100644 --- a/seaweed-block/core/geometry/volume_size_release.go +++ b/seaweed-block/core/geometry/volume_size_release.go @@ -3,8 +3,8 @@ package geometry // newVolumeCap is the release cap on a new volume (MaxNewVolumeBytes). -const newVolumeCap uint64 = 256 << 30 +const newVolumeCap uint64 = 1 << 40 -// LabBigVolume is false in a release build: the 256 GiB create cap and the +// LabBigVolume is false in a release build: the 1 TiB create cap and the // local headroom check at create both hold. const LabBigVolume = false diff --git a/seaweed-block/core/geometry/volume_size_release_test.go b/seaweed-block/core/geometry/volume_size_release_test.go index 8aade22b0f..5010f90f4f 100644 --- a/seaweed-block/core/geometry/volume_size_release_test.go +++ b/seaweed-block/core/geometry/volume_size_release_test.go @@ -2,11 +2,29 @@ package geometry -import "testing" +import ( + "errors" + "testing" +) -// A build without the lab tag keeps the release cap: 256 GiB. +// In a release build a new volume of 1 TiB (262,144 chunks of 4 MiB) is +// created at format level 1; one block or one chunk more is refused, naming +// the maximum. +func TestANewVolumeOfOneTiBIsCreated(t *testing.T) { + const oneTiB = uint64(1) << 40 + if err := ValidateNewVolumeSizeAtLevel(oneTiB, 1); err != nil { + t.Fatalf("a new volume of 1 TiB at level 1 is refused: %v", err) + } + for _, over := range []uint64{4096, 4 << 20} { + if err := ValidateNewVolumeSizeAtLevel(oneTiB+over, 1); !errors.Is(err, ErrVolumeTooLarge) { + t.Fatalf("a new volume of 1 TiB + %d bytes: %v, want %v", over, err, ErrVolumeTooLarge) + } + } +} + +// A build without the lab tag keeps the release cap: 1 TiB. func TestReleaseBuildKeepsTheCreateCap(t *testing.T) { - if LabBigVolume || MaxNewVolumeBytes != 256<<30 { - t.Fatalf("release build: LabBigVolume %v, MaxNewVolumeBytes %d; want false and 256 GiB", LabBigVolume, MaxNewVolumeBytes) + if LabBigVolume || MaxNewVolumeBytes != 1<<40 { + t.Fatalf("release build: LabBigVolume %v, MaxNewVolumeBytes %d; want false and 1 TiB", LabBigVolume, MaxNewVolumeBytes) } } diff --git a/seaweed-block/core/host/master/create_format_level_size_test.go b/seaweed-block/core/host/master/create_format_level_size_test.go new file mode 100644 index 0000000000..9fa901e12a --- /dev/null +++ b/seaweed-block/core/host/master/create_format_level_size_test.go @@ -0,0 +1,113 @@ +package master + +import ( + "context" + "errors" + "strings" + "testing" + "time" + + "github.com/seaweedfs/seaweed-block/core/authority" + "github.com/seaweedfs/seaweed-block/core/geometry" + "github.com/seaweedfs/seaweed-block/core/lifecycle" + control "github.com/seaweedfs/seaweed-block/core/rpc/control" + "github.com/seaweedfs/seaweed-block/core/rpc/lifecycleclient" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" +) + +// sizeLevelMaster starts a master on a new cluster (format level 1) or on an +// upgraded, not finalized store (level 0), with the create path wired. +func sizeLevelMaster(t *testing.T, level0 bool) (*Host, *grpc.ClientConn) { + t.Helper() + dir := t.TempDir() + if level0 { + dir = upgradedStoreDir(t) + } + m, err := New(Config{Listen: "127.0.0.1:0", AuthorityStoreDir: dir, LifecycleStoreDir: t.TempDir(), WorkspaceRPC: true, LifecycleProductLoop: true, LayoutCreateVolume: testLayoutCreateVolume, + WorkspaceHeadReader: func(context.Context, string) (authority.WorkspaceHead, error) { return authority.WorkspaceHead{}, nil }}) + if err != nil { + t.Fatal(err) + } + m.Start() + t.Cleanup(func() { closeTestMaster(t, m) }) + want := uint32(1) + if level0 { + want = 0 + } + if m.formatLevel() != want { + t.Fatalf("setup: format level %d, want %d", m.formatLevel(), want) + } + conn, err := grpc.NewClient(m.Addr(), grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { conn.Close() }) + return m, conn +} + +// The size cap follows the cluster's format level on the create path. At +// level 0 a CreateVolume above 256 GiB is refused, FailedPrecondition typed +// SIZE_REQUIRES_FORMAT_LEVEL_1 naming the finalize, with no record, so a +// binding for that id to a registered node is refused for the missing +// record; 256 GiB is created and binds to the same node. At level 1 (a new +// cluster) a volume above 256 GiB is created. +func TestCreateAboveTheLegacyBoundFollowsTheFormatLevel(t *testing.T) { + const big = uint64(512) << 30 + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + t.Run("level 0", func(t *testing.T) { + m, conn := sizeLevelMaster(t, true) + lc := control.NewLifecycleServiceClient(conn) + _, err := lc.CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "big", SizeBytes: big, ReplicationFactor: 1}) + if status.Code(err) != codes.FailedPrecondition || reasonOf(err) != lifecycleclient.ReasonSizeRequiresFormatLevel1 || !strings.Contains(status.Convert(err).Message(), "finalize-format") { + t.Fatalf("CreateVolume of 512 GiB at level 0: %v (reason %q), want FailedPrecondition %s naming finalize-format", err, reasonOf(err), lifecycleclient.ReasonSizeRequiresFormatLevel1) + } + if _, ok := m.Lifecycle().Volumes.GetVolume("big"); ok { + t.Fatal("the refused create left a volume record") + } + if _, err := lc.CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "legacy-max", SizeBytes: geometry.MaxLegacyFormatVolumeBytes, ReplicationFactor: 1}); err != nil { + t.Fatalf("CreateVolume of 256 GiB at level 0: %v, want created", err) + } + if _, err := m.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{ServerID: "node-a", DataAddr: "127.0.0.1:10000", CtrlAddr: "127.0.0.1:10001"}); err != nil { + t.Fatal(err) + } + ws := control.NewWorkspaceServiceClient(conn) + _, err = ws.RegisterWorkspaceBinding(ctx, &control.WorkspaceBinding{VolumeId: "big", ServerId: "node-a", DataAddr: "127.0.0.1:10000", CtrlAddr: "127.0.0.1:10001"}) + if status.Code(err) != codes.FailedPrecondition || !strings.Contains(status.Convert(err).Message(), "requires an existing RF1 volume") { + t.Fatalf("a binding for the refused volume on registered node-a: %v, want refused for the missing record", err) + } + if _, err := ws.RegisterWorkspaceBinding(ctx, &control.WorkspaceBinding{VolumeId: "legacy-max", ServerId: "node-a", DataAddr: "127.0.0.1:10000", CtrlAddr: "127.0.0.1:10001"}); err != nil { + t.Fatalf("a binding for the admitted 256 GiB volume on node-a: %v, want bound", err) + } + }) + t.Run("level 1", func(t *testing.T) { + m, conn := sizeLevelMaster(t, false) + if _, err := control.NewLifecycleServiceClient(conn).CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "big", SizeBytes: big, ReplicationFactor: 1}); err != nil { + t.Fatalf("CreateVolume of 512 GiB at level 1: %v, want created", err) + } + if _, ok := m.Lifecycle().Volumes.GetVolume("big"); !ok { + t.Fatal("the created volume has no record") + } + }) +} + +// The cluster-spec import (blockmaster's start) is admitted at the same +// guard: at level 0 a volume above 256 GiB is refused typed with no record; +// at level 1 it is imported. +func TestClusterSpecImportAboveTheLegacyBoundFollowsTheFormatLevel(t *testing.T) { + spec := lifecycle.VolumeSpec{VolumeID: "big", SizeBytes: uint64(512) << 30, ReplicationFactor: 1} + m0, _ := sizeLevelMaster(t, true) + if _, err := m0.ImportLifecycleVolume(spec); !errors.Is(err, geometry.ErrSizeRequiresFormatLevel1) { + t.Fatalf("the import of 512 GiB at level 0: %v, want %v", err, geometry.ErrSizeRequiresFormatLevel1) + } + if _, ok := m0.Lifecycle().Volumes.GetVolume("big"); ok { + t.Fatal("the refused import left a volume record") + } + m1, _ := sizeLevelMaster(t, false) + if imported, err := m1.ImportLifecycleVolume(spec); err != nil || !imported { + t.Fatalf("the import of 512 GiB at level 1: imported %v, %v; want imported", imported, err) + } +} diff --git a/seaweed-block/core/host/master/services.go b/seaweed-block/core/host/master/services.go index 7ec90f8e20..cfe53f8e6f 100644 --- a/seaweed-block/core/host/master/services.go +++ b/seaweed-block/core/host/master/services.go @@ -12,6 +12,7 @@ import ( "github.com/seaweedfs/seaweed-block/core/auth" "github.com/seaweedfs/seaweed-block/core/authority" "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/layout" + "github.com/seaweedfs/seaweed-block/core/geometry" "github.com/seaweedfs/seaweed-block/core/lifecycle" "github.com/seaweedfs/seaweed-block/core/ops" control "github.com/seaweedfs/seaweed-block/core/rpc/control" @@ -165,6 +166,9 @@ func (s *services) CreateVolume(ctx context.Context, req *control.CreateVolumeRe s.host.log.Printf("blockmaster: CreateVolume volume=%q protocol=%q replication_factor=%d pvc=%q namespace=%q", spec.VolumeID, spec.Protocol, spec.ReplicationFactor, spec.PVCName, spec.PVCNamespace) rec, err := s.host.createLifecycleVolume(ctx, spec) if err != nil { + if errors.Is(err, geometry.ErrSizeRequiresFormatLevel1) { + return nil, lifecycleclient.WithReason(status.Newf(codes.FailedPrecondition, "create volume: %v", err), lifecycleclient.ReasonSizeRequiresFormatLevel1).Err() + } if errors.Is(err, layout.ErrNoSnapshot) { return nil, status.Errorf(codes.NotFound, "restore snapshot: %v", err) } @@ -205,6 +209,12 @@ func restoreRefusedForGood(err error) bool { // leaves the durable record not-ready; replay uses its same identity and // completes VOLUME/HEAD before publishing the one-way placement hint. func (h *Host) createLifecycleVolume(ctx context.Context, spec lifecycle.VolumeSpec) (lifecycle.VolumeRecord, error) { + // The size cap follows the cluster's format level: every create (the RPC, + // a restore target, the cluster-spec import) is admitted here, before any + // record; a binding needs that record. + if err := geometry.ValidateNewVolumeSizeAtLevel(spec.SizeBytes, h.formatLevel()); errors.Is(err, geometry.ErrSizeRequiresFormatLevel1) { + return lifecycle.VolumeRecord{}, err + } rec, err := h.lifecycle.Volumes.CreateVolume(spec) if err != nil { return lifecycle.VolumeRecord{}, err diff --git a/seaweed-block/core/rpc/lifecycleclient/reason.go b/seaweed-block/core/rpc/lifecycleclient/reason.go index a3b366749b..7dff2786d6 100644 --- a/seaweed-block/core/rpc/lifecycleclient/reason.go +++ b/seaweed-block/core/rpc/lifecycleclient/reason.go @@ -26,6 +26,9 @@ const ( // ReasonHostHoldsWork: a host retire was refused because the host still // holds a lease or an assignment for a volume. ReasonHostHoldsWork = "HOST_HOLDS_WORK" + // ReasonSizeRequiresFormatLevel1: a new volume above 256 GiB was refused + // because the cluster's format level is 0 (finalize the v1.1 format). + ReasonSizeRequiresFormatLevel1 = "SIZE_REQUIRES_FORMAT_LEVEL_1" ) // WithReason returns st with an ErrorInfo detail carrying reason in diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 2e07d3964d..5dc80a3e43 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -1135,7 +1135,7 @@ Notes: | `INV-HOST-URGENT-PENDING-001` | While urgent work holds urgent-pending (its slot's lease or HoldUrgentPending), Normal admissions on the host are refused with ErrUrgentPending, a wait. Urgent work waits at most 200 ms for that hold and otherwise proceeds without it; a probe never blocks it. | M7 host cut admission (Normal before a slot) | `core/hostlimit/limiter.go` `pool`, `Admit`; `core/hostlimit/pending.go` `HoldUrgentPending` | `TestNormalWaitsWhileUrgentPendingIsHeld`, `TestUrgentLeaseHoldsThePendingSignal` (`core/hostlimit/pending_test.go`); `TestSlotsUrgentAndJoinedRelease` (`core/hostlimit/limiter_test.go`) | — | ACTIVE | | `INV-HOST-LAUNCH-CHECK-001` | blockvolume refuses to start with a --host-limit-dir that is missing or not a directory, under a temporary directory, on a network file system, or already in use with different host-limit flags. | M7 host cut admission (process start) | `core/hostlimit/launch.go` `CheckLaunch`; `core/hostlimit/remotefs_linux.go`; `cmd/blockvolume/main.go` | `TestCheckLaunch` (`core/hostlimit/pending_test.go`) | — | ACTIVE | | `INV-LOCAL-HEADROOM-001` | blockvolume refuses to create a volume when the durable root's free space is below the volume size plus its WAL, naming both numbers, before it creates the store, WAL or fresh marker, and warns at start when an existing volume's remaining sparse growth plus the WAL exceed the free space. | M1 open/create (durable provider start) | `core/frontend/durable/headroom.go`; `core/frontend/durable/provider.go` `createFresh`, `openExisting` | `TestCreateRefusesWithoutLocalHeadroom`, `TestOpenWarnsWithoutLocalHeadroom` (`core/frontend/durable/headroom_test.go`) | A lab build (tag `swblock_lab_bigvol`, scale rehearsals only) warns instead of refusing (`TestLabBuildCreatesWithoutLocalHeadroom`); CI keeps the tag out of every image and release build (`.github/scripts/lab-tag-check.sh`) | ACTIVE | -| `INV-CREATE-MAX-SIZE-001` | blockmaster refuses a new volume above `geometry.MaxNewVolumeBytes` at CreateVolume (InvalidArgument) and at a `--cluster-spec` start, with `ErrVolumeTooLarge` naming the size and the maximum, before any record or store exists. An existing volume keeps opening under `MaxVolumeBytes`. | create admission (CreateVolume, cluster-spec import) | `core/geometry/volume_size.go` `ValidateNewVolumeSize`; `core/lifecycle/store.go` `CreateVolume`; `cmd/blockmaster/cluster_spec.go` `loadClusterSpec`; `core/host/master/services.go` `CreateVolume` (restore geometry) | `TestCreateVolumeRefusesAVolumeAboveTheMaximum` (`core/host/master`), `TestClusterSpecRefusesAVolumeAboveTheMaximum` (`cmd/blockmaster`), `TestValidateNewVolumeSizeAtAndAboveTheMaximum` (`core/geometry`), `TestCreateVolumeRejectsBeyondUint32LBACap` (`core/lifecycle`) | In a lab build (tag `swblock_lab_bigvol`, scale rehearsals only) `MaxNewVolumeBytes` is `MaxVolumeBytes` (`TestLabBuildLiftsTheCreateCap`); a release build keeps 256 GiB (`TestReleaseBuildKeepsTheCreateCap`), and CI keeps the tag out of every image (`.github/scripts/lab-tag-check.sh`, `scripts/refuse-lab-binary.sh`) | ACTIVE | +| `INV-CREATE-MAX-SIZE-001` | blockmaster refuses a new volume above `MaxNewVolumeBytes` (InvalidArgument) and, at format level 0, above 256 GiB (FailedPrecondition `SIZE_REQUIRES_FORMAT_LEVEL_1`), at CreateVolume and a cluster-spec import, before any record or store. An existing volume keeps opening under `MaxVolumeBytes`. | create admission (CreateVolume, cluster-spec import) | `core/geometry/volume_size.go` `ValidateNewVolumeSize`, `ValidateNewVolumeSizeAtLevel`; `core/host/master/services.go` `createLifecycleVolume`; `core/lifecycle/store.go` `CreateVolume`; `cmd/blockmaster/cluster_spec.go` `loadClusterSpec`; `core/host/master/services.go` `CreateVolume` (restore geometry) | `TestCreateVolumeRefusesAVolumeAboveTheMaximum` (`core/host/master`), `TestClusterSpecRefusesAVolumeAboveTheMaximum` (`cmd/blockmaster`), `TestValidateNewVolumeSizeAtAndAboveTheMaximum`, `TestANewVolumeAboveTheLegacyBoundNeedsFormatLevel1` (`core/geometry`), `TestCreateAboveTheLegacyBoundFollowsTheFormatLevel`, `TestClusterSpecImportAboveTheLegacyBoundFollowsTheFormatLevel` (`core/host/master`), `TestCreateVolumeRejectsBeyondUint32LBACap` (`core/lifecycle`) | FormatGate `CreateBig` / `NoBigAtLevel0` (mutation `big_at_level0`); In a lab build (tag `swblock_lab_bigvol`, scale rehearsals only) `MaxNewVolumeBytes` is `MaxVolumeBytes` (`TestLabBuildLiftsTheCreateCap`); a release build keeps 1 TiB (`TestReleaseBuildKeepsTheCreateCap`, `TestANewVolumeOfOneTiBIsCreated`); the 256 GiB bound at level 0 holds in any build, and CI keeps the tag out of every image (`.github/scripts/lab-tag-check.sh`, `scripts/refuse-lab-binary.sh`) | ACTIVE | | `INV-HOST-TICKET-ORDER-001` | A waiting timer cut is admitted only when no earlier ticket on the host is live and not stalled; dead tickets are removed, stalled ones (head free for 2 s) skipped. A volume waits at most (V-1) x T_cut,max plus the window's urgent work plus one poll per hand-off. | M7 waiting → admitted (reason: under random retry, 9 of 20 volumes on one host made zero cuts in 720 s) | `core/hostlimit/tickets.go` `TakeTicket`, `headCheck`, `reap`; `core/hostlimit/limiter.go` `pool`, `Admit`; `core/frontend/durable/provider_chunk.go` `chunkLoop` | `TestTicketsAdmitInDueOrder`, `TestDeadEarlierTicketIsRemoved`, `TestStalledEarlierTicketIsSkipped`, `TestNoSkipWhileTheSlotIsHeld`, `TestTicketRemovedBeforeItsLockIsRetaken`, `TestOneStalledTicketCostsOneSkipNotEveryHandoff`, `TestConfigurationLockHeldPastTheBoundIsAWait`, `TestTakeTicketDoesNotRecreateARemovedPool` (`core/hostlimit/tickets_test.go`); `TestCutPolicy_TicketOrderWaitBound` (`core/frontend/durable/cut_policy_test.go`); `TestChunkLoop_TicketKeptForAWaitDroppedOtherwise` (`core/frontend/durable/cut_loop_fence_test.go`) | `HostTickets` OrderedAdmission, BoundedWait, NoLostTicket, SingleHolder | ACTIVE | | `INV-HOST-TICKET-REENTRY-001` | A timer cut never cuts without a ticket (a failed ticket creation waits for the next poll), and once an attempt of a turn was admitted and failed, every later ticket of that turn is at the back of the queue, never at the schedule's earlier due time. | M7 waiting → admitted | `core/frontend/durable/provider_chunk.go` `chunkLoop` | `TestChunkLoop_AConsumedAttemptRetriesAtTheBack`, `TestChunkLoop_NoTicketNoCut`, `TestChunkLoop_ARequeuedTurnStaysAtTheBackAcrossAWaitAndADrop` (`core/frontend/durable/cut_loop_ticket_order_test.go`) | SlotShareN (a cut that yields or retries takes a new ticket at the back) | ACTIVE | | `INV-HOST-CUT-PACING-HOST-001` | Coordinated cut transfers on one host upload at most the budget in total, plus at most H x PayloadBytes once per change of H (H = held normal and urgent slots); a lone transfer may use the whole budget. Fallback leases are excluded. | M7 admitted (upload pacing) | `core/hostlimit/limiter.go` `WaitUpload`, `heldCodedSlots` | `TestPacingUsesTheBudgetOverHeldSlots` (`core/hostlimit/tickets_test.go`); `TestPacingDebtSurvivesOwnLeaseTurnover` (`core/hostlimit/limiter_test.go`) | — | ACTIVE | @@ -1490,7 +1490,7 @@ One row per fixed time limit on a volume's path that surrounds, or once surround Known limits of this table: what an attempt keeps is kept in the memory of one process. After a restart the cut uploads again what it cannot prove was uploaded; names are by content, so this costs time and no correctness. -The two STUB rows of the start path are measured by the 1 TiB row's kill-and-restart step (recovery, attach and their sum). If the sum does not leave a wide margin under the limit, the limit is changed to progress (a retry keeps the finished recovery) before 1 TiB is claimed. +The start path at 1 TiB, measured by the 1 TiB gate rows: attach about 4 s (about 1.4 ms per GiB; heap about 50 MB per TiB) and a restart after a kill about 2.1 s (about 1.5 ms per GiB), a wide margin under the 30 s window, so the limit stays a window. Both grow with the volume (they load the resident per-chunk state) and are bounded by the 1 TiB create cap; making them constant is a later release's work. ### v3 offline reader (row12a) diff --git a/seaweed-block/docs/releases/v1.1.md b/seaweed-block/docs/releases/v1.1.md index 90a499dc3f..e84a7964e1 100644 --- a/seaweed-block/docs/releases/v1.1.md +++ b/seaweed-block/docs/releases/v1.1.md @@ -8,6 +8,13 @@ These notes collect v1.1's changes as they land; v1.1 is not released. --durable-impl`, `blockmaster --launcher-durable-impl` and the provider. v1.0.1's notes carried the advance notice. ## Changed +- New volumes can be up to 1 TiB (1099511627776 bytes, 262,144 chunks of 4 MiB); v1.0.x created at most 256 GiB. + A larger create is refused naming the maximum. 1 TiB volumes need format level 1: new clusters have it, upgraded + clusters after the finalize; until then a create above 256 GiB is refused (`SIZE_REQUIRES_FORMAT_LEVEL_1`, exit 78, + naming `sw-block cluster finalize-format`), as is its cluster-spec import. Until every host runs v1.1, create no volume above 256 GiB: a + v1.0.x holder checks a commit's chunks inside its 2 s HEAD update, which such a volume can outrun. Starting a + volume grows with its size: attach about 1.4 ms per GiB (about 4 s at 1 TiB; heap about 50 MB per TiB) and a + restart after a kill about 1.5 ms per GiB (about 2.1 s at 1 TiB), both inside the 30 s startup window. - The host limiter's cut hold (with `--host-limit-dir` set; the limiter is off by default) is a no-progress window: a held slot is revoked only after `--host-limit-no-progress` (default 60 s) passes with no progress of its cut (a chunk compared, staged or uploaded), instead of at a fixed 5 minutes of age. `--host-limit-max-hold` is kept as a @@ -60,7 +67,8 @@ These notes collect v1.1's changes as they land; v1.1 is not released. - The finalize is one-way. Afterwards a v1.0.x blockmaster refuses to start on the store, and a v1.0.x holder that meets a volume v1.1 has opened refuses it and writes nothing to it, but exits with a status its systemd unit treats as retryable, so the unit restarts it until its start limit. With its local store it answers `invalid - superblock`; without one, `HEAD written by a newer version` (v1.0.0 and v1.0.1 report that HEAD as malformed). + superblock`. Without one, the master's grant gate refuses it first: its binary does not report the cluster's + format level, so it gets no assignment, never reads HEAD, and exits 75 (retryable). None of these means damage: do not rebuild the volume; start v1.1 again. - After the finalize, a host whose binary does not read v1.1 is refused (`binary_too_old`) and gets no volume. A move onto such a host is refused with the typed reason `BINARY_TOO_OLD` (`reason` in diff --git a/seaweed-block/docs/standalone-deployment.md b/seaweed-block/docs/standalone-deployment.md index a287e4ff89..9e50c2d8b1 100644 --- a/seaweed-block/docs/standalone-deployment.md +++ b/seaweed-block/docs/standalone-deployment.md @@ -330,9 +330,9 @@ RF1 volume can use its static observation controller with the loop off. Turning the loop off later does not stop volumes already assigned; identical create and placement retries keep their existing result and conflict rules. -New volumes are limited to **256 GiB** (274877906944 bytes). A larger create +New volumes are limited to **1 TiB** (1099511627776 bytes). A larger create is refused with exit 78; its diagnostic includes `volume too large` and -`exceeds the maximum of 274877906944 bytes`. No binding or placement follows. +`exceeds the maximum of 1099511627776 bytes`. No binding or placement follows. To abandon the volume after creation or binding, delete the volume that never served: