mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
--durable-impl now defaults to empty (auto). A new volume is created as walstore. An existing volume opens with the implementation its on-disk superblock names, so volumes created under the old smartwal default keep opening (no ImplKindMismatch on upgrade). An explicit selector keeps the exact ErrImplKindMismatch refusal, and an unrecognized on-disk format is still refused. - core/frontend/durable: ImplAuto (the zero value) is resolved per volume in openOrCreate; openExisting/createFresh take the resolved implementation, and each volume handle records it, so DurableStatuses reports the on-disk implementation. ImplSmartWAL is documented as experimental; the 'production default' comments are removed. - cmd/blockvolume: --durable-impl default '' with help text 'auto'; smartwal (experimental). The walstore-only options still require an explicit --durable-impl=walstore. - README: smartwal listed under 'Not claimed yet' with its open issues. Tests: auto creates walstore; auto opens existing smartwal, walstore and parallel-walstore volumes by their on-disk format; auto refuses an unrecognized file; the flag default is empty; explicit values accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package main
|
|
|
|
import "testing"
|
|
|
|
// --durable-impl defaults to empty (auto): new volumes are walstore, and an
|
|
// existing volume opens with its on-disk format. smartwal is experimental
|
|
// and only used when chosen explicitly or found on disk.
|
|
func TestBlockvolumeDurableImplDefaultIsAuto(t *testing.T) {
|
|
f, err := parseFlags(phase150RequiredBlockvolumeArgs())
|
|
if err != nil {
|
|
t.Fatalf("parseFlags: %v", err)
|
|
}
|
|
if f.durableImpl != "" {
|
|
t.Fatalf("durableImpl default=%q, want empty (auto)", f.durableImpl)
|
|
}
|
|
}
|
|
|
|
func TestBlockvolumeDurableImplExplicitValues(t *testing.T) {
|
|
for _, impl := range []string{"walstore", "smartwal", "parallel-walstore"} {
|
|
args := append(phase150RequiredBlockvolumeArgs(), "--durable-root=/tmp/sw-block", "--durable-impl="+impl)
|
|
f, err := parseFlags(args)
|
|
if err != nil {
|
|
t.Fatalf("--durable-impl=%s: %v", impl, err)
|
|
}
|
|
if f.durableImpl != impl {
|
|
t.Fatalf("durableImpl=%q, want %q", f.durableImpl, impl)
|
|
}
|
|
}
|
|
args := append(phase150RequiredBlockvolumeArgs(), "--durable-impl=bogus")
|
|
if _, err := parseFlags(args); err == nil {
|
|
t.Fatal("--durable-impl=bogus accepted")
|
|
}
|
|
}
|