mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c624372936 | ||
|
|
fc4c4ae546 | ||
|
|
41eab1edb6 | ||
|
|
83545dc103 | ||
|
|
16e8cce859 | ||
|
|
a2b8926092 | ||
|
|
5491d95f40 | ||
|
|
55f0ea1439 | ||
|
|
30710c46a6 | ||
|
|
f6588ff84c | ||
|
|
5f4e92da5c | ||
|
|
acc22a4270 | ||
|
|
e17e30b4aa | ||
|
|
f92efd4437 | ||
|
|
fe2d016c41 | ||
|
|
cf3eda7e57 | ||
|
|
68d56d8ff8 | ||
|
|
39f568f614 | ||
|
|
4a58968439 | ||
|
|
f9febc7ee5 | ||
|
|
0ce344d559 |
No files matched your search
+5
-4
@@ -11,14 +11,14 @@ cmd/sw-block/volume_backup.go RestoreCommand.Abort
|
||||
cmd/sw-block/volume_backup.go RestoreCommand.AbortVerify
|
||||
cmd/sw-block/volume_backup.go RestoreCommand.Run
|
||||
cmd/sw-block/volume_backup.go RestoreCommand.Start
|
||||
cmd/sw-block/volume_start_release.go StopAndRestart.CrashRestart
|
||||
cmd/sw-block/volume_start_release.go StopAndRestart.IssueClean
|
||||
cmd/sw-block/volume_start_release.go StopAndRestart.ReadClean
|
||||
cmd/sw-block/volume_start_release.go StopAndRestart.SameEpochReopen
|
||||
cmd/sw-block/volume_verbs.go CutTime.CliGiveUp
|
||||
cmd/sw-block/volume_verbs.go CutTime.Poll
|
||||
cmd/sw-block/workspace_show.go MoveAdmission.ReadForMove
|
||||
core/authority/authority.go DeleteRetire.Retire
|
||||
core/authority/authority_store_file.go DeleteRetire.Retire
|
||||
core/authority/authority.go DeleteRetire.RetireLine
|
||||
core/authority/authority_store_file.go DeleteRetire.RetireLine
|
||||
core/authority/workspace.go HolderInterface.ForcedMove
|
||||
core/authority/workspace.go HolderInterface.PlannedMove
|
||||
core/authority/workspace.go MoveAdmission.Ack
|
||||
@@ -36,7 +36,7 @@ core/authority/workspace_delete_reservation.go MoveAdmission.DelCheck
|
||||
core/authority/workspace_delete_reservation.go MoveAdmission.Reserve
|
||||
core/authority/workspace_lease_view.go HolderInterface.Grant
|
||||
core/authority/workspace_lease_view.go HolderInterface.Regrant
|
||||
core/authority/workspace_retirement.go DeleteRetire.Retire
|
||||
core/authority/workspace_retirement.go DeleteRetire.RetireLine
|
||||
core/engine/apply.go ReplicationPeer.Reconcile
|
||||
core/frontend/chunkstore/catalog_b.go CleanBatch.Publish
|
||||
core/frontend/chunkstore/catalog_b.go CleanBatch.Request
|
||||
@@ -187,6 +187,7 @@ core/frontend/durable/provider_layout.go EngineAdapter.SettleDown
|
||||
core/frontend/durable/provider_layout.go StopAndRestart.SettleDown
|
||||
core/frontend/durable/provider_preempt.go CutTime.Preempt
|
||||
core/frontend/durable/provider_preempt.go CutTime.Settle
|
||||
core/frontend/durable/provider_seal_replay.go PlainSealReplay.Reply
|
||||
core/frontend/durable/storage_adapter.go EngineAdapter.GuestWrite
|
||||
core/frontend/durable/storage_adapter.go HolderInterface.Write
|
||||
core/frontend/durable/storage_adapter.go WALHold.Resubmit
|
||||
|
||||
|
@@ -0,0 +1,91 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/host/master"
|
||||
"github.com/seaweedfs/seaweed-block/core/lifecycle"
|
||||
)
|
||||
|
||||
// Re-importing the same declarative spec must preserve the durable records,
|
||||
// including the registration observation time. This checks replacement, not
|
||||
// just equal JSON: an identical rewrite still pays the durability barriers.
|
||||
func TestUnchangedSpecRestartKeepsAll999ImportRecords(t *testing.T) {
|
||||
const count = 999
|
||||
authorityDir, lifecycleDir := t.TempDir(), t.TempDir()
|
||||
open := func() *master.Host {
|
||||
t.Helper()
|
||||
h, err := master.New(master.Config{Listen: "127.0.0.1:0", AuthorityStoreDir: authorityDir, LifecycleStoreDir: lifecycleDir})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return h
|
||||
}
|
||||
closeHost := func(h *master.Host) {
|
||||
t.Helper()
|
||||
h.Start()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
if err := h.Close(ctx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
nodes := make([]lifecycle.NodeRegistration, count)
|
||||
intents := make([]lifecycle.PlacementIntent, count)
|
||||
for i := range nodes {
|
||||
id := fmt.Sprintf("n%04d", i)
|
||||
nodes[i] = lifecycle.NodeRegistration{ServerID: id, Addr: "127.0.0.1:19001"}
|
||||
intents[i] = lifecycle.PlacementIntent{VolumeID: fmt.Sprintf("v%04d", i), DesiredRF: 1, Slots: []lifecycle.PlacementSlotIntent{{ServerID: id, ReplicaID: "r1", Source: lifecycle.PlacementSourceExistingReplica}}}
|
||||
}
|
||||
importSpec := func(h *master.Host) {
|
||||
t.Helper()
|
||||
if err := importLifecycleNodeInventory(h, nodes); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := importLifecyclePlacementIntents(h, intents); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
h := open()
|
||||
importSpec(h)
|
||||
closeHost(h)
|
||||
before := make(map[string]os.FileInfo, 2*count)
|
||||
for _, kind := range []string{"nodes", "placements"} {
|
||||
entries, err := os.ReadDir(filepath.Join(lifecycleDir, kind))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(entries) != count {
|
||||
t.Fatalf("%s records=%d, want %d", kind, len(entries), count)
|
||||
}
|
||||
for _, entry := range entries {
|
||||
path := filepath.Join(lifecycleDir, kind, entry.Name())
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
before[path] = info
|
||||
}
|
||||
}
|
||||
h = open()
|
||||
importSpec(h)
|
||||
closeHost(h)
|
||||
rewritten := map[string]int{}
|
||||
for path, info := range before {
|
||||
after, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !os.SameFile(info, after) || !info.ModTime().Equal(after.ModTime()) {
|
||||
rewritten[filepath.Base(filepath.Dir(path))]++
|
||||
}
|
||||
}
|
||||
if rewritten["nodes"] != 0 || rewritten["placements"] != 0 {
|
||||
t.Fatalf("unchanged restart replaced records: nodes=%d placements=%d; want zero", rewritten["nodes"], rewritten["placements"])
|
||||
}
|
||||
}
|
||||
@@ -274,6 +274,7 @@ func run(f flags) int {
|
||||
fmt.Fprintln(os.Stderr, "blockmaster: dynamic lifecycle topology enabled by cluster-spec node inventory; assignments will be derived from verified placement intents")
|
||||
}
|
||||
cfg := master.Config{
|
||||
FailStopLifecycleWrites: true,
|
||||
EphemeralLauncherState: (f.launcherManifestDir != "" || f.launcherKubernetesApply) && f.launcherStateHostPath == "",
|
||||
AuthorityStoreDir: f.authorityStore,
|
||||
LifecycleStoreDir: f.lifecycleStore,
|
||||
@@ -339,6 +340,7 @@ func run(f flags) int {
|
||||
fmt.Fprintln(os.Stderr, "blockmaster:", err)
|
||||
return 1
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "blockmaster: lifecycle import durability: %s\n", lifecycle.ImportDurabilityMode(f.lifecycleStore))
|
||||
// Every promotion decides on the probe round's answers: each candidate
|
||||
// answers a fresh round over its authenticated node stream.
|
||||
h.SetPromotionEvidenceProvider(h.NewRoundPromotionEvidenceProvider(f.launcherReplicationAck, nil))
|
||||
@@ -478,10 +480,8 @@ func importLifecycleNodeInventory(h *master.Host, nodes []lifecycle.NodeRegistra
|
||||
if stores == nil {
|
||||
return fmt.Errorf("lifecycle node import requires --lifecycle-store")
|
||||
}
|
||||
for _, node := range nodes {
|
||||
if _, err := stores.Nodes.RegisterNode(node); err != nil {
|
||||
return fmt.Errorf("register lifecycle node %s: %w", node.ServerID, err)
|
||||
}
|
||||
if err := stores.Nodes.ImportNodes(nodes); err != nil {
|
||||
return fmt.Errorf("import lifecycle nodes: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -510,6 +510,7 @@ func importLifecyclePlacementIntents(h *master.Host, intents []lifecycle.Placeme
|
||||
if stores == nil {
|
||||
return fmt.Errorf("lifecycle placement import requires --lifecycle-store")
|
||||
}
|
||||
plans := make([]lifecycle.PlacementPlan, 0, len(intents))
|
||||
for _, intent := range intents {
|
||||
if stores.Deletions.Reserved(intent.VolumeID) {
|
||||
continue // never placed again (see importLifecycleVolumes)
|
||||
@@ -528,9 +529,10 @@ func importLifecyclePlacementIntents(h *master.Host, intents []lifecycle.Placeme
|
||||
Source: slot.Source,
|
||||
})
|
||||
}
|
||||
if _, err := stores.Placements.ApplyPlan(plan); err != nil {
|
||||
return fmt.Errorf("apply lifecycle placement seed %s: %w", intent.VolumeID, err)
|
||||
}
|
||||
plans = append(plans, plan)
|
||||
}
|
||||
if err := stores.Placements.ImportPlans(plans); err != nil {
|
||||
return fmt.Errorf("import lifecycle placement seeds: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
// only a host that holds no volume: a retired id is then unregistered, so a
|
||||
// holder RPC under it is refused (refuseWorkspaceHolderHost) and the checks
|
||||
// only get stricter. This guard fails when any other non-test caller of
|
||||
// RegisterNode or RemoveNode appears anywhere.
|
||||
// RegisterNode, ImportNodes or RemoveNode appears anywhere.
|
||||
func TestNodeRegistryIsWrittenOnlyAtStartup(t *testing.T) {
|
||||
root, err := filepath.Abs(filepath.Join("..", ".."))
|
||||
if err != nil {
|
||||
@@ -56,7 +56,7 @@ func TestNodeRegistryIsWrittenOnlyAtStartup(t *testing.T) {
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
if sel, ok := call.Fun.(*ast.SelectorExpr); ok && (sel.Sel.Name == "RegisterNode" || sel.Sel.Name == "RemoveNode") {
|
||||
if sel, ok := call.Fun.(*ast.SelectorExpr); ok && (sel.Sel.Name == "RegisterNode" || sel.Sel.Name == "ImportNodes" || sel.Sel.Name == "RemoveNode") {
|
||||
sites = append(sites, filepath.ToSlash(rel)+":"+fn.Name.Name+"."+sel.Sel.Name)
|
||||
}
|
||||
return true
|
||||
@@ -68,7 +68,7 @@ func TestNodeRegistryIsWrittenOnlyAtStartup(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
sort.Strings(sites)
|
||||
want := []string{"cmd/blockmaster/main.go:importLifecycleNodeInventory.RegisterNode", "core/host/master/format_gate.go:RetireHost.RemoveNode"}
|
||||
want := []string{"cmd/blockmaster/main.go:importLifecycleNodeInventory.ImportNodes", "core/host/master/format_gate.go:RetireHost.RemoveNode"}
|
||||
if strings.Join(sites, ",") != strings.Join(want, ",") {
|
||||
t.Fatalf("node registry writers = %v, want only %v: an adder after start, or another remover, breaks the identity checks' assumption", sites, want)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
//go:build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/host/master"
|
||||
"github.com/seaweedfs/seaweed-block/core/lifecycle"
|
||||
)
|
||||
|
||||
func TestMasterImportPersistenceFailureExitsAndRecovers(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
nodeDir := filepath.Join(root, "lifecycle", "nodes")
|
||||
store, err := lifecycle.OpenNodeInventoryStore(nodeDir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
old := lifecycle.NodeRegistration{ServerID: "kept", Addr: "127.0.0.1:19001"}
|
||||
old, err = store.RegisterNode(old)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// A real rename failure, even as root; the preceding committed record
|
||||
// stays untouched. Directories are not parsed as JSON records on reload.
|
||||
block := filepath.Join(nodeDir, "new.json")
|
||||
if err := os.Mkdir(block, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(block, "blocker"), []byte("fixture"), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
spec := filepath.Join(root, "spec.yaml")
|
||||
if err := os.WriteFile(spec, []byte("nodes:\n - server_id: new\n addr: 127.0.0.1:19002\n"), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
args := []string{"--listen", "127.0.0.1:0", "--authority-store", filepath.Join(root, "authority"), "--lifecycle-store", filepath.Join(root, "lifecycle"), "--cluster-spec", spec}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestGuardHelperProcess$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), guardHelperEnv+"="+strings.Join(args, guardHelperSep))
|
||||
out, runErr := cmd.CombinedOutput()
|
||||
var exit *exec.ExitError
|
||||
if ctx.Err() != nil || !errors.As(runErr, &exit) || exit.ExitCode() != 1 {
|
||||
t.Fatalf("master did not fail-stop with exit1: %v context=%v\n%s", runErr, ctx.Err(), out)
|
||||
}
|
||||
text := string(out)
|
||||
if strings.Count(text, "exiting so the supervisor restarts from durable state") != 1 || !strings.Contains(text, "ERROR") || !strings.Contains(text, "new.json") || !strings.Contains(text, nodeDir) {
|
||||
t.Fatalf("missing single persistence ERROR: %s", text)
|
||||
}
|
||||
oldRaw, err := json.Marshal(old)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
recovery := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestMasterImportPersistenceRecoveryChild$", "-test.timeout=8s")
|
||||
recovery.Env = append(os.Environ(), "MASTER_RECOVERY_ROOT="+root, "MASTER_RECOVERY_OLD="+string(oldRaw))
|
||||
if out, err := recovery.CombinedOutput(); err != nil {
|
||||
t.Fatalf("bounded recovery: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMasterImportPersistenceRecoveryChild(t *testing.T) {
|
||||
root := os.Getenv("MASTER_RECOVERY_ROOT")
|
||||
if root == "" {
|
||||
t.Skip("bounded recovery subprocess")
|
||||
}
|
||||
nodeDir := filepath.Join(root, "lifecycle", "nodes")
|
||||
var old lifecycle.NodeRegistration
|
||||
if err := json.Unmarshal([]byte(os.Getenv("MASTER_RECOVERY_OLD")), &old); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// A new master must load the complete committed record, not a speculative
|
||||
// new registration or partial JSON from the failed write.
|
||||
h, err := master.New(master.Config{Listen: "127.0.0.1:0", AuthorityStoreDir: filepath.Join(root, "authority"), LifecycleStoreDir: filepath.Join(root, "lifecycle")})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
h.Start()
|
||||
t.Cleanup(func() {
|
||||
closeCtx, stop := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer stop()
|
||||
if err := h.Close(closeCtx); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
if got, ok := h.Lifecycle().Nodes.GetNodeSnapshot("kept"); !ok || got.ServerID != old.ServerID || got.Addr != old.Addr || !got.SeenAt.Equal(old.SeenAt) {
|
||||
t.Fatalf("committed record lost on restart: %+v %v", got, ok)
|
||||
}
|
||||
if _, ok := h.Lifecycle().Nodes.GetNodeSnapshot("new"); ok {
|
||||
t.Fatal("failed record appeared on restart")
|
||||
}
|
||||
entries, err := os.ReadDir(nodeDir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, entry := range entries {
|
||||
if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".json") {
|
||||
raw, err := os.ReadFile(filepath.Join(nodeDir, entry.Name()))
|
||||
if err != nil || !json.Valid(raw) {
|
||||
t.Fatalf("partial record %s: %v", entry.Name(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,13 +26,6 @@ import (
|
||||
// refuses an interval above half the freshness window (a longer loop gap
|
||||
// reads as the master's own pause), so the window is 60 s: the dead
|
||||
// primary's loss then comes at most a window after its last report.
|
||||
//
|
||||
// The failover is predicted within gapLoop + gapWindow + gapLoop of the
|
||||
// kill: the tick that ends creation comes at most a loop after it, the
|
||||
// loss a window after that tick's silence floor, and the tick that reads
|
||||
// the loss at most a loop later. The test waits twice that.
|
||||
const gapLoop, gapWindow = 30 * time.Second, 60 * time.Second
|
||||
|
||||
func TestAVolumeThatServedBeforeItsFirstGateTickFailsOver(t *testing.T) {
|
||||
bins := buildG54Binaries(t)
|
||||
h := &plannedHandoffHarness{dir: t.TempDir(), t: t}
|
||||
@@ -55,8 +48,8 @@ func TestAVolumeThatServedBeforeItsFirstGateTickFailsOver(t *testing.T) {
|
||||
}
|
||||
master := h.start(t, "blockmaster", bins.master,
|
||||
"--authority-store", filepath.Join(h.dir, "master", "authority"), "--lifecycle-store", filepath.Join(h.dir, "master", "lifecycle"),
|
||||
"--cluster-spec", spec, "--expected-slots-per-volume", "3", "--lifecycle-product-loop-interval", gapLoop.String(),
|
||||
"--freshness-window", gapWindow.String(), "--launcher-replication-ack", "sync-quorum", "--listen", h.masterAddr)
|
||||
"--cluster-spec", spec, "--expected-slots-per-volume", "3", "--lifecycle-product-loop-interval", "30s",
|
||||
"--freshness-window", "60s", "--launcher-replication-ack", "sync-quorum", "--listen", h.masterAddr)
|
||||
master.waitLog(t, 30*time.Second, "blockmaster: lock acquired")
|
||||
for _, b := range hosts {
|
||||
lockDir := b.root + ".locks"
|
||||
@@ -91,8 +84,7 @@ func TestAVolumeThatServedBeforeItsFirstGateTickFailsOver(t *testing.T) {
|
||||
// 3. The next tick reads the survivors' write: creation ended, and the
|
||||
// gate fails the volume over.
|
||||
var p2 *host
|
||||
predicted := gapLoop + gapWindow + gapLoop
|
||||
poll(t, 2*predicted, fmt.Sprintf("no survivor became primary at epoch 2 within %v, twice the predicted %v (the volume held as creating, or the gate's replace not acted on: see the master's 'decision=replace' lines)", 2*predicted, predicted), func() bool {
|
||||
poll(t, 120*time.Second, "no survivor became primary at epoch 2 (the volume held as creating?)", func() bool {
|
||||
for _, b := range survivors {
|
||||
if statusIsPrimaryAt(b.status, 2) {
|
||||
p2 = b
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
//go:build linux && subprocess && chunkstore_integration
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/rpc/control"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// A master restart must not replace live holders while rebuilding its
|
||||
// heartbeat view. Registration time is deliberately older than the window;
|
||||
// only the new process's received heartbeats make its node evidence fresh.
|
||||
func TestMasterImportRestartKeepsLiveHoldersAcrossFreshnessWindow(t *testing.T) {
|
||||
const window = 6 * time.Second
|
||||
env := startHandoffEnvVolumes(t, 1, []string{"v2"}, "--freshness-window", window.String(), "--lifecycle-product-loop-interval", "100ms")
|
||||
env.volExtra = append(env.volExtra, "--heartbeat-interval", "250ms")
|
||||
for id, volume := range map[string]string{"s1": "v1", "n-v2": "v2"} {
|
||||
host := env.hosts[id]
|
||||
host.volume, host.replica = volume, "r1"
|
||||
env.hosts[id] = host
|
||||
}
|
||||
first, second := f1Up(t, env, "s1"), f1Up(t, env, "n-v2")
|
||||
epochs := map[string]uint64{}
|
||||
for volume, holder := range map[string]*daemon{"v1": first, "v2": second} {
|
||||
epoch, err := adoptedEpochOf(volume, holder.line("blockvolume: volume "+volume+" adopted as PRIMARY at r1@"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
epochs[volume] = epoch
|
||||
}
|
||||
// Both durable registrations now age beyond freshness while holders keep
|
||||
// reporting; a restart must not renew these durable observation times.
|
||||
time.Sleep(window + 100*time.Millisecond)
|
||||
env.masterProcess.term(t, 10*time.Second)
|
||||
started := time.Now()
|
||||
env.masterProcess = env.h.start(t, "blockmaster-import-restarted", env.h.master, env.masterArgs...)
|
||||
conn, err := grpc.NewClient(env.h.masterAddr, env.masterDialOption(t, "admin"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer conn.Close()
|
||||
client := control.NewClusterEvidenceServiceClient(conn)
|
||||
fresh := map[string]bool{}
|
||||
verified := map[string]bool{}
|
||||
observed := map[string]bool{}
|
||||
samples := 0
|
||||
for time.Since(started) < window {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
status, err := client.GetClusterStatus(ctx, &control.GetClusterStatusRequest{})
|
||||
cancel()
|
||||
if err == nil {
|
||||
samples++
|
||||
for _, node := range status.Nodes {
|
||||
if at := node.GetLastHeartbeatAt(); at != nil && at.AsTime().After(started) {
|
||||
fresh[node.GetNodeName()] = true
|
||||
}
|
||||
}
|
||||
for _, volume := range status.Volumes {
|
||||
if epoch, ok := epochs[volume.VolumeId]; ok && volume.Epoch != 0 {
|
||||
observed[volume.VolumeId] = true
|
||||
if volume.Epoch != epoch {
|
||||
t.Fatalf("%s changed epoch after restart: %d -> %d", volume.VolumeId, epoch, volume.Epoch)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, event := range status.Events {
|
||||
if event.EventType == "placement_verified" {
|
||||
verified[event.VolumeId] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, bad := range []string{"primary lost:", "decision=replace("} {
|
||||
if env.masterProcess.has(bad) {
|
||||
t.Fatalf("live-holder restart made a loss/replacement decision: %s", bad)
|
||||
}
|
||||
}
|
||||
for id, d := range map[string]*daemon{"s1": first, "n-v2": second} {
|
||||
select {
|
||||
case <-d.done:
|
||||
t.Fatalf("live holder %s exited during master restart: %v", id, d.err)
|
||||
default:
|
||||
}
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
if samples == 0 {
|
||||
t.Fatal("no successful status sample in the freshness window")
|
||||
}
|
||||
for _, id := range []string{"s1", "n-v2"} {
|
||||
if !fresh[id] {
|
||||
t.Fatalf("live node %s never became fresh after restart", id)
|
||||
}
|
||||
}
|
||||
for id := range epochs {
|
||||
if !observed[id] {
|
||||
t.Fatalf("volume %s never showed its authoritative epoch again", id)
|
||||
}
|
||||
if !verified[id] {
|
||||
t.Fatalf("placement %s did not verify again within one window", id)
|
||||
}
|
||||
}
|
||||
for _, id := range []string{"s1", "n-v2"} {
|
||||
block := pattern("restart-live-io!")
|
||||
env.writeBlock(t, id, 0, block)
|
||||
}
|
||||
t.Logf("master restart: %d status samples, both nodes fresh, both placements verified, no loss/replacement or holder exit within %s", samples, window)
|
||||
}
|
||||
@@ -32,7 +32,6 @@ type TopologyController struct {
|
||||
unsupported map[string]UnsupportedEvidence
|
||||
convergenceStuck map[string]*ConvergenceStuckEvidence
|
||||
bootGrace map[string]*primaryBootGrace // volume/replica -> current incarnation's grace
|
||||
outcome map[string]string // volume -> what the last intake did with it (LastOutcome); kept like bootGrace
|
||||
now func() time.Time
|
||||
}
|
||||
|
||||
@@ -45,21 +44,10 @@ func NewTopologyController(config TopologyControllerConfig, reader AuthorityBasi
|
||||
unsupported: make(map[string]UnsupportedEvidence),
|
||||
convergenceStuck: make(map[string]*ConvergenceStuckEvidence),
|
||||
bootGrace: make(map[string]*primaryBootGrace),
|
||||
outcome: make(map[string]string),
|
||||
now: time.Now,
|
||||
}
|
||||
}
|
||||
|
||||
// LastOutcome says what the last snapshot intake that carried the volume
|
||||
// as supported did with it: the ask it enqueued, or why it enqueued none
|
||||
// ("" before any). The master logs it beside a promotion gate's replace
|
||||
// decision, so a decision the controller did not act on says why.
|
||||
func (c *TopologyController) LastOutcome(volumeID string) string {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
return c.outcome[volumeID]
|
||||
}
|
||||
|
||||
// SetNowForTest overrides the controller's clock source. Tests
|
||||
// use this to drive RetryWindow / Stuck transitions deterministically.
|
||||
// Production code MUST NOT call this.
|
||||
@@ -137,21 +125,6 @@ func (c *TopologyController) SubmitClusterSnapshot(snap ClusterSnapshot) error {
|
||||
// desired state live; SubmitObservedState always processes the
|
||||
// report.
|
||||
func (c *TopologyController) SubmitObservedState(snap ClusterSnapshot, report SupportabilityReport) error {
|
||||
return c.submitObservedState(snap, report, nil)
|
||||
}
|
||||
|
||||
// SubmitObservedStateOutcomes is SubmitObservedState that also returns what
|
||||
// this intake did with each volume it carried (supported, pending or
|
||||
// unsupported), read while the intake still holds the controller's lock: a
|
||||
// later intake (the background observation host shares the controller)
|
||||
// cannot change it. A volume this intake did not carry has no entry.
|
||||
func (c *TopologyController) SubmitObservedStateOutcomes(snap ClusterSnapshot, report SupportabilityReport) (map[string]string, error) {
|
||||
out := map[string]string{}
|
||||
err := c.submitObservedState(snap, report, out)
|
||||
return out, err
|
||||
}
|
||||
|
||||
func (c *TopologyController) submitObservedState(snap ClusterSnapshot, report SupportabilityReport, outcomes map[string]string) error {
|
||||
// Validate non-empty supported snapshots the same way
|
||||
// SubmitClusterSnapshot does. Empty supported + empty report
|
||||
// is allowed (no-op).
|
||||
@@ -190,7 +163,6 @@ func (c *TopologyController) submitObservedState(snap ClusterSnapshot, report Su
|
||||
// stale unsupported record from a prior build is cleared,
|
||||
// because pending is a transitional state, not a fault.
|
||||
delete(c.unsupported, vid)
|
||||
c.outcome[vid] = "no ask: supportability pending"
|
||||
}
|
||||
for vid, ev := range report.Unsupported {
|
||||
c.clearDesiredLocked(vid)
|
||||
@@ -208,7 +180,6 @@ func (c *TopologyController) submitObservedState(snap ClusterSnapshot, report Su
|
||||
Basis: AuthorityBasis{},
|
||||
Reason: joinReasons(ev.Reasons),
|
||||
}
|
||||
c.outcome[vid] = "no ask: unsupported: " + joinReasons(ev.Reasons)
|
||||
}
|
||||
|
||||
// Process supported volumes via the existing decision path.
|
||||
@@ -225,17 +196,6 @@ func (c *TopologyController) submitObservedState(snap ClusterSnapshot, report Su
|
||||
currentLine, hasLine := c.reader.VolumeAuthorityLine(vol.VolumeID)
|
||||
c.processSupportedVolumeLocked(vol, snap, serverIndex, currentLine, hasLine, currentLoad, projectedLoad)
|
||||
}
|
||||
if outcomes != nil {
|
||||
for vid := range report.Pending {
|
||||
outcomes[vid] = c.outcome[vid]
|
||||
}
|
||||
for vid := range report.Unsupported {
|
||||
outcomes[vid] = c.outcome[vid]
|
||||
}
|
||||
for _, vol := range volumes {
|
||||
outcomes[vol.VolumeID] = c.outcome[vol.VolumeID]
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -292,13 +252,11 @@ func (c *TopologyController) processSupportedVolumeLocked(
|
||||
if vol.Authority.Assigned && !volumeIncludesReplica(vol, vol.Authority.ReplicaID) {
|
||||
c.recordUnsupportedLocked(vol.VolumeID, snap, vol.Authority, "snapshot authority outside accepted topology: "+vol.Authority.ReplicaID)
|
||||
c.clearDesiredLocked(vol.VolumeID)
|
||||
c.outcome[vol.VolumeID] = "no ask: snapshot authority outside accepted topology"
|
||||
return
|
||||
}
|
||||
if hasLine && !volumeIncludesReplica(vol, currentLine.ReplicaID) {
|
||||
c.recordUnsupportedLocked(vol.VolumeID, snap, currentLine, "publisher authority on replica outside accepted topology: "+currentLine.ReplicaID)
|
||||
c.clearDesiredLocked(vol.VolumeID)
|
||||
c.outcome[vol.VolumeID] = "no ask: publisher authority outside accepted topology"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -311,20 +269,17 @@ func (c *TopologyController) processSupportedVolumeLocked(
|
||||
// Stale snapshot: do not emit from a stale basis, but keep any
|
||||
// existing desired (publish-until-observed convergence record).
|
||||
if !basisMatchesLine(vol.Authority, currentLine, hasLine) {
|
||||
c.outcome[vol.VolumeID] = fmt.Sprintf("no ask: stale snapshot basis %s@%d, line %s@%d", vol.Authority.ReplicaID, vol.Authority.Epoch, currentLine.ReplicaID, currentLine.Epoch)
|
||||
return
|
||||
}
|
||||
// Stale slot facts: likewise keep any existing desired and emit
|
||||
// nothing from this snapshot.
|
||||
if staleFacts {
|
||||
c.outcome[vol.VolumeID] = "no ask: superseded slot facts"
|
||||
return
|
||||
}
|
||||
|
||||
ask, reason, emit := c.decideVolume(vol, serverIndex, currentLine, hasLine, currentLoad, projectedLoad)
|
||||
if !emit {
|
||||
c.clearDesiredLocked(vol.VolumeID)
|
||||
c.outcome[vol.VolumeID] = "no ask: " + reason
|
||||
return
|
||||
}
|
||||
// Same-ask dedupe: if the identical ask is already the current
|
||||
@@ -332,7 +287,6 @@ func (c *TopologyController) processSupportedVolumeLocked(
|
||||
// identical supported feeds would mint a new Reassign epoch
|
||||
// each iteration — authority churn.
|
||||
if prev, ok := c.desired[vol.VolumeID]; ok && sameAsk(prev.Ask, ask) {
|
||||
c.outcome[vol.VolumeID] = fmt.Sprintf("already desired since %s: %s %s (%s)", prev.DesiredAt.UTC().Format(time.RFC3339Nano), ask.Intent, ask.ReplicaID, prev.Reason)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -354,7 +308,6 @@ func (c *TopologyController) processSupportedVolumeLocked(
|
||||
}
|
||||
c.desired[vol.VolumeID] = desired
|
||||
c.queue.enqueue(ask)
|
||||
c.outcome[vol.VolumeID] = fmt.Sprintf("enqueued %s %s (%s)", ask.Intent, ask.ReplicaID, reason)
|
||||
applyProjectedMove(projectedLoad, vol, currentLine, hasLine, ask)
|
||||
}
|
||||
|
||||
@@ -519,7 +472,7 @@ func (c *TopologyController) decideVolume(
|
||||
if !hasLine {
|
||||
cands := placeableCandidates(vol, serverIndex)
|
||||
if len(cands) == 0 {
|
||||
return AssignmentAsk{}, "no placeable candidate for the first line", false
|
||||
return AssignmentAsk{}, "", false
|
||||
}
|
||||
best := choosePlacementCandidate(cands, projectedLoad)
|
||||
return AssignmentAsk{
|
||||
@@ -534,7 +487,7 @@ func (c *TopologyController) decideVolume(
|
||||
|
||||
current, ok := candidateByReplica(vol, currentLine.ReplicaID)
|
||||
if !ok {
|
||||
return AssignmentAsk{}, "the line's replica is not in the snapshot", false
|
||||
return AssignmentAsk{}, "", false
|
||||
}
|
||||
|
||||
if candidateAcceptable(current, serverIndex) {
|
||||
@@ -547,7 +500,7 @@ func (c *TopologyController) decideVolume(
|
||||
// current primary is alive, so it is a planned move: the same
|
||||
// guard as a failback (the target in every acknowledgement set).
|
||||
if target.PromotionEvidence.Kind != adapter.PrimaryKindPromotion || !target.PlannedMoveAllowed {
|
||||
return AssignmentAsk{}, "the current primary is acceptable; rebalance target " + target.ReplicaID + " has no planned-move evidence", false
|
||||
return AssignmentAsk{}, "", false
|
||||
}
|
||||
return AssignmentAsk{
|
||||
VolumeID: vol.VolumeID,
|
||||
@@ -559,7 +512,7 @@ func (c *TopologyController) decideVolume(
|
||||
Incarnation: target.Incarnation,
|
||||
}, "rebalance", true
|
||||
}
|
||||
return AssignmentAsk{}, "the current primary is acceptable", false
|
||||
return AssignmentAsk{}, "", false
|
||||
}
|
||||
|
||||
// A restarted current primary that is placeable but not ready yet
|
||||
@@ -569,13 +522,9 @@ func (c *TopologyController) decideVolume(
|
||||
if !superseded && endpointStale(current, currentLine) {
|
||||
return refreshAsk(vol.VolumeID, current, currentLine), "endpoint refresh (primary boot grace)", true
|
||||
}
|
||||
if superseded {
|
||||
return AssignmentAsk{}, "the current primary holds its boot grace (by its newer recorded fact)", false
|
||||
}
|
||||
return AssignmentAsk{}, "the current primary holds its boot grace", false
|
||||
return AssignmentAsk{}, "", false
|
||||
}
|
||||
|
||||
why := "no acceptable candidate besides the current primary"
|
||||
other := acceptableCandidatesExcept(vol, serverIndex, current.ReplicaID)
|
||||
if len(other) > 0 {
|
||||
best := chooseFailoverCandidate(other, projectedLoad)
|
||||
@@ -592,7 +541,6 @@ func (c *TopologyController) decideVolume(
|
||||
Incarnation: best.Incarnation,
|
||||
}, "failover", true
|
||||
}
|
||||
why = "failover target " + best.ReplicaID + " has no promotion evidence"
|
||||
}
|
||||
// No promotion-ready peer exists. Keep the current authority endpoint fresh
|
||||
// when the current replica is still reachable/eligible; this preserves
|
||||
@@ -600,7 +548,7 @@ func (c *TopologyController) decideVolume(
|
||||
if candidatePlaceable(current, serverIndex) && endpointStale(current, currentLine) {
|
||||
return refreshAsk(vol.VolumeID, current, currentLine), "endpoint refresh", true
|
||||
}
|
||||
return AssignmentAsk{}, why, false
|
||||
return AssignmentAsk{}, "", false
|
||||
}
|
||||
|
||||
// endpointStale reports whether the current primary's line needs a new
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package master
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/authority"
|
||||
)
|
||||
|
||||
// bindingFailingProbe is switchProbe whose fencing round first makes the
|
||||
// master's workspace binding store fail a write (its file replaced by a
|
||||
// directory, so the write's rename fails), which latches the store
|
||||
// uncertain: every later read answers restart-required. It does this once.
|
||||
type bindingFailingProbe struct {
|
||||
*switchProbe
|
||||
once sync.Once
|
||||
fault func()
|
||||
}
|
||||
|
||||
func (p *bindingFailingProbe) FencePromotionCandidates(volume string, current authority.AuthorityBasis, survivors []PromotionCandidateEvidence) (PromotionProbeResult, error) {
|
||||
p.once.Do(p.fault)
|
||||
return p.switchProbe.FencePromotionCandidates(volume, current, survivors)
|
||||
}
|
||||
|
||||
// A binding store that turns uncertain while the gate probes (the probe runs
|
||||
// without the workspace lock) makes the tick's post-probe binding read fail.
|
||||
// The tick returns the error and its replace decision is reported as not
|
||||
// submitted, with the error, instead of vanishing with the tick.
|
||||
func TestABindingReadFailureAfterTheProbeReportsTheDecisionNotSubmitted(t *testing.T) {
|
||||
buf := &lockedBuffer{}
|
||||
dir := t.TempDir()
|
||||
h := newBootGraceMaster(t, Config{Logger: log.New(buf, "", 0), LifecycleStoreDir: dir})
|
||||
defer closeTestMaster(t, h)
|
||||
base, ok := h.promotionProber.(*switchProbe)
|
||||
if !ok {
|
||||
t.Fatalf("fixture: the master's prober is %T, want *switchProbe", h.promotionProber)
|
||||
}
|
||||
var faultErr error
|
||||
h.SetPromotionEvidenceProvider(&bindingFailingProbe{switchProbe: base, fault: func() {
|
||||
file := filepath.Join(dir, "workspace-bindings", "bindings.json")
|
||||
if err := os.RemoveAll(file); err != nil {
|
||||
faultErr = err
|
||||
return
|
||||
}
|
||||
if err := os.MkdirAll(file, 0o755); err != nil {
|
||||
faultErr = err
|
||||
return
|
||||
}
|
||||
if err := h.lifecycle.WorkspaceBindings.Retire("vol-other", "node-x", 1); err == nil {
|
||||
faultErr = os.ErrInvalid // the write was expected to fail
|
||||
}
|
||||
}})
|
||||
ineligible := restarting
|
||||
ineligible.eligible = false
|
||||
ingestRF3Incarnations(t, h, ineligible, readySlot("r2-a"), readySlot("r3-a"))
|
||||
_, err := h.RunLifecycleProductTick()
|
||||
if faultErr != nil {
|
||||
t.Fatalf("fixture: the binding store did not fail its write: %v", faultErr)
|
||||
}
|
||||
if err == nil || !strings.Contains(err.Error(), "restart required") {
|
||||
t.Fatalf("tick error %v, want the binding store's restart-required error", err)
|
||||
}
|
||||
pattern := `promotion gate volume=vol-rf3 decision=replace\(fenced_at=2\) not submitted: the workspace bindings could not be read after the probe: .*restart required`
|
||||
if !regexp.MustCompile(pattern).MatchString(buf.String()) {
|
||||
t.Fatalf("no log line matching %q:\n%s", pattern, buf.String())
|
||||
}
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
package master
|
||||
|
||||
import (
|
||||
"log"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/adapter"
|
||||
"github.com/seaweedfs/seaweed-block/core/authority"
|
||||
)
|
||||
|
||||
// A replace decision of the promotion gate is followed, on the master's
|
||||
// log, by what became of it: the ask the controller enqueued, why it
|
||||
// enqueued none, or that it was not submitted. A replace the controller
|
||||
// does not act on is otherwise silent until the volume fails to fail over.
|
||||
func TestAReplaceDecisionLogsWhatTheControllerDidWithIt(t *testing.T) {
|
||||
// The gate's replace of the lost r1, fed to a controller bound to r1@1.
|
||||
replaced := func(t *testing.T) (*Host, *lockedBuffer, *authority.TopologyController, authority.ClusterSnapshot) {
|
||||
t.Helper()
|
||||
ctrl, pub, stop := lossCluster(t, authority.TopologyControllerConfig{})
|
||||
stop() // the enqueued ask stays queued: the outcome is the controller's alone
|
||||
h, buf := lossMaster(t, &fenceProbe{plain: lossPlain, fenced: lossFenced})
|
||||
h.ctrl = ctrl
|
||||
snap := lossTicks(h)
|
||||
snap.Volumes[0].Authority, _ = pub.VolumeAuthorityLine("vol-rf3")
|
||||
return h, buf, ctrl, snap
|
||||
}
|
||||
submit := func(t *testing.T, h *Host, ctrl *authority.TopologyController, snap authority.ClusterSnapshot) {
|
||||
t.Helper()
|
||||
outcomes, err := ctrl.SubmitObservedStateOutcomes(snap, authority.SupportabilityReport{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
h.reportReplaces("", nil, outcomes)
|
||||
}
|
||||
want := func(t *testing.T, buf *lockedBuffer, pattern string) {
|
||||
t.Helper()
|
||||
if !regexp.MustCompile(pattern).MatchString(buf.String()) {
|
||||
t.Fatalf("no log line matching %q:\n%s", pattern, buf.String())
|
||||
}
|
||||
}
|
||||
t.Run("enqueued", func(t *testing.T) {
|
||||
h, buf, ctrl, snap := replaced(t)
|
||||
submit(t, h, ctrl, snap)
|
||||
want(t, buf, `promotion gate volume=vol-rf3 decision=replace\(fenced_at=2\) controller: enqueued Reassign r[23] \(failover\)`)
|
||||
})
|
||||
t.Run("the same decision again: already desired", func(t *testing.T) {
|
||||
h, buf, ctrl, snap := replaced(t)
|
||||
submit(t, h, ctrl, snap)
|
||||
h.noteGateReplace("vol-rf3", "replace(fenced_at=2)") // the next tick decides the same
|
||||
submit(t, h, ctrl, snap)
|
||||
want(t, buf, `decision=replace\(fenced_at=2\) controller: already desired since \S+: Reassign r[23] \(failover\)`)
|
||||
})
|
||||
t.Run("not acted on: says why", func(t *testing.T) {
|
||||
h, buf, ctrl, snap := replaced(t)
|
||||
for i := range snap.Volumes[0].Slots {
|
||||
snap.Volumes[0].Slots[i].PromotionEvidence = adapter.PrimaryEvidence{}
|
||||
}
|
||||
submit(t, h, ctrl, snap)
|
||||
want(t, buf, `decision=replace\(fenced_at=2\) controller: no ask: failover target r[23] has no promotion evidence`)
|
||||
})
|
||||
t.Run("not submitted", func(t *testing.T) {
|
||||
h, buf, _, _ := replaced(t)
|
||||
h.reportReplaces("not submitted: the placements changed during the probe", nil, nil)
|
||||
want(t, buf, `decision=replace\(fenced_at=2\) not submitted: the placements changed during the probe`)
|
||||
})
|
||||
t.Run("an intake after the submission does not change its report", func(t *testing.T) {
|
||||
// The background observation host shares the controller: its intake
|
||||
// may land between the tick's submit and the report.
|
||||
h, buf, ctrl, snap := replaced(t)
|
||||
outcomes, err := ctrl.SubmitObservedStateOutcomes(snap, authority.SupportabilityReport{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
stale := snap
|
||||
stale.Volumes = append([]authority.VolumeTopologySnapshot(nil), snap.Volumes...)
|
||||
stale.Volumes[0].Authority.Epoch++ // a basis the publisher does not hold
|
||||
if err := ctrl.SubmitClusterSnapshot(stale); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if o := ctrl.LastOutcome("vol-rf3"); !strings.HasPrefix(o, "no ask: stale snapshot basis") {
|
||||
t.Fatalf("fixture: the intervening intake did not record its own outcome: %q", o)
|
||||
}
|
||||
h.reportReplaces("", nil, outcomes)
|
||||
want(t, buf, `decision=replace\(fenced_at=2\) controller: enqueued Reassign r[23] \(failover\)`)
|
||||
if strings.Contains(buf.String(), "decision=replace(fenced_at=2) controller: no ask: stale") {
|
||||
t.Fatalf("the report took the later intake's outcome:\n%s", buf.String())
|
||||
}
|
||||
})
|
||||
t.Run("a submission that did not carry the volume", func(t *testing.T) {
|
||||
h, buf, _, _ := replaced(t)
|
||||
h.reportReplaces("", nil, map[string]string{})
|
||||
want(t, buf, `decision=replace\(fenced_at=2\) controller: no outcome \(the submission did not carry the volume\)`)
|
||||
})
|
||||
t.Run("one report per decision", func(t *testing.T) {
|
||||
h, buf, ctrl, snap := replaced(t)
|
||||
submit(t, h, ctrl, snap)
|
||||
h.reportReplaces("", nil, nil) // nothing decided since: nothing to report
|
||||
if n := strings.Count(buf.String(), "decision=replace(fenced_at=2) controller:"); n != 1 {
|
||||
t.Fatalf("%d reports of one decision:\n%s", n, buf.String())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// The same through the production tick on the supported gate: an
|
||||
// established volume whose primary turns ineligible is replaced by a fencing
|
||||
// round; the gate's replace is reported with the controller's enqueued
|
||||
// failover, and the publication is logged. The publication line comes from
|
||||
// the publisher's observer after the line is visible, so it is waited for
|
||||
// (bounded); the two lines are not ordered against each other.
|
||||
func TestAProductTickReplaceLogsTheControllerOutcomeAndThePublication(t *testing.T) {
|
||||
buf := &lockedBuffer{}
|
||||
h := newBootGraceMaster(t, Config{Logger: log.New(buf, "", 0)})
|
||||
defer closeTestMaster(t, h)
|
||||
ineligible := restarting
|
||||
ineligible.eligible = false
|
||||
supportedCreatingTick(t, h, ineligible)
|
||||
expectFailoverToR2(t, h, "fenced survivors")
|
||||
for _, pattern := range []string{
|
||||
`promotion gate volume=vol-rf3 decision=replace\(fenced_at=2\) controller: enqueued Reassign r2 \(failover\)`,
|
||||
`blockmaster: volume=vol-rf3 authority reassigned to replica r2 epoch=2 endpoint_version=1 \(Reassign\)`,
|
||||
} {
|
||||
waitLogLine(t, buf, pattern, 5*time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
// waitLogLine waits up to limit for a line of buf matching pattern.
|
||||
func waitLogLine(t *testing.T, buf *lockedBuffer, pattern string, limit time.Duration) {
|
||||
t.Helper()
|
||||
re := regexp.MustCompile(pattern)
|
||||
for end := time.Now().Add(limit); !re.MatchString(buf.String()); time.Sleep(10 * time.Millisecond) {
|
||||
if time.Now().After(end) {
|
||||
t.Fatalf("no log line matching %q within %v:\n%s", pattern, limit, buf.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Every publication is on the master's log, with or without an event log.
|
||||
func TestAPublicationIsLogged(t *testing.T) {
|
||||
h, buf := lossMaster(t, &fenceProbe{})
|
||||
h.recordAuthorityPublishedEvent(authority.PublishEvent{
|
||||
Info: adapter.AssignmentInfo{VolumeID: "vol-rf3", ReplicaID: "r2", Epoch: 2, EndpointVersion: 1},
|
||||
Ask: authority.AssignmentAsk{VolumeID: "vol-rf3", ReplicaID: "r2", Intent: authority.IntentReassign},
|
||||
})
|
||||
if !strings.Contains(buf.String(), "blockmaster: volume=vol-rf3 authority reassigned to replica r2 epoch=2 endpoint_version=1 (Reassign)") {
|
||||
t.Fatalf("publication not logged:\n%s", buf.String())
|
||||
}
|
||||
}
|
||||
@@ -121,6 +121,11 @@ type Config struct {
|
||||
// GET /status/workspace-lease on this loopback address.
|
||||
StatusListen string
|
||||
|
||||
// FailStopLifecycleWrites exits the process on uncertain lifecycle-store
|
||||
// persistence. The supervised blockmaster executable enables it; embedders
|
||||
// that leave it off must reopen a failed store before attempting mutations.
|
||||
FailStopLifecycleWrites bool
|
||||
|
||||
// Logger is used for structured startup and error logging. If
|
||||
// nil, the default log package logger is used.
|
||||
Logger *log.Logger
|
||||
@@ -147,9 +152,8 @@ type Host struct {
|
||||
attest *storeAttestations // primaries' attested write-ACK stores
|
||||
healthMu sync.Mutex // orders replica health events with their accepted heartbeats (#128 rule 6)
|
||||
log *log.Logger
|
||||
gateNoteMu sync.Mutex // guards gateNoteLast and gateReplaces
|
||||
gateNoteMu sync.Mutex // guards gateNoteLast
|
||||
gateNoteLast map[string]string // per kind, the last skip or drop a product-loop tick logged (noteGate)
|
||||
gateReplaces []gateReplace // this tick's replace decisions, reported after the submit (reportReplaces)
|
||||
primaryLossMu sync.Mutex // guards primaryLoss
|
||||
primaryLoss primaryLosses // per volume, the recorded loss of the current primary (primary_loss.go)
|
||||
boot *bootstrap.DurableAuthorityBootstrap
|
||||
@@ -276,6 +280,10 @@ func New(cfg Config) (*Host, error) {
|
||||
if lg == nil {
|
||||
lg = log.Default()
|
||||
}
|
||||
var persistenceFailure lifecycle.PersistenceFailureHandler
|
||||
if cfg.FailStopLifecycleWrites {
|
||||
persistenceFailure = lifecycleFailStop(lg)
|
||||
}
|
||||
|
||||
holder := &publisherHolder{}
|
||||
ctrlCfg := cfg.ControllerConfig
|
||||
@@ -324,9 +332,18 @@ func New(cfg Config) (*Host, error) {
|
||||
// the master's state it reads.
|
||||
lifecycleStores, err := openLifecycleStores(cfg.LifecycleStoreDir)
|
||||
if err != nil {
|
||||
var failure *lifecycle.RecordPersistenceError
|
||||
if persistenceFailure != nil && errors.As(err, &failure) {
|
||||
persistenceFailure(failure)
|
||||
}
|
||||
_ = boot.Close()
|
||||
return nil, fmt.Errorf("master.New: lifecycle stores: %w", err)
|
||||
}
|
||||
if lifecycleStores != nil && persistenceFailure != nil {
|
||||
lifecycleStores.Nodes.SetPersistenceFailureHandler(persistenceFailure)
|
||||
lifecycleStores.Placements.SetPersistenceFailureHandler(persistenceFailure)
|
||||
lifecycleStores.Volumes.SetPersistenceFailureHandler(persistenceFailure)
|
||||
}
|
||||
// A new cluster starts at the current level: with no prior
|
||||
// state in any master store (no authority record reloaded or skipped, no
|
||||
// attestation file, no volume, node, placement or deletion in the
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package master
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/lifecycle"
|
||||
)
|
||||
|
||||
func lifecycleFailStop(logger *log.Logger) lifecycle.PersistenceFailureHandler {
|
||||
var once sync.Once
|
||||
return func(failure *lifecycle.RecordPersistenceError) {
|
||||
once.Do(func() {
|
||||
// Arm termination before touching the logger: its writer or output
|
||||
// mutex may be blocked. ERROR delivery is best effort in that case.
|
||||
time.AfterFunc(time.Second, func() { os.Exit(1) })
|
||||
logger.Printf("ERROR lifecycle persistence failure store=%q record=%q error=%q; exiting so the supervisor restarts from durable state", failure.Store, failure.Record, failure.Err)
|
||||
// A graceful close can wait on the writer that discovered the error.
|
||||
// The supervisor restarts; Open establishes the recovery barriers.
|
||||
os.Exit(1)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
//go:build linux
|
||||
|
||||
package master
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/lifecycle"
|
||||
)
|
||||
|
||||
func TestLifecyclePersistenceFailureStopsTheProcess(t *testing.T) {
|
||||
for _, kind := range []string{"nodes", "placements", "volumes", "concurrent"} {
|
||||
t.Run(kind, func(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLifecyclePersistenceExitChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "LIFECYCLE_EXIT_ROOT="+root, "LIFECYCLE_EXIT_KIND="+kind)
|
||||
out, err := cmd.CombinedOutput()
|
||||
var exit *exec.ExitError
|
||||
if ctx.Err() != nil || !errors.As(err, &exit) || exit.ExitCode() != 1 {
|
||||
t.Fatalf("master failed to exit1: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
text := string(out)
|
||||
record := "new.json"
|
||||
if kind == "volumes" {
|
||||
record = "kept.json"
|
||||
}
|
||||
if strings.Count(text, "exiting so the supervisor restarts from durable state") != 1 || !strings.Contains(text, "ERROR") || !strings.Contains(text, record) || !strings.Contains(text, filepath.Join(root, "lifecycle")) {
|
||||
t.Fatalf("missing single record/store/error line: %s", text)
|
||||
}
|
||||
recovery := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLifecyclePersistenceRecoveryChild$", "-test.timeout=8s")
|
||||
recovery.Env = append(os.Environ(), "LIFECYCLE_RECOVERY_ROOT="+root, "LIFECYCLE_EXIT_KIND="+kind)
|
||||
if out, err := recovery.CombinedOutput(); err != nil {
|
||||
t.Fatalf("bounded recovery: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestLifecyclePersistenceRecoveryChild(t *testing.T) {
|
||||
root := os.Getenv("LIFECYCLE_RECOVERY_ROOT")
|
||||
if root == "" {
|
||||
t.Skip("bounded recovery subprocess")
|
||||
}
|
||||
kind := os.Getenv("LIFECYCLE_EXIT_KIND")
|
||||
h, err := New(Config{Listen: "127.0.0.1:0", AuthorityStoreDir: filepath.Join(root, "authority"), LifecycleStoreDir: filepath.Join(root, "lifecycle"), FailStopLifecycleWrites: true})
|
||||
if err != nil {
|
||||
t.Fatal("restart", err)
|
||||
}
|
||||
h.Start()
|
||||
t.Cleanup(func() {
|
||||
c, stop := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer stop()
|
||||
if err := h.Close(c); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
kinds := []string{kind}
|
||||
if kind == "concurrent" {
|
||||
kinds = []string{"nodes", "placements"}
|
||||
}
|
||||
for _, part := range kinds {
|
||||
raw, err := os.ReadFile(filepath.Join(root, "lifecycle", part, "kept.json"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want, err := os.ReadFile(filepath.Join(root, part+"-sha256"))
|
||||
if err != nil || fmt.Sprintf("%x", sha256.Sum256(raw)) != string(want) {
|
||||
t.Fatalf("restart changed committed %s: %v", part, err)
|
||||
}
|
||||
var kept, failed bool
|
||||
switch part {
|
||||
case "nodes":
|
||||
_, kept = h.Lifecycle().Nodes.GetNodeSnapshot("kept")
|
||||
_, failed = h.Lifecycle().Nodes.GetNodeSnapshot("new")
|
||||
case "placements":
|
||||
_, kept = h.Lifecycle().Placements.GetPlacementSnapshot("kept")
|
||||
_, failed = h.Lifecycle().Placements.GetPlacementSnapshot("new")
|
||||
case "volumes":
|
||||
_, kept = h.Lifecycle().Volumes.GetVolumeSnapshot("kept")
|
||||
_, failed = h.Lifecycle().Volumes.GetVolumeSnapshot("new")
|
||||
}
|
||||
if !kept || failed {
|
||||
t.Fatalf("restart published wrong %s records", part)
|
||||
}
|
||||
entries, err := os.ReadDir(filepath.Join(root, "lifecycle", part))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, entry := range entries {
|
||||
if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".json") {
|
||||
raw, err := os.ReadFile(filepath.Join(root, "lifecycle", part, entry.Name()))
|
||||
if err != nil || !json.Valid(raw) {
|
||||
t.Fatalf("partial record %s: %v", entry.Name(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type blockedLifecycleLog struct {
|
||||
entered chan struct{}
|
||||
once sync.Once
|
||||
}
|
||||
|
||||
func (w *blockedLifecycleLog) Write(p []byte) (int, error) {
|
||||
w.once.Do(func() { close(w.entered) })
|
||||
select {}
|
||||
}
|
||||
|
||||
func TestLifecycleFailStopExitsWithBlockedLogger(t *testing.T) {
|
||||
for _, mode := range []string{"writer", "held-lock"} {
|
||||
t.Run(mode, func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 6*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLifecycleBlockedLoggerChild$", "-test.timeout=4s")
|
||||
cmd.Env = append(os.Environ(), "LIFECYCLE_BLOCKED_LOG="+mode)
|
||||
out, err := cmd.CombinedOutput()
|
||||
exited := time.Now()
|
||||
var exit *exec.ExitError
|
||||
if ctx.Err() != nil || !errors.As(err, &exit) || exit.ExitCode() != 1 {
|
||||
t.Fatalf("blocked logger prevented own exit1: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
var triggered int64
|
||||
for _, line := range strings.Split(string(out), "\n") {
|
||||
if v, ok := strings.CutPrefix(line, "lifecycle-failure-triggered="); ok {
|
||||
triggered, _ = strconv.ParseInt(v, 10, 64)
|
||||
}
|
||||
}
|
||||
if triggered == 0 {
|
||||
t.Fatalf("child did not report its failure trigger:\n%s", out)
|
||||
}
|
||||
// One-second deadline plus one second of scheduler tolerance; the
|
||||
// subprocess watchdog above is separate and longer.
|
||||
if elapsed := exited.Sub(time.Unix(0, triggered)); elapsed > 2*time.Second {
|
||||
t.Fatalf("exit took %s after the failure, want within the one-second deadline", elapsed)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestLifecycleBlockedLoggerChild(t *testing.T) {
|
||||
mode := os.Getenv("LIFECYCLE_BLOCKED_LOG")
|
||||
if mode == "" {
|
||||
t.Skip("bounded blocked-sink child")
|
||||
}
|
||||
w := &blockedLifecycleLog{entered: make(chan struct{})}
|
||||
logger := log.New(w, "", 0)
|
||||
if mode == "held-lock" {
|
||||
go logger.Print("earlier message")
|
||||
<-w.entered
|
||||
}
|
||||
fail := lifecycleFailStop(logger)
|
||||
fmt.Printf("lifecycle-failure-triggered=%d\n", time.Now().UnixNano())
|
||||
go fail(&lifecycle.RecordPersistenceError{Store: "nodes", Record: "v.json", Err: errors.New("fixture")})
|
||||
fail(&lifecycle.RecordPersistenceError{Store: "placements", Record: "v.json", Err: errors.New("fixture")})
|
||||
os.Exit(91)
|
||||
}
|
||||
|
||||
func TestLifecyclePersistenceExitChild(t *testing.T) {
|
||||
root := os.Getenv("LIFECYCLE_EXIT_ROOT")
|
||||
if root == "" {
|
||||
t.Skip("bounded fail-stop subprocess")
|
||||
}
|
||||
h, err := New(Config{Listen: "127.0.0.1:0", AuthorityStoreDir: filepath.Join(root, "authority"), LifecycleStoreDir: filepath.Join(root, "lifecycle"), FailStopLifecycleWrites: true})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
h.Start()
|
||||
put := func(kind, id string) error {
|
||||
switch kind {
|
||||
case "nodes":
|
||||
_, err := h.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{ServerID: id, Addr: "127.0.0.1:19001"})
|
||||
return err
|
||||
case "placements":
|
||||
_, err := h.Lifecycle().Placements.ApplyPlan(lifecycle.PlacementPlan{VolumeID: id, DesiredRF: 1, Candidates: []lifecycle.PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: lifecycle.PlacementSourceExistingReplica}}})
|
||||
return err
|
||||
default:
|
||||
_, err := h.Lifecycle().Volumes.CreateVolume(lifecycle.VolumeSpec{VolumeID: id, SizeBytes: 1 << 20, ReplicationFactor: 1})
|
||||
return err
|
||||
}
|
||||
}
|
||||
kinds := []string{os.Getenv("LIFECYCLE_EXIT_KIND")}
|
||||
if kinds[0] == "concurrent" {
|
||||
kinds = []string{"nodes", "placements"}
|
||||
}
|
||||
for _, kind := range kinds {
|
||||
if err := put(kind, "kept"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
raw, err := os.ReadFile(filepath.Join(root, "lifecycle", kind, "kept.json"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(root, kind+"-sha256"), []byte(fmt.Sprintf("%x", sha256.Sum256(raw))), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if kind == "volumes" {
|
||||
continue
|
||||
}
|
||||
block := filepath.Join(root, "lifecycle", kind, "new.json")
|
||||
if err := os.Mkdir(block, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(block, "blocker"), []byte("fixture"), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
var descriptors []*os.File
|
||||
if kinds[0] == "volumes" {
|
||||
// Attach has no pre-write record lookup on disk. Exhaust only this child's
|
||||
// descriptor budget so CreateTemp fails while its committed file stays intact.
|
||||
var limit syscall.Rlimit
|
||||
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if limit.Cur > 128 {
|
||||
limit.Cur = 128
|
||||
}
|
||||
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for {
|
||||
file, err := os.Open(os.DevNull)
|
||||
if errors.Is(err, syscall.EMFILE) {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
descriptors = append(descriptors, file)
|
||||
}
|
||||
}
|
||||
start := make(chan struct{})
|
||||
done := make(chan error, len(kinds))
|
||||
for _, kind := range kinds {
|
||||
go func(kind string) {
|
||||
<-start
|
||||
if kind == "volumes" {
|
||||
_, err := h.Lifecycle().Volumes.AttachVolume("kept", "node")
|
||||
done <- err
|
||||
return
|
||||
}
|
||||
done <- put(kind, "new")
|
||||
}(kind)
|
||||
}
|
||||
close(start)
|
||||
for range kinds {
|
||||
if err := <-done; err != nil {
|
||||
fmt.Fprintln(os.Stderr, "persistence error returned instead of exiting:", err)
|
||||
os.Exit(91)
|
||||
}
|
||||
}
|
||||
runtime.KeepAlive(descriptors)
|
||||
fmt.Fprintln(os.Stderr, "failed persistence did not stop master")
|
||||
os.Exit(92)
|
||||
}
|
||||
@@ -263,7 +263,6 @@ func (h *Host) submitPlacementSnapshots(placements []lifecycle.PlacementIntent)
|
||||
receipts := h.obs.Store().Snapshot()
|
||||
build := authority.BuildSnapshot(receipts, topology, h.Publisher())
|
||||
h.notePrimaryLosses(receipts, &build.Snapshot)
|
||||
h.takeGateReplaces() // only this tick's decisions are reported
|
||||
probeCount, blockedCount, directAsks := h.applyPromotionEvidenceGate(&build.Snapshot)
|
||||
supported := supportedSnapshotVolumes(build.Snapshot)
|
||||
unsupportedProbeCount, unsupportedBlockedCount, unsupportedDirectAsks := h.applyUnsupportedPromotionEvidenceGate(placements, build.Report, supported)
|
||||
@@ -276,16 +275,13 @@ func (h *Host) submitPlacementSnapshots(placements []lifecycle.PlacementIntent)
|
||||
defer h.workspaceMu.Unlock()
|
||||
if !reflect.DeepEqual(captured, h.lifecycle.Placements.ListPlacements()) {
|
||||
h.noteGate(gateNoteTick, "decisions not submitted: the placements changed during the probe")
|
||||
h.reportReplaces("not submitted: the placements changed during the probe", nil, nil)
|
||||
return false, probeCount, blockedCount, nil, nil
|
||||
}
|
||||
for _, p := range placements {
|
||||
if _, bound, err := h.lifecycle.WorkspaceBindings.Get(p.VolumeID); err != nil {
|
||||
h.reportReplaces("not submitted: the workspace bindings could not be read after the probe: "+err.Error(), nil, nil)
|
||||
return false, probeCount, blockedCount, nil, err
|
||||
} else if bound {
|
||||
h.noteGate(gateNoteTick, "decisions not submitted: volume "+p.VolumeID+" got a workspace binding during the probe")
|
||||
h.reportReplaces("not submitted: volume "+p.VolumeID+" got a workspace binding during the probe", nil, nil)
|
||||
return false, probeCount, blockedCount, nil, nil
|
||||
}
|
||||
}
|
||||
@@ -293,58 +289,12 @@ func (h *Host) submitPlacementSnapshots(placements []lifecycle.PlacementIntent)
|
||||
for _, slot := range v.Slots {
|
||||
if err := h.lifecycle.WorkspaceBindings.CheckAvailable(lifecycle.WorkspaceBinding{VolumeID: v.VolumeID, DataAddr: slot.DataAddr, CtrlAddr: slot.CtrlAddr}); err != nil {
|
||||
h.noteGate(gateNoteTick, fmt.Sprintf("decisions not submitted: volume %s replica %s endpoints are bound elsewhere: %v", v.VolumeID, slot.ReplicaID, err))
|
||||
h.reportReplaces(fmt.Sprintf("not submitted: volume %s replica %s endpoints are bound elsewhere", v.VolumeID, slot.ReplicaID), nil, nil)
|
||||
return false, probeCount, blockedCount, nil, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
h.noteGate(gateNoteTick, "")
|
||||
// The outcomes are this submission's own, read under the controller's
|
||||
// lock: the background observation host may submit right after it.
|
||||
outcomes, err := h.ctrl.SubmitObservedStateOutcomes(build.Snapshot, build.Report)
|
||||
h.reportReplaces("", err, outcomes)
|
||||
return true, probeCount, blockedCount, directAsks, err
|
||||
}
|
||||
|
||||
// gateReplace is one replace decision of a tick's promotion gate.
|
||||
type gateReplace struct{ volumeID, decision string }
|
||||
|
||||
func (h *Host) noteGateReplace(volumeID, decision string) {
|
||||
h.gateNoteMu.Lock()
|
||||
h.gateReplaces = append(h.gateReplaces, gateReplace{volumeID, decision})
|
||||
h.gateNoteMu.Unlock()
|
||||
}
|
||||
|
||||
func (h *Host) takeGateReplaces() []gateReplace {
|
||||
h.gateNoteMu.Lock()
|
||||
defer h.gateNoteMu.Unlock()
|
||||
out := h.gateReplaces
|
||||
h.gateReplaces = nil
|
||||
return out
|
||||
}
|
||||
|
||||
// reportReplaces logs what became of each replace decision of this tick:
|
||||
// not submitted (notSubmitted says why), a failed submit, or what the
|
||||
// controller did with the volume (an enqueued ask, or why none). A decision
|
||||
// the controller does not act on is otherwise silent until the volume is
|
||||
// seen not to fail over.
|
||||
func (h *Host) reportReplaces(notSubmitted string, submitErr error, outcomes map[string]string) {
|
||||
for _, d := range h.takeGateReplaces() {
|
||||
outcome := ""
|
||||
switch {
|
||||
case notSubmitted != "":
|
||||
outcome = notSubmitted
|
||||
case submitErr != nil:
|
||||
outcome = "submit failed: " + submitErr.Error()
|
||||
default:
|
||||
if o, ok := outcomes[d.volumeID]; ok {
|
||||
outcome = "controller: " + o
|
||||
} else {
|
||||
outcome = "controller: no outcome (the submission did not carry the volume)"
|
||||
}
|
||||
}
|
||||
h.log.Printf("blockmaster: promotion gate volume=%s decision=%s %s", d.volumeID, d.decision, outcome)
|
||||
}
|
||||
return true, probeCount, blockedCount, directAsks, h.ctrl.SubmitObservedState(build.Snapshot, build.Report)
|
||||
}
|
||||
|
||||
func (h *Host) applyPromotionEvidenceGate(snap *authority.ClusterSnapshot) (int, int, []authority.AssignmentAsk) {
|
||||
@@ -426,7 +376,6 @@ func (h *Host) applyPromotionEvidenceGate(snap *authority.ClusterSnapshot) (int,
|
||||
// decision names, on the gate's line, the branch this tick took, so a
|
||||
// volume that keeps a lost primary says why.
|
||||
decision := ""
|
||||
replaceDecided := false // the gate decided to replace the primary (reported after the submit)
|
||||
switch {
|
||||
case !replaceWanted:
|
||||
decision = "keep_current(" + gateAcceptance(vol.Slots[currentIdx], serverIndex, h.placementEligible(vol.Slots[currentIdx].ServerID)) + ")"
|
||||
@@ -453,7 +402,6 @@ func (h *Host) applyPromotionEvidenceGate(snap *authority.ClusterSnapshot) (int,
|
||||
} else if (len(allowed) > 0 || emptyVolumeSurvivors(result, ok)) && replacing {
|
||||
result, allowed = h.fencedDecision(vol.VolumeID, vol.Authority, result, len(candidates))
|
||||
fencedReplace = len(allowed) > 0
|
||||
replaceDecided = true
|
||||
decision = fmt.Sprintf("replace(fenced_at=%d)", vol.Authority.Epoch+1)
|
||||
if len(allowed) == 0 {
|
||||
decision = "replace(fencing_round_published_nothing)"
|
||||
@@ -469,12 +417,8 @@ func (h *Host) applyPromotionEvidenceGate(snap *authority.ClusterSnapshot) (int,
|
||||
}
|
||||
}
|
||||
if decision == "" && replacing {
|
||||
replaceDecided = true
|
||||
decision = "replace(no_candidate_to_fence)"
|
||||
}
|
||||
if replaceDecided {
|
||||
h.noteGateReplace(vol.VolumeID, decision)
|
||||
}
|
||||
if ok {
|
||||
h.log.Printf("blockmaster: promotion gate volume=%s current=%s current_known=%t current_ready=%t ack_profile=%s required_lsn=%d candidates=%v allowed=%v primary_lost=%t decision=%s",
|
||||
vol.VolumeID, vol.Authority.ReplicaID, result.CurrentKnown, result.Current.Ready, result.AckProfile, result.SyncAckLSN, result.Candidates, allowed, lost, decision)
|
||||
@@ -1013,19 +957,13 @@ func (h *Host) recordVolumeBlockedEvent(volumeID, reason string) {
|
||||
}
|
||||
|
||||
func (h *Host) recordAuthorityPublishedEvent(event authority.PublishEvent) {
|
||||
if h == nil {
|
||||
if h == nil || h.events == nil {
|
||||
return
|
||||
}
|
||||
message := fmt.Sprintf("authority published replica %s epoch=%d endpoint_version=%d", event.Info.ReplicaID, event.Info.Epoch, event.Info.EndpointVersion)
|
||||
if event.Ask.Intent == authority.IntentReassign {
|
||||
message = fmt.Sprintf("authority reassigned to replica %s epoch=%d endpoint_version=%d", event.Info.ReplicaID, event.Info.Epoch, event.Info.EndpointVersion)
|
||||
}
|
||||
if h.log != nil {
|
||||
h.log.Printf("blockmaster: volume=%s %s (%s)", event.Info.VolumeID, message, event.Ask.Intent)
|
||||
}
|
||||
if h.events == nil {
|
||||
return
|
||||
}
|
||||
h.events.append(ops.ClusterEvent{
|
||||
VolumeID: event.Info.VolumeID,
|
||||
ReplicaID: event.Info.ReplicaID,
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestImportRejectionNamesTheEntry(t *testing.T) {
|
||||
nodes, err := OpenNodeInventoryStore(t.TempDir())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = nodes.ImportNodes([]NodeRegistration{{ServerID: "good", Addr: "127.0.0.1:19001"}, {ServerID: "no-addr"}})
|
||||
if !errors.Is(err, ErrInvalidNodeRegistration) || !strings.Contains(err.Error(), "no-addr") {
|
||||
t.Fatalf("node import error = %v, want ErrInvalidNodeRegistration naming no-addr", err)
|
||||
}
|
||||
if _, ok := nodes.GetNodeSnapshot("good"); ok {
|
||||
t.Fatal("rejected node step published an entry")
|
||||
}
|
||||
if err := nodes.ImportNodes([]NodeRegistration{{ServerID: "good", Addr: "127.0.0.1:19001"}}); err != nil {
|
||||
t.Fatalf("validation rejection blocked the next import: %v", err)
|
||||
}
|
||||
|
||||
placements, err := OpenPlacementIntentStore(t.TempDir())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
valid := PlacementPlan{VolumeID: "good", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}
|
||||
short := PlacementPlan{VolumeID: "short", DesiredRF: 2, Candidates: valid.Candidates}
|
||||
err = placements.ImportPlans([]PlacementPlan{valid, short})
|
||||
if !errors.Is(err, ErrInsufficientPlacementCandidates) || !strings.Contains(err.Error(), "short") {
|
||||
t.Fatalf("placement import error = %v, want ErrInsufficientPlacementCandidates naming short", err)
|
||||
}
|
||||
if _, ok := placements.GetPlacementSnapshot("good"); ok {
|
||||
t.Fatal("rejected placement step published an entry")
|
||||
}
|
||||
if err := placements.ImportPlans([]PlacementPlan{valid}); err != nil {
|
||||
t.Fatalf("validation rejection blocked the next import: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk(t *testing.T) {
|
||||
for _, kind := range []string{"nodes", "placements"} {
|
||||
for _, mode := range []string{"reopen-barrier", "single-directory", "batch-directory", "batch-second-file"} {
|
||||
t.Run(kind+"/"+mode, func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestRecordEqualityRecoveryChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "RECORD_RECOVERY_KIND="+kind, "RECORD_RECOVERY_MODE="+mode)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("recovery control: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecordEqualityRecoveryChild(t *testing.T) {
|
||||
kind := os.Getenv("RECORD_RECOVERY_KIND")
|
||||
if kind == "" {
|
||||
t.Skip("isolated recovery hooks")
|
||||
}
|
||||
mode := os.Getenv("RECORD_RECOVERY_MODE")
|
||||
dir := t.TempDir()
|
||||
fault := errors.New("injected recovery barrier failure")
|
||||
var cause error = fault
|
||||
if mode == "syncfs-second-rename" {
|
||||
cause = os.ErrNotExist
|
||||
}
|
||||
useSyncfs := strings.HasPrefix(mode, "syncfs-")
|
||||
var apply func(bool) error
|
||||
var view func() any
|
||||
var reopen func() error
|
||||
var otherMutations func() []error
|
||||
var setPolicy func(PersistenceFailureHandler)
|
||||
var latched func() bool
|
||||
if kind == "nodes" {
|
||||
var store *NodeInventoryStore
|
||||
reopen = func() error { var err error; store, err = OpenNodeInventoryStore(dir); return err }
|
||||
apply = func(changed bool) error {
|
||||
nodes := []NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001", SeenAt: time.Unix(1, 0).UTC()}, {ServerID: "b", Addr: "127.0.0.1:19001", SeenAt: time.Unix(1, 0).UTC()}}
|
||||
if changed {
|
||||
for i := range nodes {
|
||||
nodes[i].Addr = "127.0.0.1:19002"
|
||||
}
|
||||
}
|
||||
if mode == "single-directory" {
|
||||
_, err := store.RegisterNode(nodes[0])
|
||||
return err
|
||||
}
|
||||
return store.ImportNodes(nodes)
|
||||
}
|
||||
view = func() any { return store.ListNodes() }
|
||||
setPolicy = func(handler PersistenceFailureHandler) { store.SetPersistenceFailureHandler(handler) }
|
||||
latched = func() bool { return store.writeErr != nil }
|
||||
otherMutations = func() []error {
|
||||
_, e := store.RegisterNode(NodeRegistration{ServerID: "c", Addr: "127.0.0.1:19001"})
|
||||
return []error{e, store.ImportNodes(nil), store.RemoveNode("a")}
|
||||
}
|
||||
} else {
|
||||
var store *PlacementIntentStore
|
||||
reopen = func() error { var err error; store, err = OpenPlacementIntentStore(dir); return err }
|
||||
apply = func(changed bool) error {
|
||||
plans := make([]PlacementPlan, 2)
|
||||
for i, id := range []string{"a", "b"} {
|
||||
plans[i] = PlacementPlan{VolumeID: id, DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}
|
||||
if changed {
|
||||
plans[i].Candidates[0].ReplicaID = "r2"
|
||||
}
|
||||
}
|
||||
if mode == "single-directory" {
|
||||
_, err := store.ApplyPlan(plans[0])
|
||||
return err
|
||||
}
|
||||
return store.ImportPlans(plans)
|
||||
}
|
||||
view = func() any { return store.ListPlacements() }
|
||||
setPolicy = func(handler PersistenceFailureHandler) { store.SetPersistenceFailureHandler(handler) }
|
||||
latched = func() bool { return store.writeErr != nil }
|
||||
otherMutations = func() []error {
|
||||
_, e := store.ApplyPlan(PlacementPlan{VolumeID: "c", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}})
|
||||
return []error{e, store.ImportPlans(nil), store.DeletePlacement("a")}
|
||||
}
|
||||
}
|
||||
if err := reopen(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := apply(false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
old := view()
|
||||
callbacks := 0
|
||||
setPolicy(func(failure *RecordPersistenceError) {
|
||||
callbacks++
|
||||
record := "<import-step>"
|
||||
if mode == "single-directory" {
|
||||
record = "a.json"
|
||||
}
|
||||
if mode == "batch-second-file" || mode == "syncfs-second-rename" {
|
||||
record = "b.json"
|
||||
}
|
||||
if !latched() || failure.Store != dir || failure.Record != record || !errors.Is(failure, cause) {
|
||||
t.Fatalf("incorrect failure-policy context: %+v", failure)
|
||||
}
|
||||
})
|
||||
if mode == "reopen-barrier" {
|
||||
called := 0
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{dirSync: func(path string) error {
|
||||
called++
|
||||
if path != dir {
|
||||
t.Fatal("recovery synced wrong directory")
|
||||
}
|
||||
return fault
|
||||
}})
|
||||
defer durableRecordHooksForTest.Store(nil)
|
||||
if err := reopen(); !errors.Is(err, fault) {
|
||||
t.Fatalf("loaded records published without a successful recovery barrier: %v calls=%d", err, called)
|
||||
}
|
||||
if called != 1 {
|
||||
t.Fatalf("recovery directory barriers=%d want1", called)
|
||||
}
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
if err := reopen(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(view(), old) {
|
||||
t.Fatal("recovery barrier changed record contents")
|
||||
}
|
||||
return
|
||||
}
|
||||
files, filesystemSyncs, renames, directorySyncs, ioCalls := 0, 0, 0, 0, 0
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{batchSyncfs: &useSyncfs,
|
||||
crash: func(point string) {
|
||||
ioCalls++
|
||||
if point == "before-rename" {
|
||||
renames++
|
||||
if mode == "syncfs-second-rename" && renames == 2 {
|
||||
temps, err := filepath.Glob(filepath.Join(dir, "b.json.*.tmp"))
|
||||
if err != nil || len(temps) != 1 {
|
||||
t.Fatalf("second rename has no unique staged file: %v %v", temps, err)
|
||||
}
|
||||
if err := os.Remove(temps[0]); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fileSync: func(f *os.File) error {
|
||||
ioCalls++
|
||||
files++
|
||||
if useSyncfs {
|
||||
t.Fatal("batch syncfs control fell back to per-file fsync")
|
||||
}
|
||||
if mode == "batch-second-file" && files == 2 {
|
||||
return fault
|
||||
}
|
||||
return f.Sync()
|
||||
},
|
||||
fsSync: func(fd *os.File) error {
|
||||
ioCalls++
|
||||
filesystemSyncs++
|
||||
if mode == "syncfs-failure" {
|
||||
return fault
|
||||
}
|
||||
return syncRecordFilesystem(fd)
|
||||
},
|
||||
dirSync: func(string) error { ioCalls++; directorySyncs++; return fault },
|
||||
})
|
||||
defer durableRecordHooksForTest.Store(nil)
|
||||
if err := apply(true); !errors.Is(err, cause) {
|
||||
t.Fatalf("fixture did not expose the failed persistence: %v", err)
|
||||
}
|
||||
if callbacks != 1 {
|
||||
t.Fatalf("failure callbacks=%d want1", callbacks)
|
||||
}
|
||||
if !reflect.DeepEqual(view(), old) {
|
||||
t.Fatal("failed write published its records")
|
||||
}
|
||||
if useSyncfs {
|
||||
wantRenames, wantDirs := 0, 0
|
||||
if mode == "syncfs-second-rename" {
|
||||
wantRenames = 2
|
||||
}
|
||||
if mode == "syncfs-directory" {
|
||||
wantRenames = 2
|
||||
wantDirs = 1
|
||||
}
|
||||
if filesystemSyncs != 1 || renames != wantRenames || directorySyncs != wantDirs || files != 0 {
|
||||
t.Fatalf("failure boundary: syncfs=%d renames=%d dir=%d files=%d", filesystemSyncs, renames, directorySyncs, files)
|
||||
}
|
||||
}
|
||||
beforeRefusals := ioCalls
|
||||
for _, err := range otherMutations() {
|
||||
if !errors.Is(err, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("mutation after uncertainty: %v", err)
|
||||
}
|
||||
}
|
||||
if callbacks != 1 {
|
||||
t.Fatalf("refused mutation called policy again: %d", callbacks)
|
||||
}
|
||||
retryErr := apply(false)
|
||||
if !errors.Is(retryErr, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("old-value retry must require recovery: %v", retryErr)
|
||||
}
|
||||
if callbacks != 1 || ioCalls != beforeRefusals {
|
||||
t.Fatalf("poisoned mutation retried I/O/policy: io=%d/%d callbacks=%d", ioCalls, beforeRefusals, callbacks)
|
||||
}
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
if err := reopen(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if useSyncfs && !reflect.DeepEqual(view(), syncfsFailureReopenedView(old, mode)) {
|
||||
t.Fatalf("reopen did not expose complete records at the injected boundary: got=%+v want=%+v", view(), syncfsFailureReopenedView(old, mode))
|
||||
}
|
||||
if err := apply(false); err != nil {
|
||||
t.Fatalf("recovered store cannot restore the old value: %v", err)
|
||||
}
|
||||
if err := reopen(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(view(), old) {
|
||||
t.Fatal("successful post-recovery write did not match disk")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestImportStepSyncsChangedFilesThenOneDirectory(t *testing.T) {
|
||||
for _, kind := range []string{"nodes", "placements"} {
|
||||
for _, failure := range []string{"none", "file", "second-file", "directory"} {
|
||||
t.Run(kind+"/"+failure, func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportStepSyncChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "IMPORT_STEP_KIND="+kind, "IMPORT_STEP_FAILURE="+failure)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("import control: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportStepSyncChild(t *testing.T) {
|
||||
kind := os.Getenv("IMPORT_STEP_KIND")
|
||||
if kind == "" {
|
||||
t.Skip("isolated filesystem hooks")
|
||||
}
|
||||
failure := os.Getenv("IMPORT_STEP_FAILURE")
|
||||
dir := t.TempDir()
|
||||
var apply func(bool) error
|
||||
var snapshot func() any
|
||||
var reopen func() any
|
||||
var values func() []string
|
||||
var wantValues []string
|
||||
if kind == "nodes" {
|
||||
store, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
nodes := []NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19001"}, {ServerID: "unchanged", Addr: "127.0.0.1:19001"}}
|
||||
apply = func(change bool) error {
|
||||
next := append([]NodeRegistration(nil), nodes...)
|
||||
if change {
|
||||
next[0].Addr = "127.0.0.1:19002"
|
||||
next[1].Addr = "127.0.0.1:19002"
|
||||
}
|
||||
return store.ImportNodes(next)
|
||||
}
|
||||
snapshot = func() any {
|
||||
var got []NodeRegistration
|
||||
for _, node := range nodes {
|
||||
r, _ := store.GetNodeSnapshot(node.ServerID)
|
||||
got = append(got, r)
|
||||
}
|
||||
return got
|
||||
}
|
||||
values = func() []string {
|
||||
var got []string
|
||||
for _, node := range nodes {
|
||||
r, _ := store.GetNodeSnapshot(node.ServerID)
|
||||
got = append(got, r.Addr)
|
||||
}
|
||||
return got
|
||||
}
|
||||
wantValues = []string{"127.0.0.1:19002", "127.0.0.1:19002", "127.0.0.1:19001"}
|
||||
reopen = func() any {
|
||||
s, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store = s
|
||||
return s.ListNodes()
|
||||
}
|
||||
} else {
|
||||
store, err := OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
plans := make([]PlacementPlan, 3)
|
||||
for i, id := range []string{"a", "b", "unchanged"} {
|
||||
plans[i] = PlacementPlan{VolumeID: id, DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}
|
||||
}
|
||||
apply = func(change bool) error {
|
||||
next := make([]PlacementPlan, len(plans))
|
||||
copy(next, plans)
|
||||
for i := range next {
|
||||
next[i].Candidates = append([]PlacementCandidate(nil), plans[i].Candidates...)
|
||||
}
|
||||
if change {
|
||||
next[0].Candidates[0].ReplicaID = "r2"
|
||||
next[1].Candidates[0].ReplicaID = "r2"
|
||||
}
|
||||
return store.ImportPlans(next)
|
||||
}
|
||||
snapshot = func() any {
|
||||
var got []PlacementIntent
|
||||
for _, p := range plans {
|
||||
r, _ := store.GetPlacementSnapshot(p.VolumeID)
|
||||
got = append(got, r)
|
||||
}
|
||||
return got
|
||||
}
|
||||
values = func() []string {
|
||||
var got []string
|
||||
for _, p := range plans {
|
||||
r, _ := store.GetPlacementSnapshot(p.VolumeID)
|
||||
if len(r.Slots) != 1 {
|
||||
return nil
|
||||
}
|
||||
got = append(got, r.Slots[0].ReplicaID)
|
||||
}
|
||||
return got
|
||||
}
|
||||
wantValues = []string{"r2", "r2", "r1"}
|
||||
reopen = func() any {
|
||||
s, err := OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store = s
|
||||
return s.ListPlacements()
|
||||
}
|
||||
}
|
||||
if err := apply(false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
old := snapshot()
|
||||
var events []string
|
||||
fault := errors.New("injected import sync failure")
|
||||
// Qualify the portable per-file fallback independently of the syncfs path.
|
||||
useSyncfs := false
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{
|
||||
batchSyncfs: &useSyncfs,
|
||||
fileSync: func(file *os.File) error {
|
||||
events = append(events, "file")
|
||||
if failure == "file" || failure == "second-file" && len(events) == 2 {
|
||||
return fault
|
||||
}
|
||||
return file.Sync()
|
||||
},
|
||||
dirSync: func(path string) error {
|
||||
events = append(events, "directory")
|
||||
if !reflect.DeepEqual(snapshot(), old) {
|
||||
t.Fatal("step published before its directory barrier")
|
||||
}
|
||||
if path != dir {
|
||||
t.Fatal("wrong import directory barrier")
|
||||
}
|
||||
if failure == "directory" {
|
||||
return fault
|
||||
}
|
||||
return syncBindingParent(path)
|
||||
},
|
||||
})
|
||||
defer durableRecordHooksForTest.Store(nil)
|
||||
err := apply(true)
|
||||
want := []string{"file", "file", "directory"}
|
||||
if failure == "file" {
|
||||
want = []string{"file"}
|
||||
} else if failure == "second-file" {
|
||||
want = []string{"file", "file"}
|
||||
}
|
||||
if !reflect.DeepEqual(events, want) {
|
||||
t.Fatalf("events %v want %v", events, want)
|
||||
}
|
||||
if failure != "none" {
|
||||
if !errors.Is(err, fault) {
|
||||
t.Fatalf("sync failure hidden: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(snapshot(), old) {
|
||||
t.Fatal("failed step changed the published snapshot")
|
||||
}
|
||||
// A failed step requires recovery before any further mutations.
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
if err := apply(true); !errors.Is(err, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("mutation after failed persistence: %v", err)
|
||||
}
|
||||
reopen()
|
||||
if err := apply(true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
} else if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := values(); !reflect.DeepEqual(got, wantValues) {
|
||||
t.Fatalf("completed import published %v want %v", got, wantValues)
|
||||
}
|
||||
completed := snapshot()
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
if !reflect.DeepEqual(reopen(), completed) {
|
||||
t.Fatal("completed import did not survive reopen")
|
||||
}
|
||||
if got := values(); !reflect.DeepEqual(got, wantValues) {
|
||||
t.Fatalf("reopened store holds %v want %v", got, wantValues)
|
||||
}
|
||||
events = nil
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{fileSync: func(*os.File) error { return fmt.Errorf("unchanged file synced") }, dirSync: func(string) error { return fmt.Errorf("unchanged directory synced") }})
|
||||
if err := apply(true); err != nil {
|
||||
t.Fatalf("unchanged step did I/O: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,379 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func TestImportBatchStagesAllFilesBeforeAnyRename(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportBatchStageChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "IMPORT_BATCH_STAGE_CHILD=1")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("batch stage control: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportBatchStageChild(t *testing.T) {
|
||||
if os.Getenv("IMPORT_BATCH_STAGE_CHILD") == "" {
|
||||
t.Skip("isolated filesystem hooks")
|
||||
}
|
||||
dir := t.TempDir()
|
||||
s, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checked := false
|
||||
useSyncfs := true
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{batchSyncfs: &useSyncfs, crash: func(point string) {
|
||||
if point != "before-rename" || checked {
|
||||
return
|
||||
}
|
||||
checked = true
|
||||
temps, err := filepath.Glob(filepath.Join(dir, "*.tmp"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(temps) != 2 {
|
||||
t.Fatalf("first rename has %d staged files, want 2", len(temps))
|
||||
}
|
||||
}})
|
||||
defer durableRecordHooksForTest.Store(nil)
|
||||
if err := s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !checked {
|
||||
t.Fatal("rename boundary not observed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportSyncfsFailureAndOrdering(t *testing.T) {
|
||||
for _, kind := range []string{"nodes", "placements"} {
|
||||
for _, mode := range []string{"success", "failure", "old-kernel"} {
|
||||
t.Run(kind+"/"+mode, func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportSyncfsChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "IMPORT_SYNCFS_KIND="+kind, "IMPORT_SYNCFS_MODE="+mode)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("syncfs control: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportSyncfsChild(t *testing.T) {
|
||||
kind := os.Getenv("IMPORT_SYNCFS_KIND")
|
||||
if kind == "" {
|
||||
t.Skip("isolated filesystem hooks")
|
||||
}
|
||||
mode := os.Getenv("IMPORT_SYNCFS_MODE")
|
||||
dir := t.TempDir()
|
||||
var apply func() error
|
||||
var reopen func()
|
||||
var snapshot func() int
|
||||
if kind == "nodes" {
|
||||
var s *NodeInventoryStore
|
||||
reopen = func() {
|
||||
var err error
|
||||
s, err = OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
apply = func() error {
|
||||
return s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}})
|
||||
}
|
||||
snapshot = func() int {
|
||||
n := 0
|
||||
for _, id := range []string{"a", "b"} {
|
||||
if _, ok := s.GetNodeSnapshot(id); ok {
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
} else {
|
||||
var s *PlacementIntentStore
|
||||
reopen = func() {
|
||||
var err error
|
||||
s, err = OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
apply = func() error {
|
||||
return s.ImportPlans([]PlacementPlan{{VolumeID: "a", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}, {VolumeID: "b", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}})
|
||||
}
|
||||
snapshot = func() int {
|
||||
n := 0
|
||||
for _, id := range []string{"a", "b"} {
|
||||
if _, ok := s.GetPlacementSnapshot(id); ok {
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
}
|
||||
reopen()
|
||||
useSyncfs := mode != "old-kernel"
|
||||
fault := errors.New("injected filesystem writeback failure")
|
||||
var events []string
|
||||
var failedTemps []string
|
||||
install := func(fail bool) {
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{
|
||||
batchSyncfs: &useSyncfs,
|
||||
crash: func(point string) {
|
||||
if point == "batch-open" {
|
||||
temps, _ := filepath.Glob(filepath.Join(dir, "*.tmp"))
|
||||
if len(temps) != 0 {
|
||||
t.Fatal("syncfs fd opened after temp writes")
|
||||
}
|
||||
events = append(events, "open")
|
||||
}
|
||||
if point == "before-rename" {
|
||||
if useSyncfs && !reflect.DeepEqual(events, []string{"open", "syncfs"}) && !reflect.DeepEqual(events, []string{"open", "syncfs", "rename"}) {
|
||||
t.Fatalf("rename before syncfs completed: %v", events)
|
||||
}
|
||||
events = append(events, "rename")
|
||||
}
|
||||
},
|
||||
fileSync: func(f *os.File) error {
|
||||
if useSyncfs {
|
||||
t.Fatal("syncfs path used per-file fsync")
|
||||
}
|
||||
events = append(events, "file")
|
||||
return f.Sync()
|
||||
},
|
||||
fsSync: func(fd *os.File) error {
|
||||
if fd.Name() != dir {
|
||||
t.Fatal("wrong filesystem fd")
|
||||
}
|
||||
for _, name := range []string{"a.json", "b.json"} {
|
||||
if _, err := os.Stat(filepath.Join(dir, name)); !os.IsNotExist(err) {
|
||||
t.Fatalf("final record visible before syncfs: %s %v", name, err)
|
||||
}
|
||||
}
|
||||
temps, _ := filepath.Glob(filepath.Join(dir, "*.tmp"))
|
||||
if len(temps) != 2 {
|
||||
t.Fatalf("staged temps=%v", temps)
|
||||
}
|
||||
if snapshot() != 0 {
|
||||
t.Fatal("published before syncfs")
|
||||
}
|
||||
if fail {
|
||||
failedTemps = temps
|
||||
events = append(events, "syncfs")
|
||||
return fault
|
||||
}
|
||||
for _, temp := range temps {
|
||||
for _, old := range failedTemps {
|
||||
if temp == old {
|
||||
t.Fatal("reused failed temp")
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := syncRecordFilesystem(fd); err != nil {
|
||||
return err
|
||||
}
|
||||
events = append(events, "syncfs")
|
||||
return nil
|
||||
},
|
||||
dirSync: func(path string) error {
|
||||
if snapshot() != 0 {
|
||||
t.Fatal("published before directory barrier")
|
||||
}
|
||||
events = append(events, "directory")
|
||||
return syncBindingParent(path)
|
||||
},
|
||||
})
|
||||
}
|
||||
defer durableRecordHooksForTest.Store(nil)
|
||||
install(mode == "failure")
|
||||
err := apply()
|
||||
if mode == "failure" {
|
||||
if !errors.Is(err, fault) || !reflect.DeepEqual(events, []string{"open", "syncfs"}) {
|
||||
t.Fatalf("failed syncfs retried/renamed: %v %v", events, err)
|
||||
}
|
||||
if snapshot() != 0 {
|
||||
t.Fatal("failed import published")
|
||||
}
|
||||
if err := apply(); !errors.Is(err, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("failed store admitted retry: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(events, []string{"open", "syncfs"}) {
|
||||
t.Fatal("poisoned retry performed I/O")
|
||||
}
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
reopen()
|
||||
events = nil
|
||||
install(false)
|
||||
err = apply()
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := []string{"open", "syncfs", "rename", "rename", "directory"}
|
||||
if !useSyncfs {
|
||||
want = []string{"file", "rename", "file", "rename", "directory"}
|
||||
}
|
||||
if !reflect.DeepEqual(events, want) {
|
||||
t.Fatalf("events=%v want=%v", events, want)
|
||||
}
|
||||
if snapshot() != 2 {
|
||||
t.Fatal("successful import not published")
|
||||
}
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
reopen()
|
||||
if snapshot() != 2 {
|
||||
t.Fatal("completed import lost on reopen")
|
||||
}
|
||||
}
|
||||
|
||||
// Returned-error controls complement the process-crash ordering controls:
|
||||
// the published view stays old while complete disk records may be old or new.
|
||||
func TestImportSyncfsReturnedFailurePolicyAndReplay(t *testing.T) {
|
||||
for _, kind := range []string{"nodes", "placements"} {
|
||||
for _, mode := range []string{"syncfs-failure", "syncfs-second-rename", "syncfs-directory"} {
|
||||
t.Run(kind+"/"+mode, func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestRecordEqualityRecoveryChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "RECORD_RECOVERY_KIND="+kind, "RECORD_RECOVERY_MODE="+mode)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("returned syncfs failure control: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func syncfsFailureReopenedView(old any, mode string) any {
|
||||
changed := func(id string) bool {
|
||||
return mode == "syncfs-directory" || (mode == "syncfs-second-rename" && id == "a")
|
||||
}
|
||||
switch records := old.(type) {
|
||||
case []NodeRegistration:
|
||||
out := make([]NodeRegistration, len(records))
|
||||
for i, rec := range records {
|
||||
out[i] = copyNodeRegistration(rec)
|
||||
if changed(rec.ServerID) {
|
||||
out[i].Addr = "127.0.0.1:19002"
|
||||
}
|
||||
}
|
||||
return out
|
||||
case []PlacementIntent:
|
||||
out := make([]PlacementIntent, len(records))
|
||||
for i, rec := range records {
|
||||
out[i] = copyPlacementIntent(rec)
|
||||
if changed(rec.VolumeID) {
|
||||
out[i].Slots[0].ReplicaID = "r2"
|
||||
}
|
||||
}
|
||||
return out
|
||||
default:
|
||||
panic("unexpected fixture records")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSyncfsKernelGate(t *testing.T) {
|
||||
for release, want := range map[string]bool{"5.7.19": false, "5.8.0": true, "6.8.0-azure": true, "4.19.0": false, "unknown": false, "5.x.0": false} {
|
||||
if got := kernelHasSyncfsErrors(release); got != want {
|
||||
t.Errorf("%s: got %v want %v", release, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportSyncfsCrashBoundaries(t *testing.T) {
|
||||
for _, point := range []string{"before-syncfs", "after-syncfs", "after-rename"} {
|
||||
t.Run(point, func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportSyncfsCrashChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "IMPORT_CRASH_DIR="+dir, "IMPORT_CRASH_POINT="+point)
|
||||
out, err := cmd.CombinedOutput()
|
||||
var exit *exec.ExitError
|
||||
if ctx.Err() != nil || !errors.As(err, &exit) || exit.ExitCode() != 86 {
|
||||
t.Fatalf("crash child: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
s, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := 0
|
||||
if point == "after-rename" {
|
||||
want = 1
|
||||
}
|
||||
if len(s.ListNodes()) != want {
|
||||
t.Fatalf("reopen records=%v want=%d", s.ListNodes(), want)
|
||||
}
|
||||
for _, rec := range s.ListNodes() {
|
||||
if rec.ServerID != "a" || rec.Addr != "127.0.0.1:19001" {
|
||||
t.Fatalf("incomplete record: %+v", rec)
|
||||
}
|
||||
}
|
||||
// A malformed final name is refused, never silently admitted; leftover
|
||||
// unsynced temp names are ignored. This is a process-crash ordering
|
||||
// control, not a claim to simulate a machine power loss.
|
||||
if err := os.WriteFile(filepath.Join(dir, "broken.json"), []byte(`{"server_id":`), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := OpenNodeInventoryStore(dir); err == nil {
|
||||
t.Fatal("torn JSON accepted")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportSyncfsCrashChild(t *testing.T) {
|
||||
dir := os.Getenv("IMPORT_CRASH_DIR")
|
||||
if dir == "" {
|
||||
t.Skip("bounded crash child")
|
||||
}
|
||||
s, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
useSyncfs := true
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{batchSyncfs: &useSyncfs, crash: func(point string) {
|
||||
if point == os.Getenv("IMPORT_CRASH_POINT") {
|
||||
os.Exit(86)
|
||||
}
|
||||
}})
|
||||
if err := s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
raw, _ := json.Marshal(s.ListNodes())
|
||||
t.Fatalf("crash boundary not reached: %s", raw)
|
||||
}
|
||||
|
||||
func TestSyncfsFilesystemGate(t *testing.T) {
|
||||
for name, tc := range map[string]struct {
|
||||
magic uint32
|
||||
want bool
|
||||
}{
|
||||
"ext4": {unix.EXT4_SUPER_MAGIC, true}, "xfs": {unix.XFS_SUPER_MAGIC, true}, "btrfs": {unix.BTRFS_SUPER_MAGIC, true}, "tmpfs": {unix.TMPFS_MAGIC, true},
|
||||
"overlay": {unix.OVERLAYFS_SUPER_MAGIC, false}, "fuse": {unix.FUSE_SUPER_MAGIC, false}, "nfs": {unix.NFS_SUPER_MAGIC, false}, "unknown": {0, false},
|
||||
} {
|
||||
if got := filesystemReportsSyncfsErrors(tc.magic); got != tc.want {
|
||||
t.Errorf("%s: got %v want %v", name, got, tc.want)
|
||||
}
|
||||
}
|
||||
if recordBatchSyncfsSupported(filepath.Join(t.TempDir(), "missing")) {
|
||||
t.Error("an unreadable records directory selected syncfs")
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,13 @@ func TestLifecycleLayoutIdentity(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
failed = false
|
||||
if _, err := loaded.CreateVolume(failedSpec); !errors.Is(err, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("retry before recovery: %v", err)
|
||||
}
|
||||
loaded, err = OpenFileStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
b, err = loaded.CreateVolume(failedSpec)
|
||||
if err != nil || b.Spec.LayoutID != written.Spec.LayoutID {
|
||||
t.Fatalf("unknown put retry changed identity: %v %+v", err, b)
|
||||
|
||||
@@ -61,8 +61,15 @@ func TestRedrawPendingLayoutID(t *testing.T) {
|
||||
t.Fatal(e)
|
||||
}
|
||||
fail = false
|
||||
if _, e := s.CreateVolume(spec); !errors.Is(e, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("retry before recovery: %v", e)
|
||||
}
|
||||
s, e = OpenFileStore(s.dir)
|
||||
if e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
// Exercise the public retry path, including metadata enrichment. It
|
||||
// must settle disk B before a metadata put could overwrite it with A.
|
||||
// must preserve recovered disk B before a metadata put could overwrite it with A.
|
||||
retry := spec
|
||||
retry.PVCName, retry.PVName = "claim", "pv"
|
||||
public, retryErr := s.CreateVolume(retry)
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestUnchangedNodeRestartDoesNotRefreshAStaleObservation(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
now := time.Now().UTC()
|
||||
oldSeen := now.Add(-2 * time.Hour)
|
||||
reg := NodeRegistration{ServerID: "node", Addr: "127.0.0.1:19001", SeenAt: oldSeen}
|
||||
store, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := store.RegisterNode(reg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store, err = OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
reg.SeenAt = time.Time{} // cluster-spec registrations have no observation time
|
||||
if _, err := store.RegisterNode(reg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, ok := store.GetNodeSnapshot("node")
|
||||
if !ok {
|
||||
t.Fatal("node missing after re-import")
|
||||
}
|
||||
intent := PlacementIntent{VolumeID: "volume", DesiredRF: 1, Slots: []PlacementSlotIntent{{ServerID: "node", PoolID: "pool", Source: PlacementSourceBlankPool}}}
|
||||
verified := VerifyPlacementIntent(intent, []NodeRegistration{got}, VerificationConfig{Now: now, FreshnessWindow: time.Hour})
|
||||
if verified.Verified || verified.Reason != VerifyReasonStaleObservation {
|
||||
t.Fatalf("restart laundered a stale node fresh: seen=%s result=%+v", got.SeenAt, verified)
|
||||
}
|
||||
if !got.SeenAt.Equal(oldSeen) {
|
||||
t.Fatalf("observation changed: got %s want %s", got.SeenAt, oldSeen)
|
||||
}
|
||||
// An explicit timestamp on otherwise identical declarative input cannot
|
||||
// impersonate a heartbeat either.
|
||||
reg.SeenAt = now
|
||||
if _, err := store.RegisterNode(reg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, _ = store.GetNodeSnapshot("node")
|
||||
if !got.SeenAt.Equal(oldSeen) {
|
||||
t.Fatal("timestamp-only registration refreshed the observation")
|
||||
}
|
||||
reopened, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, _ = reopened.GetNodeSnapshot("node")
|
||||
if !got.SeenAt.Equal(oldSeen) {
|
||||
t.Fatal("reloaded observation did not retain its original time")
|
||||
}
|
||||
}
|
||||
|
||||
func TestChangedNodeImportDoesNotRefreshAStaleObservation(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
now := time.Now().UTC()
|
||||
oldSeen := now.Add(-2 * time.Hour)
|
||||
store, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
reg := NodeRegistration{ServerID: "node", Addr: "127.0.0.1:19001", SeenAt: oldSeen, Pools: []StoragePool{{PoolID: "pool", BlockSize: 4096, TotalBytes: 1 << 30}}}
|
||||
if _, err := store.RegisterNode(reg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
store, err = OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
reg.SeenAt = time.Time{}
|
||||
reg.Pools = []StoragePool{{PoolID: "pool", BlockSize: 4096, TotalBytes: 2 << 30}}
|
||||
if err := store.ImportNodes([]NodeRegistration{reg}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, ok := store.GetNodeSnapshot("node")
|
||||
if !ok || got.Pools[0].TotalBytes != 2<<30 {
|
||||
t.Fatalf("changed declaration not imported: %+v", got)
|
||||
}
|
||||
if !got.SeenAt.Equal(oldSeen) {
|
||||
t.Fatalf("changed declaration refreshed the observation: got %s want %s", got.SeenAt, oldSeen)
|
||||
}
|
||||
intent := PlacementIntent{VolumeID: "volume", DesiredRF: 1, Slots: []PlacementSlotIntent{{ServerID: "node", PoolID: "pool", Source: PlacementSourceBlankPool}}}
|
||||
verified := VerifyPlacementIntent(intent, []NodeRegistration{got}, VerificationConfig{Now: now, FreshnessWindow: time.Hour})
|
||||
if verified.Verified || verified.Reason != VerifyReasonStaleObservation {
|
||||
t.Fatalf("restart laundered a stale node fresh: %+v", verified)
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -65,11 +66,13 @@ type NodeRegistration struct {
|
||||
|
||||
// NodeInventoryStore persists one JSON registration record per server.
|
||||
type NodeInventoryStore struct {
|
||||
mu sync.Mutex
|
||||
dir string
|
||||
records map[string]NodeRegistration
|
||||
published sync.Map // committed NodeRegistration values; holder host checks never take mu (INV-WS-RENEW-NONBLOCKING-001)
|
||||
failWrite func() error // tests: a non-nil error fails the next record write or removal
|
||||
mu sync.Mutex
|
||||
dir string
|
||||
writeErr error // failed persistence requires reopen before another mutation
|
||||
onPersistenceFailure PersistenceFailureHandler
|
||||
records map[string]NodeRegistration
|
||||
published sync.Map // committed NodeRegistration values; holder host checks never take mu (INV-WS-RENEW-NONBLOCKING-001)
|
||||
failWrite func() error // tests: a non-nil error fails the next record write or removal
|
||||
}
|
||||
|
||||
// SetPersistHookForTest installs (nil clears) a callback that each later
|
||||
@@ -81,6 +84,14 @@ func (s *NodeInventoryStore) SetPersistHookForTest(hook func() error) {
|
||||
s.failWrite = hook
|
||||
}
|
||||
|
||||
// SetPersistenceFailureHandler installs the process host policy before serving.
|
||||
// The callback runs under the writer mutex and must not reenter the store.
|
||||
func (s *NodeInventoryStore) SetPersistenceFailureHandler(handler PersistenceFailureHandler) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.onPersistenceFailure = handler
|
||||
}
|
||||
|
||||
// OpenNodeInventoryStore opens or creates a node inventory store.
|
||||
func OpenNodeInventoryStore(dir string) (*NodeInventoryStore, error) {
|
||||
if dir == "" {
|
||||
@@ -111,6 +122,11 @@ func OpenNodeInventoryStore(dir string) (*NodeInventoryStore, error) {
|
||||
if err := s.load(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Loaded names may come from a failed rename/barrier attempt. Establish
|
||||
// their durability before exposing them or taking an equality shortcut.
|
||||
if err := syncRecordDirectory(dir); err != nil {
|
||||
return nil, &RecordPersistenceError{Store: dir, Record: "<recovery>", Err: err}
|
||||
}
|
||||
for id, rec := range s.records {
|
||||
s.published.Store(id, copyNodeRegistration(rec))
|
||||
}
|
||||
@@ -137,24 +153,29 @@ func (s *NodeInventoryStore) HoldWritesForTest() (release func()) {
|
||||
}
|
||||
|
||||
// RegisterNode records the latest observed inventory for a server.
|
||||
// Repeating registration replaces observation fields, but still does not
|
||||
// publish authority or readiness.
|
||||
// Changed registration replaces observation fields, but still does not
|
||||
// publish authority or readiness. A declaration without SeenAt retains the
|
||||
// stored one (INV-NODE-REGISTRATION-FRESHNESS-001); only a heartbeat adds fresh evidence.
|
||||
func (s *NodeInventoryStore) RegisterNode(reg NodeRegistration) (NodeRegistration, error) {
|
||||
if err := validateNodeRegistration(reg); err != nil {
|
||||
return NodeRegistration{}, err
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if reg.SeenAt.IsZero() {
|
||||
reg.SeenAt = time.Now().UTC()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return NodeRegistration{}, err
|
||||
}
|
||||
reg, changed := s.registrationLocked(reg)
|
||||
if !changed {
|
||||
return copyNodeRegistration(reg), nil
|
||||
}
|
||||
reg = normalizeNodeRegistration(reg)
|
||||
if err := s.putLocked(reg); err != nil {
|
||||
latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure)
|
||||
return NodeRegistration{}, err
|
||||
}
|
||||
s.records[reg.ServerID] = reg
|
||||
s.published.Store(reg.ServerID, copyNodeRegistration(reg)) // committed: the file is in place
|
||||
return reg, nil
|
||||
return copyNodeRegistration(reg), nil
|
||||
}
|
||||
|
||||
// RemoveNode deletes one registration record. Missing nodes are a
|
||||
@@ -165,15 +186,18 @@ func (s *NodeInventoryStore) RemoveNode(serverID string) error {
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return err
|
||||
}
|
||||
if s.failWrite != nil {
|
||||
if err := s.failWrite(); err != nil {
|
||||
return fmt.Errorf("lifecycle: remove node %s: %w", serverID, err)
|
||||
}
|
||||
}
|
||||
delete(s.records, serverID)
|
||||
if err := os.Remove(s.path(serverID)); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return fmt.Errorf("lifecycle: remove node %s: %w", serverID, err)
|
||||
}
|
||||
delete(s.records, serverID)
|
||||
s.published.Delete(serverID) // committed: the file is gone
|
||||
return nil
|
||||
}
|
||||
@@ -327,3 +351,82 @@ func copyStringMap(in map[string]string) map[string]string {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// ImportNodes replays one startup node step. All changed data is durable before
|
||||
// rename; one directory barrier precedes publication of the changed snapshots.
|
||||
func (s *NodeInventoryStore) ImportNodes(nodes []NodeRegistration) error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return err
|
||||
}
|
||||
changed := make(map[string]NodeRegistration)
|
||||
seen := make(map[string]bool)
|
||||
order := make([]string, 0, len(nodes))
|
||||
for _, node := range nodes {
|
||||
if err := validateNodeRegistration(node); err != nil {
|
||||
return fmt.Errorf("lifecycle: import node %s: %w", node.ServerID, err)
|
||||
}
|
||||
reg, differs := s.registrationLocked(node)
|
||||
if !seen[reg.ServerID] {
|
||||
order = append(order, reg.ServerID)
|
||||
seen[reg.ServerID] = true
|
||||
}
|
||||
if !differs {
|
||||
delete(changed, reg.ServerID)
|
||||
continue
|
||||
}
|
||||
changed[reg.ServerID] = reg
|
||||
}
|
||||
writes := make([]recordWrite, 0, len(order))
|
||||
for _, id := range order {
|
||||
if _, ok := changed[id]; !ok {
|
||||
continue
|
||||
}
|
||||
if s.failWrite != nil {
|
||||
if err := s.failWrite(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
raw, err := json.MarshalIndent(changed[id], "", " ")
|
||||
if err != nil {
|
||||
return fmt.Errorf("lifecycle: marshal node %s: %w", id, err)
|
||||
}
|
||||
writes = append(writes, recordWrite{name: id + ".json", raw: raw})
|
||||
}
|
||||
if err := writeRecordBatchDurably(s.dir, writes); err != nil {
|
||||
latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure)
|
||||
return err
|
||||
}
|
||||
for _, id := range order {
|
||||
if _, ok := changed[id]; !ok {
|
||||
continue
|
||||
}
|
||||
reg := changed[id]
|
||||
s.records[id] = reg
|
||||
s.published.Store(id, copyNodeRegistration(reg))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *NodeInventoryStore) registrationLocked(reg NodeRegistration) (NodeRegistration, bool) {
|
||||
// Retain an independent value: a caller may reuse its pool slices.
|
||||
reg = copyNodeRegistration(reg)
|
||||
if old, ok := s.records[reg.ServerID]; ok {
|
||||
unchanged := reg
|
||||
unchanged.SeenAt = old.SeenAt
|
||||
if reflect.DeepEqual(old, unchanged) {
|
||||
// Declarative replay is not a new observation. Heartbeats supply
|
||||
// freshness independently of this durable registration.
|
||||
return copyNodeRegistration(old), false
|
||||
}
|
||||
if reg.SeenAt.IsZero() {
|
||||
// A changed declaration is not an observation either.
|
||||
reg.SeenAt = old.SeenAt
|
||||
}
|
||||
}
|
||||
if reg.SeenAt.IsZero() {
|
||||
reg.SeenAt = time.Now().UTC()
|
||||
}
|
||||
return reg, true
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"sort"
|
||||
"sync"
|
||||
)
|
||||
@@ -36,10 +37,20 @@ type PlacementIntent struct {
|
||||
|
||||
// PlacementIntentStore persists one placement intent per volume.
|
||||
type PlacementIntentStore struct {
|
||||
mu sync.Mutex
|
||||
dir string
|
||||
records map[string]PlacementIntent
|
||||
published sync.Map // committed immutable PlacementIntent values; renewal never takes mu
|
||||
mu sync.Mutex
|
||||
dir string
|
||||
writeErr error // failed persistence requires reopen before another mutation
|
||||
onPersistenceFailure PersistenceFailureHandler
|
||||
records map[string]PlacementIntent
|
||||
published sync.Map // committed immutable PlacementIntent values; renewal never takes mu
|
||||
}
|
||||
|
||||
// SetPersistenceFailureHandler installs the process host policy before serving.
|
||||
// The callback runs under the writer mutex and must not reenter the store.
|
||||
func (s *PlacementIntentStore) SetPersistenceFailureHandler(handler PersistenceFailureHandler) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.onPersistenceFailure = handler
|
||||
}
|
||||
|
||||
// OpenPlacementIntentStore opens or creates a placement intent store.
|
||||
@@ -72,6 +83,11 @@ func OpenPlacementIntentStore(dir string) (*PlacementIntentStore, error) {
|
||||
if err := s.load(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Loaded names may come from a failed rename/barrier attempt. Establish
|
||||
// their durability before exposing them or taking an equality shortcut.
|
||||
if err := syncRecordDirectory(dir); err != nil {
|
||||
return nil, &RecordPersistenceError{Store: dir, Record: "<recovery>", Err: err}
|
||||
}
|
||||
for volume, rec := range s.records {
|
||||
s.published.Store(volume, copyPlacementIntent(rec))
|
||||
}
|
||||
@@ -81,32 +97,21 @@ func OpenPlacementIntentStore(dir string) (*PlacementIntentStore, error) {
|
||||
// ApplyPlan records placement intent from a sufficient plan. Insufficient
|
||||
// plans are rejected rather than persisted as partial authority-shaped state.
|
||||
func (s *PlacementIntentStore) ApplyPlan(plan PlacementPlan) (PlacementIntent, error) {
|
||||
if !plan.EnoughCandidates() {
|
||||
return PlacementIntent{}, ErrInsufficientPlacementCandidates
|
||||
}
|
||||
intent := PlacementIntent{
|
||||
VolumeID: plan.VolumeID,
|
||||
DesiredRF: plan.DesiredRF,
|
||||
Slots: make([]PlacementSlotIntent, 0, plan.DesiredRF),
|
||||
}
|
||||
for _, candidate := range plan.Candidates[:plan.DesiredRF] {
|
||||
intent.Slots = append(intent.Slots, PlacementSlotIntent{
|
||||
ServerID: candidate.ServerID,
|
||||
PoolID: candidate.PoolID,
|
||||
ReplicaID: candidate.ReplicaID,
|
||||
Source: candidate.Source,
|
||||
DataAddr: candidate.DataAddr,
|
||||
CtrlAddr: candidate.CtrlAddr,
|
||||
ISCSIListenPort: candidate.ISCSIListenPort,
|
||||
NVMeListenPort: candidate.NVMeListenPort,
|
||||
})
|
||||
}
|
||||
if err := validatePlacementIntent(intent); err != nil {
|
||||
intent, err := placementIntentFromPlan(plan)
|
||||
if err != nil {
|
||||
return PlacementIntent{}, err
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return PlacementIntent{}, err
|
||||
}
|
||||
// Equal input already has a durable record; preserve it on restart.
|
||||
if old, ok := s.records[intent.VolumeID]; ok && old.DesiredRF == intent.DesiredRF && slices.Equal(old.Slots, intent.Slots) {
|
||||
return copyPlacementIntent(old), nil
|
||||
}
|
||||
if err := s.putLocked(intent); err != nil {
|
||||
latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure)
|
||||
return PlacementIntent{}, err
|
||||
}
|
||||
s.records[intent.VolumeID] = intent
|
||||
@@ -122,6 +127,9 @@ func (s *PlacementIntentStore) DeletePlacement(volumeID string) error {
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Remove(s.path(volumeID)); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return fmt.Errorf("lifecycle: remove placement intent %s: %w", volumeID, err)
|
||||
}
|
||||
@@ -262,3 +270,83 @@ func copyPlacementIntent(in PlacementIntent) PlacementIntent {
|
||||
out.Slots = append([]PlacementSlotIntent(nil), in.Slots...)
|
||||
return out
|
||||
}
|
||||
|
||||
// ImportPlans replays one startup placement step and publishes only after
|
||||
// the changed files and their shared directory barrier have completed.
|
||||
func (s *PlacementIntentStore) ImportPlans(plans []PlacementPlan) error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return err
|
||||
}
|
||||
changed := make(map[string]PlacementIntent)
|
||||
seen := make(map[string]bool)
|
||||
order := make([]string, 0, len(plans))
|
||||
for _, plan := range plans {
|
||||
intent, err := placementIntentFromPlan(plan)
|
||||
if err != nil {
|
||||
return fmt.Errorf("lifecycle: import placement intent %s: %w", plan.VolumeID, err)
|
||||
}
|
||||
old, ok := s.records[intent.VolumeID]
|
||||
if !seen[intent.VolumeID] {
|
||||
order = append(order, intent.VolumeID)
|
||||
seen[intent.VolumeID] = true
|
||||
}
|
||||
if ok && old.DesiredRF == intent.DesiredRF && slices.Equal(old.Slots, intent.Slots) {
|
||||
delete(changed, intent.VolumeID)
|
||||
continue
|
||||
}
|
||||
changed[intent.VolumeID] = intent
|
||||
}
|
||||
writes := make([]recordWrite, 0, len(order))
|
||||
for _, id := range order {
|
||||
if _, ok := changed[id]; !ok {
|
||||
continue
|
||||
}
|
||||
raw, err := json.MarshalIndent(changed[id], "", " ")
|
||||
if err != nil {
|
||||
return fmt.Errorf("lifecycle: marshal placement intent %s: %w", id, err)
|
||||
}
|
||||
writes = append(writes, recordWrite{name: id + ".json", raw: raw})
|
||||
}
|
||||
if err := writeRecordBatchDurably(s.dir, writes); err != nil {
|
||||
latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure)
|
||||
return err
|
||||
}
|
||||
for _, id := range order {
|
||||
if _, ok := changed[id]; !ok {
|
||||
continue
|
||||
}
|
||||
intent := changed[id]
|
||||
s.records[id] = intent
|
||||
s.published.Store(id, copyPlacementIntent(intent))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func placementIntentFromPlan(plan PlacementPlan) (PlacementIntent, error) {
|
||||
if !plan.EnoughCandidates() {
|
||||
return PlacementIntent{}, ErrInsufficientPlacementCandidates
|
||||
}
|
||||
intent := PlacementIntent{
|
||||
VolumeID: plan.VolumeID,
|
||||
DesiredRF: plan.DesiredRF,
|
||||
Slots: make([]PlacementSlotIntent, 0, plan.DesiredRF),
|
||||
}
|
||||
for _, candidate := range plan.Candidates[:plan.DesiredRF] {
|
||||
intent.Slots = append(intent.Slots, PlacementSlotIntent{
|
||||
ServerID: candidate.ServerID,
|
||||
PoolID: candidate.PoolID,
|
||||
ReplicaID: candidate.ReplicaID,
|
||||
Source: candidate.Source,
|
||||
DataAddr: candidate.DataAddr,
|
||||
CtrlAddr: candidate.CtrlAddr,
|
||||
ISCSIListenPort: candidate.ISCSIListenPort,
|
||||
NVMeListenPort: candidate.NVMeListenPort,
|
||||
})
|
||||
}
|
||||
if err := validatePlacementIntent(intent); err != nil {
|
||||
return PlacementIntent{}, err
|
||||
}
|
||||
return intent, nil
|
||||
}
|
||||
@@ -135,6 +135,7 @@ func TestPlacementSnapshotFailedCommitStaysCommitted(t *testing.T) {
|
||||
if ok != existed || !reflect.DeepEqual(got, before) {
|
||||
t.Fatal("reopen did not retain the committed placement")
|
||||
}
|
||||
s = reopened // failed persistence requires reopening before further writes
|
||||
if _, err = s.ApplyPlan(plan); err != nil {
|
||||
t.Fatal("unblocked commit", err)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPlacementRepeatKeepsRecordAndChangedPlanReplacesIt(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
store, err := OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
plan := PlacementPlan{VolumeID: "volume", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}
|
||||
if _, err := store.ApplyPlan(plan); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
path := filepath.Join(dir, "volume.json")
|
||||
original, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Reloading must not cause an otherwise equal import to rewrite the file.
|
||||
store, err = OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := store.ApplyPlan(plan); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
repeated, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !os.SameFile(original, repeated) || !original.ModTime().Equal(repeated.ModTime()) {
|
||||
t.Fatal("equal placement plan rewrote its durable record")
|
||||
}
|
||||
plan.Candidates[0].ReplicaID = "r2"
|
||||
if _, err := store.ApplyPlan(plan); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
changed, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if os.SameFile(repeated, changed) {
|
||||
t.Fatal("changed placement did not replace its record")
|
||||
}
|
||||
reopened, err := OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, ok := reopened.GetPlacementSnapshot("volume")
|
||||
if !ok || len(got.Slots) != 1 || got.Slots[0].ReplicaID != "r2" {
|
||||
t.Fatalf("changed plan did not survive reload: %+v", got)
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,63 @@
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
// ErrLifecycleRecoveryRequired means a failed persistence operation may have
|
||||
// changed disk. Reopen the store before making further mutations.
|
||||
var ErrLifecycleRecoveryRequired = errors.New("lifecycle: store recovery required")
|
||||
|
||||
// RecordPersistenceError identifies the operation whose durable outcome is
|
||||
// uncertain. A process host can fail-stop rather than remain alive and poisoned.
|
||||
type RecordPersistenceError struct {
|
||||
Store string
|
||||
Record string
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e *RecordPersistenceError) Error() string {
|
||||
return fmt.Sprintf("lifecycle: persist store %q record %q: %v", e.Store, e.Record, e.Err)
|
||||
}
|
||||
|
||||
func (e *RecordPersistenceError) Unwrap() error { return e.Err }
|
||||
|
||||
// PersistenceFailureHandler is called synchronously after a failed I/O has
|
||||
// poisoned a store. It must not reenter a store; production exits the process.
|
||||
type PersistenceFailureHandler func(*RecordPersistenceError)
|
||||
|
||||
// Only a write that may have touched disk poisons the store; a marshal error
|
||||
// happens before any I/O, so the caller can correct the input and retry.
|
||||
func latchPersistenceFailure(err error, prior *error, handler PersistenceFailureHandler) {
|
||||
var failure *RecordPersistenceError
|
||||
if !errors.As(err, &failure) {
|
||||
return
|
||||
}
|
||||
*prior = err
|
||||
if handler != nil {
|
||||
handler(failure)
|
||||
}
|
||||
}
|
||||
|
||||
func recoveryRequired(writeErr error) error {
|
||||
if writeErr == nil {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("%w: %v", ErrLifecycleRecoveryRequired, writeErr)
|
||||
}
|
||||
|
||||
// Hooks are installed only in isolated subprocess tests. Production uses
|
||||
// the real filesystem operations; one helper owns all publication seams.
|
||||
type durableRecordHooks struct {
|
||||
crash func(string)
|
||||
fileSync func(*os.File) error
|
||||
dirSync func(string) error
|
||||
crash func(string)
|
||||
fileSync func(*os.File) error
|
||||
dirSync func(string) error
|
||||
batchSyncfs *bool
|
||||
fsSync func(*os.File) error
|
||||
}
|
||||
|
||||
var durableRecordHooksForTest atomic.Pointer[durableRecordHooks]
|
||||
@@ -20,42 +65,170 @@ var durableRecordHooksForTest atomic.Pointer[durableRecordHooks]
|
||||
// writeRecordDurably implements INV-LIFECYCLE-STORE-DURABLE-001 for puts and
|
||||
// replacements. A post-rename error may leave the new record on disk.
|
||||
func writeRecordDurably(dir, name string, raw []byte) error {
|
||||
if err := writeRecordBeforeDirectorySync(dir, name, raw); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: name, Err: err}
|
||||
}
|
||||
if err := syncRecordDirectory(dir); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: name, Err: err}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type recordWrite struct {
|
||||
name string
|
||||
raw []byte
|
||||
}
|
||||
|
||||
// A startup import makes all changed data durable before rename, then shares
|
||||
// a directory barrier before publication. A failed step leaves complete old/new
|
||||
// names. Linux >= 5.8 on ext4, xfs, btrfs or tmpfs uses one syncfs for staged
|
||||
// temps; other systems sync each.
|
||||
func writeRecordBatchDurably(dir string, records []recordWrite) error {
|
||||
if len(records) == 0 {
|
||||
return nil
|
||||
}
|
||||
useSyncfs := recordBatchSyncfsSupported(dir)
|
||||
hooks := durableRecordHooksForTest.Load()
|
||||
if hooks != nil && hooks.batchSyncfs != nil {
|
||||
useSyncfs = *hooks.batchSyncfs
|
||||
}
|
||||
if useSyncfs {
|
||||
return writeRecordBatchWithSyncfs(dir, records)
|
||||
}
|
||||
for _, record := range records {
|
||||
if err := writeRecordBeforeDirectorySync(dir, record.name, record.raw); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: record.name, Err: err}
|
||||
}
|
||||
}
|
||||
if err := syncRecordDirectory(dir); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: "<import-step>", Err: err}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ImportDurabilityMode reports the batch persistence path for records under dir.
|
||||
// Single-record mutations always retain their file and directory fsyncs.
|
||||
func ImportDurabilityMode(dir string) string {
|
||||
if recordBatchSyncfsSupported(dir) {
|
||||
return "syncfs (Linux >= 5.8, local filesystem)"
|
||||
}
|
||||
return "per-file fsync (syncfs writeback error reporting unavailable)"
|
||||
}
|
||||
|
||||
func writeRecordBatchWithSyncfs(dir string, records []recordWrite) error {
|
||||
// Opening before any write samples the filesystem's writeback errseq.
|
||||
fd, err := os.Open(dir)
|
||||
if err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: "<import-step>", Err: err}
|
||||
}
|
||||
defer fd.Close()
|
||||
hooks := durableRecordHooksForTest.Load()
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("batch-open")
|
||||
}
|
||||
temps := make([]string, 0, len(records))
|
||||
defer func() {
|
||||
for _, temp := range temps {
|
||||
_ = os.Remove(temp)
|
||||
}
|
||||
}()
|
||||
for _, record := range records {
|
||||
temp, err := writeRecordTemp(dir, record.name, record.raw, false)
|
||||
if err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: record.name, Err: err}
|
||||
}
|
||||
temps = append(temps, temp)
|
||||
}
|
||||
fsSync := syncRecordFilesystem
|
||||
if hooks != nil && hooks.fsSync != nil {
|
||||
fsSync = hooks.fsSync
|
||||
}
|
||||
// Never retry a failed syncfs: it consumes the writeback error. The caller
|
||||
// poisons the store; recovery creates fresh temps for any subsequent import.
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("before-syncfs")
|
||||
}
|
||||
if err := fsSync(fd); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: "<import-step>", Err: fmt.Errorf("lifecycle: sync record filesystem: %w", err)}
|
||||
}
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("after-syncfs")
|
||||
}
|
||||
for i, record := range records {
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("before-rename")
|
||||
}
|
||||
if err := os.Rename(temps[i], filepath.Join(dir, record.name)); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: record.name, Err: err}
|
||||
}
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("after-rename")
|
||||
}
|
||||
}
|
||||
if err := syncRecordDirectory(dir); err != nil {
|
||||
return &RecordPersistenceError{Store: dir, Record: "<import-step>", Err: err}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func writeRecordBeforeDirectorySync(dir, name string, raw []byte) error {
|
||||
temp, err := writeRecordTemp(dir, name, raw, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer os.Remove(temp)
|
||||
hooks := durableRecordHooksForTest.Load()
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("before-rename")
|
||||
}
|
||||
if err := os.Rename(temp, filepath.Join(dir, name)); err != nil {
|
||||
return fmt.Errorf("lifecycle: rename record %s: %w", name, err)
|
||||
}
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("after-rename")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func writeRecordTemp(dir, name string, raw []byte, syncFile bool) (temp string, resultErr error) {
|
||||
f, err := os.CreateTemp(dir, name+".*.tmp")
|
||||
if err != nil {
|
||||
return fmt.Errorf("lifecycle: temp record %s: %w", name, err)
|
||||
return "", fmt.Errorf("lifecycle: temp record %s: %w", name, err)
|
||||
}
|
||||
defer os.Remove(f.Name())
|
||||
defer func() {
|
||||
if resultErr != nil {
|
||||
_ = os.Remove(f.Name())
|
||||
}
|
||||
}()
|
||||
if _, err := f.Write(raw); err != nil {
|
||||
_ = f.Close()
|
||||
return fmt.Errorf("lifecycle: write record %s: %w", name, err)
|
||||
return "", fmt.Errorf("lifecycle: write record %s: %w", name, err)
|
||||
}
|
||||
hooks := durableRecordHooksForTest.Load()
|
||||
fileSync := f.Sync
|
||||
if hooks != nil && hooks.fileSync != nil {
|
||||
fileSync = func() error { return hooks.fileSync(f) }
|
||||
}
|
||||
if err := fileSync(); err != nil {
|
||||
_ = f.Close()
|
||||
return fmt.Errorf("lifecycle: sync record %s: %w", name, err)
|
||||
if syncFile {
|
||||
if err := fileSync(); err != nil {
|
||||
_ = f.Close()
|
||||
return "", fmt.Errorf("lifecycle: sync record %s: %w", name, err)
|
||||
}
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
return fmt.Errorf("lifecycle: close record %s: %w", name, err)
|
||||
}
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("before-rename")
|
||||
}
|
||||
if err := os.Rename(f.Name(), filepath.Join(dir, name)); err != nil {
|
||||
return fmt.Errorf("lifecycle: rename record %s: %w", name, err)
|
||||
}
|
||||
if hooks != nil && hooks.crash != nil {
|
||||
hooks.crash("after-rename")
|
||||
return "", fmt.Errorf("lifecycle: close record %s: %w", name, err)
|
||||
}
|
||||
return f.Name(), nil
|
||||
}
|
||||
|
||||
func syncRecordDirectory(dir string) error {
|
||||
hooks := durableRecordHooksForTest.Load()
|
||||
dirSync := syncBindingParent
|
||||
if hooks != nil && hooks.dirSync != nil {
|
||||
dirSync = hooks.dirSync
|
||||
}
|
||||
if err := dirSync(dir); err != nil {
|
||||
return fmt.Errorf("lifecycle: sync record directory %s: %w", name, err)
|
||||
return fmt.Errorf("lifecycle: sync record directory %s: %w", dir, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var recordKernelSyncfsErrors = detectRecordSyncfs()
|
||||
|
||||
// recordBatchSyncfsSupported reports whether syncfs on dir's filesystem
|
||||
// returns the writeback errors a per-file fsync would. Overlay, FUSE and
|
||||
// network mounts keep per-file fsync: syncfs does not reach their backing files.
|
||||
func recordBatchSyncfsSupported(dir string) bool {
|
||||
if !recordKernelSyncfsErrors {
|
||||
return false
|
||||
}
|
||||
var st unix.Statfs_t
|
||||
if unix.Statfs(dir, &st) != nil {
|
||||
return false
|
||||
}
|
||||
return filesystemReportsSyncfsErrors(uint32(st.Type))
|
||||
}
|
||||
|
||||
func filesystemReportsSyncfsErrors(fsType uint32) bool {
|
||||
switch fsType {
|
||||
case unix.EXT4_SUPER_MAGIC, unix.XFS_SUPER_MAGIC, unix.BTRFS_SUPER_MAGIC, unix.TMPFS_MAGIC:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func detectRecordSyncfs() bool {
|
||||
var u unix.Utsname
|
||||
if unix.Uname(&u) != nil {
|
||||
return false
|
||||
}
|
||||
return kernelHasSyncfsErrors(unix.ByteSliceToString(u.Release[:]))
|
||||
}
|
||||
|
||||
func kernelHasSyncfsErrors(release string) bool {
|
||||
parts := strings.SplitN(release, ".", 3)
|
||||
if len(parts) < 2 {
|
||||
return false
|
||||
}
|
||||
major, err := strconv.Atoi(parts[0])
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
minor, err := strconv.Atoi(parts[1])
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return major > 5 || major == 5 && minor >= 8
|
||||
}
|
||||
|
||||
func syncRecordFilesystem(fd *os.File) error { return unix.Syncfs(int(fd.Fd())) }
|
||||
@@ -0,0 +1,12 @@
|
||||
//go:build !linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func recordBatchSyncfsSupported(string) bool { return false }
|
||||
|
||||
func syncRecordFilesystem(*os.File) error { return fmt.Errorf("syncfs unavailable on this platform") }
|
||||
@@ -0,0 +1,106 @@
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestFailedRemoveKeepsRecordForRetry(t *testing.T) {
|
||||
for _, kind := range []string{"node", "placement", "volume"} {
|
||||
t.Run(kind, func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
var remove func() error
|
||||
var present func() (record, snapshot bool)
|
||||
switch kind {
|
||||
case "node":
|
||||
s, err := OpenNodeInventoryStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := s.RegisterNode(NodeRegistration{ServerID: "v", Addr: "127.0.0.1:19001"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
remove = func() error { return s.RemoveNode("v") }
|
||||
present = func() (bool, bool) { _, a := s.GetNode("v"); _, b := s.GetNodeSnapshot("v"); return a, b }
|
||||
case "placement":
|
||||
s, err := OpenPlacementIntentStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := s.ApplyPlan(PlacementPlan{VolumeID: "v", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
remove = func() error { return s.DeletePlacement("v") }
|
||||
present = func() (bool, bool) { _, a := s.GetPlacement("v"); _, b := s.GetPlacementSnapshot("v"); return a, b }
|
||||
case "volume":
|
||||
s, err := OpenFileStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := s.CreateVolume(VolumeSpec{VolumeID: "v", SizeBytes: 1 << 20, ReplicationFactor: 1}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
remove = func() error { return s.DeleteVolume("v") }
|
||||
present = func() (bool, bool) { _, a := s.GetVolume("v"); _, b := s.GetVolumeSnapshot("v"); return a, b }
|
||||
}
|
||||
path := filepath.Join(dir, "v.json")
|
||||
backup := path + ".saved"
|
||||
if err := os.Rename(path, backup); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Mkdir(path, 0700); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
blocker := filepath.Join(path, "blocker")
|
||||
if err := os.WriteFile(blocker, []byte("fixture"), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := remove(); err == nil {
|
||||
t.Fatal("nonempty-directory removal succeeded")
|
||||
}
|
||||
if record, snapshot := present(); !record || !snapshot {
|
||||
t.Fatalf("failed removal hid retry state: record=%v snapshot=%v", record, snapshot)
|
||||
}
|
||||
if err := os.Remove(blocker); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Remove(path); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Rename(backup, path); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := remove(); err != nil {
|
||||
t.Fatalf("later removal retry: %v", err)
|
||||
}
|
||||
if record, snapshot := present(); record || snapshot {
|
||||
t.Fatalf("successful removal left state: record=%v snapshot=%v", record, snapshot)
|
||||
}
|
||||
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
||||
t.Fatalf("record file survived successful retry: %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeMarshalErrorDoesNotRequireRecovery(t *testing.T) {
|
||||
s, err := OpenNodeInventoryStore(t.TempDir())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var latched []*RecordPersistenceError
|
||||
s.SetPersistenceFailureHandler(func(f *RecordPersistenceError) { latched = append(latched, f) })
|
||||
reg := NodeRegistration{ServerID: "n", Addr: "127.0.0.1:19001", SeenAt: time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC)}
|
||||
if _, err := s.RegisterNode(reg); err == nil {
|
||||
t.Fatal("unencodable SeenAt was accepted")
|
||||
}
|
||||
reg.SeenAt = time.Now().UTC()
|
||||
if _, err := s.RegisterNode(reg); err != nil {
|
||||
t.Fatalf("corrected registration after a marshal error: %v", err)
|
||||
}
|
||||
if len(latched) != 0 {
|
||||
t.Fatalf("marshal error reached the persistence policy: %v", latched)
|
||||
}
|
||||
}
|
||||
@@ -67,9 +67,11 @@ type VolumeRecord struct {
|
||||
|
||||
// FileStore persists one JSON record per volume ID.
|
||||
type FileStore struct {
|
||||
mu sync.Mutex
|
||||
dir string
|
||||
records map[string]VolumeRecord
|
||||
mu sync.Mutex
|
||||
dir string
|
||||
writeErr error // a failed put requires reopen before another mutation
|
||||
onPersistenceFailure PersistenceFailureHandler
|
||||
records map[string]VolumeRecord
|
||||
// snap mirrors records as an immutable copy, republished at every change
|
||||
// of records, for lock-free renewal-path reads.
|
||||
snap atomic.Pointer[map[string]VolumeRecord]
|
||||
@@ -97,6 +99,14 @@ func (s *FileStore) GetVolumeSnapshot(volumeID string) (VolumeRecord, bool) {
|
||||
return rec, ok
|
||||
}
|
||||
|
||||
// SetPersistenceFailureHandler installs the process host policy before serving.
|
||||
// The callback runs under the writer mutex and must not reenter the store.
|
||||
func (s *FileStore) SetPersistenceFailureHandler(handler PersistenceFailureHandler) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.onPersistenceFailure = handler
|
||||
}
|
||||
|
||||
// OpenFileStore opens or creates a lifecycle intent store.
|
||||
func OpenFileStore(dir string) (*FileStore, error) {
|
||||
if dir == "" {
|
||||
@@ -127,6 +137,11 @@ func OpenFileStore(dir string) (*FileStore, error) {
|
||||
if err := s.load(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Visible names can come from a failed directory barrier. Recover their
|
||||
// durability before publication or an equal create can acknowledge them.
|
||||
if err := syncRecordDirectory(dir); err != nil {
|
||||
return nil, &RecordPersistenceError{Store: dir, Record: "<recovery>", Err: err}
|
||||
}
|
||||
s.publishLocked()
|
||||
return s, nil
|
||||
}
|
||||
@@ -137,6 +152,9 @@ func (s *FileStore) CreateVolume(spec VolumeSpec) (VolumeRecord, error) {
|
||||
spec = normalizeVolumeSpec(spec)
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return VolumeRecord{}, err
|
||||
}
|
||||
if existing, ok := s.records[spec.VolumeID]; ok {
|
||||
if existing.Spec.SourceVolume != spec.SourceVolume || existing.Spec.SourceLayoutID != spec.SourceLayoutID || existing.Spec.SourceSnapshot != spec.SourceSnapshot || existing.Spec.CreateRequestID != spec.CreateRequestID {
|
||||
return VolumeRecord{}, ErrVolumeConflict
|
||||
@@ -221,6 +239,9 @@ func (s *FileStore) CreateVolume(spec VolumeSpec) (VolumeRecord, error) {
|
||||
func (s *FileStore) RedrawPendingLayoutID(volumeID, rejectedID string) (VolumeRecord, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return VolumeRecord{}, err
|
||||
}
|
||||
rec, ok := s.records[volumeID]
|
||||
if !ok {
|
||||
return VolumeRecord{}, ErrVolumeNotFound
|
||||
@@ -301,6 +322,9 @@ func (s *FileStore) settlePendingLayoutIDLocked(rec VolumeRecord) (VolumeRecord,
|
||||
func (s *FileStore) MarkStoreReady(volumeID, layoutID string) (VolumeRecord, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return VolumeRecord{}, err
|
||||
}
|
||||
rec, ok := s.records[volumeID]
|
||||
if !ok {
|
||||
return VolumeRecord{}, ErrVolumeNotFound
|
||||
@@ -362,11 +386,14 @@ func (s *FileStore) DeleteVolume(volumeID string) error {
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
delete(s.records, volumeID)
|
||||
s.publishLocked()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Remove(s.path(volumeID)); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return fmt.Errorf("lifecycle: remove %s: %w", volumeID, err)
|
||||
}
|
||||
delete(s.records, volumeID)
|
||||
s.publishLocked()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -381,6 +408,9 @@ func (s *FileStore) AttachVolume(volumeID, nodeID string) (VolumeRecord, error)
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return VolumeRecord{}, err
|
||||
}
|
||||
rec, ok := s.records[volumeID]
|
||||
if !ok {
|
||||
return VolumeRecord{}, ErrVolumeNotFound
|
||||
@@ -405,6 +435,9 @@ func (s *FileStore) DetachVolume(volumeID, nodeID string) (VolumeRecord, error)
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if err := recoveryRequired(s.writeErr); err != nil {
|
||||
return VolumeRecord{}, err
|
||||
}
|
||||
rec, ok := s.records[volumeID]
|
||||
if !ok {
|
||||
return VolumeRecord{}, ErrVolumeNotFound
|
||||
@@ -480,7 +513,11 @@ func (s *FileStore) putLocked(rec VolumeRecord) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("lifecycle: marshal %s: %w", rec.Spec.VolumeID, err)
|
||||
}
|
||||
return writeRecordDurably(s.dir, rec.Spec.VolumeID+".json", raw)
|
||||
err = writeRecordDurably(s.dir, rec.Spec.VolumeID+".json", raw)
|
||||
if err != nil {
|
||||
latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *FileStore) path(volumeID string) string {
|
||||
|
||||
@@ -60,6 +60,8 @@ func TestLifecycleStoreParentSyncChild(t *testing.T) {
|
||||
want = append(want, "/"+strings.Join(parts[:n], "/"))
|
||||
}
|
||||
want = append(want, "/")
|
||||
ancestor := want[len(want)-2]
|
||||
want = append(want, abs)
|
||||
var calls []string
|
||||
var warnings bytes.Buffer
|
||||
log.SetOutput(&warnings)
|
||||
@@ -68,7 +70,7 @@ func TestLifecycleStoreParentSyncChild(t *testing.T) {
|
||||
fault := &os.PathError{Op: "open", Path: want[0], Err: os.ErrPermission}
|
||||
syncBindingParent = func(path string) error {
|
||||
calls = append(calls, path)
|
||||
if shape == "ancestor-permission" && path == want[len(want)-2] {
|
||||
if shape == "ancestor-permission" && path == ancestor {
|
||||
return &os.PathError{Op: "open", Path: path, Err: os.ErrPermission}
|
||||
}
|
||||
if failFirst {
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
//go:build linux
|
||||
|
||||
package lifecycle
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestVolumeEqualityRequiresRecovery(t *testing.T) {
|
||||
for _, mode := range []string{"reopen", "failed-put"} {
|
||||
t.Run(mode, func(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestVolumeRecoveryChild$", "-test.timeout=8s")
|
||||
cmd.Env = append(os.Environ(), "VOLUME_RECOVERY_MODE="+mode)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("volume recovery: %v context=%v\n%s", err, ctx.Err(), out)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeRecoveryChild(t *testing.T) {
|
||||
mode := os.Getenv("VOLUME_RECOVERY_MODE")
|
||||
if mode == "" {
|
||||
t.Skip("isolated recovery hooks")
|
||||
}
|
||||
dir := t.TempDir()
|
||||
s, err := OpenFileStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
spec := VolumeSpec{VolumeID: "v", SizeBytes: 1 << 20, ReplicationFactor: 1}
|
||||
rec, err := s.CreateVolume(spec)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := s.MarkStoreReady("v", rec.Spec.LayoutID); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
old, _ := s.GetVolumeSnapshot("v")
|
||||
fault := errors.New("injected volume directory barrier failure")
|
||||
callbacks := 0
|
||||
s.SetPersistenceFailureHandler(func(failure *RecordPersistenceError) {
|
||||
callbacks++
|
||||
if s.writeErr == nil || failure.Store != dir || failure.Record != "v.json" || !errors.Is(failure, fault) {
|
||||
t.Fatalf("incorrect volume policy context: %+v", failure)
|
||||
}
|
||||
})
|
||||
durableRecordHooksForTest.Store(&durableRecordHooks{dirSync: func(string) error { return fault }})
|
||||
defer durableRecordHooksForTest.Store(nil)
|
||||
if mode == "reopen" {
|
||||
if _, err := OpenFileStore(dir); !errors.Is(err, fault) {
|
||||
t.Fatalf("loaded volume published without recovery barrier: %v", err)
|
||||
}
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
reopened, err := OpenFileStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, _ := reopened.GetVolumeSnapshot("v"); got != old {
|
||||
t.Fatal("recovery changed volume")
|
||||
}
|
||||
return
|
||||
}
|
||||
if _, err := s.AttachVolume("v", "node"); !errors.Is(err, fault) {
|
||||
t.Fatalf("attachment did not fail at barrier: %v", err)
|
||||
}
|
||||
if callbacks != 1 {
|
||||
t.Fatalf("volume failure callbacks=%d want1", callbacks)
|
||||
}
|
||||
if got, _ := s.GetVolumeSnapshot("v"); got != old {
|
||||
t.Fatal("failed attach published")
|
||||
}
|
||||
durableRecordHooksForTest.Store(nil)
|
||||
if _, err := s.CreateVolume(spec); !errors.Is(err, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("equal create must refuse after possibly-applied failure: %v", err)
|
||||
}
|
||||
_, redrawErr := s.RedrawPendingLayoutID("v", rec.Spec.LayoutID)
|
||||
_, markErr := s.MarkStoreReady("v", rec.Spec.LayoutID)
|
||||
_, attachErr := s.AttachVolume("v", "node")
|
||||
_, detachErr := s.DetachVolume("v", "node")
|
||||
for _, err := range []error{redrawErr, markErr, attachErr, detachErr, s.DeleteVolume("v")} {
|
||||
if !errors.Is(err, ErrLifecycleRecoveryRequired) {
|
||||
t.Fatalf("mutation after uncertainty: %v", err)
|
||||
}
|
||||
}
|
||||
reopened, err := OpenFileStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, _ := reopened.GetVolumeSnapshot("v"); got.AttachedTo != "node" {
|
||||
t.Fatal("fixture did not retain renamed attachment")
|
||||
}
|
||||
if _, err := reopened.DetachVolume("v", "node"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
again, err := OpenFileStore(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, _ := again.GetVolumeSnapshot("v"); !reflect.DeepEqual(got, old) {
|
||||
t.Fatal("recovered successful detach differs on disk")
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,55 @@ The design is described in three documents, and this one collects their machines
|
||||
|
||||
Each machine lists its states, the allowed transitions, the guard that must hold for each transition, where the guard is enforced, and the IDs of the Part B rows that protect it. A state name in `code font` is a value in the code; the other names describe a condition and are not code types.
|
||||
|
||||
### Lifecycle record I/O and supervised master recovery
|
||||
|
||||
This is the process projection of `INV-LIFECYCLE-STORE-DURABLE-001` and
|
||||
`INV-LIFECYCLE-FAILSTOP-001`; it adds no record format or authority state.
|
||||
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
[*] --> Recovering: supervisor starts master
|
||||
Recovering --> Ready: complete records loaded, directory barriers succeed
|
||||
Ready --> Ready: changed files synced, renamed, directory synced
|
||||
Ready --> Faulted: record put/import persistence failure
|
||||
Recovering --> Faulted: recovery directory sync failure
|
||||
Faulted --> Exited: one ERROR attempt, exit 1 within 1 s
|
||||
Exited --> Recovering: supervisor restarts
|
||||
```
|
||||
|
||||
| From | To | Guard | Enforced in | Protects |
|
||||
|---|---|---|---|---|
|
||||
| — | Recovering | the supervisor starts blockmaster with a lifecycle store | `cmd/blockmaster/main.go` `run`; `deploy/systemd/sw-blockmaster.service` | `INV-LIFECYCLE-FAILSTOP-001` |
|
||||
| Recovering | Ready | each node, placement and volume store loads complete records and its records-directory barrier succeeds; the cluster-spec import completes before serving | `core/lifecycle/node_inventory.go` `OpenNodeInventoryStore`; `core/lifecycle/placement_intent.go` `OpenPlacementIntentStore`; `core/lifecycle/store.go` `OpenFileStore`; `cmd/blockmaster/main.go` `run` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-LIFECYCLE-FAILSTOP-001` |
|
||||
| Ready | Ready | a changed put or import: changed files are durable before rename (per-file fsync, or one `syncfs` on a qualified filesystem) and one directory barrier precedes publication; an unchanged record does no I/O and keeps its SeenAt | `core/lifecycle/record_file.go` `writeRecordDurably`, `writeRecordBatchDurably`; `core/lifecycle/node_inventory.go` `ImportNodes`, `registrationLocked`; `core/lifecycle/placement_intent.go` `ImportPlans` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-NODE-REGISTRATION-FRESHNESS-001` |
|
||||
| Ready | Faulted | a put or import returns a `RecordPersistenceError`; the store latches it, so later mutations return `ErrLifecycleRecoveryRequired`, before calling the process policy; a marshal error before any I/O does not latch | `core/lifecycle/record_file.go` `latchPersistenceFailure`; each store's `putLocked`, `ImportNodes`, `ImportPlans` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-LIFECYCLE-FAILSTOP-001` |
|
||||
| Recovering | Faulted | a store open's records-directory sync fails; `New` hands the `RecordPersistenceError` to the process policy | `core/lifecycle/record_file.go` `syncRecordDirectory`; `core/host/master/host.go` `New` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-LIFECYCLE-FAILSTOP-001` |
|
||||
| Faulted | Exited | the policy arms a one-second exit timer, attempts one ERROR line, then exits 1 | `core/host/master/lifecycle_failure.go` `lifecycleFailStop` | `INV-LIFECYCLE-FAILSTOP-001` |
|
||||
| Exited | Recovering | the supervisor restarts blockmaster (`Restart=on-failure`) | `deploy/systemd/sw-blockmaster.service` | `INV-LIFECYCLE-FAILSTOP-001` |
|
||||
|
||||
A store latches the error before calling the process policy. A failed step may
|
||||
leave a mix of complete old and new files; recovery syncs their directory and
|
||||
startup reconciles the declarative import before serving. Temporary files are
|
||||
not records. On Linux >= 5.8 with the records on ext4, xfs, btrfs or tmpfs,
|
||||
startup import opens the records-directory fd before writing, writes and
|
||||
closes every changed temp, calls one `syncfs`, then renames all temps and
|
||||
syncs the directory before publication. A failed `syncfs` is never retried
|
||||
within the step: its writeback error may have been consumed. Recovery writes
|
||||
fresh temps. Older kernels, other filesystems (overlay, FUSE, NFS: syncfs does
|
||||
not reach their backing files) and other platforms retain per-file fsync
|
||||
before rename; startup reports the chosen path. The filesystem-wide sync can
|
||||
also wait for unrelated writeback on that filesystem.
|
||||
The executable arms a one-second process-exit timer before logging
|
||||
and exits immediately after the log returns, rather than waiting for graceful
|
||||
shutdown behind a writer. Embedders without this process policy must reopen a
|
||||
failed store before any further mutation. Removal errors do not invoke this
|
||||
policy: the in-memory record and its published snapshot stay present until
|
||||
removal succeeds, so a later retirement tick can retry. This is covered by
|
||||
`TestFailedRemoveKeepsRecordForRetry` and
|
||||
`TestSpecRetirementLocalFailureDoesNotStopOtherVolumesOrProductTick`.
|
||||
A successful removal still has the separate directory-sync limitation
|
||||
recorded below.
|
||||
|
||||
### M1 walstore: open, recover, serve, fault
|
||||
|
||||
The local storage engine and the durable backend in front of it. Diagrams in the core design: the per-I/O gate in [§1.1](block-design.md#11-frontends-and-the-backend-contract), and the life of one write (appended, synced, in the extent, checkpointed, reusable) in [§1.2](block-design.md#12-walstore-wal-plus-extent).
|
||||
@@ -547,8 +596,6 @@ Tests: `TestMaintenanceKickRunsAPassNow`, `TestMaintenanceKickedBusyPassRetriesS
|
||||
`TestDefaultConfigCleansAfterEachSnapshotDelete`. Detach/fence/Close cancels and joins before
|
||||
catalog/storage release; only a still-current handle may re-arm after safe abort.
|
||||
A pass has no total deadline. Its one-minute no-progress window renews only on a strict advance of this pass's finite (phase, cursor) work position; a stalled pass answers `no_progress`. Each remote request has a separate 30 s deadline; request attempts never renew the window. The existing cursor resumes later; retention failure skips cleaning.
|
||||
A scoped GC pass traces the whole catalog but mutates only its target volume,
|
||||
with a separate scope/config-bound mark. Incomplete marks carry no coverage.
|
||||
|
||||
The scheduled-snapshot worker runs beside it under the same owner and join, on
|
||||
in-process monotonic time: `Armed -> Due -> Running -> Armed`. A success sets the
|
||||
@@ -973,14 +1020,16 @@ Notes:
|
||||
| `INV-FMT-LEVEL0-V100-001` | At format level 0 the master writes as v1.0: grants clamp to the persisted horizon, an extender keeps it current, forced moves and re-grants wait for the later of horizon and deadline plus skew, records are version 1. Every grant raises the deadline at both levels. | M2 Granted → Granted; Expired → Moved (forced); Expired → Granted (level 0) | `core/authority/workspace_lease_v100.go` `renewV100Locked`, `extendWorkspaceLease`, `forcedMoveBarrierV100Locked`, `ackValidityLocked`, `envelopeVersionLocked`; `core/authority/workspace_lease_view.go` `RenewWorkspaceLease` | `TestALevel0RenewalKeepsTheHorizonCurrent`, `TestALevel0GrantIsClampedToTheHorizon`, `TestTheForcedBarrierFollowsTheFormatLevel`, `TestRecordEnvelopeVersionFollowsTheFormatLevel` (`core/authority/workspace_format_level_test.go`) | `FormatGateMaster` `OneServer`, `GraceOnlyFinal` (mutations `level0_no_horizon`, `old_starts_after_finalize`) | ACTIVE |
|
||||
| `INV-FMT-RETIRE-001` | A host retire, the node registry's only writer after start, is refused, naming the volumes, while the host holds a placement or a live line, and unless confirm repeats the id. A retired id is unregistered; if the host returns it registers again at its reported level. | FormatGate Retire | `core/host/master/format_gate.go` `RetireHost`; `core/host/master/journal_isolation.go` `volumesServedBy` | `TestRetireHostRefusesAHostThatHoldsWork` (`core/host/master/format_gate_test.go`); `TestACleanMoveReleasesTheTopologyHome`, `TestTheTopologyHomeHoldsTheVolumeBeforeAMove`, `TestTheTopologyHomeAloneHoldsTheVolumeBeforeAMove` (`core/host/master/served_topology_move_test.go`); `TestClusterRetireHost` (`cmd/sw-block/cluster_format_test.go`); `TestNodeRegistryIsWrittenOnlyAtStartup` (`cmd/blockmaster/node_registry_guard_test.go`) | `FormatGate` r2 `OneServer` (mutation `retire_holding_host`) | ACTIVE |
|
||||
| `INV-LIFECYCLE-SNAPSHOT-001` | The Volumes and deletion-reservation snapshots read by the renewal path equal the store records after every change of the records, including load, delete and a protective reservation kept in memory on an unknown write outcome; a published snapshot is never mutated. | M2 Bound → Deleting (renewal reads) | `core/lifecycle/store.go` `publishLocked`, `GetVolumeSnapshot`; `core/lifecycle/deletion_reservations.go` `publishLocked`, `ReservedSnapshot` | `TestDeletionReservationSnapshotFollowsRecords`, `TestFileStoreSnapshotFollowsRecords`, `TestLifecycleSnapshotReadsDoNotTakeStoreMutex`, `TestLifecycleSnapshotConcurrentWriters` (`core/lifecycle/renewal_snapshot_test.go`); `TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation` (`core/host/master/workspace_lease_horizon_test.go`) | — | ACTIVE |
|
||||
| `INV-LIFECYCLE-STORE-DURABLE-001` | Node registration, volume record and placement-intent puts/replacements are atomic and durable: after a crash the record file is the complete old or the complete new record; a put that returned nil has fsynced the file and its directory. | M2 lifecycle record publication | `core/lifecycle/record_file.go` `writeRecordDurably`; `node_inventory.go`, `store.go`, `placement_intent.go` `putLocked` | `TestNodeInventoryCrashKeepsCompleteRegistration` (`core/lifecycle/node_inventory_crash_test.go`); `TestFileStoreCrashKeepsCompleteRecord`, `TestPlacementStoreCrashKeepsCompleteRecord`, `TestLifecyclePutSyncOrderAndFailure` (`core/lifecycle/store_crash_test.go`); `TestLifecycleStoreParentSync` (`core/lifecycle/store_parent_sync_test.go`) | � | ACTIVE |
|
||||
| `INV-NODE-REGISTRATION-FRESHNESS-001` | Replaying a node registration without an observation time preserves its stored SeenAt; unchanged non-time fields do not rewrite its record. A restart is not a fresh observation, also when the declaration changed; a live heartbeat supplies freshness independently. | M2 lifecycle registration replay (no authority transition) | `core/lifecycle/node_inventory.go` `ImportNodes`, `RegisterNode`, `registrationLocked`; `core/host/master/observation_snapshot.go` `nodeHeartbeat`; `core/lifecycle/verified_placement.go` `VerifyPlacementIntent` | `TestUnchangedNodeRestartDoesNotRefreshAStaleObservation`, `TestChangedNodeImportDoesNotRefreshAStaleObservation` (`core/lifecycle/node_import_freshness_test.go`); `TestObservationNodesReportTheNewestHeartbeat` (`core/host/master/observation_heartbeat_test.go`); live-holder process restart qualification pending | Observation time is evidence, not authority; a declaration is not an observation | STUB |
|
||||
| `INV-LIFECYCLE-STORE-DURABLE-001` | A successful record put/import publishes only after complete replacement records and their directory are durable. Open syncs the records directory before publication. A possibly-applied failure blocks mutations until reopen; recovery reconciles complete old/new records. | M2 lifecycle record publication | `core/lifecycle/record_file.go` `writeRecordDurably`, `writeRecordBatchDurably`; `node_inventory.go` `ImportNodes`; `placement_intent.go` `ImportPlans`; `node_inventory.go`, `store.go`, `placement_intent.go` `putLocked` | `TestNodeInventoryCrashKeepsCompleteRegistration` (`core/lifecycle/node_inventory_crash_test.go`); `TestFileStoreCrashKeepsCompleteRecord`, `TestPlacementStoreCrashKeepsCompleteRecord`, `TestLifecyclePutSyncOrderAndFailure` (`core/lifecycle/store_crash_test.go`); `TestLifecycleStoreParentSync` (`core/lifecycle/store_parent_sync_test.go`); `TestImportStepSyncsChangedFilesThenOneDirectory` (`core/lifecycle/import_step_sync_test.go`); `TestImportSyncfsFailureAndOrdering`, `TestImportSyncfsReturnedFailurePolicyAndReplay`, `TestImportSyncfsCrashBoundaries`, `TestSyncfsKernelGate`, `TestSyncfsFilesystemGate` (`core/lifecycle/import_syncfs_test.go`); `TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk` (`core/lifecycle/import_recovery_test.go`); `TestVolumeEqualityRequiresRecovery` (`core/lifecycle/volume_recovery_test.go`); `TestNodeMarshalErrorDoesNotRequireRecovery` (`core/lifecycle/remove_retry_test.go`) | Lifecycle record publication, including startup-step durability barrier | ACTIVE |
|
||||
| `INV-LIFECYCLE-FAILSTOP-001` | A supervised master exits nonzero within one second of a lifecycle put/import or open-barrier persistence failure, independently of logging. It attempts one ERROR; restart completes recovery barriers and import before serving. | Lifecycle process ready/recovering → faulted → exited → recovering | `core/host/master/lifecycle_failure.go` `lifecycleFailStop`; `host.go` `New`; `cmd/blockmaster/main.go` `run`; lifecycle store failure handlers | `TestMasterImportPersistenceFailureExitsAndRecovers` (`cmd/blockmaster/persist_exit_test.go`); `TestLifecyclePersistenceFailureStopsTheProcess`, `TestLifecycleFailStopExitsWithBlockedLogger` (`core/host/master/lifecycle_failure_test.go`) | Manual process-fault/recovery projection of lifecycle record durability; no new wire or format state | ACTIVE |
|
||||
| `INV-VOL-ID-NO-REUSE-001` | A deleted volume id is never created or attached again. | M2 Deleting; M6 purging → deleted | `core/host/master/services.go` `MarkVolumeDeleting`; `core/frontend/chunkstore/layout/create.go` `createVolume` | `TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart` (`core/host/master/volume_deleting_test.go`); `TestCreateVolume_OverAnExistingHeadByState` (`core/frontend/chunkstore/layout/create_test.go`) | `ChunkLifecycleFixed` `NoIdReuse` | ACTIVE |
|
||||
| `INV-MASTER-JOURNAL-ISOLATION-001` | Under strict journal isolation, blockmaster gives no new work to a node whose durable root shares the authority store's file system: it refuses that node's heartbeat while it serves no volume, a new placement on it and a move onto it; work the node already has is kept. | M2 workspace move: Acked or Expired → (move refused, nothing written); workspace placement admission; node heartbeat | `core/host/master/journal_isolation.go` `refuseColocatedHeartbeat`, `colocatedTargetRefused`, `reconcilePlacements`, `nodeServesVolumes`; `core/host/master/workspace_service.go` `workspaceMoveCheckLocked`; `core/host/master/workspace_binding.go` `PlaceWorkspace` | `TestColocatedNodeIsAlarmedButAcceptedByDefault`, `TestStrictRefusesColocatedNodeWithoutVolumes`, `TestStrictAcceptsColocatedNodeThatAlreadyServes`, `TestStrictRefusesPlacementAndMoveOntoColocatedNode`, `TestStrictProductLoopSkipsColocatedNodeForNewPlacement` (`core/host/master/journal_isolation_test.go`); `TestStrictReplaysAnIssuedMoveToANowColocatedTarget`, `TestStrictKeepsAnIdempotentPlacementOnANowColocatedNode` (`core/host/master/journal_isolation_fold_test.go`) | — | ACTIVE |
|
||||
| `INV-SEC-CONTROL-BIND-001` | blockmaster's unauthenticated control listeners bind only loopback: --listen without mutual TLS, and the runtime HTTP listener always; a non-loopback address, and --insecure-external-bind, are refused at startup. | AUTHORITY: control API reachability | `core/host/master/journal_isolation.go` `ValidateControlListen`; `cmd/blockmaster/main.go` `parseFlags` | `TestParseFlags_PlaintextControlListenersStayOnLoopback`, `TestManifests_NoPlaintextExternalBlockmasterBind` (`cmd/blockmaster/external_bind_test.go`); `TestAuthFlags` (`cmd/blockmaster/auth_flags_test.go`) | — (no state machine; the flag test is the proof form) | ACTIVE |
|
||||
|
||||
Notes:
|
||||
|
||||
- `INV-LIFECYCLE-STORE-DURABLE-001` open gaps: Store-directory ancestor sync on Open is best-effort: failures are logged and do not block startup; a new directory entry may not survive an immediate crash when an ancestor cannot be synced. Record-file and store-directory sync after a put remain mandatory. `NodeInventoryStore.RemoveNode` does not fsync its directory after deletion, so a removed node can reappear after a crash. A failed put may still be on disk: if directory fsync fails after rename, restart can load the new record.
|
||||
- `INV-LIFECYCLE-STORE-DURABLE-001` open gaps: Store-directory ancestor sync on Open is best-effort: failures are logged and do not block startup; a new directory entry may not survive an immediate crash when an ancestor cannot be synced. Record-file and store-directory sync after a put remain mandatory. `NodeInventoryStore.RemoveNode`, `PlacementIntentStore.DeletePlacement` and `FileStore.DeleteVolume` do not fsync their directory after deletion, so a removed node, placement or volume record can reappear after a crash. A failed put may still be on disk: if directory fsync fails after rename, restart can load the new record.
|
||||
- `INV-AUTH-PERSIST-BEFORE-PUBLISH-001`: a failure before the rename leaves the old record and is reported failed (the in-memory rollback test); a directory open or fsync failure after the rename leaves the outcome unknown and fail-stops the process, for every record type, so the restart reloads whatever survived and callers re-read. A workspace volume's uncertainty latch (`INV-AUTH-UNCERTAIN-001`) stays for its other causes.
|
||||
- `INV-AUTH-UNCERTAIN-001`: The cited test asserts the refusal after an unknown-outcome lease extension (rename landed, then a failure; the file store fail-stops on a directory fsync failure instead, `INV-AUTH-PERSIST-BEFORE-PUBLISH-001`): the next renewal, a revocation and an endpoint change are all refused. The TLA+ configuration `S5_red_noUncertain` violates `UniqueEpoch` without it. A Revoking lease still gets its bounded drain reply, min(horizon, deadline), never extended: see M2 any (workspace) → Uncertain. A failed move on an uncertain volume is answered as an unknown outcome before any admission refusal, the request's own cancellation or deadline stays typed, and an issued move's replay still returns its stored grant: see M2 Uncertain → Uncertain (move answer). The renewal path reads uncertainty from the lease view (`INV-LEASE-VIEW-001`), not from `persistWorkspaceLocked`.
|
||||
- `INV-WS-LEASE-HORIZON-001`: The forced-barrier argument (a renewal that reads its clock after the barrier has read the deadline is refused) assumes nondecreasing master time. That is an assumption of the current `WorkspaceTakeover` model, whose `Tick` and `SlowTick` actions only advance `now`; it is not a consequence of `time.Now` carrying a monotonic reading, because persisted `UnixNano` deadlines are compared as wall-clock values. The existing deadline check stays alongside the horizon. The model still renews with `exp = deadline = now + TTL`; the horizon/grant split is a pending specification update (Part C rule 2).
|
||||
@@ -1038,7 +1087,7 @@ Notes:
|
||||
| `INV-WS-HEAD-KEY-PROVENANCE-001` | RETIRED at the cut-over to the content-named store: intents are gone and a content name may be written again. Replaced by `INV-SNAPK-COMMIT-REACH-001`. | M5 Manifest → CAS | — (`PrepareManifest` and `core/frontend/chunkstore/manifest.go` were deleted) | — | — | ARCHIVED |
|
||||
| `INV-WS-REOPEN-FENCE-001` | Retired: the legacy same-holder reopen replaced HEAD generation. B fences by claim id and local-root lineage (`INV-SNAPK-START-ROOT-001`, `INV-SNAPK-START-CLAIM-001`, `INV-SNAPK-STALE-HOLDER-001`); an ordinary same-root reopen may leave HEAD unchanged. | legacy M4 | — | — | — | ARCHIVED |
|
||||
| `INV-WS-SEALED-REOPEN-001` | A same-epoch Start cannot reactivate a detached HEAD: it refuses before another HEAD update or serving, preserving its current root, position and detached state for a higher-epoch claimant. | M9 detached → higher-epoch idle | `core/frontend/chunkstore/layout/start.go` `Start`; `core/frontend/chunkstore/layout/claim.go` `Claim` | `TestCommitDetached_ProofAndLostReply`, `TestDetachedHEAD_RefusesEveryHolderTransition` (`core/frontend/chunkstore/layout/detached_test.go`); `TestRestoreEqualOwnerDetachedHEADStaysSealed` (`core/frontend/durable/provider_seed_order_test.go`) | `INV-SNAPK-DETACHED-001` | ACTIVE |
|
||||
| `INV-WS-SEAL-REPLAY-001` | A repeated plain seal, also after a same-epoch detached restart, succeeds only from a fresh B HEAD with exact epoch, holder and local claim id. It returns that HEAD/frontier without a new generation. An unreadable or mismatched proof cannot be answered from process memory. | B detached HEAD read | `core/frontend/durable/provider_seal_replay.go` `replayPlainSeal`, `readLayoutSeal`; `cmd/blockvolume/workspace_lease.go` `workspaceLayoutDetachedGeneration` | `TestLayoutPlainDetachReplayAfterRestartNeedsNoLegacyFactory` (`core/frontend/durable/provider_layout_plain_replay_test.go`); `TestWorkspaceLayoutDetachedProof` (`cmd/blockvolume/workspace_layout_proof_test.go`) | K1: detached proof belongs to the exact claim | ACTIVE |
|
||||
| `INV-WS-SEAL-REPLAY-001` | A repeated plain seal, also after a same-epoch detached restart, succeeds only from a fresh B HEAD with exact epoch, holder and local claim id. It returns that HEAD/frontier without a new generation. An unreadable or mismatched proof cannot be answered from process memory. | B detached HEAD read | `core/frontend/durable/provider_seal_replay.go` `replayPlainSeal`, `readLayoutSeal`; `cmd/blockvolume/workspace_lease.go` `workspaceLayoutDetachedGeneration` | `TestLayoutPlainDetachReplayAfterRestartNeedsNoLegacyFactory` (`core/frontend/durable/provider_layout_plain_replay_test.go`); `TestWorkspaceLayoutDetachedProof` (`cmd/blockvolume/workspace_layout_proof_test.go`) | K1: detached proof belongs to the exact claim; `PlainSealReplay` `SuccessNeedsFreshExactProof`, `ValidProofDoesNotNeedProcessMemory` (mutants `PlainSealReplay_memory`, `PlainSealReplay_no_exact`, `PlainSealReplay_layer`) | ACTIVE |
|
||||
| `INV-WS-CAS-UNKNOWN-001` | An unknown HEAD CAS outcome is settled by re-reading HEAD, never by a blind retry; until it is settled the proposal stays pending and its session stays open; settlement replays the same commit in it. | M5 CAS → Pending | `core/storage/chunk_layer.go` `captureLocked`, `resolvePending`; `core/frontend/chunkstore/layout_remote.go` | `TestChunkLayer_C6_UnknownNotAppliedNeverClaimsSuccess` (`core/storage/chunk_layer_contract_test.go`); `TestSession_UncertainCommitIsNotAbortedUntilSettled` (`core/storage/chunk_layer_session_test.go`); `TestLayoutRemote_LostReplyOfTheFirstCutIsNotAFence`, `TestLayoutRemote_LostReplyOfALaterCutWithAnInheritedChunkIsNotAFence`, `TestLayoutRemote_LostReplyOfANoOpCutIsNotAFence` (`core/frontend/chunkstore/layout_remote_same_proposal_test.go`); `TestLevelZeroCutRefusalDoesNotBecomeAnUnresolvedPublication` (`core/frontend/chunkstore/layout_format_refusal_test.go`); `TestARefusedReproposalDoesNotSettleAnEarlierUnknownWrite`, `TestARefusedConfirmationReadDoesNotUnpublishTheSuccessfulWrite` (`core/storage/chunk_head_refusal_test.go`) | — | ACTIVE |
|
||||
| `INV-WS-CLAIM-BEFORE-SERVE-001` | A new B holder claims HEAD at its issued epoch only after the local root is validated against the HEAD it updates; an older epoch or another holder at the same epoch is refused, and guest writes stay closed until assignment and claim. | M9 Start → Claim → Serving | `core/frontend/chunkstore/layout/start.go` `Start`; `core/frontend/durable/provider_layout.go` `startLayoutRoot` | `TestStart_ValidatesAgainstTheHeadItUpdates`, `TestStart_Refusals` (`core/frontend/chunkstore/layout/start_test.go`); `TestStart_TheClaimRechecksTheSeedRule` (`core/frontend/chunkstore/layout/start_seed_test.go`); `TestFreshStoreRefusesWriteBeforeAssignmentThenPublishesAfterClaim` (`core/frontend/durable/provider_restore_schedule_test.go`) | `INV-SNAPK-START-LINEAGE-001`, `INV-SNAPK-START-CLAIM-001` | ACTIVE |
|
||||
| `INV-VOL-GEOMETRY-FLAGS-RECORD-001` | A create-mode start whose `--durable-blocks`/`--durable-blocksize` disagree with the volume record exits 78 before any local store exists; an existing store is checked only at attach; an absent record keeps the create path; an unread record exits 75 (filer failed) or 78 (corrupt). | blockvolume startup (before the durable provider) | `cmd/blockvolume/main.go`; `cmd/blockvolume/chunk_remote.go` `geometryFlagsRefusal`; `core/frontend/chunkstore/layout/volume.go`, `start.go`, `create.go`; `core/frontend/chunkstore/catalog_b.go` | `TestGeometryFlagsRefusalComparesTheRecord`, `TestVolumeRequiresGeometry`, `TestVolumeGeometryChecksAndIsImmutable`, `TestStartGeometryMismatchPrecedesClaim`, `TestBCatalogRestoreCopiesVolumeGeometry`, `TestVolumeGeometryLivesOnlyInVolume` | K3: immutable required VOLUME geometry; Start checks the local persisted shape before claim; restores copy source geometry; no resize or compatibility path. | ACTIVE |
|
||||
@@ -1208,8 +1257,8 @@ Notes:
|
||||
| `INV-CUT-TIMER-SKIP-001` | A periodic cut decided from an older last cut is skipped under the capture lock: no automatic cut follows another within the interval. | M5 periodic trigger (before Admit) | `core/storage/chunk_periodic_cut.go` `CutUnlessCutSince`; `core/frontend/durable/provider_chunk.go` `chunkLoop` | `TestChunkPeriodicCut_SkipsAfterANewerCut`, `TestChunkPeriodicCut_SkipsANewerCutWithAnOlderStamp` (`core/storage/chunk_periodic_cut_test.go`); `TestWALStoreChunk_ExplicitCutOverlappingTheTimerRestartsIt` (`core/frontend/durable/provider_chunk_sched_test.go`) | — | ACTIVE |
|
||||
| `INV-CUT-TIMER-SLOT-WAIT-001` | A periodic cut refused for held host slots, pending urgent work or an earlier ticket is a wait, not a failure: no backoff or minimum spacing; it retries at the next poll in ticket order, and status reports the wait until any later cut succeeds. Other errors keep the backoff. | M5 periodic trigger (before Admit) | `core/frontend/durable/provider_chunk.go` `cutPolicy.after`, `chunkLoop`; `core/hostlimit/limiter.go` `ErrSlotsHeld` | `TestCutPolicy_HostSlotBusyIsAWaitNotAFailure`, `TestCutPolicy_SuccessDuringSlotWaitEndsTheWait`, `TestCutWaitSlot_StatusEndsTheWaitAfterALaterCut`, `TestCutPolicy_TicketOrderWaitBound` (`core/frontend/durable/cut_policy_test.go`); `TestTimerCutRunsSoonAfterHostSlotFrees`, `TestSlotWaitEndsWithASuccessfulDetachSeal` (`core/frontend/durable/host_slot_wait_test.go`); `TestAdmitClosedDuringPoolAcquisitionIsRevoked` (`core/hostlimit/limiter_test.go`) | — | ACTIVE |
|
||||
| `INV-SNAPSHOT-ANSWER-COUNT-001` | Newly produced snapshot creation and listing answers omit the uncomputed chunk count; no manifest scan is added to answer a snapshot. | M9 snapshot answer projection (no transition change) | `core/frontend/chunkstore/control_types.go`, `api.go`; `core/host/volume/chunk_control.go` | `TestSnapshotAfter200MiBWritesOmitsUncomputedChunkCount` (`core/host/volume/snapshot_chunk_count_test.go`) | NONE (pure projection of the published snapshot; no authority or persisted format change) | STUB |
|
||||
| `INV-SPEC-DELETE-RETIRE-001` | Retire spec-removed metadata only under a permanent reservation after no-live-lease and a subsequent HEAD read proves deleted or absent. Read errors, live HEAD and deleting HEAD keep the records. Retirement never removes the reservation or store data. | M4 delete retirement | `core/host/master/spec_retirement.go`; `core/authority/workspace_retirement.go`, `authority_store_file.go` | `TestSpecRetirementReadsHeadOnlyAfterLeaseAndKeepsTombstone`, `TestSpecRetirementRequiresDeletedOrAbsentAndReadableHead`, `TestSpecRetirementDoesNotUseAbsentHeadWithoutReservation`, `TestRetirementKeepsReservationAndWaitsForLiveLease`, `TestFileAuthorityRetirementSurvivesReloadAndKeepsOtherRecords`, `TestSpecRetirementBackgroundBoundsReadsAndCachesTerminalProof`, `TestSpecRetirementLocalFailureDoesNotStopOtherVolumesOrProductTick` | DeleteRetire.ReadOK; DeleteRetire.Retire; DeleteRetire.HostRetire | STUB |
|
||||
| `INV-SPEC-DELETE-RETRY-001` | Startup lease barriers schedule one more retirement pass after the latest observed barrier, independently of the product loop. The pass rechecks every lease and HEAD guard, logs skipped volumes, and is cancelled and joined before stores close. | M4 delete retirement scheduling | `core/host/master/host.go` `Start`, `Close`; `spec_retirement.go` `startPostFloorRetirement` | `TestStandaloneRestartRetriesSpecRetirementAfterLeaseFloor`, `TestRetirementLeaseBarrierIsOnlyASchedulingHint`, `TestPostFloorRetirementTimerJoinsOnCancellation` | DeleteRetire.ReadOK; DeleteRetire.Retire | STUB |
|
||||
| `INV-SPEC-DELETE-RETIRE-001` | Retire spec-removed metadata only under a permanent reservation after no-live-lease and a subsequent HEAD read proves deleted or absent. Read errors, live HEAD and deleting HEAD keep the records. Retirement never removes the reservation or store data. | M4 delete retirement | `core/host/master/spec_retirement.go`; `core/authority/workspace_retirement.go`, `authority_store_file.go` | `TestSpecRetirementReadsHeadOnlyAfterLeaseAndKeepsTombstone`, `TestSpecRetirementRequiresDeletedOrAbsentAndReadableHead`, `TestSpecRetirementDoesNotUseAbsentHeadWithoutReservation`, `TestRetirementKeepsReservationAndWaitsForLiveLease`, `TestFileAuthorityRetirementSurvivesReloadAndKeepsOtherRecords`, `TestSpecRetirementBackgroundBoundsReadsAndCachesTerminalProof`, `TestSpecRetirementLocalFailureDoesNotStopOtherVolumesOrProductTick` | DeleteRetire.ReadOK; DeleteRetire.RetireLine; DeleteRetire.RetirePlace; DeleteRetire.HostRetire | STUB |
|
||||
| `INV-SPEC-DELETE-RETRY-001` | Startup lease barriers schedule one more retirement pass after the latest observed barrier, independently of the product loop. The pass rechecks every lease and HEAD guard, logs skipped volumes, and is cancelled and joined before stores close. | M4 delete retirement scheduling | `core/host/master/host.go` `Start`, `Close`; `spec_retirement.go` `startPostFloorRetirement` | `TestStandaloneRestartRetriesSpecRetirementAfterLeaseFloor`, `TestRetirementLeaseBarrierIsOnlyASchedulingHint`, `TestPostFloorRetirementTimerJoinsOnCancellation` | DeleteRetire.ReadOK; DeleteRetire.RetireLine; DeleteRetire.RetirePlace | STUB |
|
||||
| `INV-SPEC-UNUSED-PLACEMENT-001` | A spec startup prunes an undesired placement only before serving and with no volume record, authority line, binding or deletion reservation, and no skipped authority recovery. The desired spec and seed are one keep set. | M4 registration input | `cmd/blockmaster/main.go`; `core/host/master/spec_retirement.go` | `TestClusterSpecImportRemovesUnusedPlacementMissingFromSpec`, `TestClusterSpecCleanupKeepsRecordsBindingsAuthorityAndSeed` | NONE (registration-only cleanup before controller activity) | STUB |
|
||||
| `INV-CHECK-DELETING-001` | A post-lease reserved volume with HEAD deleting, deleted or absent holds no serving work. Its status is informational and checks issue no lease or holder requests for it. Another volume's failures remain visible. | M9 delete observation | `core/host/master/observation_snapshot.go`, `journal_isolation.go`; `cmd/sw-block/shell_check.go` | `TestSpecRetirementRequiresDeletedOrAbsentAndReadableHead`, `TestSpecRetirementReadsHeadOnlyAfterLeaseAndKeepsTombstone`, `TestClusterCheckDoesNotProbeDeletingOrDeletedVolumes` | DeleteRetire.HostRetire | STUB |
|
||||
| `INV-CLI-DELETE-RETRY-001` | Only the final lease barrier after a committed volume-delete reservation permits retryable true/exit 75 at its horizon. A live-holder Reserve refusal requires stopping the volume first (not_admitted, non-retryable, exit 1). No lease guard is bypassed. | M9 delete admission result projection | `cmd/sw-block/chunk_volume_delete.go` `authorityErr`; `cmd/sw-block/chunk.go` `chunkResult` | `TestVolumeDeleteAdmissionRetryAnswer`; `TestOpsChunkVolumeDeleteRefusalSaysNothingWasPersisted` | MoveAdmission.DelRead; MoveAdmission.DelMark (unchanged guards) | STUB |
|
||||
@@ -1323,8 +1372,6 @@ Notes:
|
||||
| `INV-PROMOTE-FRONTIER-UNKNOWN-001` | With an unknown frontier under `sync_quorum` or `sync_all`, the gate allows the highest-durable ready candidate only if at least N_peers-K+1 of the N_peers peers are probed ready this tick and have a fresh heartbeat (K as in `waitForSyncAcks`); else none. | M3 Supporting → promotion candidate (RF=3 gate) | `core/host/master/product_loop.go` `promotionAllowedReplicas`, `unknownFrontierSurvivorsNeeded`, `freshPromotionPeers`; `core/replication/async_ack.go` `waitForSyncAcks` | `TestMountedFailover_ProductLoopRF3UnknownRequiredLSNFallsBackToHighestDurableLSN` (`core/host/master/product_loop_test.go`); `TestProductLoop_MissingRequiredFrontierRefusesRF3Promotion` (`core/host/master/promotion_missing_frontier_regression_test.go`); `TestUnknownFrontierSurvivorsNeeded`, `TestFreshPromotionPeers_UsesObservationFreshness`, `TestProductLoop_UnknownFrontierSurvivorReadyLastTickMissingNowRefused` (`core/host/master/promotion_frontier_coverage_test.go`) | — | ACTIVE |
|
||||
| `INV-PROMOTE-FRONTIER-BEST-EFFORT-001` | The automatic path never replaces a lost primary of a `best_effort` volume (a write may be on the primary alone, as for the operator's move): both gates hold it before any fencing round and show `best_effort_no_automatic_failover`. | M3 Supporting → promotion candidate (both gates) | `core/host/master/product_loop.go` `automaticFailoverHold` (supported gate before `fencedDecision`; unsupported gate before its candidates); `promotionAllowedReplicas` | `TestTheAutomaticPathHoldsABestEffortVolume` (`core/host/master/best_effort_hold_test.go`); `TestMountedFailover_ProductLoopRF3BestEffortIsHeldDespiteAHighestDurableSurvivor`, `TestMountedFailover_ProductLoopRF3RejectsBestEffortProbeForHA` (`core/host/master/product_loop_test.go`); `TestPromotionAllowedReplicas_RequiredFrontierCoverage` (`core/host/master/promotion_frontier_coverage_test.go`) | — | ACTIVE |
|
||||
| `INV-PROMOTE-ACK-PROFILE-MATCH-001` | The automatic path holds a lost primary's volume, before any fencing round and showing `ack_profile_mismatch`, when a probe answer names no ack profile or another than blockmaster's `--launcher-replication-ack`; blockmaster refuses to start with an unknown one. | M3 Supporting → promotion candidate (both gates) | `core/host/master/probe_round.go` `profileMismatch`; `core/host/master/product_loop.go` `automaticFailoverHold` (plain round), `fencedDecision` (fencing round); `core/host/volume/probe_round.go` `probeAnswer`; `cmd/blockvolume/main.go` `hostConfig`; `cmd/blockmaster/main.go` `parseFlags` | `TestTheAutomaticPathHoldsOnAnAckProfileMismatch`, `TestProbeRound_ReportsAnAckProfileMismatch`, `TestTheFencingRoundsAckProfileIsCheckedToo` (`core/host/master/ack_profile_mismatch_test.go`); `TestProbeAnswerNamesTheVolumesAckProfile` (`core/host/volume/probe_ack_profile_test.go`); `TestHostConfigAnswersTheVolumesOwnAckProfile` (`cmd/blockvolume/probe_ack_profile_test.go`); `TestBlockmasterRefusesAnUnknownLauncherReplicationAck` (`cmd/blockmaster/launcher_replication_ack_flag_test.go`) | — | ACTIVE |
|
||||
| `INV-PROMOTE-DECISION-REPORTED-001` | Every replace decision of the supported promotion gate is logged once after its tick: with the controller's outcome from the same submission (read under its lock, so a later intake cannot change it), as not submitted and why, or as a failed submit. Diagnostics only: no decision changes. | M3 Supporting → promotion candidate (supported gate → controller → publisher) | `core/host/master/product_loop.go` `submitPlacementSnapshots`, `noteGateReplace`, `reportReplaces`; `core/authority/controller.go` `SubmitObservedStateOutcomes`, `LastOutcome` | `TestAReplaceDecisionLogsWhatTheControllerDidWithIt` (cases: enqueued, already desired, no ask with why, not submitted, an intake after the submission does not change its report, a submission that did not carry the volume, one report per decision), `TestAProductTickReplaceLogsTheControllerOutcomeAndThePublication`, `TestABindingReadFailureAfterTheProbeReportsTheDecisionNotSubmitted` (`core/host/master/gate_controller_outcome_test.go`, `core/host/master/gate_binding_read_failure_test.go`) | — (diagnostics; no published specification models the log) | ACTIVE |
|
||||
| `INV-AUTHORITY-PUBLICATION-LOGGED-001` | Every authority publication is logged on the master's log with its volume, replica, epoch, endpoint version and intent, also when no event sink is set. Diagnostics only: no decision changes. | M3 controller → publisher (publication observer) | `core/host/master/product_loop.go` `recordAuthorityPublishedEvent` | `TestAPublicationIsLogged`, `TestAProductTickReplaceLogsTheControllerOutcomeAndThePublication` (`core/host/master/gate_controller_outcome_test.go`) | — (diagnostics; no published specification models the log) | ACTIVE |
|
||||
| `INV-PRIMARY-ACK-PROFILE-001` | A primary of a replicated line serves only when its own `--replication-ack` is the profile its assignment names (blockmaster's); otherwise its frontend is not Healthy and status names both profiles. So a lost primary, which does not answer, acknowledged under the master's profile. | M1 Primary → Serving (replicated line) | `core/host/master/services.go` `assignmentFact` (`ack_profile`); `core/host/volume/workspace_startup.go` `noteAckProfile`; `core/host/volume/projection_bridge.go` `projectionWithSupersede`; `core/host/volume/status_server.go` | `TestPrimaryOfAReplicatedLineServesOnlyUnderTheMastersAckProfile` (`core/host/volume/ack_profile_refusal_test.go`); `TestAssignmentNamesTheMastersAckProfile` (`core/host/master/ack_profile_mismatch_test.go`) | — | ACTIVE |
|
||||
| `INV-CSI-CONSUMES-AUTHORITY-001` | CSI never imports authority code or builds assignment facts; it takes the publish target from blockmaster and refreshes it before a stage, and blockmaster mints the IDs of the events CSI reports. | M2 (read side) | `core/csi/master_backend.go` `LookupPublishTarget`; `core/csi/node.go` `refreshPublishContext`; `core/host/master/observation_service.go` `ReportClusterEvent` | `TestG15a_CSI_DoesNotImportAuthorityOrConstructAssignmentFacts` (`core/csi/boundary_guard_test.go`); `TestG15e_CSIReattachUsesFreshPublishTargetAfterUnstage` (`core/csi/node_test.go`); `TestObservationService_ReportClusterEventAppearsInVolumeTimeline` (`core/host/master/observation_service_test.go`) | — | ACTIVE |
|
||||
| `INV-K8S-NONLOOPBACK-001` | Generated multi-node Helm values enable external iSCSI, external status and loopback rejection; with rejection enabled CSI never publishes a loopback target and fails closed when only loopback targets exist. | M2 (read side) | `cmd/sw-block/main.go` `runOpsGenerateHelmValues`; `core/csi/master_backend.go` `rejectFrontendAddr` | `TestOpsGenerateHelmValuesMultiNodeExternalISCSI` (`cmd/sw-block/main_test.go`); `TestNodeLoss_ControlStatusLookup_RejectsLoopbackPublishTargetsWhenEnabled`, `TestNodeLoss_ControlStatusLookup_FailClosedWhenOnlyLoopbackTargets` (`core/csi/master_backend_test.go`) | — | ACTIVE |
|
||||
@@ -1346,7 +1393,6 @@ Notes:
|
||||
- `INV-FENCE-STALE-PRIMARY-001`: Narrowed. A primary cut off from blockmaster that has not seen the newer line keeps admitting I/O, and under `best_effort` its local `fsync` still acknowledges (no primary lease on the Kubernetes path; see the Kubernetes known gaps). The lab counter `old_primary_stale_io_success_count=0` is lab evidence only.
|
||||
- `INV-PROMOTE-FRONTIER-001`: Fixed for [#181](https://github.com/seaweedfs/seaweed-block/issues/181). `cmd/blockmaster` does not set `RequiredLSNByVolume`, so in a deployment the frontier is unknown and the survivor rule applies (an RF=3 `sync_quorum` volume with one peer unseen is not promoted automatically). Limits: blockmaster has no source for the required frontier ([#192](https://github.com/seaweedfs/seaweed-block/issues/192)); the rule covers only the acknowledgements represented by the frontiers sampled in one tick, because those probes are snapshots, not a fence, and a deposed primary can still acknowledge after a sample (no primary lease, [#195](https://github.com/seaweedfs/seaweed-block/issues/195)). See [Kubernetes design §6 and §12](kubernetes-block-design.md). RF=2 relies on `INV-REPL-PROMOTION-READY-001`.
|
||||
- `INV-PROMOTE-FRONTIER-PROBE-001`, `INV-PROMOTE-FRONTIER-UNKNOWN-001`, `INV-PROMOTE-FRONTIER-BEST-EFFORT-001`: new rows split from `INV-PROMOTE-FRONTIER-001`, kept beside it. N_peers is the number of replicas other than the current primary; for RF=3 (two peers) both must be seen under `sync_quorum`, one under `sync_all`. An unknown frontier is never read as zero. Heartbeat freshness is the observation store's rule (`FreshSlotCandidate`). The gate runs for every volume with two or more slots (RF=2 included); a primary change is published only with its evidence.
|
||||
- `INV-PROMOTE-DECISION-REPORTED-001`: a decision is not submitted when the placements changed during the probe, a volume got a workspace binding, a replica's endpoints are bound elsewhere, or the workspace bindings could not be read after the probe; the line names which. `INV-AUTHORITY-PUBLICATION-LOGGED-001` was split from it.
|
||||
- `INV-K8S-NONLOOPBACK-001`: Rejection is opt-in: the chart default for `network.rejectLoopbackPublishTargets` is false; the generator sets it for multi-node values.
|
||||
- `INV-OBS-PRODUCT-EVENTS-001`: Each event type has a unit test; all four together in one node-loss run is lab evidence only.
|
||||
- `INV-HOSTPATH-TRANSPARENT-001`: Narrowed to the classifier. It does not compare the host path target with the promoted target, and only the missing-multipath case has a negative test. The mounted-failover run is lab evidence.
|
||||
|
||||
@@ -242,6 +242,19 @@ with its size and home placement. A volume's record comes from the cluster spec:
|
||||
blockmaster reads the cluster spec only when it starts. After editing the spec, run
|
||||
`sudo systemctl restart sw-blockmaster`. Serving volumes keep serving across that restart.
|
||||
|
||||
blockmaster must run under systemd or an equivalent restart supervisor. A node, placement
|
||||
or volume lifecycle record write or recovery-directory sync failure attempts one `ERROR` naming the store,
|
||||
record and error, ending with `exiting so the supervisor restarts from durable state`,
|
||||
and exits with status 1. Termination is armed before logging and occurs within one second even if the log writer or its lock is blocked; a blocked sink may lose that diagnostic. It does not remain alive with a failed store. The shipped
|
||||
`sw-blockmaster.service` has `Restart=on-failure` and `RestartSec=5s`; restart reloads
|
||||
complete records through the recovery barriers before serving again.
|
||||
|
||||
Deletion-reservation and workspace-binding write failures do not exit: the request returns
|
||||
the error and blockmaster keeps serving. A deletion reservation whose write outcome is unknown
|
||||
keeps a new exclusion in memory. A workspace-binding rename or directory-sync failure leaves
|
||||
the binding store uncertain, and every later binding operation fails with `restart required`
|
||||
until `sudo systemctl restart sw-blockmaster`.
|
||||
|
||||
## 3. Create and attach a volume
|
||||
|
||||
1. **Add the volume to the cluster spec** with its `size_bytes` (edit it as root, as in section 2), and restart
|
||||
|
||||
@@ -27,6 +27,10 @@ writing guest:
|
||||
5. **Under `best-effort`, a replica can fall behind while it shows `healthy`.** A `best-effort` write waits for no
|
||||
replica, so a replica whose connection dropped can keep showing `healthy` while it misses writes. Use `sync-quorum`
|
||||
when the replicas must hold the data.
|
||||
6. **An operator failover can be undone by an automatic rebalance.** With `sync-all`, or `sync-quorum` and two
|
||||
replicas, a rebalance blockmaster decided just before `sw-block ops failover` can still be applied after it and move
|
||||
the primary again. No acknowledged write is lost. After a failover, read the line with
|
||||
`sw-block ops volumes --master-api <addr> -o json` and, if the primary moved, repeat the failover against it.
|
||||
|
||||
**Planned for a later release.** Supported replicated volumes are planned for a later release; v1.1.x keeps every replicated
|
||||
configuration a preview. Replicated volumes are a preview: a primary cut off from the block master is not stopped
|
||||
|
||||
@@ -46,6 +46,13 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo
|
||||
- At startup blockmaster checks volumes that are reserved for deletion and hold no workspace lease, one at a time, before it serves. Each check reads the filer, so a slow filer delays the start: in our test, 100 such volumes with a 100 ms filer delay added about 20 s. Volumes in normal use are skipped without a read.
|
||||
- No data is lost. A fix is planned for v1.1.2.
|
||||
|
||||
## Known issue: replicated volumes (preview): a queued rebalance can undo an operator failover
|
||||
|
||||
- Affects replicated volumes (preview) whose acknowledgement profile allows a planned move: `sync-all`, or `sync-quorum` with two replicas.
|
||||
- blockmaster may decide an automatic rebalance, which moves the primary to a less loaded server, just before an operator's `sw-block ops failover`. If that rebalance is applied after the failover, it moves the primary again, away from the replica the operator chose.
|
||||
- No acknowledged write is lost: under these profiles every replica holds every acknowledged write.
|
||||
- What to do: after `sw-block ops failover`, read the volume's line with `sw-block ops volumes --master-api <addr> -o json`; if `primary_replica` moved again, repeat the failover with `--expect-current <primary_replica>@<epoch>`. A fix is planned for a later v1.1.x release.
|
||||
|
||||
## Upgrade notes
|
||||
|
||||
- **Order: the CLI first, then blockmaster, then each holder**, as in
|
||||
|
||||
@@ -103,7 +103,7 @@ cmd/sw-block/volume_release.go releaseLease context.WithTimeout 1 per-call NONE:
|
||||
cmd/sw-block/volume_release.go releaseLease context.WithTimeout 2 availability-contract NONE: no model row maps this file yet the wait for the recorded release: one lease validity plus slack, since the holder acknowledges at its next renewal within the lease
|
||||
cmd/sw-block/volume_release.go releaseLease time.After 1 control-timer NONE: no model row maps this file yet lease record poll during the release wait
|
||||
cmd/sw-block/volume_resolve.go runOpsVolume context.WithTimeout 1 per-call NONE: no model row maps this file yet one CLI request (operator --timeout)
|
||||
cmd/sw-block/volume_start_release.go prepareVolumeStart context.WithTimeout 1 availability-contract StopAndRestart.IssueClean; StopAndRestart.ReadClean; StopAndRestart.SameEpochReopen lease-query/clean-move setup (10 s), before enabling the unit; no volume data is processed
|
||||
cmd/sw-block/volume_start_release.go prepareVolumeStart context.WithTimeout 1 availability-contract StopAndRestart.IssueClean; StopAndRestart.ReadClean; StopAndRestart.CrashRestart lease-query/clean-move setup (10 s), before enabling the unit; no volume data is processed
|
||||
cmd/sw-block/volume_verbs.go runVolume http.Client.Timeout 1 per-call CutTime.Poll one HTTP request
|
||||
cmd/sw-block/volume_verbs.go volumeStart time.Now().Add 1 per-call CutTime.Poll volume start: the operator's --wait for it to serve
|
||||
cmd/sw-block/volume_verbs.go volumeStart time.After 1 control-timer CutTime.Poll volume start poll
|
||||
@@ -201,10 +201,11 @@ core/host/master/host.go New http.Server.ReadHeaderTimeout 1 per-call NONE: no m
|
||||
core/host/master/host.go New http.Server.ReadTimeout 1 per-call NONE: no model row maps this file yet one HTTP request or connection
|
||||
core/host/master/host.go New http.Server.WriteTimeout 1 per-call NONE: no model row maps this file yet one HTTP request or connection
|
||||
core/host/master/host.go New http.Server.IdleTimeout 1 per-call NONE: no model row maps this file yet one HTTP request or connection
|
||||
core/host/master/lifecycle_failure.go lifecycleFailStop time.AfterFunc 1 availability-contract NONE: process-fault exit projection of INV-LIFECYCLE-FAILSTOP-001, no wire state one-second exit deadline armed before logger; independent of blocked sink
|
||||
core/host/master/probe_round.go roundEvidenceProvider.round time.NewTimer 1 per-call FencingRound.Deliver; FencingRound.Open one probe round's evidence wait
|
||||
core/host/master/services.go services.deleteHolderEvidence context.WithTimeout 1 per-call FormatGate.Report one RPC or request
|
||||
core/host/master/spec_retirement.go Host.reconcileDeletedSpecVolumes context.WithTimeout 1 per-call DeleteRetire.ReadOK one fresh HEAD read after the no-live-lease barrier
|
||||
core/host/master/spec_retirement.go Host.startPostFloorRetirement time.NewTimer 1 control-timer DeleteRetire.ReadOK; DeleteRetire.Retire one startup retry at the latest authority lease barrier; every guard is rechecked
|
||||
core/host/master/spec_retirement.go Host.startPostFloorRetirement time.NewTimer 1 control-timer DeleteRetire.ReadOK; DeleteRetire.RetireLine one startup retry at the latest authority lease barrier; every guard is rechecked
|
||||
core/host/master/spec_retirement.go Host.refreshHostDeletionProofs context.WithTimeout 1 per-call DeleteRetire.ReadOK one post-lease HEAD read for a requested host candidate; error retains work
|
||||
core/host/master/workspace_service.go services.AckWorkspaceRevoked context.WithTimeout 1 per-call FormatGate.Place; MoveAdmission.ReadForMove; StopAndRestart.ReadClean one RPC or request
|
||||
core/host/master/workspace_service.go services.MoveWorkspace context.WithTimeout 1 per-call FormatGate.Place; MoveAdmission.ReadForMove; StopAndRestart.ReadClean one RPC or request
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 49 and column 123.
|
@@ -439,6 +439,9 @@ Use this checklist when changing the feature.
|
||||
| `same-node-alpha-attach-chain.yaml` | loopback same-node accepted path |
|
||||
| `same-node-alpha-attach-negative-chain.yaml` | cross-node loopback blocked as unsupported |
|
||||
|
||||
The last three run only against the project's lab and are kept in a private test repository; the first three
|
||||
are in `testops/scenarios/`.
|
||||
|
||||
The runner must not pass a Stage 2 gate by grepping only lines it wrote itself.
|
||||
It needs independent evidence: pod UID, host sessions, multipath map, RTPG
|
||||
state, stale-I/O probe, and cleanup verifier.
|
||||
|
||||
@@ -85,7 +85,6 @@ Prefer gates that compare at least two surfaces:
|
||||
| Area | Path |
|
||||
|---|---|
|
||||
| scenario definitions | `testops/scenarios/` |
|
||||
| suites | `testops/suites/` |
|
||||
| runner contracts | `internal/docs/ref/testops-runner-binary-contract.md` |
|
||||
| control/data contract | `internal/docs/ref/testops-control-data-contract.md` |
|
||||
| QA sign-offs | `internal/docs/qa-assignments/` |
|
||||
|
||||
@@ -27,6 +27,9 @@ injection.
|
||||
| Cleanup | `cleanup-residue-chain.yaml` and cleanup verifier | zero-residue contract |
|
||||
| Protocol | `iscsi-*`, `nvme-*` | frontend-specific gates |
|
||||
|
||||
Scenarios that run against the project's lab are kept in a private test repository. This repository keeps
|
||||
the ones its own tests and scripts use; [testops/README.md](../../testops/README.md) lists them and the settings each needs.
|
||||
|
||||
## Release Evidence
|
||||
|
||||
Release claims should point to:
|
||||
|
||||
@@ -1164,11 +1164,11 @@ Approximate engineering effort if scope remains tight:
|
||||
baseline and corrects stale audit wording: ANA log/Identify/provider and CSI
|
||||
single-path NVMe stage/unstage are present. Phase 100 closed the Kubernetes
|
||||
CSI NVMe multipath attach follow-up for the supported lab path.
|
||||
- Operation milestone release readiness is active and blocked only on matching
|
||||
published images. Run `scripts/run-operation-milestone-release-readiness.ps1`
|
||||
plus the published-image Day-1 smoke before marking the operation milestone
|
||||
released. Development has moved ahead in parallel; this does not mark the
|
||||
operation milestone released.
|
||||
- Operation milestone release readiness is blocked only on matching published
|
||||
images. Its readiness script ran against the project lab and is kept outside
|
||||
this repository with the lab scenarios; run it and the published-image Day-1
|
||||
smoke there before marking the operation milestone released. Development has
|
||||
moved ahead in parallel; this does not mark the operation milestone released.
|
||||
- Phase 100 Kubernetes CSI NVMe Multipath Attach is closed. It implements and
|
||||
gates the path from dynamic PVC `protocol=nvme` and `replicationFactor=2` to
|
||||
master NVMe frontend grouping, CSI `nvmeAddrs` publish context, NodeStage
|
||||
|
||||
@@ -88,25 +88,27 @@ Default output:
|
||||
Validate a product-owned scenario:
|
||||
|
||||
```bash
|
||||
swblock validate testops/scenarios/csi-rf1-durable-restart-chain.yaml
|
||||
swblock validate testops/scenarios/nvme-p5-protocol-component-gate.yaml
|
||||
```
|
||||
|
||||
Run a product-owned scenario against m02:
|
||||
Run a product-owned scenario against a test node (every setting is required;
|
||||
testops/README.md lists them):
|
||||
|
||||
```bash
|
||||
swblock run testops/scenarios/csi-rf1-durable-restart-chain.yaml \
|
||||
--env product_root=/tmp/seaweed_block \
|
||||
--env ssh_key=C:/work/dev_server/testdev_key
|
||||
swblock run testops/scenarios/nvme-p5-protocol-component-gate.yaml \
|
||||
--env product_root=/path/to/seaweed-block \
|
||||
--env node_host=<node address> \
|
||||
--env node_user=<ssh user> \
|
||||
--env ssh_key=/path/to/key \
|
||||
--env artifact_root=/path/to/shared/artifacts
|
||||
```
|
||||
|
||||
Run the full protocol release gate:
|
||||
Run the full protocol release gate (the four protocol chains in order):
|
||||
|
||||
```bash
|
||||
swblock suite \
|
||||
--results-dir <evidence-store>/g15d-k8s/testops-runs/protocol-release-gate-native \
|
||||
--env product_root=/tmp/seaweed-block-nvme-p4l \
|
||||
--env ssh_key=C:/work/dev_server/testdev_key \
|
||||
C:/work/seaweed_block/testops/suites/protocol-release-gate.yaml
|
||||
SW_BLOCK_SSH_KEY=/path/to/key SW_BLOCK_NODE_HOST=<node address> \
|
||||
SW_BLOCK_NODE_USER=<ssh user> SW_BLOCK_NODE_ARTIFACT_ROOT=/path/to/shared/artifacts \
|
||||
bash scripts/testops-run-protocol-release-gate.sh
|
||||
```
|
||||
|
||||
Validate a finished protocol release gate bundle:
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package scripts_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestReleaseGateRefusesArtifactRootOutsideAllowlist(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("bash script")
|
||||
}
|
||||
bash, err := exec.LookPath("bash")
|
||||
if err != nil {
|
||||
t.Skip("bash not available")
|
||||
}
|
||||
script := filepath.Join(repoRoot(t), "scripts", "testops-run-protocol-release-gate.sh")
|
||||
run := func(root string) (string, string, error) {
|
||||
artifacts := filepath.Join(t.TempDir(), "gate")
|
||||
cmd := exec.Command(bash, script, t.TempDir())
|
||||
cmd.Env = append(os.Environ(),
|
||||
"SW_BLOCK_SSH_KEY=/k",
|
||||
"SW_BLOCK_NODE_HOST=192.0.2.10",
|
||||
"SW_BLOCK_NODE_USER=tester",
|
||||
"SW_BLOCK_NODE_ARTIFACT_ROOT="+root,
|
||||
"SW_BLOCK_ARTIFACT_DIR="+artifacts,
|
||||
"SWBLOCK_CMD=/nonexistent-swblock",
|
||||
)
|
||||
out, err := cmd.CombinedOutput()
|
||||
return string(out), artifacts, err
|
||||
}
|
||||
const refusal = "must be an absolute path other than /"
|
||||
marker := filepath.Join(t.TempDir(), "substituted")
|
||||
for _, root := range []string{
|
||||
"/srv/test artifacts",
|
||||
"/srv/test\tartifacts",
|
||||
"/",
|
||||
"relative/dir",
|
||||
"/srv/*",
|
||||
"/srv/'$(touch " + marker + ")'",
|
||||
"/srv/x\n",
|
||||
} {
|
||||
out, artifacts, err := run(root)
|
||||
if err == nil {
|
||||
t.Fatalf("artifact root %q accepted; output:\n%s", root, out)
|
||||
}
|
||||
if !strings.Contains(out, refusal) {
|
||||
t.Fatalf("artifact root %q: unexpected output:\n%s", root, out)
|
||||
}
|
||||
if _, err := os.Stat(artifacts); !os.IsNotExist(err) {
|
||||
t.Fatalf("artifact root %q: %s created before the check (stat err %v)", root, artifacts, err)
|
||||
}
|
||||
}
|
||||
if _, err := os.Stat(marker); !os.IsNotExist(err) {
|
||||
t.Fatalf("a command substitution in the artifact root ran (stat err %v)", err)
|
||||
}
|
||||
if out, _, _ := run("/srv/evidence-2/block_v1.1"); strings.Contains(out, refusal) {
|
||||
t.Fatalf("plain absolute artifact root refused:\n%s", out)
|
||||
}
|
||||
|
||||
ps, err := os.ReadFile(filepath.Join(repoRoot(t), "scripts", "testops-run-protocol-release-gate.ps1"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
check := strings.Index(string(ps), `$NodeArtifactRoot -cnotmatch '^/[A-Za-z0-9._/-]+\z'`)
|
||||
mkdir := strings.Index(string(ps), "New-Item -ItemType Directory")
|
||||
if check < 0 || mkdir < 0 || check > mkdir {
|
||||
t.Fatalf(".ps1 must refuse a NodeArtifactRoot outside the allowlist before it creates directories (check at %d, New-Item at %d)", check, mkdir)
|
||||
}
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
param(
|
||||
[string]$ProductRoot = (Get-Location).Path,
|
||||
[string]$ArtifactDir = "",
|
||||
[string]$ReleaseImage = $env:SW_BLOCK_RELEASE_IMAGE,
|
||||
[string]$ReleaseCSIImage = $env:SW_BLOCK_CSI_RELEASE_IMAGE
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($ArtifactDir)) {
|
||||
$stamp = (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmssZ")
|
||||
$ArtifactDir = Join-Path $ProductRoot "results\operation-milestone-release-readiness-$stamp"
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $ArtifactDir | Out-Null
|
||||
|
||||
$summary = Join-Path $ArtifactDir "operation-milestone-release-readiness-summary.txt"
|
||||
$result = Join-Path $ArtifactDir "result.json"
|
||||
Set-Content -Path $summary -Value "operation_milestone_release_readiness_status=running"
|
||||
|
||||
function Add-Summary {
|
||||
param([string]$Line)
|
||||
Add-Content -Path $summary -Value $Line
|
||||
}
|
||||
|
||||
function Parse-ImageRef {
|
||||
param([string]$Image)
|
||||
if ($Image -match '^(?<repo>.+)@(?<digest>sha256:[0-9a-fA-F]+)$') {
|
||||
return [ordered]@{
|
||||
repository = $Matches.repo
|
||||
tag = ""
|
||||
digest = $Matches.digest
|
||||
}
|
||||
}
|
||||
$lastColon = $Image.LastIndexOf(':')
|
||||
$lastSlash = $Image.LastIndexOf('/')
|
||||
if ($lastColon -le $lastSlash) {
|
||||
throw "image must include an explicit tag or digest: $Image"
|
||||
}
|
||||
return [ordered]@{
|
||||
repository = $Image.Substring(0, $lastColon)
|
||||
tag = $Image.Substring($lastColon + 1)
|
||||
digest = ""
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-Step {
|
||||
param(
|
||||
[string]$Name,
|
||||
[string]$FilePath,
|
||||
[string[]]$Arguments
|
||||
)
|
||||
$stdout = Join-Path $ArtifactDir "$Name.stdout.txt"
|
||||
$stderr = Join-Path $ArtifactDir "$Name.stderr.txt"
|
||||
$process = Start-Process -FilePath $FilePath -ArgumentList $Arguments -WorkingDirectory $ProductRoot -NoNewWindow -Wait -PassThru -RedirectStandardOutput $stdout -RedirectStandardError $stderr
|
||||
if ($process.ExitCode -eq 0) {
|
||||
Add-Summary "$Name=ok"
|
||||
return $true
|
||||
}
|
||||
Add-Summary "$Name=failed"
|
||||
return $false
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($ReleaseImage) -or [string]::IsNullOrWhiteSpace($ReleaseCSIImage)) {
|
||||
Add-Summary "operation_milestone_release_readiness_status=blocked_missing_release_images"
|
||||
Add-Summary "required_env=SW_BLOCK_RELEASE_IMAGE,SW_BLOCK_CSI_RELEASE_IMAGE"
|
||||
Add-Summary "example_SW_BLOCK_RELEASE_IMAGE=ghcr.io/seaweedfs/seaweed-block:sha-<commit>"
|
||||
Add-Summary "example_SW_BLOCK_CSI_RELEASE_IMAGE=ghcr.io/seaweedfs/seaweed-block-csi:sha-<same-commit>"
|
||||
[ordered]@{
|
||||
schema_version = "1.0"
|
||||
scenario = "operation-milestone-release-readiness"
|
||||
status = "blocked"
|
||||
reason = "missing_release_images"
|
||||
artifact_dir = $ArtifactDir
|
||||
} | ConvertTo-Json -Depth 4 | Set-Content -Path $result
|
||||
exit 2
|
||||
}
|
||||
|
||||
$status = "ok"
|
||||
$image = Parse-ImageRef $ReleaseImage
|
||||
$csiImage = Parse-ImageRef $ReleaseCSIImage
|
||||
|
||||
Add-Summary "release_image=$ReleaseImage"
|
||||
Add-Summary "release_csi_image=$ReleaseCSIImage"
|
||||
|
||||
if (-not (Invoke-Step -Name "docker_manifest_release_image" -FilePath "docker" -Arguments @("manifest", "inspect", $ReleaseImage))) {
|
||||
$status = "failed"
|
||||
}
|
||||
if (-not (Invoke-Step -Name "docker_manifest_release_csi_image" -FilePath "docker" -Arguments @("manifest", "inspect", $ReleaseCSIImage))) {
|
||||
$status = "failed"
|
||||
}
|
||||
if (-not (Invoke-Step -Name "go_test_release_scope" -FilePath "go" -Arguments @("test", "./core/ops", "./cmd/sw-block", "./cmd/blockcsi", "./cmd/blockmaster", "./cmd/blockvolume", "./scripts", "-count=1"))) {
|
||||
$status = "failed"
|
||||
}
|
||||
if (-not (Invoke-Step -Name "helm_lint" -FilePath "helm" -Arguments @("lint", "charts/seaweed-block"))) {
|
||||
$status = "failed"
|
||||
}
|
||||
|
||||
$templateArgs = @(
|
||||
"template", "sw-block", "charts/seaweed-block",
|
||||
"--namespace", "kube-system",
|
||||
"--include-crds",
|
||||
"--set", "image.repository=$($image.repository)",
|
||||
"--set", "csiImage.repository=$($csiImage.repository)",
|
||||
"--set", "image.pullPolicy=Always",
|
||||
"--set", "csiImage.pullPolicy=Always",
|
||||
"--set", "operatorStatus.create=true",
|
||||
"--set", "operatorStatus.dryRun=false",
|
||||
"--set", "lifecycleOwner.create=true",
|
||||
"--set", "lifecycleOwner.dryRun=false",
|
||||
"--set", "lifecycleOwner.admission.create=true"
|
||||
)
|
||||
if ($image.digest) {
|
||||
$templateArgs += @("--set", "image.digest=$($image.digest)")
|
||||
} else {
|
||||
$templateArgs += @("--set", "image.tag=$($image.tag)")
|
||||
}
|
||||
if ($csiImage.digest) {
|
||||
$templateArgs += @("--set", "csiImage.digest=$($csiImage.digest)")
|
||||
} else {
|
||||
$templateArgs += @("--set", "csiImage.tag=$($csiImage.tag)")
|
||||
}
|
||||
|
||||
if (-not (Invoke-Step -Name "helm_template_operation_components" -FilePath "helm" -Arguments $templateArgs)) {
|
||||
$status = "failed"
|
||||
}
|
||||
if (-not (Invoke-Step -Name "validate_day1_published_image_scenario" -FilePath "C:\work\swblock.exe" -Arguments @("validate", "testops\scenarios\helm-first-volume-via-sw-block-cli-chain.yaml"))) {
|
||||
$status = "failed"
|
||||
}
|
||||
if (-not (Invoke-Step -Name "validate_phase98_operation_close_scenario" -FilePath "C:\work\swblock.exe" -Arguments @("validate", "testops\scenarios\failback-frontend-workload-close-chain.yaml"))) {
|
||||
$status = "failed"
|
||||
}
|
||||
if (-not (Invoke-Step -Name "git_diff_check" -FilePath "git" -Arguments @("diff", "--check"))) {
|
||||
$status = "failed"
|
||||
}
|
||||
|
||||
Add-Summary "published_image_day1_lab_required=true"
|
||||
Add-Summary "published_image_operator_lifecycle_lab_required=true"
|
||||
Add-Summary "source_gated_phase98_regression_required=true"
|
||||
Add-Summary "nvme_not_in_release_claim=true"
|
||||
Add-Summary "operation_milestone_release_readiness_status=$status"
|
||||
|
||||
[ordered]@{
|
||||
schema_version = "1.0"
|
||||
scenario = "operation-milestone-release-readiness"
|
||||
status = $status
|
||||
release_image = $ReleaseImage
|
||||
release_csi_image = $ReleaseCSIImage
|
||||
artifact_dir = $ArtifactDir
|
||||
lab_qa_required = $true
|
||||
} | ConvertTo-Json -Depth 4 | Set-Content -Path $result
|
||||
|
||||
if ($status -ne "ok") {
|
||||
exit 1
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Parse commands AND env parameters, then execute every complete guarded action
|
||||
# with cleanup stubs. Requires Go and a POSIX shell; never contacts a cluster.
|
||||
# Usage: bash scripts/testops-artifact-root-guard-test.sh [scenario dir]
|
||||
set -euo pipefail
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
dir=$(cd "${1:-$here/../testops/scenarios}" && pwd)
|
||||
go_cmd=${GO:-go}
|
||||
if [ "$("$go_cmd" env GOOS)" = windows ]; then
|
||||
echo 'artifact-root controls require a POSIX Go runtime (for example, in WSL)' >&2
|
||||
exit 2
|
||||
fi
|
||||
cd "$here/.."
|
||||
TESTOPS_SCENARIO_DIR="$dir" "$go_cmd" test ./scripts -run '^TestTestopsArtifactRootGuards$' -count=1
|
||||
@@ -1,14 +1,22 @@
|
||||
param(
|
||||
[string]$ProductRepoRoot = (Get-Location).Path,
|
||||
[string]$RunnerRoot = "C:\work\seaweedfs\learn\sw-test-runner-standalone",
|
||||
[string]$RunnerRoot = "",
|
||||
[string]$RemoteProductRoot = "/tmp/seaweed-block-nvme-p4l",
|
||||
[string]$SshKey = "C:\work\dev_server\testdev_key",
|
||||
[Parameter(Mandatory = $true)][string]$SshKey,
|
||||
[Parameter(Mandatory = $true)][string]$NodeHost,
|
||||
[Parameter(Mandatory = $true)][string]$NodeUser,
|
||||
[Parameter(Mandatory = $true)][string]$NodeArtifactRoot,
|
||||
[string]$ArtifactRoot = "",
|
||||
[string]$RunId = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# The scenarios put artifact_root into shell commands as raw text.
|
||||
if ($NodeArtifactRoot -cnotmatch '^/[A-Za-z0-9._/-]+\z') {
|
||||
throw "NodeArtifactRoot must be an absolute path other than / using only A-Za-z0-9._/-: $NodeArtifactRoot"
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($RunId)) {
|
||||
$RunId = "protocol-release-gate-" + (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmssZ")
|
||||
}
|
||||
@@ -23,7 +31,7 @@ $ProductCommit = "unknown"
|
||||
$RunnerCommit = "unknown"
|
||||
try { $ProductCommit = (& git -C $ProductRepoRoot rev-parse HEAD).Trim() } catch {}
|
||||
try {
|
||||
if (Test-Path $RunnerRoot) {
|
||||
if ($RunnerRoot -and (Test-Path $RunnerRoot)) {
|
||||
$RunnerCommit = (& git -C $RunnerRoot rev-parse HEAD).Trim()
|
||||
}
|
||||
} catch {}
|
||||
@@ -200,13 +208,16 @@ function Invoke-Chain {
|
||||
"run",
|
||||
"--env", "product_root=$RemoteProductRoot",
|
||||
"--env", "ssh_key=$SshKey",
|
||||
"--env", "node_host=$NodeHost",
|
||||
"--env", "node_user=$NodeUser",
|
||||
"--env", "artifact_root=$NodeArtifactRoot",
|
||||
"--results-dir", $stepResults,
|
||||
$scenarioPath
|
||||
)
|
||||
Set-Content -Path (Join-Path $stepDir "swblock.command.txt") -Value ("swblock " + ($swblockArgs -join " "))
|
||||
$rc = 0
|
||||
try {
|
||||
if (Test-Path $RunnerRoot) {
|
||||
if ($RunnerRoot -and (Test-Path $RunnerRoot)) {
|
||||
$rc = Invoke-NativeRedirect -FilePath "go" -Arguments (@("run", "./cmd/swblock") + $swblockArgs) -WorkingDirectory $RunnerRoot -StdoutPath $stdout -StderrPath $stderr
|
||||
} else {
|
||||
$rc = Invoke-NativeRedirect -FilePath "swblock" -Arguments $swblockArgs -WorkingDirectory $ProductRepoRoot -StdoutPath $stdout -StderrPath $stderr
|
||||
|
||||
@@ -6,7 +6,16 @@ RUN_ID="${SW_BLOCK_RUN_ID:-protocol-release-gate-$(date -u +%Y%m%dT%H%M%SZ)}"
|
||||
ARTIFACT_ROOT="${SW_BLOCK_ARTIFACT_DIR:-$ROOT/results/$RUN_ID}"
|
||||
RESULTS_ROOT="${SW_BLOCK_RESULTS_DIR:-$ARTIFACT_ROOT/runs}"
|
||||
REMOTE_PRODUCT_ROOT="${SW_BLOCK_REMOTE_PRODUCT_ROOT:-/tmp/seaweed-block-nvme-p4l}"
|
||||
SSH_KEY="${SW_BLOCK_SSH_KEY:-C:\\work\\dev_server\\testdev_key}"
|
||||
# The test node and its access: required, with no default host, user, key or share.
|
||||
SSH_KEY="${SW_BLOCK_SSH_KEY:?set SW_BLOCK_SSH_KEY to the private key for the test node}"
|
||||
NODE_HOST="${SW_BLOCK_NODE_HOST:?set SW_BLOCK_NODE_HOST to the test node address}"
|
||||
NODE_USER="${SW_BLOCK_NODE_USER:?set SW_BLOCK_NODE_USER to the ssh user on the test node}"
|
||||
NODE_ARTIFACT_ROOT="${SW_BLOCK_NODE_ARTIFACT_ROOT:?set SW_BLOCK_NODE_ARTIFACT_ROOT to the shared artifact directory on the test node}"
|
||||
# The scenarios put artifact_root into shell commands as raw text.
|
||||
if [[ ! "$NODE_ARTIFACT_ROOT" =~ ^/[A-Za-z0-9._/-]+$ ]]; then
|
||||
echo "SW_BLOCK_NODE_ARTIFACT_ROOT must be an absolute path other than / using only A-Za-z0-9._/-: $NODE_ARTIFACT_ROOT" >&2
|
||||
exit 2
|
||||
fi
|
||||
SWBLOCK_CMD="${SWBLOCK_CMD:-swblock}"
|
||||
SWBLOCK_RUNNER_ROOT="${SWBLOCK_RUNNER_ROOT:-}"
|
||||
SUITE_STARTED_EPOCH="$(date -u +%s)"
|
||||
@@ -167,6 +176,9 @@ run_chain() {
|
||||
run_swblock run \
|
||||
--env "product_root=$REMOTE_PRODUCT_ROOT" \
|
||||
--env "ssh_key=$SSH_KEY" \
|
||||
--env "node_host=$NODE_HOST" \
|
||||
--env "node_user=$NODE_USER" \
|
||||
--env "artifact_root=$NODE_ARTIFACT_ROOT" \
|
||||
--results-dir "$step_results" \
|
||||
"$ROOT/$scenario" \
|
||||
>"$step_dir/swblock.stdout.log" \
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
package scripts_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type artifactRootScenario struct {
|
||||
Env map[string]string
|
||||
Phases []struct {
|
||||
Name string
|
||||
Always bool
|
||||
Actions []map[string]string
|
||||
}
|
||||
}
|
||||
|
||||
// Exercise whole action copies, including the runner's quoted environment
|
||||
// prefix. No real cleanup executable is reachable in the test's stub PATH.
|
||||
func TestTestopsArtifactRootGuards(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("POSIX shell controls")
|
||||
}
|
||||
dir := os.Getenv("TESTOPS_SCENARIO_DIR")
|
||||
if dir == "" {
|
||||
dir = filepath.Join(repoRoot(t), "testops", "scenarios")
|
||||
}
|
||||
files, err := filepath.Glob(filepath.Join(dir, "*.yaml"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
guarded, uninstalls := 0, 0
|
||||
for _, path := range files {
|
||||
raw, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var scenario artifactRootScenario
|
||||
if err := yaml.Unmarshal(raw, &scenario); err != nil {
|
||||
t.Fatalf("%s: %v", path, err)
|
||||
}
|
||||
if _, exists := scenario.Env["artifact_root"]; !exists {
|
||||
continue
|
||||
}
|
||||
for _, phase := range scenario.Phases {
|
||||
for index, action := range phase.Actions {
|
||||
cmd := action["cmd"]
|
||||
if action["action"] != "exec" {
|
||||
continue
|
||||
}
|
||||
usesRoot := strings.Contains(cmd, "{{ artifact_root }}")
|
||||
for key, value := range action {
|
||||
if strings.HasPrefix(key, "env.") && strings.Contains(value, "{{ artifact_root }}") {
|
||||
usesRoot = true
|
||||
}
|
||||
}
|
||||
needsGuard := usesRoot && (phase.Always || strings.Contains(cmd, "rm -") || strings.Contains(cmd, "case "))
|
||||
if !needsGuard {
|
||||
continue
|
||||
}
|
||||
guarded++
|
||||
if phase.Always && strings.Contains(cmd, "uninstall-k8s-alpha.sh") {
|
||||
uninstalls++
|
||||
}
|
||||
name := fmt.Sprintf("%s/%s/%d", filepath.Base(path), phase.Name, index)
|
||||
t.Run(name, func(t *testing.T) { checkArtifactRootAction(t, action) })
|
||||
}
|
||||
}
|
||||
}
|
||||
if guarded < 24 || uninstalls != 6 {
|
||||
t.Fatalf("coverage: guarded actions=%d, always uninstalls=%d; want >=24 and 6", guarded, uninstalls)
|
||||
}
|
||||
}
|
||||
|
||||
func checkArtifactRootAction(t *testing.T, action map[string]string) {
|
||||
t.Helper()
|
||||
work := t.TempDir()
|
||||
bin := filepath.Join(work, "bin")
|
||||
if err := os.Mkdir(bin, 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, overridesPath := action["env.PATH"]; overridesPath {
|
||||
t.Fatal("cleanup controls must retain their stub-only PATH")
|
||||
}
|
||||
if err := os.Symlink("/bin/sh", filepath.Join(bin, "sh")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Symlink("/bin/cat", filepath.Join(bin, "cat")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Make the uncordon branch real in the supported-root control.
|
||||
nodeFile := filepath.Join(work, "g15d-k8s", "guard-test-node-loss-survival", "demo", "cordoned-primary-node.txt")
|
||||
if err := os.MkdirAll(filepath.Dir(nodeFile), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(nodeFile, []byte("node-test\n"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
trace := filepath.Join(work, "cleanup-started")
|
||||
for _, name := range []string{"rm", "mkdir", "kubectl", "helm", "sudo", "nvme", "iscsiadm", "bash", "touch", "go"} {
|
||||
stub := "#!/bin/sh\nprintf '%s %s\\n' '" + name + "' \"$*\" >> \"$GUARD_TRACE\"\nexit 0\n"
|
||||
if err := os.WriteFile(filepath.Join(bin, name), []byte(stub), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
bad := []string{"", "/", "relative/dir", "/srv/with space", "/srv/*", "/srv/x\n", "/srv/'$(touch injected)'", "/srv/x'; touch injected; '"}
|
||||
for index, root := range bad {
|
||||
t.Run(fmt.Sprintf("invalid-%d", index), func(t *testing.T) {
|
||||
_ = os.Remove(trace)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, "bash", "-c", renderArtifactRootAction(action, root, work))
|
||||
cmd.Dir = work
|
||||
cmd.Env = append(os.Environ(), "PATH="+bin, "GUARD_TRACE="+trace)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if ctx.Err() != nil {
|
||||
t.Fatalf("invalid-root control expired: %v; %s", ctx.Err(), out)
|
||||
}
|
||||
var exit *exec.ExitError
|
||||
if !errors.As(err, &exit) {
|
||||
t.Fatalf("invalid-root command did not complete with a refusal: %v; %s", err, out)
|
||||
}
|
||||
if exit.ExitCode() != 2 {
|
||||
t.Errorf("invalid root %q: exit=%d want2; %s", root, exit.ExitCode(), out)
|
||||
}
|
||||
if raw, readErr := os.ReadFile(trace); readErr == nil || !os.IsNotExist(readErr) {
|
||||
t.Fatalf("invalid root %q started cleanup: %q (read=%v)", root, raw, readErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
// A real supported path must reach the original action, not a blanket
|
||||
// refusal. Every complete body must finish and leave a command witness.
|
||||
_ = os.Remove(trace)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, "bash", "-c", renderArtifactRootAction(action, work, work))
|
||||
cmd.Dir = work
|
||||
cmd.Env = append(os.Environ(), "PATH="+bin, "GUARD_TRACE="+trace)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if ctx.Err() != nil || err != nil {
|
||||
t.Fatalf("supported root command did not complete: %v (context=%v); %s", err, ctx.Err(), out)
|
||||
}
|
||||
witness, err := os.ReadFile(trace)
|
||||
if err != nil || len(witness) == 0 {
|
||||
t.Fatalf("supported root did not reach its action: %v; %s", err, out)
|
||||
}
|
||||
for _, target := range []string{"scripts/run-phase129-nvme-k8s-mounted-restage-gate.sh", "scripts/uninstall-k8s-alpha.sh"} {
|
||||
if strings.Contains(action["cmd"], target) && !strings.Contains(string(witness), "bash "+target+" ") {
|
||||
t.Fatalf("missing script witness %s: %s", target, witness)
|
||||
}
|
||||
}
|
||||
if strings.Contains(action["cmd"], "kubectl uncordon") {
|
||||
for _, target := range []string{"kubectl uncordon node-test", "kubectl get node node-test"} {
|
||||
if !strings.Contains(string(witness), target) {
|
||||
t.Fatalf("missing node-file witness %s: %s", target, witness)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func renderArtifactRootAction(action map[string]string, root, product string) string {
|
||||
render := strings.NewReplacer("{{ artifact_root }}", root, "{{ product_root }}", product, "{{ run_id }}", "guard-test")
|
||||
var keys []string
|
||||
for key := range action {
|
||||
if strings.HasPrefix(key, "env.") {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
}
|
||||
sort.Strings(keys)
|
||||
var prefix strings.Builder
|
||||
for _, key := range keys {
|
||||
fmt.Fprintf(&prefix, "%s=%s ", strings.TrimPrefix(key, "env."), artifactShellQuote(render.Replace(action[key])))
|
||||
}
|
||||
// The runner applies env.* to the complete command through sh -c.
|
||||
return prefix.String() + "sh -c " + artifactShellQuote(render.Replace(action["cmd"]))
|
||||
}
|
||||
|
||||
func artifactShellQuote(value string) string {
|
||||
return "'" + strings.ReplaceAll(value, "'", "'\\''") + "'"
|
||||
}
|
||||
@@ -8,7 +8,10 @@ DELETE_ALL_BLOCKVOLUMES="${SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES:-0}"
|
||||
CHAP_SECRET_NAME="${SW_BLOCK_ISCSI_CHAP_SECRET_NAME:-sw-block-iscsi-chap}"
|
||||
STORAGECLASS_NAME="${SW_BLOCK_STORAGECLASS_NAME:-sw-block-dynamic}"
|
||||
|
||||
mkdir -p "$ARTIFACT_DIR"
|
||||
if ! mkdir -p "$ARTIFACT_DIR" 2>/dev/null; then
|
||||
printf '[alpha-uninstall] cannot create %s; refusing cleanup\n' "$ARTIFACT_DIR" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ -z "${KUBECONFIG:-}" && -f /etc/rancher/k3s/k3s.yaml ]]; then
|
||||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
||||
|
||||
@@ -2,7 +2,9 @@ package scripts_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -28,6 +30,52 @@ func TestUninstallK8sAlphaDeletesSeaweedISCSINodeRecords(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUninstallK8sAlphaRefusesBeforeCleanupWhenArtifactDirCannotBeCreated(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("bash script")
|
||||
}
|
||||
bash, err := exec.LookPath("bash")
|
||||
if err != nil {
|
||||
t.Skip("bash not available")
|
||||
}
|
||||
work := t.TempDir()
|
||||
bin := filepath.Join(work, "bin")
|
||||
if err := os.Mkdir(bin, 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
calls := filepath.Join(work, "calls.log")
|
||||
for _, name := range []string{"kubectl", "iscsiadm", "helm", "sudo", "nvme"} {
|
||||
stub := "#!/bin/sh\necho \"" + name + " $*\" >> \"" + calls + "\"\nexit 0\n"
|
||||
if err := os.WriteFile(filepath.Join(bin, name), []byte(stub), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
blocker := filepath.Join(work, "not-a-dir")
|
||||
if err := os.WriteFile(blocker, nil, 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cmd := exec.Command(bash, filepath.Join(repoRoot(t), "scripts", "uninstall-k8s-alpha.sh"), repoRoot(t))
|
||||
cmd.Env = append(os.Environ(),
|
||||
"PATH="+bin+string(os.PathListSeparator)+os.Getenv("PATH"),
|
||||
"SW_BLOCK_ARTIFACT_DIR="+filepath.Join(blocker, "cleanup"),
|
||||
"TMPDIR="+work,
|
||||
)
|
||||
if out, err := cmd.CombinedOutput(); err == nil {
|
||||
t.Fatalf("uninstall continued without its artifact directory:\n%s", out)
|
||||
}
|
||||
if log, err := os.ReadFile(calls); !os.IsNotExist(err) {
|
||||
t.Fatalf("uninstall started cleanup without its artifact directory: %q (read=%v)", log, err)
|
||||
}
|
||||
good := exec.Command(bash, filepath.Join(repoRoot(t), "scripts", "uninstall-k8s-alpha.sh"), repoRoot(t))
|
||||
good.Env = append(os.Environ(), "PATH="+bin+string(os.PathListSeparator)+os.Getenv("PATH"), "SW_BLOCK_ARTIFACT_DIR="+filepath.Join(work, "artifacts"), "TMPDIR="+work)
|
||||
if out, err := good.CombinedOutput(); err != nil {
|
||||
t.Fatalf("valid artifact directory refused: %v\n%s", err, out)
|
||||
}
|
||||
if log, err := os.ReadFile(calls); err != nil || !strings.Contains(string(log), "kubectl delete") {
|
||||
t.Fatalf("valid artifact directory did not reach cleanup: %q (%v)", log, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFailureSnapshotScriptCapturesRequiredEvidenceLayers(t *testing.T) {
|
||||
root := repoRoot(t)
|
||||
raw, err := os.ReadFile(filepath.Join(root, "scripts", "collect-k8s-failure-snapshot.sh"))
|
||||
|
||||
+47
-271
@@ -1,78 +1,65 @@
|
||||
# V3 TestOps Scenarios
|
||||
# TestOps scenarios
|
||||
|
||||
This directory holds product-owned scenario content for the standalone
|
||||
`sw-test-runner` stack.
|
||||
This directory holds runner scenarios for the `swblock` binary of `sw-test-runner`.
|
||||
The product owns the test intent: which scripts represent a gate, what each
|
||||
artifact proves, and what cleanup must hold. The runner owns orchestration:
|
||||
target cleanup, command execution, run-bundle layout and artifact collection.
|
||||
|
||||
The intended boundary is:
|
||||
The scenarios kept here are the ones this repository's tests or scripts use:
|
||||
`cmd/blockcsi/g15d_manifest_test.go` checks the contents of some of them, and
|
||||
scripts under `scripts/` run others.
|
||||
|
||||
- Product repo owns the test intent: which scripts or checks represent the
|
||||
product gate, what artifacts prove each hop, and what cleanup must be true.
|
||||
- Standalone runner owns orchestration: target cleanup, command execution,
|
||||
build/import coordination, progress checks, run-bundle layout, and artifact
|
||||
collection.
|
||||
- QA can run the same YAML locally or from CI; developers can run it before
|
||||
pushing to avoid stale-image / stale-process / scattered-artifact loops.
|
||||
## Running a scenario
|
||||
|
||||
## Runner Binary
|
||||
|
||||
`swblock` is the `sw-test-runner` binary used for Seaweed Block / V3 tests.
|
||||
|
||||
- Source repo: `pingqiu/sw-test-runner`
|
||||
- Source path: `cmd/swblock/main.go`
|
||||
- Build command from the runner repo:
|
||||
|
||||
```bash
|
||||
go build -o swblock ./cmd/swblock
|
||||
```
|
||||
|
||||
- Windows QA convention: `C:\work\swblock.exe`
|
||||
- Linux controller convention: put `swblock` on `PATH`, or set a shell alias to
|
||||
the built binary.
|
||||
|
||||
`swblock` is not built from this product repo. If a developer only has
|
||||
`seaweed_block` checked out, runner-native scenarios can still be authored and
|
||||
statically reviewed here, but `swblock validate`, `swblock run`, and
|
||||
`swblock suite` require the external runner binary.
|
||||
|
||||
Convenience build helpers are available when the runner source is accessible:
|
||||
|
||||
```powershell
|
||||
.\internal\tools\build-swblock.ps1
|
||||
```
|
||||
`swblock` is built from the runner's source (`go build -o swblock ./cmd/swblock`),
|
||||
not from this repository. Check a scenario before running it:
|
||||
|
||||
```bash
|
||||
bash internal/tools/build-swblock.sh
|
||||
swblock validate testops/scenarios/nvme-p5-protocol-component-gate.yaml
|
||||
```
|
||||
|
||||
They build into `.tools/swblock(.exe)`, write `.tools/swblock.path`, and print
|
||||
the final binary path.
|
||||
Apart from `helm-multi-volume-rf3-app-spread-failover-chain.yaml`, which still targets
|
||||
the project's lab, no scenario names a host, user, key or share. Each one reads them
|
||||
from its `env` block, where they are empty, so set every one on the command line:
|
||||
|
||||
Related runner binaries share the same engine but link different product/action
|
||||
sets:
|
||||
|
||||
- `swblock`: V3 / Seaweed Block product pack.
|
||||
- `weedblock`: V2 product pack.
|
||||
- `cmd/sw-test-runner`: kitchen-sink/dev binary.
|
||||
|
||||
Recommended local check before running scenarios:
|
||||
| Setting | Meaning |
|
||||
| --- | --- |
|
||||
| `product_root` | this repository's checkout on the test node |
|
||||
| `node_host` | address of the test node |
|
||||
| `node_user` | ssh user on the test node |
|
||||
| `ssh_key` | private key for `node_user`, on the controller |
|
||||
| `artifact_root` | shared directory for run artifacts, as the test node sees it; an absolute path other than `/` using only `A-Za-z0-9._/-` |
|
||||
| `import_nodes` | every other k3s node, for the image import (`nvme-tcp-status-surface-evidence-chain`, `nvme-tcp-cross-node-multivolume-lifecycle-soak-chain`); without it only the test node gets the images |
|
||||
| `node_ssh_key` | key path on the test node for the image import (those two chains and `node-loss-survival-rf3-reattach-chain`) |
|
||||
|
||||
```bash
|
||||
swblock list
|
||||
swblock validate testops/scenarios/csi-rf1-durable-restart-chain.yaml
|
||||
swblock run \
|
||||
-env product_root=/path/to/seaweed-block \
|
||||
-env node_host=192.0.2.10 \
|
||||
-env node_user=tester \
|
||||
-env ssh_key=/path/to/key \
|
||||
-env artifact_root=/path/to/shared/artifacts \
|
||||
testops/scenarios/nvme-p5-protocol-component-gate.yaml
|
||||
```
|
||||
|
||||
## Which Gate To Run
|
||||
Destructive and artifact-dependent always actions validate the root independently,
|
||||
before cleanup starts. The value reaches the guard through the runner's quoted
|
||||
`env.SW_BLOCK_ARTIFACT_ROOT` parameter, rather than being rendered into shell
|
||||
syntax. This also protects a direct `swblock run` when an earlier phase fails.
|
||||
Uninstall refuses cleanup if its artifact directory cannot be created.
|
||||
|
||||
Use the smallest gate that can prove the contract you changed.
|
||||
Check every complete guard/action copy locally, with cleanup stubs and no cluster:
|
||||
`bash scripts/testops-artifact-root-guard-test.sh` (requires Go on a POSIX system).
|
||||
|
||||
| Change type | Default gate | Why |
|
||||
| --- | --- | --- |
|
||||
| Package-local logic, parser, renderer, state-machine helper | `go test -count=1 ./<touched-package>` | Fastest feedback; no m02 or runner dependency. |
|
||||
| CSI protocol propagation, lifecycle persistence, launcher render shape | `swblock run testops/scenarios/nvme-p5-protocol-component-gate.yaml` | Proves the known NVMe/iSCSI protocol-shape contracts with a runner bundle in seconds. |
|
||||
| RF=1 restart contract, durable-root/status manifest shape | `swblock run testops/scenarios/csi-rf1-durable-restart-component-gate.yaml` | Proves restart/recovery contract shape without a full K8s restart. |
|
||||
| Operations read-only volume status report shape | `swblock run testops/scenarios/operations-volume-status-report-component-gate.yaml` | Proves schema, frontend identity, unavailable fields, and residue copy behavior without starting product processes. |
|
||||
| Kernel initiator, k3s, mounted filesystem, failover, or stale-session behavior | The matching child chain, for example `nvme-p5-csi-protocol-chain` or `csi-rf1-durable-restart-chain` | These require real Linux/K8s/initiator behavior. |
|
||||
| Milestone readiness or cross-protocol release confidence | `swblock suite testops/suites/beta-hardening-gate.yaml` plus `swblock validate-bundle --profile beta-hardening` | Slow, evidence-heavy gate. Use for release/milestone claims, not first debugging. |
|
||||
## Which gate to run
|
||||
|
||||
Use the smallest gate that proves the contract you changed.
|
||||
|
||||
| Change type | Gate |
|
||||
| --- | --- |
|
||||
| Package-local logic, parser, renderer, state-machine helper | `go test -count=1 ./<touched-package>` |
|
||||
| CSI protocol propagation, lifecycle persistence, launcher render shape | `nvme-p5-protocol-component-gate` |
|
||||
| Kernel initiator, k3s, mounted filesystem, failover or stale-session behaviour | the matching chain, for example `nvme-p5-csi-protocol-chain`, `nvme-p4-multipath-failover-chain` or `iscsi-p6-alua-failover-chain` |
|
||||
|
||||
**Node loss (`node-loss-survival-rf3-reattach-chain`).** This release claims no automatic promotion on node loss:
|
||||
the gate cordons the primary's node and stops it, requires that no other replica is promoted during the hold
|
||||
@@ -83,214 +70,3 @@ data. Manual failover (a `SwBlockReplicaFailback` handled by the failback execut
|
||||
(`core/host/master/failback_runtime_test.go`), `TestFailbackAuthorityRuntimeAdapterRejectsStaleExpectedCurrent`
|
||||
(`core/ops/failback_authority_runtime_adapter_test.go`) and `TestFailbackExecutorInvokesRuntimeWhenExplicitlyEnabled`
|
||||
(`core/ops/failback_executor_controller_test.go`).
|
||||
|
||||
Default ownership:
|
||||
|
||||
- Developers run unit/component tests, fast runner-native component gates, and
|
||||
single-child chains while iterating.
|
||||
- QA runs full-suite repeatability, long soak, ambiguous lab failures, and
|
||||
independent milestone validation.
|
||||
- If QA would only execute a single known command and return stdout, run it
|
||||
yourself and reserve QA for scenario design or trust-critical validation.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
swblock run \
|
||||
-env product_root=/path/to/seaweed_block/on/m02 \
|
||||
-env ssh_key=/path/to/testdev_key/on/controller \
|
||||
testops/scenarios/nvme-p5-csi-protocol-chain.yaml
|
||||
```
|
||||
|
||||
Fast component gates are available for developer loops before running the
|
||||
heavier K8s or initiator paths. For example, the NVMe-P5 protocol component
|
||||
gate pins CSI protocol extraction, lifecycle protocol planning, and launcher
|
||||
protocol persistence/planning, plus launcher NVMe/iSCSI manifest shape without
|
||||
launching k3s:
|
||||
|
||||
```bash
|
||||
swblock run \
|
||||
-env product_root=/path/to/seaweed_block/on/m02 \
|
||||
-env ssh_key=/path/to/testdev_key/on/controller \
|
||||
testops/scenarios/nvme-p5-protocol-component-gate.yaml
|
||||
```
|
||||
|
||||
The RF=1 durable restart path also has a component gate that checks restart
|
||||
wrapper shape, generated hostPath/status manifest behavior, master frontend
|
||||
projection, and durable status lineage without doing the full K8s restart:
|
||||
|
||||
```bash
|
||||
swblock run \
|
||||
-env product_root=/path/to/seaweed_block/on/m02 \
|
||||
-env ssh_key=/path/to/testdev_key/on/controller \
|
||||
testops/scenarios/csi-rf1-durable-restart-component-gate.yaml
|
||||
```
|
||||
|
||||
The first operations-layer status report contract has its own component gate.
|
||||
It is read-only, does not start product processes, and is not a block/data
|
||||
snapshot:
|
||||
|
||||
```bash
|
||||
swblock run \
|
||||
-env product_root=/path/to/seaweed_block/on/m02 \
|
||||
-env ssh_key=/path/to/testdev_key/on/controller \
|
||||
testops/scenarios/operations-volume-status-report-component-gate.yaml
|
||||
```
|
||||
|
||||
The same runner-native shape is used for the longer iSCSI P8 soak:
|
||||
|
||||
```bash
|
||||
swblock run \
|
||||
-env product_root=/path/to/seaweed_block/on/m02 \
|
||||
-env ssh_key=/path/to/testdev_key/on/controller \
|
||||
testops/scenarios/iscsi-p8-compat-soak-chain.yaml
|
||||
```
|
||||
|
||||
The scenario still shells out to existing bash payloads. That is deliberate:
|
||||
the first migration step is to move orchestration and evidence collection into
|
||||
the runner without rewriting the product smoke tests.
|
||||
|
||||
## Protocol Release Gate
|
||||
|
||||
The product-owned release gate composes the current protocol chains:
|
||||
|
||||
- `iscsi-p6-alua-failover-chain`
|
||||
- `nvme-p4-multipath-failover-chain`
|
||||
- `nvme-p5-csi-protocol-chain`
|
||||
- `iscsi-p8-compat-soak-chain`
|
||||
|
||||
The primary operator path is the runner-native suite command. Run it from the
|
||||
controller, pointing it at the remote product checkout on m02:
|
||||
|
||||
```powershell
|
||||
swblock suite `
|
||||
--results-dir <evidence-store>/g15d-k8s/testops-runs/protocol-release-gate-native `
|
||||
--env product_root=/tmp/seaweed-block-nvme-p4l `
|
||||
--env ssh_key=C:/work/dev_server/testdev_key `
|
||||
C:/work/seaweed_block/testops/suites/protocol-release-gate.yaml
|
||||
```
|
||||
|
||||
Validate the bundle before manual artifact review:
|
||||
|
||||
```powershell
|
||||
swblock validate-bundle --profile protocol-release-gate `
|
||||
<evidence-store>/g15d-k8s/testops-runs/protocol-release-gate-native/<run-id>
|
||||
```
|
||||
|
||||
QA close evidence:
|
||||
|
||||
- product commit: `033028e74c1ac3bc06f19c0563bc2e6a0495af59`,
|
||||
- runner commit: `3c1b6603aefcf4c1bf0b22f9a9c081a67e786d8d`,
|
||||
- suite run: `20260509-151531-9c6c`,
|
||||
- result: PASS, validated by `swblock validate-bundle --profile
|
||||
protocol-release-gate`.
|
||||
|
||||
The older wrappers remain available for compatibility and local debugging. The
|
||||
PowerShell wrapper supports both Windows PowerShell 5.1 and PowerShell 7+;
|
||||
native runner stderr is captured into the child artifact directory instead of
|
||||
being treated as a PowerShell exception.
|
||||
|
||||
```powershell
|
||||
.\scripts\testops-run-protocol-release-gate.ps1 `
|
||||
-RunnerRoot C:\work\seaweedfs\learn\sw-test-runner-standalone `
|
||||
-RemoteProductRoot /tmp/seaweed-block-nvme-p4l `
|
||||
-SshKey C:\work\dev_server\testdev_key `
|
||||
-ArtifactRoot C:\work\tmp\protocol-release-gate-$(Get-Date -Format yyyyMMddTHHmmssZ)
|
||||
```
|
||||
|
||||
Linux / Git Bash controllers can use the bash wrapper:
|
||||
|
||||
```bash
|
||||
SWBLOCK_RUNNER_ROOT=/c/work/seaweedfs/learn/sw-test-runner-standalone \
|
||||
SW_BLOCK_REMOTE_PRODUCT_ROOT=/tmp/seaweed-block-nvme-p4l \
|
||||
SW_BLOCK_SSH_KEY='C:\work\dev_server\testdev_key' \
|
||||
SW_BLOCK_ARTIFACT_DIR=/c/work/tmp/protocol-release-gate-$(date -u +%Y%m%dT%H%M%SZ) \
|
||||
bash scripts/testops-run-protocol-release-gate.sh "$PWD"
|
||||
```
|
||||
|
||||
The suite writes a top-level `result.json` and `status.json` with
|
||||
`started_at`, `ended_at`, `wall_clock_s`, child run IDs, per-child PASS/FAIL,
|
||||
and artifact pointers. Each child bundle still owns its own `status.json`,
|
||||
`result.json`, `scenario.yaml`, and collected remote artifacts under
|
||||
`<suite-artifact>/<step>/runs/<child-run-id>/`.
|
||||
|
||||
After a run, validate the suite bundle offline before manual artifact review:
|
||||
|
||||
```powershell
|
||||
.\scripts\testops-validate-latest-protocol-release-gate.ps1 `
|
||||
-RunnerRoot C:\work\seaweedfs\learn\sw-test-runner-standalone `
|
||||
-ArtifactRoot C:\work\tmp\protocol-release-gate-20260509T000000Z `
|
||||
-ExpectCommit 033028e74c1ac3bc06f19c0563bc2e6a0495af59
|
||||
```
|
||||
|
||||
Linux / Git Bash:
|
||||
|
||||
```bash
|
||||
SWBLOCK_RUNNER_ROOT=/c/work/seaweedfs/learn/sw-test-runner-standalone \
|
||||
SW_BLOCK_ARTIFACT_DIR=/c/work/tmp/protocol-release-gate-20260509T000000Z \
|
||||
SW_BLOCK_EXPECT_COMMIT=033028e74c1ac3bc06f19c0563bc2e6a0495af59 \
|
||||
bash scripts/testops-validate-latest-protocol-release-gate.sh "$PWD"
|
||||
```
|
||||
|
||||
The wrapper calls the platform validator profile:
|
||||
|
||||
```bash
|
||||
swblock validate-bundle --profile protocol-release-gate \
|
||||
--expect-commit 033028e74c1ac3bc06f19c0563bc2e6a0495af59 \
|
||||
/path/to/protocol-release-gate-artifact
|
||||
```
|
||||
|
||||
The older product-specific Python checker remains available for local
|
||||
debugging but is no longer the primary operator path:
|
||||
|
||||
```bash
|
||||
python3 scripts/testops-validate-protocol-release-gate.py \
|
||||
/path/to/protocol-release-gate-artifact \
|
||||
--expect-product-commit 033028e74c1ac3bc06f19c0563bc2e6a0495af59
|
||||
```
|
||||
|
||||
Use `--allow-fail` when validating the schema of an intentionally failed or
|
||||
cancelled run; without it the checker requires all four child chains to be
|
||||
`pass` with complete phase counts.
|
||||
|
||||
## Beta Hardening Gate
|
||||
|
||||
`testops/suites/beta-hardening-gate.yaml` is the seed suite for the current
|
||||
beta-hardening plan. It composes the protocol release children plus the new
|
||||
component/restart/reintegration gates:
|
||||
|
||||
- `iscsi-p6-alua-failover-chain`
|
||||
- `nvme-p4-multipath-failover-chain`
|
||||
- `nvme-p5-csi-protocol-chain`
|
||||
- `iscsi-p8-compat-soak-chain`
|
||||
- `csi-lifecycle-component-gate`
|
||||
- `csi-rf1-durable-restart-chain`
|
||||
- `operations-status-diagnostics-chain`
|
||||
- `returned-replica-component-gate`
|
||||
- `iscsi-returned-replica-chain`
|
||||
- `cleanup-residue-chain`
|
||||
|
||||
Run shape:
|
||||
|
||||
```powershell
|
||||
swblock suite `
|
||||
--results-dir <evidence-store>/g15d-k8s/testops-runs/beta-hardening-gate `
|
||||
--env product_root=/tmp/seaweed-block-plan-roadmap-refresh-devrun `
|
||||
--env ssh_key=C:/work/dev_server/testdev_key `
|
||||
C:/work/seaweed_block/testops/suites/beta-hardening-gate.yaml
|
||||
```
|
||||
|
||||
Repeatability evidence:
|
||||
|
||||
- product commit:
|
||||
`8822f20e91c2b88727ead9e49f9bf75eec28c791`
|
||||
- runner commit:
|
||||
`cf65daaf2ce5cf500e1efa48b411f7cb66dbac0b`
|
||||
- run 1: `20260511-031605-8258`, PASS, `21m46s`,
|
||||
`validate-bundle --profile beta-hardening` VALID.
|
||||
- run 2: `20260511-040412-ac38`, PASS, `22m55s`,
|
||||
`validate-bundle --profile beta-hardening` VALID.
|
||||
- no manual cleanup between runs; final residue audit clean.
|
||||
|
||||
Use this suite for milestone readiness or release-candidate confidence. Do not
|
||||
use it as the first debug loop for a package-level change.
|
||||
@@ -1,80 +0,0 @@
|
||||
# Runner-native Phase 67 gate: caught-up rebuild to ACK eligibility publication.
|
||||
|
||||
name: ack-eligibility-publication-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: ack_eligibility_publication_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication bash scripts/run-phase67-ack-eligibility-publication-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt"
|
||||
pattern: "^phase67_ack_eligibility_publication_status=ok$"
|
||||
save_as: phase67_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase67_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt"
|
||||
pattern: "^ack_publication_after_caught_up=true$"
|
||||
save_as: ack_after_caught_up
|
||||
- action: assert_greater
|
||||
actual: "{{ ack_after_caught_up }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt"
|
||||
pattern: "^ack_publication_requires_rebuild_caught_up=true$"
|
||||
save_as: requires_caught_up
|
||||
- action: assert_greater
|
||||
actual: "{{ requires_caught_up }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt"
|
||||
pattern: "^ack_publication_rejects_running_rebuild=true$"
|
||||
save_as: rejects_running
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_running }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt"
|
||||
pattern: "^ack_publication_rejects_unexpected_publication_allowed=true$"
|
||||
save_as: rejects_unexpected_policy
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_unexpected_policy }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=0$"
|
||||
save_as: no_frontend
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -10,42 +10,46 @@ timeout: 24m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
ssh_key: "" # private key for node_user; set with -env ssh_key=<path>
|
||||
node_host: "" # address of the test node; set with -env node_host=<address>
|
||||
node_user: "" # ssh user on the test node; set with -env node_user=<user>
|
||||
artifact_root: "" # shared artifact directory; set with -env artifact_root=<path>
|
||||
sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-28a99ce4f644"
|
||||
sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-28a99ce4f644"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
node-a:
|
||||
host: "{{ node_host }}"
|
||||
user: "{{ node_user }}"
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
node: node-a
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/activation /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup"
|
||||
node: node-a
|
||||
cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume/activation $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup"
|
||||
env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
node: node-a
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
node: node-a
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
|
||||
- name: activate_alpha_stack
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
node: node-a
|
||||
timeout: 12m
|
||||
cmd: "cd {{ product_root }} && bash scripts/activate-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/activation"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/activation"
|
||||
env.SW_BLOCK_ACTIVATION_IMAGE_MODE: "published"
|
||||
env.SW_BLOCK_IMAGE: "{{ sw_block_image }}"
|
||||
env.SW_BLOCK_CSI_IMAGE: "{{ sw_block_csi_image }}"
|
||||
@@ -53,81 +57,81 @@ phases:
|
||||
- name: first_volume_user_loop
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
node: node-a
|
||||
timeout: 10m
|
||||
cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app"
|
||||
env.SW_BLOCK_BASIC_APP_CLEANUP: "1"
|
||||
|
||||
- name: first_volume_asserts
|
||||
actions:
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
pattern: "^first_volume_status=ok$"
|
||||
save_as: first_volume_ok_count
|
||||
- action: assert_greater
|
||||
actual: "{{ first_volume_ok_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
pattern: "^pvc=sw-block-example-pvc$"
|
||||
save_as: pvc_count
|
||||
- action: assert_greater
|
||||
actual: "{{ pvc_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
pattern: "^writer_verified=true$"
|
||||
save_as: writer_verified_count
|
||||
- action: assert_greater
|
||||
actual: "{{ writer_verified_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
pattern: "^reader_verified=true$"
|
||||
save_as: reader_verified_count
|
||||
- action: assert_greater
|
||||
actual: "{{ reader_verified_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/writer.log"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/writer.log"
|
||||
pattern: "/data/demo.bin: OK"
|
||||
save_as: writer_checksum_count
|
||||
- action: assert_greater
|
||||
actual: "{{ writer_checksum_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/reader.log"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/reader.log"
|
||||
pattern: "/data/demo.bin: OK"
|
||||
save_as: reader_checksum_count
|
||||
- action: assert_greater
|
||||
actual: "{{ reader_checksum_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt"
|
||||
pattern: "^cleanup_status=ok$"
|
||||
save_as: basic_cleanup_count
|
||||
- action: assert_greater
|
||||
actual: "{{ basic_cleanup_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/cluster-evidence.json"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/cluster-evidence.json"
|
||||
pattern: "\"volumes\""
|
||||
save_as: cluster_volumes_count
|
||||
- action: assert_greater
|
||||
actual: "{{ cluster_volumes_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/inventory/volume-inventory-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/inventory/volume-inventory-summary.txt"
|
||||
pattern: "pvc=sw-block-example-pvc"
|
||||
save_as: inventory_pvc_count
|
||||
- action: assert_greater
|
||||
@@ -138,14 +142,15 @@ phases:
|
||||
always: true
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
node: node-a
|
||||
timeout: 5m
|
||||
cmd: "kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup"
|
||||
cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup"
|
||||
env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
node: node-a
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
node: node-a
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
@@ -7,8 +7,11 @@
|
||||
#
|
||||
# Expected invocation:
|
||||
# swblock run \
|
||||
# -env product_root=/path/to/seaweed_block/on/m02 \
|
||||
# -env ssh_key=/path/to/testdev_key/on/controller \
|
||||
# -env product_root=/path/to/seaweed_block/on/node-a \
|
||||
# -env ssh_key=/path/to/ssh/key/on/controller \
|
||||
# -env node_host=192.0.2.10 \
|
||||
# -env node_user=tester \
|
||||
# -env artifact_root=/path/to/shared/artifacts \
|
||||
# testops/scenarios/activation-day1-install-chain.yaml
|
||||
|
||||
name: activation-day1-install-chain
|
||||
@@ -16,127 +19,131 @@ timeout: 18m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
ssh_key: "" # private key for node_user; set with -env ssh_key=<path>
|
||||
node_host: "" # address of the test node; set with -env node_host=<address>
|
||||
node_user: "" # ssh user on the test node; set with -env node_user=<user>
|
||||
artifact_root: "" # shared artifact directory; set with -env artifact_root=<path>
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
node-a:
|
||||
host: "{{ node_host }}"
|
||||
user: "{{ node_user }}"
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
node: node-a
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1 && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/cleanup"
|
||||
node: node-a
|
||||
cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-day1 && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-day1/activation $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-day1/cleanup"
|
||||
env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
node: node-a
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
node: node-a
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
|
||||
- name: activate_alpha_stack
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
node: node-a
|
||||
timeout: 12m
|
||||
cmd: "cd {{ product_root }} && bash scripts/activate-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation"
|
||||
env.SW_BLOCK_ACTIVATION_IMPORT_K3S: "1"
|
||||
|
||||
- name: activation_asserts
|
||||
actions:
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^activation_status=ok$"
|
||||
save_as: activation_ok_count
|
||||
- action: assert_greater
|
||||
actual: "{{ activation_ok_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^master_ready_replicas=1$"
|
||||
save_as: master_ready_count
|
||||
- action: assert_greater
|
||||
actual: "{{ master_ready_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^csi_controller_ready_replicas=1$"
|
||||
save_as: csi_controller_ready_count
|
||||
- action: assert_greater
|
||||
actual: "{{ csi_controller_ready_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^csi_node_ready=[1-9][0-9]*/[1-9][0-9]*$"
|
||||
save_as: csi_node_ready_count
|
||||
- action: assert_greater
|
||||
actual: "{{ csi_node_ready_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^storageclass=sw-block-dynamic$"
|
||||
save_as: storageclass_count
|
||||
- action: assert_greater
|
||||
actual: "{{ storageclass_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^storageclass_provider=block.csi.seaweedfs.com$"
|
||||
save_as: storageclass_provider_count
|
||||
- action: assert_greater
|
||||
actual: "{{ storageclass_provider_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^protocol=iscsi$"
|
||||
save_as: protocol_count
|
||||
- action: assert_greater
|
||||
actual: "{{ protocol_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "^ack_profile=best-effort$"
|
||||
save_as: ack_profile_count
|
||||
- action: assert_greater
|
||||
actual: "{{ ack_profile_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "next_create_volume=kubectl apply -f examples/kubernetes/basic-app/storageclass-pvc.yaml"
|
||||
save_as: next_create_volume_count
|
||||
- action: assert_greater
|
||||
actual: "{{ next_create_volume_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt"
|
||||
pattern: "non_claims=alpha_only,no_backup_restore,no_upgrade_safety,no_mutating_dashboard_actions,no_broad_performance_slo"
|
||||
save_as: non_claims_count
|
||||
- action: assert_greater
|
||||
actual: "{{ non_claims_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/readiness.txt"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/readiness.txt"
|
||||
pattern: "sw-block-csi-node"
|
||||
save_as: readiness_csi_node_count
|
||||
- action: assert_greater
|
||||
@@ -147,20 +154,21 @@ phases:
|
||||
always: true
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
node: node-a
|
||||
timeout: 5m
|
||||
cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/cleanup"
|
||||
cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/cleanup"
|
||||
env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
node: node-a
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
node: node-a
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/cleanup/delete-storageclass.log"
|
||||
node: node-a
|
||||
path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/cleanup/delete-storageclass.log"
|
||||
pattern: "sw-block-dynamic"
|
||||
save_as: storageclass_cleanup_count
|
||||
- action: assert_greater
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
# Runner-native Phase 54 D4 gate: authority-executor ACK eligibility call-site.
|
||||
|
||||
name: authority-executor-callsite-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_callsite_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite bash scripts/run-phase54-authority-executor-callsite-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^phase54_authority_executor_callsite_status=ok$"
|
||||
save_as: phase54_callsite_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase54_callsite_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^target_missing_mutation_attempts=0$"
|
||||
save_as: target_missing_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ target_missing_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^target_missing_created_targets=0$"
|
||||
save_as: target_missing_no_create
|
||||
- action: assert_greater
|
||||
actual: "{{ target_missing_no_create }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^terminal_missing_mutation_attempts=0$"
|
||||
save_as: terminal_missing_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ terminal_missing_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^terminal_missing_target_reason_absent=$"
|
||||
save_as: terminal_missing_no_status
|
||||
- action: assert_greater
|
||||
actual: "{{ terminal_missing_no_status }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_mutation_attempts=1$"
|
||||
save_as: complete_one_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_one_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_ack_eligibility_mutation_attempts=1$"
|
||||
save_as: complete_one_ack_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_one_ack_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_reason=ack_eligibility_recorded$"
|
||||
save_as: complete_reason
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_reason }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_ack_eligible=true$"
|
||||
save_as: complete_ack_eligible
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_ack_eligible }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_frontend_fenced=true$"
|
||||
save_as: complete_frontend_fenced
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_frontend_fenced }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_primary_unchanged=true$"
|
||||
save_as: complete_primary_unchanged
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_primary_unchanged }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_frontier_covered=true$"
|
||||
save_as: complete_frontier_covered
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_frontier_covered }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_no_cross_volume=true$"
|
||||
save_as: complete_no_cross_volume
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_no_cross_volume }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_swblockvolume_ack_still_false=false$"
|
||||
save_as: complete_source_unchanged
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_source_unchanged }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^complete_target_nonclaims_ok=true$"
|
||||
save_as: complete_nonclaims
|
||||
- action: assert_greater
|
||||
actual: "{{ complete_nonclaims }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^exec_patch_swblockvolumes_status_denied=no$"
|
||||
save_as: boundary_volume_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ boundary_volume_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt"
|
||||
pattern: "^exec_create_events_denied=no$"
|
||||
save_as: boundary_events_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ boundary_events_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,128 +0,0 @@
|
||||
# Runner-native Phase 62 gate: authority-executor HTTP rebuild runtime transport.
|
||||
|
||||
name: authority-executor-http-runtime-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_http_runtime_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime bash scripts/run-phase62-authority-executor-http-runtime-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^phase62_authority_executor_http_runtime_status=ok$"
|
||||
save_as: phase62_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase62_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^http_runtime_posts_request=true$"
|
||||
save_as: posts_request
|
||||
- action: assert_greater
|
||||
actual: "{{ posts_request }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^http_runtime_decodes_terminal_frontier=true$"
|
||||
save_as: decodes_frontier
|
||||
- action: assert_greater
|
||||
actual: "{{ decodes_frontier }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^cli_rebuild_runtime_url_enabled=true$"
|
||||
save_as: cli_enabled
|
||||
- action: assert_greater
|
||||
actual: "{{ cli_enabled }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^cli_rebuild_runtime_url_requires_rebuild_traffic=true$"
|
||||
save_as: cli_guard
|
||||
- action: assert_greater
|
||||
actual: "{{ cli_guard }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^rebuild_status_running_written=true$"
|
||||
save_as: running_written
|
||||
- action: assert_greater
|
||||
actual: "{{ running_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^rebuild_status_caught_up_written=true$"
|
||||
save_as: caught_up_written
|
||||
- action: assert_greater
|
||||
actual: "{{ caught_up_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^rebuild_status_blocked_on_runtime_failure=true$"
|
||||
save_as: blocked_written
|
||||
- action: assert_greater
|
||||
actual: "{{ blocked_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^planned_status_preserved_without_runtime=true$"
|
||||
save_as: planned_preserved
|
||||
- action: assert_greater
|
||||
actual: "{{ planned_preserved }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^blockvolume_runtime_endpoint_wired=false$"
|
||||
save_as: endpoint_not_wired
|
||||
- action: assert_greater
|
||||
actual: "{{ endpoint_not_wired }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt"
|
||||
pattern: "^failback_allowed=false$"
|
||||
save_as: no_failback
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,166 +0,0 @@
|
||||
# Runner-native Phase 54 D7 gate: live returned-replica close with bounded ACK eligibility execution.
|
||||
|
||||
name: authority-executor-live-close-chain
|
||||
timeout: 22m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,iscsi-target"
|
||||
unmount: "/tmp/sw-block-phase54-live-close/mnt"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
|
||||
- name: authority_executor_live_close_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 18m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close bash scripts/run-phase54-authority-executor-live-close-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^phase54_authority_executor_live_close_status=ok$"
|
||||
save_as: phase54_live_close_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase54_live_close_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^previous_primary_frontend_fenced=true$"
|
||||
save_as: previous_primary_fenced
|
||||
- action: assert_greater
|
||||
actual: "{{ previous_primary_fenced }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^current_primary_unchanged=true$"
|
||||
save_as: current_primary_unchanged
|
||||
- action: assert_greater
|
||||
actual: "{{ current_primary_unchanged }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^durable_frontier_covered=true$"
|
||||
save_as: durable_frontier_covered
|
||||
- action: assert_greater
|
||||
actual: "{{ durable_frontier_covered }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^executor_ack_mutation_attempts=1$"
|
||||
save_as: one_ack_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ one_ack_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_reason=ack_eligibility_recorded$"
|
||||
save_as: target_ack_recorded
|
||||
- action: assert_greater
|
||||
actual: "{{ target_ack_recorded }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_ack_eligible=true$"
|
||||
save_as: target_ack_eligible
|
||||
- action: assert_greater
|
||||
actual: "{{ target_ack_eligible }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_frontend_fenced=true$"
|
||||
save_as: target_frontend_fenced
|
||||
- action: assert_greater
|
||||
actual: "{{ target_frontend_fenced }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_primary_unchanged=true$"
|
||||
save_as: target_primary_unchanged
|
||||
- action: assert_greater
|
||||
actual: "{{ target_primary_unchanged }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_frontier_covered=true$"
|
||||
save_as: target_frontier_covered
|
||||
- action: assert_greater
|
||||
actual: "{{ target_frontier_covered }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_no_cross_volume=true$"
|
||||
save_as: target_no_cross_volume
|
||||
- action: assert_greater
|
||||
actual: "{{ target_no_cross_volume }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^source_ack_still_false=false$"
|
||||
save_as: source_ack_unchanged
|
||||
- action: assert_greater
|
||||
actual: "{{ source_ack_unchanged }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt"
|
||||
pattern: "^target_nonclaims_ok=true$"
|
||||
save_as: target_nonclaims_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ target_nonclaims_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: final_asserts
|
||||
actions:
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,iscsi-target"
|
||||
unmount: "/tmp/sw-block-phase54-live-close/mnt"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,152 +0,0 @@
|
||||
# Runner-native Phase 54 D6 gate: authority-executor multi-volume isolation.
|
||||
|
||||
name: authority-executor-multivolume-chain
|
||||
timeout: 10m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_multivolume_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 9m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume bash scripts/run-phase54-authority-executor-multivolume-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^phase54_authority_executor_multivolume_status=ok$"
|
||||
save_as: phase54_multivolume_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase54_multivolume_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^multivolume_contracts=4$"
|
||||
save_as: multivolume_contracts
|
||||
- action: assert_greater
|
||||
actual: "{{ multivolume_contracts }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^multivolume_mutation_attempts=2$"
|
||||
save_as: multivolume_two_mutations
|
||||
- action: assert_greater
|
||||
actual: "{{ multivolume_two_mutations }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^multivolume_ack_mutation_attempts=2$"
|
||||
save_as: multivolume_two_ack_mutations
|
||||
- action: assert_greater
|
||||
actual: "{{ multivolume_two_ack_mutations }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^multivolume_terminal_missing=1$"
|
||||
save_as: multivolume_one_terminal_missing
|
||||
- action: assert_greater
|
||||
actual: "{{ multivolume_one_terminal_missing }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^multivolume_target_missing=1$"
|
||||
save_as: multivolume_one_target_missing
|
||||
- action: assert_greater
|
||||
actual: "{{ multivolume_one_target_missing }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^eligible_a_reason=ack_eligibility_recorded$"
|
||||
save_as: eligible_a_written
|
||||
- action: assert_greater
|
||||
actual: "{{ eligible_a_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^eligible_b_reason=ack_eligibility_recorded$"
|
||||
save_as: eligible_b_written
|
||||
- action: assert_greater
|
||||
actual: "{{ eligible_b_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^blocked_c_reason_absent=$"
|
||||
save_as: blocked_c_held
|
||||
- action: assert_greater
|
||||
actual: "{{ blocked_c_held }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^mismatch_e_reason_absent=$"
|
||||
save_as: mismatch_e_held
|
||||
- action: assert_greater
|
||||
actual: "{{ mismatch_e_held }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^no_contract_d_target_count=0$"
|
||||
save_as: no_contract_d_no_target
|
||||
- action: assert_greater
|
||||
actual: "{{ no_contract_d_no_target }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^eligible_written_count=2$"
|
||||
save_as: exactly_two_written
|
||||
- action: assert_greater
|
||||
actual: "{{ exactly_two_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^cross_contamination_count=0$"
|
||||
save_as: no_cross_contamination
|
||||
- action: assert_greater
|
||||
actual: "{{ no_cross_contamination }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^exec_patch_swblockvolumes_status_denied=no$"
|
||||
save_as: boundary_volume_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ boundary_volume_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt"
|
||||
pattern: "^exec_create_events_denied=no$"
|
||||
save_as: boundary_events_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ boundary_events_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,128 +0,0 @@
|
||||
# Runner-native Phase 54 D5 gate: authority-executor negative/hold matrix.
|
||||
|
||||
name: authority-executor-negative-chain
|
||||
timeout: 10m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_negative_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 9m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative bash scripts/run-phase54-authority-executor-negative-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^phase54_authority_executor_negative_status=ok$"
|
||||
save_as: phase54_negative_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase54_negative_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^blocked-preflight_mutation_attempts=0$"
|
||||
save_as: blocked_preflight_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ blocked_preflight_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^stale-frontier_mutation_attempts=0$"
|
||||
save_as: stale_frontier_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ stale_frontier_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^unsafe-frontend_mutation_attempts=0$"
|
||||
save_as: unsafe_frontend_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ unsafe_frontend_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^ambiguous_target_mutation_attempts=0$"
|
||||
save_as: ambiguous_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ ambiguous_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^identity_mismatch_mutation_attempts=0$"
|
||||
save_as: identity_mismatch_no_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ identity_mismatch_no_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^partial_mutation_attempts=1$"
|
||||
save_as: partial_one_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ partial_one_mutation }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^partial_terminal_missing=1$"
|
||||
save_as: partial_one_hold
|
||||
- action: assert_greater
|
||||
actual: "{{ partial_one_hold }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^partial_a_reason=ack_eligibility_recorded$"
|
||||
save_as: partial_a_written
|
||||
- action: assert_greater
|
||||
actual: "{{ partial_a_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^partial_b_reason_absent=$"
|
||||
save_as: partial_b_held
|
||||
- action: assert_greater
|
||||
actual: "{{ partial_b_held }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^exec_patch_swblockvolumes_status_denied=no$"
|
||||
save_as: boundary_volume_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ boundary_volume_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt"
|
||||
pattern: "^exec_create_events_denied=no$"
|
||||
save_as: boundary_events_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ boundary_events_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,72 +0,0 @@
|
||||
# Runner-native Phase 53 gate: authority-executor RBAC boundary.
|
||||
|
||||
name: authority-executor-rbac-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_rbac_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac bash scripts/run-phase53-authority-executor-rbac-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt"
|
||||
pattern: "^phase53_authority_executor_rbac_status=ok$"
|
||||
save_as: phase53_rbac_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase53_rbac_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt"
|
||||
pattern: "^authority_executor_get_swblockvolumes_allowed=yes$"
|
||||
save_as: phase53_get_allowed
|
||||
- action: assert_greater
|
||||
actual: "{{ phase53_get_allowed }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt"
|
||||
pattern: "^authority_executor_patch_swblockvolumes_denied=no$"
|
||||
save_as: phase53_patch_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ phase53_patch_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt"
|
||||
pattern: "^authority_executor_patch_status_denied=no$"
|
||||
save_as: phase53_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ phase53_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt"
|
||||
pattern: "^authority_executor_create_events_denied=no$"
|
||||
save_as: phase53_events_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ phase53_events_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,128 +0,0 @@
|
||||
# Runner-native Phase 57 gate: authority-executor rebuild target RBAC boundary.
|
||||
|
||||
name: authority-executor-rebuild-target-rbac-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_rebuild_target_rbac_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac bash scripts/run-phase57-authority-executor-rebuild-target-rbac-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^phase57_authority_executor_rebuild_target_rbac_status=ok$"
|
||||
save_as: phase57_rbac_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase57_rbac_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^default_patch_swblockreplicarebuilds_status_denied=no$"
|
||||
save_as: default_rebuild_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ default_rebuild_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockreplicarebuilds_status_allowed=yes$"
|
||||
save_as: exec_rebuild_status_allowed
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_rebuild_status_allowed }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockreplicarebuilds_main_denied=no$"
|
||||
save_as: exec_rebuild_main_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_rebuild_main_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockvolumes_status_denied=no$"
|
||||
save_as: exec_swblockvolume_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_swblockvolume_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockreplicaeligibilities_status_denied=no$"
|
||||
save_as: exec_eligibility_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_eligibility_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^exec_create_events_denied=no$"
|
||||
save_as: exec_events_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_events_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^default_rebuild_status_patch_runtime_denied=true$"
|
||||
save_as: default_runtime_patch_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ default_runtime_patch_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^runtime_rebuild_status_state=planned$"
|
||||
save_as: runtime_state_planned
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_state_planned }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^runtime_rebuild_status_reason=rebuild_progress_planned$"
|
||||
save_as: runtime_reason_planned
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_reason_planned }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^runtime_rebuild_traffic_started=false$"
|
||||
save_as: runtime_no_traffic
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_no_traffic }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt"
|
||||
pattern: "^runtime_no_frontend_publication=true$"
|
||||
save_as: runtime_no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,136 +0,0 @@
|
||||
# Runner-native Phase 61 gate: authority-executor rebuild runtime call-site.
|
||||
|
||||
name: authority-executor-runtime-callsite-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_runtime_callsite_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite bash scripts/run-phase61-authority-executor-runtime-callsite-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^phase61_authority_executor_runtime_callsite_status=ok$"
|
||||
save_as: phase61_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase61_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^planned_without_runtime_test=true$"
|
||||
save_as: planned_preserved
|
||||
- action: assert_greater
|
||||
actual: "{{ planned_preserved }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^runtime_callsite_caught_up_test=true$"
|
||||
save_as: runtime_caught_up
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_caught_up }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^runtime_failure_blocked_test=true$"
|
||||
save_as: runtime_blocked
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_blocked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^runtime_callsite_invoked=true$"
|
||||
save_as: callsite_invoked
|
||||
- action: assert_greater
|
||||
actual: "{{ callsite_invoked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^rebuild_status_running_written=true$"
|
||||
save_as: running_written
|
||||
- action: assert_greater
|
||||
actual: "{{ running_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^rebuild_status_caught_up_written=true$"
|
||||
save_as: caught_up_written
|
||||
- action: assert_greater
|
||||
actual: "{{ caught_up_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^rebuild_status_blocked_on_runtime_failure=true$"
|
||||
save_as: blocked_written
|
||||
- action: assert_greater
|
||||
actual: "{{ blocked_written }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^rebuild_traffic_started_when_runtime_invoked=true$"
|
||||
save_as: traffic_started
|
||||
- action: assert_greater
|
||||
actual: "{{ traffic_started }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^durable_frontier_caught_up_after_runtime=true$"
|
||||
save_as: frontier_caught_up
|
||||
- action: assert_greater
|
||||
actual: "{{ frontier_caught_up }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^blockvolume_rpc_wired=false$"
|
||||
save_as: rpc_not_wired
|
||||
- action: assert_greater
|
||||
actual: "{{ rpc_not_wired }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt"
|
||||
pattern: "^failback_allowed=false$"
|
||||
save_as: no_failback
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,80 +0,0 @@
|
||||
# Runner-native Phase 54 D3 gate: authority-executor ACK target RBAC boundary.
|
||||
|
||||
name: authority-executor-target-rbac-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: authority_executor_target_rbac_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac bash scripts/run-phase54-authority-executor-target-rbac-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt"
|
||||
pattern: "^phase54_authority_executor_target_rbac_status=ok$"
|
||||
save_as: phase54_rbac_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase54_rbac_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt"
|
||||
pattern: "^default_patch_swblockreplicaeligibilities_status_denied=no$"
|
||||
save_as: default_target_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ default_target_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockreplicaeligibilities_status_allowed=yes$"
|
||||
save_as: exec_target_status_allowed
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_target_status_allowed }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockreplicaeligibilities_main_denied=no$"
|
||||
save_as: exec_target_main_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_target_main_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt"
|
||||
pattern: "^exec_patch_swblockvolumes_status_denied=no$"
|
||||
save_as: exec_swblockvolume_status_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_swblockvolume_status_denied }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt"
|
||||
pattern: "^exec_create_events_denied=no$"
|
||||
save_as: exec_events_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ exec_events_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,96 +0,0 @@
|
||||
# Runner-native Phase 64 gate: blockvolume runtime rebuild start endpoint.
|
||||
|
||||
name: blockvolume-runtime-endpoint-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: blockvolume_runtime_endpoint_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint bash scripts/run-phase64-blockvolume-runtime-endpoint-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^phase64_blockvolume_runtime_endpoint_status=ok$"
|
||||
save_as: phase64_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase64_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^runtime_state_started_supported=true$"
|
||||
save_as: started_supported
|
||||
- action: assert_greater
|
||||
actual: "{{ started_supported }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^authority_executor_started_result_not_blocked=true$"
|
||||
save_as: started_not_blocked
|
||||
- action: assert_greater
|
||||
actual: "{{ started_not_blocked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^blockvolume_runtime_endpoint_opt_in=true$"
|
||||
save_as: opt_in
|
||||
- action: assert_greater
|
||||
actual: "{{ opt_in }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^blockvolume_runtime_endpoint_posts_started=true$"
|
||||
save_as: posts_started
|
||||
- action: assert_greater
|
||||
actual: "{{ posts_started }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^blockvolume_runtime_endpoint_requires_primary=true$"
|
||||
save_as: requires_primary
|
||||
- action: assert_greater
|
||||
actual: "{{ requires_primary }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^replication_runtime_rejects_lineage_drift=true$"
|
||||
save_as: rejects_drift
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_drift }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt"
|
||||
pattern: "^runtime_endpoint_terminal_frontier_claimed=false$"
|
||||
save_as: no_terminal_claim
|
||||
- action: assert_greater
|
||||
actual: "{{ no_terminal_claim }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,72 +0,0 @@
|
||||
# Runner-native Phase 66 gate: caught-up publication preflight surface.
|
||||
|
||||
name: caught-up-publication-preflight-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: publication_preflight_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight bash scripts/run-phase66-caught-up-publication-preflight-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt"
|
||||
pattern: "^phase66_caught_up_publication_preflight_status=ok$"
|
||||
save_as: phase66_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase66_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt"
|
||||
pattern: "^publication_decision_schema_locked=true$"
|
||||
save_as: schema_locked
|
||||
- action: assert_greater
|
||||
actual: "{{ schema_locked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt"
|
||||
pattern: "^publication_blocked_until_caught_up=true$"
|
||||
save_as: blocked_until_caught_up
|
||||
- action: assert_greater
|
||||
actual: "{{ blocked_until_caught_up }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt"
|
||||
pattern: "^publication_disabled_after_caught_up=true$"
|
||||
save_as: disabled_after_caught_up
|
||||
- action: assert_greater
|
||||
actual: "{{ disabled_after_caught_up }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt"
|
||||
pattern: "^publication_mutation_allowed=false$"
|
||||
save_as: mutation_false
|
||||
- action: assert_greater
|
||||
actual: "{{ mutation_false }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,88 +0,0 @@
|
||||
# Runner-native cleanup residue audit.
|
||||
#
|
||||
# Goal:
|
||||
# Prove the lab is clean before the next workload starts. This is not an
|
||||
# install/uninstall functional test; it is a repeatability guard for beta
|
||||
# suites that should fail when stale iSCSI/NVMe/K8s/process state leaks from
|
||||
# earlier children.
|
||||
#
|
||||
# Expected invocation:
|
||||
# swblock run \
|
||||
# -env product_root=/path/to/seaweed_block/on/m02 \
|
||||
# -env ssh_key=/path/to/testdev_key/on/controller \
|
||||
# testops/scenarios/cleanup-residue-chain.yaml
|
||||
|
||||
name: cleanup-residue-chain
|
||||
timeout: 6m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: host_protocol_residue
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/uninstall /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "cd {{ product_root }} && if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.status; else echo no-git-worktree > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.sha; : > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.status; fi"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "command -v iscsiadm >/dev/null && (sudo -n iscsiadm -m session > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/iscsi-sessions.after-cleanup.txt 2>&1 || grep -q 'No active sessions' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/iscsi-sessions.after-cleanup.txt)"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/verify-cleanup bash scripts/verify-helm-cleanup.sh {{ product_root }}"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "sudo nvme list-subsys -o json > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/nvme-list-subsys.after-cleanup.json 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/nvme-list-subsys.after-cleanup.err && ! grep -Ei 'nqn\\.[^[:space:]\"}]*seaweedfs|nqn\\.[^[:space:]\"}]*sw-block|nqn\\.[^[:space:]\"}]*weedblock' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/nvme-list-subsys.after-cleanup.json"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
|
||||
- name: kubernetes_residue
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "bash -e -c 'kubectl get deploy,daemonset,statefulset,pod,svc,pvc,pv -A -o name > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.txt 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.err; kubectl get storageclass,csidriver -o name >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.txt 2>> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.err; if grep -E \"(sw-block|seaweed-block|block\\.csi\\.seaweedfs\\.com)\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.txt > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-residue.after-cleanup.txt; then exit 1; fi'"
|
||||
|
||||
- name: hostpath_residue
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "if sudo test -d /var/lib/sw-block; then sudo find /var/lib/sw-block -maxdepth 1 -mindepth 1 -print > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath.all.txt; sudo find /var/lib/sw-block -maxdepth 1 -mindepth 1 -type d -name 'testops-*' -print > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath-testops-residue.txt; else : > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath.all.txt; : > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath-testops-residue.txt; fi; test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath-testops-residue.txt"
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 3m
|
||||
cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/uninstall"
|
||||
env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "kubectl delete storageclass sw-block sw-block-example sw-block-dynamic sw-block-dynamic-nvme --ignore-not-found=true > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/delete-storageclasses.log 2>&1 || true"
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
unmount: "/tmp/sw-block-iscsi-os/mnt,/tmp/sw-block-iscsi-failover/mnt,/tmp/sw-block-iscsi-mpath/mnt,/tmp/sw-block-nvme-failover/mnt"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,340 +0,0 @@
|
||||
# Runner-native cluster operations inventory chain.
|
||||
#
|
||||
# Goal:
|
||||
# Prove that an operator can discover the live alpha Kubernetes volume from
|
||||
# the cluster itself, not from TestOps artifacts, and collect nested
|
||||
# per-replica status bundles through sw-block ops inventory.
|
||||
#
|
||||
# Expected invocation:
|
||||
# swblock run \
|
||||
# -env product_root=/path/to/seaweed_block/on/m02 \
|
||||
# -env ssh_key=/path/to/testdev_key/on/controller \
|
||||
# testops/scenarios/cluster-ops-inventory-chain.yaml
|
||||
|
||||
name: cluster-ops-inventory-chain
|
||||
timeout: 22m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
|
||||
- name: preflight
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/preflight.txt 2>&1"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/preflight.txt"
|
||||
pattern: "summary status=PASS"
|
||||
save_as: preflight_count
|
||||
- action: assert_greater
|
||||
actual: "{{ preflight_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: pin_build_alpha_images
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 8m
|
||||
cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}"
|
||||
env.SW_BLOCK_IMPORT_K3S: "1"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build/alpha-images.env"
|
||||
pattern: "SW_BLOCK_IMAGE_ID="
|
||||
save_as: sw_block_image_id_count
|
||||
- action: assert_greater
|
||||
actual: "{{ sw_block_image_id_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build/alpha-images.env"
|
||||
pattern: "SW_BLOCK_CSI_IMAGE_ID="
|
||||
save_as: sw_block_csi_image_id_count
|
||||
- action: assert_greater
|
||||
actual: "{{ sw_block_csi_image_id_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: live_volume_boundary
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 10m
|
||||
cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=blockvolume-ready SW_BLOCK_DEMO_KEEP_ON_STOP=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo/controlled-stop.exit_code; test \"$rc\" -eq 42'"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo/run.log"
|
||||
pattern: "\\[app-demo\\] controlled stop after blockvolume ready"
|
||||
save_as: controlled_stop_count
|
||||
- action: assert_greater
|
||||
actual: "{{ controlled_stop_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo/generated-blockvolume.yaml"
|
||||
pattern: "--status-addr="
|
||||
save_as: generated_status_addr_count
|
||||
- action: assert_greater
|
||||
actual: "{{ generated_status_addr_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: second_volume_boundary
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: "cat > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-pvc.yaml <<'YAML'\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n name: sw-block-demo-pvc-2\n namespace: default\nspec:\n accessModes:\n - ReadWriteOnce\n storageClassName: sw-block-dynamic\n resources:\n requests:\n storage: 1Mi\nYAML\nkubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log 2>&1\nkubectl -n default wait --for=jsonpath='{.status.phase}'=Bound pvc/sw-block-demo-pvc-2 --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log 2>&1\nfor i in $(seq 1 120); do count=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -ge 2 && break; sleep 1; done\ncount=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -ge 2\nkubectl -n default wait --for=condition=available deploy -l app=sw-blockvolume --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log 2>&1\nkubectl -n kube-system exec deploy/sw-blockmaster -c blockmaster -- sh -c 'cat /manifests/*.yaml' > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-volume-generated-blockvolume.yaml 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-volume-generated-blockvolume.err\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/product-owned-blockvolumes.after-second-pvc.txt"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log"
|
||||
pattern: "persistentvolumeclaim/sw-block-demo-pvc-2 created"
|
||||
save_as: second_pvc_created_count
|
||||
- action: assert_greater
|
||||
actual: "{{ second_pvc_created_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/product-owned-blockvolumes.after-second-pvc.txt"
|
||||
pattern: "^sw-blockvolume-"
|
||||
save_as: second_volume_ready_count
|
||||
- action: assert_greater
|
||||
actual: "{{ second_volume_ready_count }}"
|
||||
threshold: "1"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "test ! -e /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-volume/apply.log"
|
||||
|
||||
- name: inventory_live_cluster
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; find \"$OUT/volumes\" -name ops-status-bundle.json -exec cat {} \\; > \"$OUT/nested-ops-status-bundles.json\" 2>/dev/null || true; exit \"$rc\"'"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/exit_code.txt"
|
||||
pattern: "^0$"
|
||||
save_as: inventory_exit_zero_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_exit_zero_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: inventory_asserts
|
||||
actions:
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "^inventory_status: \\(ok\\|unhealthy\\)$"
|
||||
save_as: inventory_status_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_status_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "^volumes: total=2 ok=[0-2] unhealthy=[0-2] invalid=0$"
|
||||
save_as: two_volume_count
|
||||
- action: assert_greater
|
||||
actual: "{{ two_volume_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "rf=1 desired=1 observed=1"
|
||||
save_as: two_observed_volume_count
|
||||
- action: assert_greater
|
||||
actual: "{{ two_observed_volume_count }}"
|
||||
threshold: "1"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "protocols=iscsi"
|
||||
save_as: two_iscsi_protocol_count
|
||||
- action: assert_greater
|
||||
actual: "{{ two_iscsi_protocol_count }}"
|
||||
threshold: "1"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "! grep -q 'generated_deployment_missing\\|observed_replicas=0 desired_replicas=1\\|replica_slot_missing' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "! grep -q 'replica_unhealthy' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "! grep -E 'replica: .*status=ok .*epoch=0 endpoint_version=0' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "! grep -q 'ops_status=unhealthy reason=authority_not_assigned epoch=' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "lifecycle_owner=pvc-owner-ref"
|
||||
save_as: lifecycle_owner_count
|
||||
- action: assert_greater
|
||||
actual: "{{ lifecycle_owner_count }}"
|
||||
threshold: "1"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc"
|
||||
save_as: pvc_owner_ref_count
|
||||
- action: assert_greater
|
||||
actual: "{{ pvc_owner_ref_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc-2"
|
||||
save_as: second_pvc_owner_ref_count
|
||||
- action: assert_greater
|
||||
actual: "{{ second_pvc_owner_ref_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "pvc=sw-block-demo-pvc"
|
||||
save_as: pvc_identity_count
|
||||
- action: assert_greater
|
||||
actual: "{{ pvc_identity_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "pvc=sw-block-demo-pvc-2"
|
||||
save_as: second_pvc_identity_count
|
||||
- action: assert_greater
|
||||
actual: "{{ second_pvc_identity_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt"
|
||||
pattern: "support_bundle=volumes/"
|
||||
save_as: replica_support_bundle_count
|
||||
- action: assert_greater
|
||||
actual: "{{ replica_support_bundle_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory.json"
|
||||
pattern: "\"pvc_name\": \"sw-block-demo-pvc\""
|
||||
save_as: json_pvc_count
|
||||
- action: assert_greater
|
||||
actual: "{{ json_pvc_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory.json"
|
||||
pattern: "\"pvc_name\": \"sw-block-demo-pvc-2\""
|
||||
save_as: json_second_pvc_count
|
||||
- action: assert_greater
|
||||
actual: "{{ json_second_pvc_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory.json"
|
||||
pattern: "\"status_address\": \"127.0.0.1:"
|
||||
save_as: json_status_addr_count
|
||||
- action: assert_greater
|
||||
actual: "{{ json_status_addr_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/nested-ops-status-bundles.json"
|
||||
pattern: "\"command\": \"sw-block ops status\""
|
||||
save_as: nested_status_bundle_count
|
||||
- action: assert_greater
|
||||
actual: "{{ nested_status_bundle_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: scoped_delete_inventory
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "kubectl -n default delete pvc sw-block-demo-pvc-2 --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/delete-second-pvc.log 2>&1\nfor i in $(seq 1 120); do if ! kubectl -n default get deploy -l app=sw-blockvolume -o jsonpath='{range .items[*]}{.metadata.ownerReferences[0].name}{\"\\n\"}{end}' 2>/dev/null | grep -q '^sw-block-demo-pvc-2$'; then break; fi; sleep 1; done\nif kubectl -n default get deploy -l app=sw-blockvolume -o jsonpath='{range .items[*]}{.metadata.ownerReferences[0].name}{\"\\n\"}{end}' 2>/dev/null | grep -q '^sw-block-demo-pvc-2$'; then echo 'second PVC-owned deployment still present after delete' >&2; exit 1; fi\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/blockvolumes.after-delete-second-pvc.txt"
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; exit \"$rc\"'"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete/volume-inventory-summary.txt"
|
||||
pattern: "^volumes: total=1 ok=[0-1] unhealthy=[0-1] invalid=0$"
|
||||
save_as: one_volume_after_delete_count
|
||||
- action: assert_greater
|
||||
actual: "{{ one_volume_after_delete_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete/volume-inventory-summary.txt"
|
||||
pattern: "pvc=sw-block-demo-pvc"
|
||||
save_as: surviving_pvc_count
|
||||
- action: assert_greater
|
||||
actual: "{{ surviving_pvc_count }}"
|
||||
threshold: "0"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "! grep -q 'pvc=sw-block-demo-pvc-2\\|owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc-2\\|generated_deployment_missing\\|orphan-blockvolume-deploy' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete/volume-inventory-summary.txt"
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "kubectl -n default delete pvc sw-block-demo-pvc-2 --ignore-not-found=true --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/delete-second-pvc.log 2>&1 || true"
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 3m
|
||||
cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/uninstall"
|
||||
env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1"
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,94 +0,0 @@
|
||||
# Runner-native CSI lifecycle component gate.
|
||||
#
|
||||
# Goal:
|
||||
# Run the fast CSI controller/node component tests that pin publish,
|
||||
# stage, unpublish, unstage, and reattach semantics without requiring a
|
||||
# privileged Linux initiator or Kubernetes workload.
|
||||
#
|
||||
# Expected invocation:
|
||||
# swblock run \
|
||||
# -env product_root=/path/to/seaweed_block/on/m02 \
|
||||
# -env ssh_key=/path/to/testdev_key/on/controller \
|
||||
# testops/scenarios/csi-lifecycle-component-gate.yaml
|
||||
|
||||
name: csi-lifecycle-component-gate
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build"
|
||||
|
||||
- name: pin_build
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build/git.status"
|
||||
|
||||
- name: csi_component_tests
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 3m
|
||||
cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -v ./core/csi | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log'"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log"
|
||||
pattern: "--- PASS: TestG15e_CSIReattachUsesFreshPublishTargetAfterUnstage"
|
||||
save_as: reattach_component_count
|
||||
- action: assert_greater
|
||||
actual: "{{ reattach_component_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log"
|
||||
pattern: "--- PASS: TestNodeStage_FailsClosedOnStaleLoggedInSessionWithoutStagedIdentity"
|
||||
save_as: stale_session_component_count
|
||||
- action: assert_greater
|
||||
actual: "{{ stale_session_component_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log"
|
||||
pattern: "--- PASS: TestNodeStageUnstage_RepeatedCyclesLeaveNoLocalState"
|
||||
save_as: repeated_cycle_component_count
|
||||
- action: assert_greater
|
||||
actual: "{{ repeated_cycle_component_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: final_asserts
|
||||
actions:
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,278 +0,0 @@
|
||||
# Runner-native RF=1 durable blockvolume restart chain.
|
||||
#
|
||||
# Goal:
|
||||
# clean target -> build/import alpha images -> run dynamic PVC with durable
|
||||
# generated blockvolume hostPath state -> restart generated blockvolume
|
||||
# Deployment -> verify replacement app pod reads pre-restart bytes -> collect.
|
||||
#
|
||||
# Expected invocation from sw-test-runner-standalone:
|
||||
# swblock run \
|
||||
# -env product_root=/path/to/seaweed_block/on/m02 \
|
||||
# -env ssh_key=/path/to/testdev_key/on/controller \
|
||||
# testops/scenarios/csi-rf1-durable-restart-chain.yaml
|
||||
|
||||
name: csi-rf1-durable-restart-chain
|
||||
timeout: 18m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
|
||||
- name: pin_build_alpha_images
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 8m
|
||||
cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}"
|
||||
env.SW_BLOCK_IMPORT_K3S: "1"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/pin_build"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/pin_build/alpha-images.env"
|
||||
pattern: "SW_BLOCK_IMAGE_ID="
|
||||
save_as: pin_image_id_count
|
||||
- action: assert_greater
|
||||
actual: "{{ pin_image_id_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: durable_blockvolume_restart
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 10m
|
||||
cmd: "cd {{ product_root }} && bash scripts/run-k8s-blockvolume-restart.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ALPHA_IMAGES_ENV: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/pin_build/alpha-images.env"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart"
|
||||
env.SW_BLOCK_LAUNCHER_STATE_HOSTPATH: "/var/lib/sw-block/testops-{{ run_id }}-csi-rf1-restart"
|
||||
env.SW_BLOCK_COLLECT_INVENTORY_AFTER_RESTART: "1"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/run.log"
|
||||
pattern: "\\[app-demo\\] PASS:"
|
||||
save_as: app_pass_count
|
||||
- action: assert_greater
|
||||
actual: "{{ app_pass_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/run.log"
|
||||
pattern: "restart_blockvolume_before_reader=1"
|
||||
save_as: restart_mode_count
|
||||
- action: assert_greater
|
||||
actual: "{{ restart_mode_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/block-stack.rendered.yaml"
|
||||
pattern: "--launcher-status"
|
||||
save_as: launcher_status_count
|
||||
- action: assert_greater
|
||||
actual: "{{ launcher_status_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/block-stack.rendered.yaml"
|
||||
pattern: "--launcher-state-hostpath=/var/lib/sw-block/testops-{{ run_id }}-csi-rf1-restart"
|
||||
save_as: launcher_state_hostpath_count
|
||||
- action: assert_greater
|
||||
actual: "{{ launcher_state_hostpath_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml"
|
||||
pattern: "hostPath:"
|
||||
save_as: generated_hostpath_count
|
||||
- action: assert_greater
|
||||
actual: "{{ generated_hostpath_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml"
|
||||
pattern: "type: DirectoryOrCreate"
|
||||
save_as: generated_hostpath_type_count
|
||||
- action: assert_greater
|
||||
actual: "{{ generated_hostpath_type_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml"
|
||||
pattern: "--status-addr=127.0.0.1:"
|
||||
save_as: generated_status_addr_count
|
||||
- action: assert_greater
|
||||
actual: "{{ generated_status_addr_count }}"
|
||||
threshold: "0"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "awk 'BEGIN{in_volumes=0;in_state=0;bad=0} /^[[:space:]]*volumes:[[:space:]]*$/{in_volumes=1;next} in_volumes && /^[^[:space:]]/{in_volumes=0;in_state=0} in_volumes && /^[[:space:]]*-[[:space:]]*name:[[:space:]]*state[[:space:]]*$/{in_state=1;next} in_state && /^[[:space:]]*-[[:space:]]*name:[[:space:]]*/{in_state=0} in_state && /emptyDir:/{bad=1} END{exit bad}' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/writer.log"
|
||||
pattern: "\\[app-writer\\] wrote and verified /data/demo.bin"
|
||||
save_as: writer_checksum_count
|
||||
- action: assert_greater
|
||||
actual: "{{ writer_checksum_count }}"
|
||||
threshold: "0"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.before-restart.tsv && test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.after-restart.tsv && ! cmp -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.before-restart.tsv /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.after-restart.tsv"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "! grep -q 'iqn.2026-05.io.seaweedfs' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/iscsi-sessions.before-blockvolume-restart.txt"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/restart-blockvolume-status.log"
|
||||
pattern: "successfully rolled out"
|
||||
save_as: blockvolume_rollout_count
|
||||
- action: assert_greater
|
||||
actual: "{{ blockvolume_rollout_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/reader.log"
|
||||
pattern: "/data/demo.bin: OK"
|
||||
save_as: reader_checksum_count
|
||||
- action: assert_greater
|
||||
actual: "{{ reader_checksum_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/reader.describe.before-delete.txt"
|
||||
pattern: "Status: Succeeded"
|
||||
save_as: reader_succeeded_describe_count
|
||||
- action: assert_greater
|
||||
actual: "{{ reader_succeeded_describe_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json"
|
||||
pattern: "\"ReplicaID\"[[:space:]]*:[[:space:]]*\"r1\""
|
||||
save_as: durable_status_replica_count
|
||||
- action: assert_greater
|
||||
actual: "{{ durable_status_replica_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json"
|
||||
pattern: "\"Epoch\"[[:space:]]*:[[:space:]]*[1-9][0-9]*"
|
||||
save_as: durable_status_epoch_count
|
||||
- action: assert_greater
|
||||
actual: "{{ durable_status_epoch_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json"
|
||||
pattern: "\"Latched\"[[:space:]]*:[[:space:]]*true"
|
||||
save_as: durable_status_latched_count
|
||||
- action: assert_greater
|
||||
actual: "{{ durable_status_latched_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json"
|
||||
pattern: "\"Operational\"[[:space:]]*:[[:space:]]*true"
|
||||
save_as: durable_status_operational_count
|
||||
- action: assert_greater
|
||||
actual: "{{ durable_status_operational_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-generated.after-restart.log"
|
||||
pattern: "\"phase\":\"iscsi-listening\""
|
||||
save_as: blockvolume_iscsi_listening_count
|
||||
- action: assert_greater
|
||||
actual: "{{ blockvolume_iscsi_listening_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/lifecycle-volumes.after-blockvolume-restart.json"
|
||||
pattern: "\"protocol\"[[:space:]]*:[[:space:]]*\"iscsi\""
|
||||
save_as: lifecycle_after_restart_protocol_count
|
||||
- action: assert_greater
|
||||
actual: "{{ lifecycle_after_restart_protocol_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volume-inventory-summary.txt"
|
||||
pattern: "^volume: .*pvc=sw-block-demo-pvc .*protocols=iscsi"
|
||||
save_as: inventory_after_restart_volume_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_after_restart_volume_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volume-inventory-summary.txt"
|
||||
pattern: "^replica: .*support_bundle=volumes/"
|
||||
save_as: inventory_after_restart_support_bundle_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_after_restart_support_bundle_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volume-inventory-summary.txt"
|
||||
pattern: "lifecycle_owner=pvc-owner-ref owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc"
|
||||
save_as: inventory_after_restart_owner_ref_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_after_restart_owner_ref_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/nested-ops-status-bundles.json"
|
||||
pattern: "\"command\": \"sw-block ops status\""
|
||||
save_as: nested_ops_status_bundle_count
|
||||
- action: assert_greater
|
||||
actual: "{{ nested_ops_status_bundle_count }}"
|
||||
threshold: "0"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "find /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volumes -name volume-status-summary.txt -exec grep -q '^durable_entry: .*latched=true .*operational=true' {} \\; -print | grep -q ."
|
||||
|
||||
- name: final_asserts
|
||||
actions:
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-csi-rf1-restart"
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,120 +0,0 @@
|
||||
# Runner-native RF=1 durable restart component gate.
|
||||
#
|
||||
# Goal:
|
||||
# Pin the cheap contracts behind csi-rf1-durable-restart-chain without
|
||||
# launching k3s: restart wrapper shape, generated hostPath/status manifests,
|
||||
# master frontend status projection, and durable status endpoint lineage.
|
||||
# The full csi-rf1-durable-restart-chain remains the end-to-end proof for
|
||||
# pod restart, reattach timing, and mounted data continuity.
|
||||
#
|
||||
# Expected invocation:
|
||||
# swblock run \
|
||||
# -env product_root=/path/to/seaweed_block/on/m02 \
|
||||
# -env ssh_key=/path/to/testdev_key/on/controller \
|
||||
# testops/scenarios/csi-rf1-durable-restart-component-gate.yaml
|
||||
|
||||
name: csi-rf1-durable-restart-component-gate
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build"
|
||||
|
||||
- name: pin_build
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build/git.status"
|
||||
|
||||
- name: restart_component_tests
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 3m
|
||||
cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -json -run \"^(TestCSIRF1DurableRestartScripts_PinBlockvolumeRestartContract|TestG15d_K8sRenderer_CanUseHostPathStateVolume|TestG15d_K8sRenderer_DurableHostPathPreservesOwnerRefAndStatus|TestG15d_K8sRenderer_CanOptIntoBlockVolumeStatusEndpoint|TestStatusFrontendsForAssignedLine_ReturnsObservedFrontendFacts|TestStatusServer_DurableStatusEndpoint_EnabledAfterStart_ReturnsLineage)$\" ./internal/testops ./core/host/master ./core/host/volume ./core/launcher | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl'"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl"
|
||||
pattern: "\"Action\":\"pass\".*\"Test\":\"TestCSIRF1DurableRestartScripts_PinBlockvolumeRestartContract\""
|
||||
save_as: restart_wrapper_shape_count
|
||||
- action: assert_greater
|
||||
actual: "{{ restart_wrapper_shape_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl"
|
||||
pattern: "\"Action\":\"pass\".*\"Test\":\"TestG15d_K8sRenderer_CanUseHostPathStateVolume\""
|
||||
save_as: hostpath_render_count
|
||||
- action: assert_greater
|
||||
actual: "{{ hostpath_render_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl"
|
||||
pattern: "\"Action\":\"pass\".*\"Test\":\"TestG15d_K8sRenderer_DurableHostPathPreservesOwnerRefAndStatus\""
|
||||
save_as: hostpath_owner_ref_status_count
|
||||
- action: assert_greater
|
||||
actual: "{{ hostpath_owner_ref_status_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl"
|
||||
pattern: "\"Action\":\"pass\".*\"Test\":\"TestG15d_K8sRenderer_CanOptIntoBlockVolumeStatusEndpoint\""
|
||||
save_as: status_render_count
|
||||
- action: assert_greater
|
||||
actual: "{{ status_render_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl"
|
||||
pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusFrontendsForAssignedLine_ReturnsObservedFrontendFacts\""
|
||||
save_as: master_frontend_projection_count
|
||||
- action: assert_greater
|
||||
actual: "{{ master_frontend_projection_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl"
|
||||
pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_DurableStatusEndpoint_EnabledAfterStart_ReturnsLineage\""
|
||||
save_as: durable_status_lineage_count
|
||||
- action: assert_greater
|
||||
actual: "{{ durable_status_lineage_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: final_asserts
|
||||
actions:
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume "
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,140 +0,0 @@
|
||||
# Runner-native RF=1 durable restart partial-state chain.
|
||||
#
|
||||
# Goal:
|
||||
# Prove that a controlled post-restart blockvolume outage produces an
|
||||
# actionable inventory bundle instead of a silent reader timeout.
|
||||
|
||||
name: csi-rf1-durable-restart-failure-chain
|
||||
timeout: 18m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
|
||||
- name: pin_build_alpha_images
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 8m
|
||||
cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}"
|
||||
env.SW_BLOCK_IMPORT_K3S: "1"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build/alpha-images.env"
|
||||
pattern: "SW_BLOCK_IMAGE_ID="
|
||||
save_as: pin_image_id_count
|
||||
- action: assert_greater
|
||||
actual: "{{ pin_image_id_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: durable_hostpath_unwritable
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 12m
|
||||
cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/proc/sw-block-testops-{{ run_id }} SW_BLOCK_COLLECT_INVENTORY_ON_FAILURE=1 bash scripts/run-k8s-blockvolume-restart.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/exit_code.txt; test \"$rc\" -ne 0'"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/run.log"
|
||||
pattern: "launcher_state_hostpath=/proc/sw-block-testops-{{ run_id }}"
|
||||
save_as: bad_hostpath_count
|
||||
- action: assert_greater
|
||||
actual: "{{ bad_hostpath_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/exit_code.txt"
|
||||
pattern: "^[1-9][0-9]*$"
|
||||
save_as: failed_exit_count
|
||||
- action: assert_greater
|
||||
actual: "{{ failed_exit_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: failure_bundle_asserts
|
||||
actions:
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt"
|
||||
pattern: "^inventory_status: unhealthy$"
|
||||
save_as: inventory_unhealthy_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_unhealthy_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt"
|
||||
pattern: "pvc=sw-block-demo-pvc"
|
||||
save_as: pvc_row_count
|
||||
- action: assert_greater
|
||||
actual: "{{ pvc_row_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt"
|
||||
pattern: "generated_deployment_missing\\|observed_replicas=0 desired_replicas=1\\|replica_degraded=r1 status=unhealthy\\|ops_status=unhealthy"
|
||||
save_as: actionable_issue_count
|
||||
- action: assert_greater
|
||||
actual: "{{ actionable_issue_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/ops-inventory-bundle.json"
|
||||
pattern: "\"command\": \"sw-block ops inventory\""
|
||||
save_as: inventory_bundle_count
|
||||
- action: assert_greater
|
||||
actual: "{{ inventory_bundle_count }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt"
|
||||
pattern: "collection_error: ops_status:"
|
||||
save_as: collection_error_count
|
||||
- action: assert_greater
|
||||
actual: "{{ collection_error_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: assert_no_active_iscsi_sessions
|
||||
node: m02
|
||||
iqn_substr: "io.seaweedfs"
|
||||
- action: assert_no_processes
|
||||
node: m02
|
||||
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,97 +0,0 @@
|
||||
name: data-plane-address-capability-chain
|
||||
timeout: 10m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: run_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 8m
|
||||
cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address bash scripts/run-phase121-data-plane-address-capability-gate.sh {{ product_root }}"
|
||||
|
||||
- name: assert_summary
|
||||
actions:
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^phase121_data_plane_address_capability_status=ok$"
|
||||
save_as: phase121_status_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase121_status_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^management_ip_m01=192\\.168\\.1\\.181$"
|
||||
save_as: management_ip_recorded
|
||||
- action: assert_greater
|
||||
actual: "{{ management_ip_recorded }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^publish_target_ip_m01=10\\.0\\.0\\.181$"
|
||||
save_as: data_plane_ip_recorded
|
||||
- action: assert_greater
|
||||
actual: "{{ data_plane_ip_recorded }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^publish_target_network_class=100gbe_tcp$"
|
||||
save_as: network_class_recorded
|
||||
- action: assert_greater
|
||||
actual: "{{ network_class_recorded }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^frontend_transport=tcp$"
|
||||
save_as: tcp_transport
|
||||
- action: assert_greater
|
||||
actual: "{{ tcp_transport }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^nvme_rdma_supported=false$"
|
||||
save_as: rdma_not_supported
|
||||
- action: assert_greater
|
||||
actual: "{{ rdma_not_supported }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^internal_ip_not_reused_as_performance_target=true$"
|
||||
save_as: internal_ip_not_reused
|
||||
- action: assert_greater
|
||||
actual: "{{ internal_ip_not_reused }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt"
|
||||
pattern: "^cleanup_status=ok$"
|
||||
save_as: cleanup_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ cleanup_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,115 +0,0 @@
|
||||
# Runner-native Phase 79 gate: the failback executor can call the
|
||||
# authority-owned runtime adapter. Execution remains explicit-policy gated, and
|
||||
# stale expected-current evidence blocks the call-site without a false failback.
|
||||
|
||||
name: failback-authority-callsite-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_authority_callsite_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite bash scripts/run-phase79-failback-authority-callsite-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^phase79_failback_authority_callsite_status=ok$"
|
||||
save_as: phase79_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase79_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^authority_runtime_adapter_invoked_by_executor=true$"
|
||||
save_as: adapter_invoked
|
||||
- action: assert_greater
|
||||
actual: "{{ adapter_invoked }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^publisher_authority_line_advanced=true$"
|
||||
save_as: publisher_advanced
|
||||
- action: assert_greater
|
||||
actual: "{{ publisher_advanced }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^stale_expected_current_blocks_callsite=true$"
|
||||
save_as: stale_guard
|
||||
- action: assert_greater
|
||||
actual: "{{ stale_guard }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^execution_policy_still_required=true$"
|
||||
save_as: policy_gate
|
||||
- action: assert_greater
|
||||
actual: "{{ policy_gate }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^failed_back_status_written=true$"
|
||||
save_as: failed_back_status
|
||||
- action: assert_greater
|
||||
actual: "{{ failed_back_status }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^runtime_failure_no_false_failback=true$"
|
||||
save_as: no_false_failback
|
||||
- action: assert_greater
|
||||
actual: "{{ no_false_failback }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,125 +0,0 @@
|
||||
# Runner-native Phase 78 gate: failback has a first authority-owned runtime
|
||||
# seam. It mints authority reassignment through Publisher.apply only after
|
||||
# expected-current and terminal-evidence guards pass. Default behavior remains
|
||||
# disabled and non-mutating.
|
||||
|
||||
name: failback-authority-runtime-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_authority_runtime_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime bash scripts/run-phase78-failback-authority-runtime-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^phase78_failback_authority_runtime_status=ok$"
|
||||
save_as: phase78_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase78_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^authority_failback_reassign_minted=true$"
|
||||
save_as: reassign_minted
|
||||
- action: assert_greater
|
||||
actual: "{{ reassign_minted }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^stale_expected_current_rejected=true$"
|
||||
save_as: stale_guard
|
||||
- action: assert_greater
|
||||
actual: "{{ stale_guard }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^terminal_preconditions_required=true$"
|
||||
save_as: terminal_guard
|
||||
- action: assert_greater
|
||||
actual: "{{ terminal_guard }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^failback_target_endpoint_fields=true$"
|
||||
save_as: endpoint_fields
|
||||
- action: assert_greater
|
||||
actual: "{{ endpoint_fields }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^failback_target_expected_current_fields=true$"
|
||||
save_as: expected_current_fields
|
||||
- action: assert_greater
|
||||
actual: "{{ expected_current_fields }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^executable_failback_requires_authority_endpoint=true$"
|
||||
save_as: executable_requires_endpoint
|
||||
- action: assert_greater
|
||||
actual: "{{ executable_requires_endpoint }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^explicit_runtime_authority_mutation_allowed=true$"
|
||||
save_as: authority_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ authority_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,106 +0,0 @@
|
||||
# Runner-native Phase 83 gate: Helm chart wiring for the failback gRPC
|
||||
# runtime transport. The default chart remains non-mutating; explicit values
|
||||
# render the blockmaster RPC flag plus executor execution/gRPC flags.
|
||||
|
||||
name: failback-chart-runtime-chain
|
||||
timeout: 6m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_chart_runtime_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime bash scripts/run-phase83-failback-chart-runtime-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^phase83_failback_chart_runtime_status=ok$"
|
||||
save_as: phase83_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase83_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^default_omits_failback_runtime_rpc=true$"
|
||||
save_as: default_rpc_off
|
||||
- action: assert_greater
|
||||
actual: "{{ default_rpc_off }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^enabled_renders_failback_runtime_rpc=true$"
|
||||
save_as: enabled_rpc
|
||||
- action: assert_greater
|
||||
actual: "{{ enabled_rpc }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^enabled_renders_failback_grpc_addr=true$"
|
||||
save_as: enabled_grpc
|
||||
- action: assert_greater
|
||||
actual: "{{ enabled_grpc }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^rejects_execution_with_dry_run=true$"
|
||||
save_as: rejects_dryrun
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_dryrun }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^rejects_execution_without_policy=true$"
|
||||
save_as: rejects_policy
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_policy }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^rejects_ambiguous_runtime_transports=true$"
|
||||
save_as: rejects_ambiguous
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_ambiguous }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt"
|
||||
pattern: "^chart_default_remains_non_mutating=true$"
|
||||
save_as: default_non_mutating
|
||||
- action: assert_greater
|
||||
actual: "{{ default_non_mutating }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,88 +0,0 @@
|
||||
# Runner-native Phase 94 gate: full opt-in failback suite renders coherently and
|
||||
# the executor can call a real blockmaster FailbackService in local test.
|
||||
# This is not a live Kubernetes install claim.
|
||||
|
||||
name: failback-deployed-grpc-smoke-chain
|
||||
timeout: 6m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_deployed_grpc_smoke_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke bash scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
|
||||
pattern: "^phase94_failback_deployed_grpc_smoke_status=ok$"
|
||||
save_as: phase94_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase94_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
|
||||
pattern: "^enabled_renders_failback_runtime_rpc=true$"
|
||||
save_as: runtime_rpc
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_rpc }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
|
||||
pattern: "^enabled_target_owner_activates_targets=true$"
|
||||
save_as: target_activation
|
||||
- action: assert_greater
|
||||
actual: "{{ target_activation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
|
||||
pattern: "^enabled_executor_grpc_runtime=true$"
|
||||
save_as: executor_grpc
|
||||
- action: assert_greater
|
||||
actual: "{{ executor_grpc }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
|
||||
pattern: "^executor_grpc_uses_real_master_service=true$"
|
||||
save_as: real_master_grpc
|
||||
- action: assert_greater
|
||||
actual: "{{ real_master_grpc }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
|
||||
pattern: "^live_kubernetes_install_claimed=false$"
|
||||
save_as: no_live_install_claim
|
||||
- action: assert_greater
|
||||
actual: "{{ no_live_install_claim }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,106 +0,0 @@
|
||||
# Runner-native Phase 88 gate: returned-replica failback can be packaged as a
|
||||
# deployable component suite. This is still a chart/RBAC gate, not a live
|
||||
# authority-mutation claim.
|
||||
|
||||
name: failback-deployed-suite-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_deployed_suite_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite bash scripts/run-phase88-failback-deployed-suite-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^phase88_failback_deployed_suite_status=ok$"
|
||||
save_as: phase88_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase88_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^default_omits_failback_target_owner=true$"
|
||||
save_as: target_default_off
|
||||
- action: assert_greater
|
||||
actual: "{{ target_default_off }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^enabled_renders_failback_target_owner=true$"
|
||||
save_as: target_owner_enabled
|
||||
- action: assert_greater
|
||||
actual: "{{ target_owner_enabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^enabled_renders_failback_executor=true$"
|
||||
save_as: executor_enabled
|
||||
- action: assert_greater
|
||||
actual: "{{ executor_enabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^values_schema_covers_failback_suite=true$"
|
||||
save_as: schema_covers_suite
|
||||
- action: assert_greater
|
||||
actual: "{{ schema_covers_suite }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^target_owner_rbac_create_targets_only=true$"
|
||||
save_as: target_owner_rbac
|
||||
- action: assert_greater
|
||||
actual: "{{ target_owner_rbac }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^executor_rbac_status_only=true$"
|
||||
save_as: executor_rbac
|
||||
- action: assert_greater
|
||||
actual: "{{ executor_rbac }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt"
|
||||
pattern: "^automatic_failback_claimed=false$"
|
||||
save_as: no_auto_claim
|
||||
- action: assert_greater
|
||||
actual: "{{ no_auto_claim }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,60 +0,0 @@
|
||||
# Runner-native Phase 87 gate: docs agree that returned-replica failback
|
||||
# runtime is opt-in/source-gated and automatic deployed failback is not claimed.
|
||||
|
||||
name: failback-docs-alignment-chain
|
||||
timeout: 4m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_docs_alignment
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 3m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment bash scripts/run-phase87-failback-docs-alignment-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment/phase87-failback-docs-alignment-summary.txt"
|
||||
pattern: "^phase87_failback_docs_alignment_status=ok$"
|
||||
save_as: phase87_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase87_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment/phase87-failback-docs-alignment-summary.txt"
|
||||
pattern: "^automatic_failback_not_claimed=true$"
|
||||
save_as: no_auto
|
||||
- action: assert_greater
|
||||
actual: "{{ no_auto }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment/phase87-failback-docs-alignment-summary.txt"
|
||||
pattern: "^frontend_publication_after_failback_not_claimed=true$"
|
||||
save_as: no_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,115 +0,0 @@
|
||||
# Runner-native Phase 76 gate: SwBlockReplicaFailback executor writes
|
||||
# disabled/blocked status only. It does not execute failback, advance authority,
|
||||
# swap publish targets, publish frontend paths, or mutate storage.
|
||||
|
||||
name: failback-executor-boundary-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_executor_boundary_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary bash scripts/run-phase76-failback-executor-boundary-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^phase76_failback_executor_boundary_status=ok$"
|
||||
save_as: phase76_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase76_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^failback_executor_writes_disabled_status=true$"
|
||||
save_as: writes_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ writes_disabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^failback_executor_dry_run_no_status_write=true$"
|
||||
save_as: dry_run_no_write
|
||||
- action: assert_greater
|
||||
actual: "{{ dry_run_no_write }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^kubernetes_writer_failback_status_subresource=true$"
|
||||
save_as: status_subresource
|
||||
- action: assert_greater
|
||||
actual: "{{ status_subresource }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^failback_executor_rbac_status_only=true$"
|
||||
save_as: rbac_status_only
|
||||
- action: assert_greater
|
||||
actual: "{{ rbac_status_only }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^failback_attempts=0$"
|
||||
save_as: no_failback_attempt
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_attempt }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^authority_mutation_allowed=false$"
|
||||
save_as: no_authority_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_authority_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,115 +0,0 @@
|
||||
# Runner-native Phase 82 gate: failback executor can use the blockmaster
|
||||
# FailbackService gRPC runtime transport, still behind explicit execution
|
||||
# policy. HTTP runtime remains supported; HTTP and gRPC are mutually exclusive.
|
||||
|
||||
name: failback-executor-grpc-runtime-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_executor_grpc_runtime_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime bash scripts/run-phase82-failback-executor-grpc-runtime-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^phase82_failback_executor_grpc_runtime_status=ok$"
|
||||
save_as: phase82_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase82_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^grpc_runtime_calls_failback_service=true$"
|
||||
save_as: grpc_calls_service
|
||||
- action: assert_greater
|
||||
actual: "{{ grpc_calls_service }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^cmd_grpc_runtime_writes_failed_back_status=true$"
|
||||
save_as: grpc_status
|
||||
- action: assert_greater
|
||||
actual: "{{ grpc_status }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^cmd_grpc_runtime_requires_enable=true$"
|
||||
save_as: requires_enable
|
||||
- action: assert_greater
|
||||
actual: "{{ requires_enable }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^cmd_rejects_ambiguous_runtime_transports=true$"
|
||||
save_as: ambiguous_rejected
|
||||
- action: assert_greater
|
||||
actual: "{{ ambiguous_rejected }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^cmd_http_runtime_still_supported=true$"
|
||||
save_as: http_still_supported
|
||||
- action: assert_greater
|
||||
actual: "{{ http_still_supported }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^execution_policy_still_required=true$"
|
||||
save_as: policy_gate
|
||||
- action: assert_greater
|
||||
actual: "{{ policy_gate }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,97 +0,0 @@
|
||||
# Runner-native Phase 85 gate: failback executor policy safety. Explicit
|
||||
# execution flags do not cause runtime calls unless a valid executable target
|
||||
# exists.
|
||||
|
||||
name: failback-executor-policy-safety-chain
|
||||
timeout: 6m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_executor_policy_safety
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety bash scripts/run-phase85-failback-executor-policy-safety-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^phase85_failback_executor_policy_safety_status=ok$"
|
||||
save_as: phase85_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase85_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^no_targets_no_runtime_call=true$"
|
||||
save_as: no_targets
|
||||
- action: assert_greater
|
||||
actual: "{{ no_targets }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^invalid_target_no_runtime_call=true$"
|
||||
save_as: invalid_target
|
||||
- action: assert_greater
|
||||
actual: "{{ invalid_target }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^execution_flags_alone_insufficient=true$"
|
||||
save_as: flags_insufficient
|
||||
- action: assert_greater
|
||||
actual: "{{ flags_insufficient }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^runtime_requires_valid_target=true$"
|
||||
save_as: requires_valid
|
||||
- action: assert_greater
|
||||
actual: "{{ requires_valid }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,97 +0,0 @@
|
||||
# Runner-native Phase 96 gate: terminal SwBlockReplicaFailback evidence creates
|
||||
# a disabled SwBlockFrontendPublication target. This is not a frontend
|
||||
# publication execution or data-path claim.
|
||||
|
||||
name: failback-frontend-publication-target-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_frontend_publication_target_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target bash scripts/run-phase96-failback-frontend-publication-target-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^phase96_failback_frontend_publication_target_status=ok$"
|
||||
save_as: phase96_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase96_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^terminal_failed_back_creates_frontend_publication_target=true$"
|
||||
save_as: target_created
|
||||
- action: assert_greater
|
||||
actual: "{{ target_created }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^non_terminal_failback_rejected=true$"
|
||||
save_as: rejects_non_terminal
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_non_terminal }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^executor_accepts_failback_target_as_disabled=true$"
|
||||
save_as: executor_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ executor_disabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=0$"
|
||||
save_as: no_publication_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_publication_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^failback_attempts=0$"
|
||||
save_as: no_failback_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,96 +0,0 @@
|
||||
# Runner-native Phase 98 close gate: deployed failback, product-owned frontend
|
||||
# publication runtime confirmation, post-publication workload I/O, and cleanup.
|
||||
|
||||
name: failback-frontend-workload-close-chain
|
||||
timeout: 35m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_frontend_workload_close_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 34m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close bash scripts/run-phase98-failback-frontend-workload-close-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^phase98_failback_frontend_workload_close_status=ok$"
|
||||
save_as: phase98_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase98_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^executor_status_failed_back=true$"
|
||||
save_as: failback_done
|
||||
- action: assert_greater
|
||||
actual: "{{ failback_done }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^frontend_published=true$"
|
||||
save_as: frontend_published
|
||||
- action: assert_greater
|
||||
actual: "{{ frontend_published }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^frontend_publication_failback_started=false$"
|
||||
save_as: no_second_failback
|
||||
- action: assert_greater
|
||||
actual: "{{ no_second_failback }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^post_failback_publication_writer_verified=true$"
|
||||
save_as: post_writer
|
||||
- action: assert_greater
|
||||
actual: "{{ post_writer }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^post_failback_publication_reader_verified=true$"
|
||||
save_as: post_reader
|
||||
- action: assert_greater
|
||||
actual: "{{ post_reader }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt"
|
||||
pattern: "^cleanup_status=ok$"
|
||||
save_as: cleanup_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ cleanup_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,87 +0,0 @@
|
||||
# Runner-native Phase 86 gate: an explicit gRPC failback runtime address is
|
||||
# sufficient; the target does not need the legacy HTTP runtimeEndpoint field.
|
||||
|
||||
name: failback-grpc-runtime-endpoint-decoupling-chain
|
||||
timeout: 6m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_grpc_runtime_endpoint_decoupling
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling bash scripts/run-phase86-failback-grpc-runtime-endpoint-decoupling-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt"
|
||||
pattern: "^phase86_failback_grpc_runtime_endpoint_decoupling_status=ok$"
|
||||
save_as: phase86_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase86_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt"
|
||||
pattern: "^grpc_runtime_does_not_require_target_runtime_endpoint=true$"
|
||||
save_as: grpc_no_endpoint
|
||||
- action: assert_greater
|
||||
actual: "{{ grpc_no_endpoint }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt"
|
||||
pattern: "^legacy_http_runtime_endpoint_still_supported=true$"
|
||||
save_as: http_supported
|
||||
- action: assert_greater
|
||||
actual: "{{ http_supported }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt"
|
||||
pattern: "^real_master_grpc_service_without_target_endpoint=true$"
|
||||
save_as: real_master
|
||||
- action: assert_greater
|
||||
actual: "{{ real_master }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,79 +0,0 @@
|
||||
# Runner-native Phase 93 gate: multi-volume target-owner -> executor handoff
|
||||
# isolation. Runtime requests must not mix expected-current authority or target
|
||||
# addresses across volumes.
|
||||
|
||||
name: failback-handoff-isolation-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_handoff_isolation_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation bash scripts/run-phase93-failback-handoff-isolation-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt"
|
||||
pattern: "^phase93_failback_handoff_isolation_status=ok$"
|
||||
save_as: phase93_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase93_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt"
|
||||
pattern: "^multi_volume_target_create_count=2$"
|
||||
save_as: target_count
|
||||
- action: assert_greater
|
||||
actual: "{{ target_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt"
|
||||
pattern: "^multi_volume_runtime_request_count=2$"
|
||||
save_as: request_count
|
||||
- action: assert_greater
|
||||
actual: "{{ request_count }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt"
|
||||
pattern: "^cross_volume_expected_current_mixup=false$"
|
||||
save_as: no_expected_current_mixup
|
||||
- action: assert_greater
|
||||
actual: "{{ no_expected_current_mixup }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt"
|
||||
pattern: "^cross_volume_target_addr_mixup=false$"
|
||||
save_as: no_target_addr_mixup
|
||||
- action: assert_greater
|
||||
actual: "{{ no_target_addr_mixup }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,96 +0,0 @@
|
||||
# Runner-native Phase 84 gate: local integrated smoke for failback executor ->
|
||||
# gRPC runtime -> real blockmaster FailbackService -> master Publisher.
|
||||
|
||||
name: failback-integrated-grpc-smoke-chain
|
||||
timeout: 6m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_integrated_grpc_smoke
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc bash scripts/run-phase84-failback-integrated-grpc-smoke.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^phase84_failback_integrated_grpc_status=ok$"
|
||||
save_as: phase84_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase84_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^service_default_disabled_test=true$"
|
||||
save_as: default_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ default_disabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^executor_grpc_uses_real_master_service=true$"
|
||||
save_as: integrated
|
||||
- action: assert_greater
|
||||
actual: "{{ integrated }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^master_publisher_epoch_advanced=true$"
|
||||
save_as: epoch_advanced
|
||||
- action: assert_greater
|
||||
actual: "{{ epoch_advanced }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^publish_target_swapped_after_failback=true$"
|
||||
save_as: target_swapped
|
||||
- action: assert_greater
|
||||
actual: "{{ target_swapped }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,124 +0,0 @@
|
||||
# Runner-native Phase 95 gate: install the failback target-owner/executor
|
||||
# suite in k3s and drive one real blockmaster gRPC failback authority call
|
||||
# from an in-cluster executor. This is not a frontend publication claim.
|
||||
|
||||
name: failback-live-deployed-suite-chain
|
||||
timeout: 35m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_live_deployed_suite_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 34m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite bash scripts/run-phase95-failback-live-deployed-suite-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^phase95_failback_live_deployed_suite_status=ok$"
|
||||
save_as: phase95_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase95_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^helm_install=pass$"
|
||||
save_as: helm_install_pass
|
||||
- action: assert_greater
|
||||
actual: "{{ helm_install_pass }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^first_volume_writer_reader=pass$"
|
||||
save_as: first_volume_pass
|
||||
- action: assert_greater
|
||||
actual: "{{ first_volume_pass }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^failback_target_created=true$"
|
||||
save_as: target_created
|
||||
- action: assert_greater
|
||||
actual: "{{ target_created }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^failback_executor_completed=true$"
|
||||
save_as: executor_completed
|
||||
- action: assert_greater
|
||||
actual: "{{ executor_completed }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^executor_status_failed_back=true$"
|
||||
save_as: failed_back
|
||||
- action: assert_greater
|
||||
actual: "{{ failed_back }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^master_publisher_epoch_advanced=true$"
|
||||
save_as: epoch_advanced
|
||||
- action: assert_greater
|
||||
actual: "{{ epoch_advanced }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^publish_target_swapped_after_failback=true$"
|
||||
save_as: target_swapped
|
||||
- action: assert_greater
|
||||
actual: "{{ target_swapped }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^frontend_publication_after_failback_claimed=false$"
|
||||
save_as: no_frontend_claim
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_claim }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt"
|
||||
pattern: "^cleanup_status=ok$"
|
||||
save_as: cleanup_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ cleanup_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,106 +0,0 @@
|
||||
# Runner-native Phase 77 gate: failback has a typed runtime contract and
|
||||
# explicit execution-policy gate. Default reconciliation remains disabled; a
|
||||
# fake runtime can report terminal evidence only in tests.
|
||||
|
||||
name: failback-runtime-contract-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_runtime_contract_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract bash scripts/run-phase77-failback-runtime-contract-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^phase77_failback_runtime_contract_status=ok$"
|
||||
save_as: phase77_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase77_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^failback_execution_policy_gate=true$"
|
||||
save_as: policy_gate
|
||||
- action: assert_greater
|
||||
actual: "{{ policy_gate }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^failback_runtime_invoked_only_when_enabled=true$"
|
||||
save_as: runtime_gated
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_gated }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^runtime_failure_no_false_failback=true$"
|
||||
save_as: failure_no_false
|
||||
- action: assert_greater
|
||||
actual: "{{ failure_no_false }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^runtime_invalid_terminal_evidence_no_false_failback=true$"
|
||||
save_as: invalid_no_false
|
||||
- action: assert_greater
|
||||
actual: "{{ invalid_no_false }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^http_runtime_contract_posts_request=true$"
|
||||
save_as: http_contract
|
||||
- action: assert_greater
|
||||
actual: "{{ http_contract }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^target_writer_serializes_runtime_fields=true$"
|
||||
save_as: writer_contract
|
||||
- action: assert_greater
|
||||
actual: "{{ writer_contract }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,115 +0,0 @@
|
||||
# Runner-native Phase 81 gate: blockmaster has a FailbackService RPC that is
|
||||
# registered but disabled by default. Enabling it is explicit and still requires
|
||||
# expected-current + terminal evidence.
|
||||
|
||||
name: failback-service-rpc-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_service_rpc_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc bash scripts/run-phase81-failback-service-rpc-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^phase81_failback_service_rpc_status=ok$"
|
||||
save_as: phase81_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase81_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^failback_service_default_disabled=true$"
|
||||
save_as: default_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ default_disabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^failback_runtime_rpc_flag_default_false=true$"
|
||||
save_as: flag_default_false
|
||||
- action: assert_greater
|
||||
actual: "{{ flag_default_false }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^failback_runtime_rpc_flag_opt_in=true$"
|
||||
save_as: flag_opt_in
|
||||
- action: assert_greater
|
||||
actual: "{{ flag_opt_in }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^failback_service_registered=true$"
|
||||
save_as: service_registered
|
||||
- action: assert_greater
|
||||
actual: "{{ service_registered }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^enabled_failback_service_advances_publisher=true$"
|
||||
save_as: enabled_advances
|
||||
- action: assert_greater
|
||||
actual: "{{ enabled_advances }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^public_rpc_enabled_by_default=false$"
|
||||
save_as: public_rpc_default_off
|
||||
- action: assert_greater
|
||||
actual: "{{ public_rpc_default_off }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,88 +0,0 @@
|
||||
# Runner-native Phase 91 gate: failback target activation is explicit,
|
||||
# default-off, and requires both policy and runtime endpoint. The target owner
|
||||
# may stamp enabled targets, but it does not call the runtime.
|
||||
|
||||
name: failback-target-activation-policy-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_target_activation_policy_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy bash scripts/run-phase91-failback-target-activation-policy-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt"
|
||||
pattern: "^phase91_failback_target_activation_policy_status=ok$"
|
||||
save_as: phase91_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase91_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt"
|
||||
pattern: "^activation_default_off=true$"
|
||||
save_as: activation_default_off
|
||||
- action: assert_greater
|
||||
actual: "{{ activation_default_off }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt"
|
||||
pattern: "^activation_policy_required=true$"
|
||||
save_as: policy_required
|
||||
- action: assert_greater
|
||||
actual: "{{ policy_required }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt"
|
||||
pattern: "^activation_runtime_endpoint_required=true$"
|
||||
save_as: runtime_required
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_required }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt"
|
||||
pattern: "^activated_target_failback_decision=enabled$"
|
||||
save_as: target_enabled
|
||||
- action: assert_greater
|
||||
actual: "{{ target_enabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt"
|
||||
pattern: "^failback_runtime_call_attempted=false$"
|
||||
save_as: no_runtime_call
|
||||
- action: assert_greater
|
||||
actual: "{{ no_runtime_call }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,88 +0,0 @@
|
||||
# Runner-native Phase 90 gate: failback target owner consumes current
|
||||
# SwBlockVolume.status authority facts before creating a failback target.
|
||||
# This does not execute failback or publish a frontend.
|
||||
|
||||
name: failback-target-authority-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_target_authority_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority bash scripts/run-phase90-failback-target-authority-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt"
|
||||
pattern: "^phase90_failback_target_authority_status=ok$"
|
||||
save_as: phase90_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase90_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt"
|
||||
pattern: "^expected_current_replica_from_swblockvolume_status=true$"
|
||||
save_as: expected_replica_from_status
|
||||
- action: assert_greater
|
||||
actual: "{{ expected_replica_from_status }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt"
|
||||
pattern: "^expected_current_epoch_from_swblockvolume_status=true$"
|
||||
save_as: expected_epoch_from_status
|
||||
- action: assert_greater
|
||||
actual: "{{ expected_epoch_from_status }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt"
|
||||
pattern: "^missing_current_authority_target_create_count=0$"
|
||||
save_as: missing_authority_no_target
|
||||
- action: assert_greater
|
||||
actual: "{{ missing_authority_no_target }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt"
|
||||
pattern: "^created_target_failback_decision=disabled$"
|
||||
save_as: target_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ target_disabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt"
|
||||
pattern: "^failback_runtime_call_attempted=false$"
|
||||
save_as: no_runtime_call
|
||||
- action: assert_greater
|
||||
actual: "{{ no_runtime_call }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,88 +0,0 @@
|
||||
# Runner-native Phase 92 gate: target owner creates an enabled failback target,
|
||||
# executor consumes it through a fake/local runtime, and expected-current
|
||||
# authority facts reach the runtime request.
|
||||
|
||||
name: failback-target-executor-handoff-chain
|
||||
timeout: 5m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_target_executor_handoff_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 4m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff bash scripts/run-phase92-failback-target-executor-handoff-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt"
|
||||
pattern: "^phase92_failback_target_executor_handoff_status=ok$"
|
||||
save_as: phase92_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase92_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt"
|
||||
pattern: "^target_owner_created_enabled_target=true$"
|
||||
save_as: owner_created
|
||||
- action: assert_greater
|
||||
actual: "{{ owner_created }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt"
|
||||
pattern: "^executor_consumed_target=true$"
|
||||
save_as: executor_consumed
|
||||
- action: assert_greater
|
||||
actual: "{{ executor_consumed }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt"
|
||||
pattern: "^runtime_request_expected_current_replica=r2$"
|
||||
save_as: expected_replica
|
||||
- action: assert_greater
|
||||
actual: "{{ expected_replica }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt"
|
||||
pattern: "^runtime_request_expected_current_epoch=7$"
|
||||
save_as: expected_epoch
|
||||
- action: assert_greater
|
||||
actual: "{{ expected_epoch }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt"
|
||||
pattern: "^frontend_publication_after_failback_claimed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,116 +0,0 @@
|
||||
# Runner-native Phase 75 gate: returned-replica failback can create a
|
||||
# failback target handoff CR only after terminal evidence is present. The owner
|
||||
# remains disabled by default, dry-run by default, and has no status/finalizer,
|
||||
# storage, authority, or frontend publication mutation power.
|
||||
|
||||
name: failback-target-owner-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: failback_target_owner_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner bash scripts/run-phase75-failback-target-owner-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^phase75_failback_target_owner_status=ok$"
|
||||
save_as: phase75_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase75_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^failback_target_owner_creates_target=true$"
|
||||
save_as: creates_target
|
||||
- action: assert_greater
|
||||
actual: "{{ creates_target }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^failback_target_owner_dry_run_no_create=true$"
|
||||
save_as: dry_run_no_create
|
||||
- action: assert_greater
|
||||
actual: "{{ dry_run_no_create }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^failback_target_owner_requires_terminal_evidence=true$"
|
||||
save_as: terminal_evidence_required
|
||||
- action: assert_greater
|
||||
actual: "{{ terminal_evidence_required }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^failback_target_crd_schema=true$"
|
||||
save_as: target_crd_schema
|
||||
- action: assert_greater
|
||||
actual: "{{ target_crd_schema }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^failback_target_owner_chart_boundary=true$"
|
||||
save_as: chart_boundary
|
||||
- action: assert_greater
|
||||
actual: "{{ chart_boundary }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^failback_attempts=0$"
|
||||
save_as: no_failback_attempt
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_attempt }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt"
|
||||
pattern: "^frontend_publication_allowed=false$"
|
||||
save_as: no_frontend_publication
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_publication }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,96 +0,0 @@
|
||||
# Runner-native Phase 73 gate: returned-replica frontend publication requires
|
||||
# a real authority/failback owner and must not be faked by runtime status.
|
||||
|
||||
name: frontend-publication-authority-owner-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_authority_owner_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner bash scripts/run-phase73-frontend-publication-authority-owner-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^phase73_frontend_publication_authority_owner_status=ok$"
|
||||
save_as: phase73_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase73_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^frontend_publication_requires_authority_owner=true$"
|
||||
save_as: authority_owner_required
|
||||
- action: assert_greater
|
||||
actual: "{{ authority_owner_required }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^returned_replica_runtime_invocations=0$"
|
||||
save_as: no_returned_runtime
|
||||
- action: assert_greater
|
||||
actual: "{{ no_returned_runtime }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^returned_replica_frontend_published=false$"
|
||||
save_as: no_false_publish
|
||||
- action: assert_greater
|
||||
actual: "{{ no_false_publish }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^generic_runtime_seam_preserved=true$"
|
||||
save_as: generic_seam_preserved
|
||||
- action: assert_greater
|
||||
actual: "{{ generic_seam_preserved }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=0$"
|
||||
save_as: no_publication_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_publication_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt"
|
||||
pattern: "^failback_attempts=0$"
|
||||
save_as: no_failback_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,96 +0,0 @@
|
||||
# Runner-native Phase 70 gate: frontend publication executor status boundary.
|
||||
|
||||
name: frontend-publication-executor-boundary-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_executor_boundary_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary bash scripts/run-phase70-frontend-publication-executor-boundary-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^phase70_frontend_publication_executor_boundary_status=ok$"
|
||||
save_as: phase70_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase70_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_status_writes=true$"
|
||||
save_as: status_writes
|
||||
- action: assert_greater
|
||||
actual: "{{ status_writes }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_status=blocked$"
|
||||
save_as: status_blocked
|
||||
- action: assert_greater
|
||||
actual: "{{ status_blocked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_reason=frontend_publication_policy_disabled$"
|
||||
save_as: reason_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ reason_disabled }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=0$"
|
||||
save_as: no_frontend_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_attempts }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^frontend_published=false$"
|
||||
save_as: no_frontend_published
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_published }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^failback_started=false$"
|
||||
save_as: no_failback_started
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_started }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,97 +0,0 @@
|
||||
# Runner-native Phase 97 gate: explicit-policy frontend publication executor
|
||||
# call-site after terminal failback evidence. This proves executor/runtime
|
||||
# handoff only; workload-visible I/O remains a later gate.
|
||||
|
||||
name: frontend-publication-executor-callsite-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_executor_callsite_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite bash scripts/run-phase97-frontend-publication-executor-callsite-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^phase97_frontend_publication_executor_callsite_status=ok$"
|
||||
save_as: phase97_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase97_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^failback_target_runtime_invoked=true$"
|
||||
save_as: runtime_invoked
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_invoked }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=1$"
|
||||
save_as: publication_attempt
|
||||
- action: assert_greater
|
||||
actual: "{{ publication_attempt }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^frontend_published=true$"
|
||||
save_as: frontend_published
|
||||
- action: assert_greater
|
||||
actual: "{{ frontend_published }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^failback_attempts=0$"
|
||||
save_as: no_failback_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^failback_started=false$"
|
||||
save_as: no_failback_started
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_started }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,167 +0,0 @@
|
||||
# Runner-native Phase 71 gate: frontend publication executor live API boundary.
|
||||
|
||||
name: frontend-publication-live-api-boundary-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_live_api_boundary_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary bash scripts/run-phase71-frontend-publication-live-api-boundary-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^phase71_frontend_publication_live_api_boundary_status=ok$"
|
||||
save_as: phase71_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase71_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^executor_status_patch_succeeded=true$"
|
||||
save_as: status_patch
|
||||
- action: assert_greater
|
||||
actual: "{{ status_patch }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_status_writes=true$"
|
||||
save_as: status_writes
|
||||
- action: assert_greater
|
||||
actual: "{{ status_writes }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_status=blocked$"
|
||||
save_as: status_blocked
|
||||
- action: assert_greater
|
||||
actual: "{{ status_blocked }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_reason=frontend_publication_policy_disabled$"
|
||||
save_as: reason_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ reason_disabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_status_mutation_allowed=true$"
|
||||
save_as: status_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ status_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_mutation_allowed=false$"
|
||||
save_as: frontend_mutation_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ frontend_mutation_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_published=false$"
|
||||
save_as: no_frontend_published
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_published }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^failback_started=false$"
|
||||
save_as: no_failback_started
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_started }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^frontend_publication_executor_rbac_status_only=true$"
|
||||
save_as: rbac_status_only
|
||||
- action: assert_greater
|
||||
actual: "{{ rbac_status_only }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^executor_spec_patch_allowed=false$"
|
||||
save_as: spec_patch_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ spec_patch_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^executor_label_patch_allowed=false$"
|
||||
save_as: label_patch_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ label_patch_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^executor_finalizers_endpoint_allowed=false$"
|
||||
save_as: finalizers_denied
|
||||
- action: assert_greater
|
||||
actual: "{{ finalizers_denied }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt"
|
||||
pattern: "^target_object_integrity_preserved=true$"
|
||||
save_as: integrity_preserved
|
||||
- action: assert_greater
|
||||
actual: "{{ integrity_preserved }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,72 +0,0 @@
|
||||
# Runner-native Phase 68 gate: ACK eligibility to frontend publication preflight.
|
||||
|
||||
name: frontend-publication-preflight-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_preflight_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight bash scripts/run-phase68-frontend-publication-preflight-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt"
|
||||
pattern: "^phase68_frontend_publication_preflight_status=ok$"
|
||||
save_as: phase68_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase68_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt"
|
||||
pattern: "^frontend_publication_decision_schema_locked=true$"
|
||||
save_as: schema_locked
|
||||
- action: assert_greater
|
||||
actual: "{{ schema_locked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt"
|
||||
pattern: "^frontend_publication_decision=disabled$"
|
||||
save_as: decision_disabled
|
||||
- action: assert_greater
|
||||
actual: "{{ decision_disabled }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt"
|
||||
pattern: "^frontend_publication_mutation_allowed=false$"
|
||||
save_as: mutation_false
|
||||
- action: assert_greater
|
||||
actual: "{{ mutation_false }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=0$"
|
||||
save_as: no_frontend_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,131 +0,0 @@
|
||||
# Runner-native Phase 72 gate: frontend publication runtime contract.
|
||||
|
||||
name: frontend-publication-runtime-contract-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_runtime_contract_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract bash scripts/run-phase72-frontend-publication-runtime-contract-gate.sh {{ product_root }}"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^phase72_frontend_publication_runtime_contract_status=ok$"
|
||||
save_as: phase72_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase72_ok }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_runtime_contract_schema_locked=true$"
|
||||
save_as: schema_locked
|
||||
- action: assert_greater
|
||||
actual: "{{ schema_locked }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_runtime_endpoint_field=true$"
|
||||
save_as: endpoint_field
|
||||
- action: assert_greater
|
||||
actual: "{{ endpoint_field }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_execution_policy_gate=true$"
|
||||
save_as: policy_gate
|
||||
- action: assert_greater
|
||||
actual: "{{ policy_gate }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_runtime_invoked_only_when_enabled=true$"
|
||||
save_as: runtime_invoked_only_when_enabled
|
||||
- action: assert_greater
|
||||
actual: "{{ runtime_invoked_only_when_enabled }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_runtime_failure_no_false_publish=true$"
|
||||
save_as: no_false_publish
|
||||
- action: assert_greater
|
||||
actual: "{{ no_false_publish }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_runtime_invalid_terminal_evidence_no_false_publish=true$"
|
||||
save_as: invalid_terminal_no_false_publish
|
||||
- action: assert_greater
|
||||
actual: "{{ invalid_terminal_no_false_publish }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=1$"
|
||||
save_as: one_frontend_attempt
|
||||
- action: assert_greater
|
||||
actual: "{{ one_frontend_attempt }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^frontend_published=true$"
|
||||
save_as: frontend_published
|
||||
- action: assert_greater
|
||||
actual: "{{ frontend_published }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^failback_started=false$"
|
||||
save_as: failback_not_started
|
||||
- action: assert_greater
|
||||
actual: "{{ failback_not_started }}"
|
||||
threshold: "0"
|
||||
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt"
|
||||
pattern: "^storage_mutation_allowed=false$"
|
||||
save_as: no_storage_mutation
|
||||
- action: assert_greater
|
||||
actual: "{{ no_storage_mutation }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
@@ -1,96 +0,0 @@
|
||||
# Runner-native Phase 69 gate: frontend publication target contract.
|
||||
|
||||
name: frontend-publication-target-contract-chain
|
||||
timeout: 8m
|
||||
|
||||
env:
|
||||
product_root: "/tmp/seaweed_block"
|
||||
ssh_key: "C:\\work\\dev_server\\testdev_key"
|
||||
|
||||
topology:
|
||||
nodes:
|
||||
m02:
|
||||
host: 192.168.1.184
|
||||
user: testdev
|
||||
key: "{{ ssh_key }}"
|
||||
|
||||
phases:
|
||||
- name: frontend_publication_target_contract_gate
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 7m
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract bash scripts/run-phase69-frontend-publication-target-contract-gate.sh {{ product_root }}"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^phase69_frontend_publication_target_contract_status=ok$"
|
||||
save_as: phase69_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ phase69_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^frontend_publication_target_schema_locked=true$"
|
||||
save_as: schema_locked
|
||||
- action: assert_greater
|
||||
actual: "{{ schema_locked }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^frontend_publication_target_owner_creates_target=true$"
|
||||
save_as: creates_target
|
||||
- action: assert_greater
|
||||
actual: "{{ creates_target }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^frontend_publication_target_owner_dry_run_no_create=true$"
|
||||
save_as: dry_run_no_create
|
||||
- action: assert_greater
|
||||
actual: "{{ dry_run_no_create }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^frontend_publication_target_owner_rejects_enabled_publication=true$"
|
||||
save_as: rejects_enabled
|
||||
- action: assert_greater
|
||||
actual: "{{ rejects_enabled }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^frontend_publication_target_owner_rbac_narrow=true$"
|
||||
save_as: rbac_narrow
|
||||
- action: assert_greater
|
||||
actual: "{{ rbac_narrow }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^frontend_publication_attempts=0$"
|
||||
save_as: no_frontend_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_frontend_attempts }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt"
|
||||
pattern: "^failback_attempts=0$"
|
||||
save_as: no_failback_attempts
|
||||
- action: assert_greater
|
||||
actual: "{{ no_failback_attempts }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect
|
||||
always: true
|
||||
actions:
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
Loaded 100 of 257 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user