mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
seaweed-block: neutral names in tests, comments and docs
Test fixtures use node-a, node-b and node-c for lab host names; code comments drop ruling ids and keep the rule text; docs and comments name a lab host or the CI runner instead of a machine. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a5686e7fa7
commit
62bd08e0c0
34 files changed
+290
-290
No files matched your search
+1
-1
@@ -34,7 +34,7 @@ jobs:
|
||||
# Draft PR skips it; its author tests locally until the PR is ready.
|
||||
if: github.event_name == 'push' || !github.event.pull_request.draft
|
||||
# Pull requests run on GitHub-hosted runners (free for this public repo, many
|
||||
# jobs in parallel); pushes to main keep the team's tp04 runner (seaweed.slice,
|
||||
# jobs in parallel); pushes to main keep the team's self-hosted runner (seaweed.slice,
|
||||
# capped at 8 cores / 8 GiB) as the self-hosted signal. A train PR (branch
|
||||
# train/* of this repository, a few a day) also runs on the team's runners:
|
||||
# it is the merge gate, and the organization's shared GitHub-hosted queue held
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# The wrong-size local store a 1.0 first start left (3402e0dd, the 1.0 RC):
|
||||
# v2 restored with a 65536-block record, started with --durable-blocks 32768;
|
||||
# captured from that run on tp04 (archive sha256
|
||||
# captured from that run on a lab host (archive sha256
|
||||
# 0905c3af83b3a1dc226b417fa5acf7071907cc3e53478bc14a531481b717c5c1).
|
||||
# "file <name> <size> <octal mode>", then "<offset> <hex>" for each run of
|
||||
# non-zero bytes; every other byte is zero.
|
||||
|
||||
@@ -250,11 +250,11 @@ func TestOpsOperatorStatusDryRunFromBundle(t *testing.T) {
|
||||
},
|
||||
Replicas: []ops.ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
}},
|
||||
CSIStages: []ops.CSIStageFact{{NodeName: "m02", Target: "192.168.1.184:3260"}},
|
||||
CSIStages: []ops.CSIStageFact{{NodeName: "node-b", Target: "192.168.1.184:3260"}},
|
||||
Workload: &ops.WorkloadCheckFact{WriterVerified: true, ReaderVerified: true},
|
||||
})}
|
||||
raw, err := ops.MarshalObservationJSON(cluster)
|
||||
@@ -296,11 +296,11 @@ func TestOpsOperatorStatusWritesCRDStatusWhenDryRunDisabled(t *testing.T) {
|
||||
},
|
||||
Replicas: []ops.ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
}},
|
||||
CSIStages: []ops.CSIStageFact{{NodeName: "m02", Target: "192.168.1.184:3260"}},
|
||||
CSIStages: []ops.CSIStageFact{{NodeName: "node-b", Target: "192.168.1.184:3260"}},
|
||||
Workload: &ops.WorkloadCheckFact{WriterVerified: true, ReaderVerified: true},
|
||||
})}
|
||||
raw, err := ops.MarshalObservationJSON(cluster)
|
||||
@@ -1894,7 +1894,7 @@ func TestOpsClusterMasterAPIUsesSharedInClusterNodeEvidenceEnrichment(t *testing
|
||||
}
|
||||
out := stdout.String()
|
||||
for _, want := range []string{
|
||||
`"kubernetes_node": "m02"`,
|
||||
`"kubernetes_node": "node-b"`,
|
||||
`"ready": false`,
|
||||
`"reason": "node_not_ready"`,
|
||||
} {
|
||||
@@ -1926,7 +1926,7 @@ func TestOpsReportMasterAPIUsesSharedInClusterNodeEvidenceEnrichment(t *testing.
|
||||
}
|
||||
out := string(raw)
|
||||
for _, want := range []string{
|
||||
`"kubernetes_node": "m02"`,
|
||||
`"kubernetes_node": "node-b"`,
|
||||
`"ready": false`,
|
||||
`"reason": "node_not_ready"`,
|
||||
} {
|
||||
@@ -1956,7 +1956,7 @@ func TestLoadObservationVolumeUsesSharedInClusterNodeEvidenceEnrichment(t *testi
|
||||
if code != ops.VolumeStatusExitOK {
|
||||
t.Fatalf("exit=%d stderr=%s cluster=%+v", code, stderr.String(), cluster)
|
||||
}
|
||||
if len(cluster.Nodes) != 1 || cluster.Nodes[0].KubernetesNode != "m02" {
|
||||
if len(cluster.Nodes) != 1 || cluster.Nodes[0].KubernetesNode != "node-b" {
|
||||
t.Fatalf("cluster nodes=%+v", cluster.Nodes)
|
||||
}
|
||||
if !cmdConditionReason(cluster.Nodes[0].Conditions, ops.ReasonNodeNotReady) {
|
||||
@@ -2051,7 +2051,7 @@ func TestOpsDashboardMasterAPIUsesSharedInClusterNodeEvidenceEnrichment(t *testi
|
||||
}()
|
||||
|
||||
body := waitForHTTPContains(t, "http://"+addr+"/cluster-evidence.json", `"reason": "node_not_ready"`)
|
||||
if !strings.Contains(body, `"kubernetes_node": "m02"`) || !strings.Contains(body, `"ready": false`) {
|
||||
if !strings.Contains(body, `"kubernetes_node": "node-b"`) || !strings.Contains(body, `"ready": false`) {
|
||||
t.Fatalf("dashboard cluster evidence missing enriched node:\n%s", body)
|
||||
}
|
||||
select {
|
||||
@@ -2123,8 +2123,8 @@ type fakeNodeEvidenceEnricher struct{}
|
||||
|
||||
func (fakeNodeEvidenceEnricher) EnrichNodeEvidence(_ context.Context, _ string, cluster ops.ClusterEvidence) (ops.ClusterEvidence, error) {
|
||||
cluster.Nodes = []ops.NodeEvidence{{
|
||||
NodeName: "m02",
|
||||
KubernetesNode: "m02",
|
||||
NodeName: "node-b",
|
||||
KubernetesNode: "node-b",
|
||||
Ready: false,
|
||||
Schedulable: true,
|
||||
Conditions: []ops.ObservationCondition{{
|
||||
@@ -2538,7 +2538,7 @@ func TestOpsGenerateHelmValuesSingleNodeFromKubernetes(t *testing.T) {
|
||||
code := run([]string{
|
||||
"ops", "generate-helm-values",
|
||||
"--out", outPath,
|
||||
"--target-node", "m02",
|
||||
"--target-node", "node-b",
|
||||
"--node-limit", "1",
|
||||
"--image", "ghcr.io/seaweedfs/seaweed-block:sha-test",
|
||||
"--csi-image", "ghcr.io/seaweedfs/seaweed-block-csi:sha-test",
|
||||
@@ -2551,7 +2551,7 @@ func TestOpsGenerateHelmValuesSingleNodeFromKubernetes(t *testing.T) {
|
||||
"network_mode=loopback",
|
||||
"ready_kubernetes_nodes=1",
|
||||
"discovered_kubernetes_nodes=3",
|
||||
"target_node=m02",
|
||||
"target_node=node-b",
|
||||
"restart_persistence_mode=hostpath",
|
||||
"state_hostpath=/var/lib/sw-block/k8s",
|
||||
} {
|
||||
@@ -2575,8 +2575,8 @@ func TestOpsGenerateHelmValuesSingleNodeFromKubernetes(t *testing.T) {
|
||||
"stateHostPath: /var/lib/sw-block/k8s",
|
||||
"expectedSlotsPerVolume: 1",
|
||||
"enabled: false",
|
||||
"name: m02",
|
||||
"kubernetesNode: m02",
|
||||
"name: node-b",
|
||||
"kubernetesNode: node-b",
|
||||
"internalIP: 127.0.0.1",
|
||||
"dataPort: 19101",
|
||||
"controlPort: 19102",
|
||||
@@ -2641,15 +2641,15 @@ func TestOpsGenerateHelmValuesMultiNodeExternalISCSI(t *testing.T) {
|
||||
"stateHostPath: /var/lib/sw-block/k8s",
|
||||
"enabled: true",
|
||||
"secret: fixed-chap-secret",
|
||||
"name: m01",
|
||||
"name: node-a",
|
||||
"internalIP: 192.168.1.181",
|
||||
"dataPort: 19101",
|
||||
"controlPort: 19102",
|
||||
"name: m02",
|
||||
"name: node-b",
|
||||
"internalIP: 192.168.1.184",
|
||||
"dataPort: 19103",
|
||||
"controlPort: 19104",
|
||||
"name: tp01",
|
||||
"name: node-c",
|
||||
"internalIP: 192.168.1.188",
|
||||
"dataPort: 19105",
|
||||
"controlPort: 19106",
|
||||
@@ -2709,11 +2709,11 @@ func TestOpsGenerateHelmValuesMultiNodeExternalNVMe(t *testing.T) {
|
||||
"enabled: false",
|
||||
"create: false",
|
||||
"secret: \"\"",
|
||||
"name: m01",
|
||||
"name: node-a",
|
||||
"internalIP: 192.168.1.181",
|
||||
"name: m02",
|
||||
"name: node-b",
|
||||
"internalIP: 192.168.1.184",
|
||||
"name: tp01",
|
||||
"name: node-c",
|
||||
"internalIP: 192.168.1.188",
|
||||
} {
|
||||
if !strings.Contains(string(values), want) {
|
||||
@@ -2739,7 +2739,7 @@ func TestOpsGenerateHelmValuesMultiNodeNVMeFrontendIPMap(t *testing.T) {
|
||||
"--out", outPath,
|
||||
"--replication-factor", "3",
|
||||
"--protocol", "nvme",
|
||||
"--frontend-ip-map", "m01=10.0.0.181,m02=10.0.0.184,tp01=10.0.0.188",
|
||||
"--frontend-ip-map", "node-a=10.0.0.181,node-b=10.0.0.184,node-c=10.0.0.188",
|
||||
"--frontend-network-class", "100gbe_tcp",
|
||||
}, &stdout, &stderr)
|
||||
if code != ops.VolumeStatusExitOK {
|
||||
@@ -2747,7 +2747,7 @@ func TestOpsGenerateHelmValuesMultiNodeNVMeFrontendIPMap(t *testing.T) {
|
||||
}
|
||||
for _, want := range []string{
|
||||
"network_mode=external-nvme",
|
||||
"frontend_ip_map=m01=10.0.0.181,m02=10.0.0.184,tp01=10.0.0.188",
|
||||
"frontend_ip_map=node-a=10.0.0.181,node-b=10.0.0.184,node-c=10.0.0.188",
|
||||
"frontend_network_class=100gbe_tcp",
|
||||
} {
|
||||
if !strings.Contains(stdout.String(), want) {
|
||||
@@ -2759,16 +2759,16 @@ func TestOpsGenerateHelmValuesMultiNodeNVMeFrontendIPMap(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, want := range []string{
|
||||
"name: m01",
|
||||
"name: node-a",
|
||||
"internalIP: 192.168.1.181",
|
||||
"managementIP: 192.168.1.181",
|
||||
"frontendIP: 10.0.0.181",
|
||||
"frontendNetworkClass: 100gbe_tcp",
|
||||
"name: m02",
|
||||
"name: node-b",
|
||||
"internalIP: 192.168.1.184",
|
||||
"managementIP: 192.168.1.184",
|
||||
"frontendIP: 10.0.0.184",
|
||||
"name: tp01",
|
||||
"name: node-c",
|
||||
"internalIP: 192.168.1.188",
|
||||
"managementIP: 192.168.1.188",
|
||||
"frontendIP: 10.0.0.188",
|
||||
@@ -2791,7 +2791,7 @@ func TestPhase165_OpsGenerateHelmValuesNVMERDMA(t *testing.T) {
|
||||
code := run([]string{
|
||||
"ops", "generate-helm-values", "--out", outPath, "--replication-factor", "1",
|
||||
"--protocol", "nvme", "--nvme-transport", "rdma",
|
||||
"--frontend-ip-map", "m01=10.0.0.181,m02=10.0.0.184,tp01=10.0.0.188",
|
||||
"--frontend-ip-map", "node-a=10.0.0.181,node-b=10.0.0.184,node-c=10.0.0.188",
|
||||
"--frontend-network-class", "100gbe_roce",
|
||||
}, &stdout, &stderr)
|
||||
if code != ops.VolumeStatusExitOK {
|
||||
@@ -2817,7 +2817,7 @@ func TestPhase165_OpsGenerateHelmValuesNVMERDMARequiresRoCEMap(t *testing.T) {
|
||||
for _, args := range [][]string{
|
||||
{"--protocol", "iscsi", "--nvme-transport", "rdma"},
|
||||
{"--protocol", "nvme", "--nvme-transport", "rdma"},
|
||||
{"--protocol", "nvme", "--nvme-transport", "rdma", "--frontend-ip-map", "m01=10.0.0.181", "--frontend-network-class", "100gbe_tcp"},
|
||||
{"--protocol", "nvme", "--nvme-transport", "rdma", "--frontend-ip-map", "node-a=10.0.0.181", "--frontend-network-class", "100gbe_tcp"},
|
||||
} {
|
||||
var stdout, stderr bytes.Buffer
|
||||
base := []string{"ops", "generate-helm-values", "--out", filepath.Join(t.TempDir(), "values.yaml")}
|
||||
@@ -2841,20 +2841,20 @@ func TestOpsGenerateHelmValuesRejectsIncompleteFrontendIPMap(t *testing.T) {
|
||||
"--out", filepath.Join(t.TempDir(), "values.yaml"),
|
||||
"--replication-factor", "3",
|
||||
"--protocol", "nvme",
|
||||
"--frontend-ip-map", "m01=10.0.0.181,m02=10.0.0.184",
|
||||
"--frontend-ip-map", "node-a=10.0.0.181,node-b=10.0.0.184",
|
||||
"--frontend-network-class", "100gbe_tcp",
|
||||
}, &stdout, &stderr)
|
||||
if code != ops.VolumeStatusExitInvalid {
|
||||
t.Fatalf("exit=%d want invalid stdout=%s stderr=%s", code, stdout.String(), stderr.String())
|
||||
}
|
||||
if !strings.Contains(stderr.String(), `--frontend-ip-map missing selected node "tp01"`) {
|
||||
if !strings.Contains(stderr.String(), `--frontend-ip-map missing selected node "node-c"`) {
|
||||
t.Fatalf("stderr=%s", stderr.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeEvidenceFromWirePreservesFrontendAddress(t *testing.T) {
|
||||
node := nodeEvidenceFromWire(&control.NodeEvidence{
|
||||
NodeName: "m01",
|
||||
NodeName: "node-a",
|
||||
InternalIp: "192.168.1.181",
|
||||
FrontendIp: "10.0.0.1",
|
||||
FrontendNetworkClass: "100gbe_tcp",
|
||||
@@ -2887,7 +2887,7 @@ func TestOpsGenerateHelmValuesRestartPersistenceHostPath(t *testing.T) {
|
||||
code := run([]string{
|
||||
"ops", "generate-helm-values",
|
||||
"--out", outPath,
|
||||
"--target-node", "m02",
|
||||
"--target-node", "node-b",
|
||||
"--node-limit", "1",
|
||||
"--restart-persistence", "hostpath",
|
||||
"--state-hostpath", "/var/lib/sw-block",
|
||||
@@ -2945,7 +2945,7 @@ func TestOpsGenerateHelmValuesRejectsRFAboveSelectedNodes(t *testing.T) {
|
||||
code := run([]string{
|
||||
"ops", "generate-helm-values",
|
||||
"--out", filepath.Join(t.TempDir(), "values.yaml"),
|
||||
"--target-node", "m02",
|
||||
"--target-node", "node-b",
|
||||
"--replication-factor", "3",
|
||||
}, &stdout, &stderr)
|
||||
if code != ops.VolumeStatusExitInvalid {
|
||||
@@ -2966,7 +2966,7 @@ func TestOpsDescribeVolumeFromBundle(t *testing.T) {
|
||||
for _, want := range []string{
|
||||
"cluster status=degraded volumes=1",
|
||||
"volume pvc-observed status=ok rf=3 ack=sync-quorum",
|
||||
"primary r2 on m02 frontend=192.168.1.184:3260",
|
||||
"primary r2 on node-b frontend=192.168.1.184:3260",
|
||||
} {
|
||||
if !strings.Contains(stdout.String(), want) {
|
||||
t.Fatalf("stdout missing %q:\n%s", want, stdout.String())
|
||||
@@ -2984,7 +2984,7 @@ func TestOpsDescribeVolumeFromBundlePrefersProductClusterEvidence(t *testing.T)
|
||||
for _, want := range []string{
|
||||
"cluster status=ok volumes=1 nodes=1",
|
||||
"volume pvc-product status=ok rf=3 ack=sync-quorum",
|
||||
"primary r2 on m02 frontend=192.168.1.184:3260",
|
||||
"primary r2 on node-b frontend=192.168.1.184:3260",
|
||||
} {
|
||||
if !strings.Contains(stdout.String(), want) {
|
||||
t.Fatalf("stdout missing %q:\n%s", want, stdout.String())
|
||||
@@ -3341,7 +3341,7 @@ func TestOpsReportFromBundleSkipsCorruptClusterEvidenceCandidate(t *testing.T) {
|
||||
ReplicationFactor: 1,
|
||||
Status: ops.ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
}}
|
||||
raw, err := ops.MarshalObservationJSON(cluster)
|
||||
@@ -3513,7 +3513,7 @@ func TestOpsExplainVolumeFromBundleBlockedImagePull(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, "demo", ops.KubeSystemPodsDeploysArtifact), []byte(`NAME READY STATUS RESTARTS AGE IP NODE
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 m02
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 node-b
|
||||
deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:local
|
||||
`), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -3525,7 +3525,7 @@ deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:loca
|
||||
}
|
||||
for _, want := range []string{
|
||||
"volume pvc-blocked status=blocked rf=3 reason=csi_node_image_pull_failed",
|
||||
"waiting=ImagePullBackOff on node m02 image sw-block-csi:local",
|
||||
"waiting=ImagePullBackOff on node node-b image sw-block-csi:local",
|
||||
} {
|
||||
if !strings.Contains(stdout.String(), want) {
|
||||
t.Fatalf("stdout missing %q:\n%s", want, stdout.String())
|
||||
@@ -3551,7 +3551,7 @@ func TestOpsDescribeVolumeLiveInventory(t *testing.T) {
|
||||
"cluster status=ok volumes=1 nodes=0",
|
||||
"volume pvc-live status=ok rf=1 ack=best-effort",
|
||||
"pvc default/app-live",
|
||||
"primary r1 on m02 frontend=127.0.0.1:3260",
|
||||
"primary r1 on node-b frontend=127.0.0.1:3260",
|
||||
} {
|
||||
if !strings.Contains(stdout.String(), want) {
|
||||
t.Fatalf("stdout missing %q:\n%s", want, stdout.String())
|
||||
@@ -3583,7 +3583,7 @@ func TestOpsClusterAndVolumesLiveInventory(t *testing.T) {
|
||||
if code != ops.VolumeStatusExitOK {
|
||||
t.Fatalf("volumes exit=%d stderr=%s stdout=%s", code, volumesErr.String(), volumesOut.String())
|
||||
}
|
||||
if !strings.Contains(volumesOut.String(), "volume pvc-live status=ok rf=1 primary=r1 node=m02 frontend=127.0.0.1:3260") {
|
||||
if !strings.Contains(volumesOut.String(), "volume pvc-live status=ok rf=1 primary=r1 node=node-b frontend=127.0.0.1:3260") {
|
||||
t.Fatalf("volumes output missing evidence:\n%s", volumesOut.String())
|
||||
}
|
||||
}
|
||||
@@ -3601,9 +3601,9 @@ func cleanCmdResidueCommand(_ context.Context, name string, args ...string) ([]b
|
||||
}
|
||||
}
|
||||
|
||||
const cmdHelmNodeWide = `m01 Ready worker 10d v1.34.4+k3s1 192.168.1.181 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
m02 Ready control-plane 10d v1.34.4+k3s1 192.168.1.184 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
tp01 Ready worker 10d v1.34.4+k3s1 192.168.1.188 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
const cmdHelmNodeWide = `node-a Ready worker 10d v1.34.4+k3s1 192.168.1.181 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
node-b Ready control-plane 10d v1.34.4+k3s1 192.168.1.184 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
node-c Ready worker 10d v1.34.4+k3s1 192.168.1.188 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
bad1 Ready,SchedulingDisabled worker 10d v1.34.4+k3s1 192.168.1.199 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
bad2 NotReady worker 10d v1.34.4+k3s1 192.168.1.200 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
bad3 Ready worker 10d v1.34.4+k3s1 127.0.0.1 <none> Ubuntu 24.04 6.8.0 containerd://2.0.0
|
||||
@@ -3630,7 +3630,7 @@ const cmdSingleDeploymentListJSON = `{
|
||||
"labels":{"app":"sw-blockvolume","sw-block.seaweedfs.com/volume":"pvc-live","sw-block.seaweedfs.com/replica":"r1"},
|
||||
"ownerReferences":[{"kind":"PersistentVolumeClaim","name":"app-live","uid":"uid-live"}]
|
||||
},
|
||||
"spec":{"template":{"spec":{"nodeSelector":{"kubernetes.io/hostname":"m02"},"containers":[{"name":"blockvolume","args":["--server-id=m02","--volume-id=pvc-live","--replica-id=r1","--data-addr=127.0.0.1:19101","--ctrl-addr=127.0.0.1:19102","--status-addr=127.0.0.1:23260","--iscsi-listen=127.0.0.1:3260","--iscsi-iqn=iqn.2026-05.io.seaweedfs:pvc-live"]}]}}},
|
||||
"spec":{"template":{"spec":{"nodeSelector":{"kubernetes.io/hostname":"node-b"},"containers":[{"name":"blockvolume","args":["--server-id=node-b","--volume-id=pvc-live","--replica-id=r1","--data-addr=127.0.0.1:19101","--ctrl-addr=127.0.0.1:19102","--status-addr=127.0.0.1:23260","--iscsi-listen=127.0.0.1:3260","--iscsi-iqn=iqn.2026-05.io.seaweedfs:pvc-live"]}]}}},
|
||||
"status":{"replicas":1,"readyReplicas":1}
|
||||
}
|
||||
]
|
||||
@@ -3655,7 +3655,7 @@ func writeCmdObservationBundle(t *testing.T) string {
|
||||
{
|
||||
ReplicaID: "r2",
|
||||
ServerID: "node-loss-r2",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Observed: true,
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.184:3260",
|
||||
@@ -3677,7 +3677,7 @@ func writeCmdObservationBundle(t *testing.T) string {
|
||||
{
|
||||
ReplicaID: "r3",
|
||||
ServerID: "node-loss-r3",
|
||||
NodeName: "tp01",
|
||||
NodeName: "node-c",
|
||||
Observed: true,
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.188:3260",
|
||||
@@ -3705,7 +3705,7 @@ func writeCmdObservationBundle(t *testing.T) string {
|
||||
if err := os.WriteFile(filepath.Join(dir, "demo", ops.NodeLossRecoverySummaryArtifact), []byte(strings.Join([]string{
|
||||
"result=promoted",
|
||||
"ack_profile=sync-quorum",
|
||||
"promoted=r2@m02",
|
||||
"promoted=r2@node-b",
|
||||
"before_frontend=192.168.1.181:3260",
|
||||
"after_frontend=192.168.1.184:3260",
|
||||
"reader_verified=true",
|
||||
@@ -3731,7 +3731,7 @@ func writeCmdProductClusterBundle(t *testing.T) string {
|
||||
cluster.ProductRevision = "product-cluster-rev"
|
||||
cluster.Status = ops.ObservationStatusOK
|
||||
cluster.Nodes = []ops.NodeEvidence{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
InternalIP: "192.168.1.184",
|
||||
Schedulable: true,
|
||||
Ready: true,
|
||||
@@ -3748,11 +3748,11 @@ func writeCmdProductClusterBundle(t *testing.T) string {
|
||||
ObservedReplicas: 3,
|
||||
Status: ops.ObservationStatusOK,
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Replicas: []ops.ReplicaEvidence{{
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "192.168.1.184:3260",
|
||||
@@ -3796,7 +3796,7 @@ func writeCmdReturnedReplicaBundle(t *testing.T) string {
|
||||
ReplicationFactor: 2,
|
||||
Status: ops.ObservationStatusRecovering,
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
EndpointVersion: 1,
|
||||
@@ -3804,7 +3804,7 @@ func writeCmdReturnedReplicaBundle(t *testing.T) string {
|
||||
RequiredFrontierLSN: 4241,
|
||||
Replicas: []ops.ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "previous_primary",
|
||||
ReplicationRole: "replica_ready",
|
||||
@@ -3818,7 +3818,7 @@ func writeCmdReturnedReplicaBundle(t *testing.T) string {
|
||||
SupportBundlePath: "returned-replica-summary.txt",
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
Healthy: true,
|
||||
@@ -3856,7 +3856,7 @@ func writeCmdReturnedReplicaRebuildBundle(t *testing.T) string {
|
||||
ReplicationFactor: 3,
|
||||
Status: ops.ObservationStatusRecovering,
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Epoch: 3,
|
||||
EndpointVersion: 7,
|
||||
@@ -3864,7 +3864,7 @@ func writeCmdReturnedReplicaRebuildBundle(t *testing.T) string {
|
||||
RequiredFrontierLSN: 4241,
|
||||
Replicas: []ops.ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "previous_primary",
|
||||
ReplicationRole: "replica_behind",
|
||||
@@ -3878,7 +3878,7 @@ func writeCmdReturnedReplicaRebuildBundle(t *testing.T) string {
|
||||
SupportBundlePath: "returned-replica-rebuild-summary.txt",
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
Healthy: true,
|
||||
@@ -4004,7 +4004,7 @@ func (cmdFakeClusterEvidenceServer) GetClusterStatus(context.Context, *control.G
|
||||
ObservedReplicas: 3,
|
||||
Status: ops.ObservationStatusOK,
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
EndpointVersion: 1,
|
||||
@@ -4014,7 +4014,7 @@ func (cmdFakeClusterEvidenceServer) GetClusterStatus(context.Context, *control.G
|
||||
EventTime: timestamppb.Now(),
|
||||
VolumeId: "v1",
|
||||
ReplicaId: "r2",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
EventType: ops.EventTypeCSIReattachObserved,
|
||||
Severity: "info",
|
||||
Message: "CSI staged volume on node",
|
||||
|
||||
@@ -216,7 +216,7 @@ func TestNVMePairedFlushCrashRecovery(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Opt-in serial tp04 proxy; neither a guest filesystem benchmark nor a gate.
|
||||
// Opt-in serial lab-host proxy; neither a guest filesystem benchmark nor a gate.
|
||||
func TestNVMePairedFlushLatency(t *testing.T) {
|
||||
if os.Getenv("SW_BLOCK_SYNC_PERF") != "1" {
|
||||
t.Skip("opt-in file-backed latency characterization")
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestMasterTimeline_RecordsPlacementVerified(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -42,7 +42,7 @@ func TestMasterTimeline_RecordsPromotionCandidateEvaluation(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
t.Fatalf("initial product tick: %v", err)
|
||||
@@ -65,7 +65,7 @@ func TestMasterTimeline_RecordsPromotionCandidateEvaluation(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
ingestRF3ObservationForServersWithReady(t, h, "pvc-a", "m01", "m02", "tp01",
|
||||
ingestRF3ObservationForServersWithReady(t, h, "pvc-a", "node-a", "node-b", "node-c",
|
||||
false, false,
|
||||
true, true,
|
||||
true, true)
|
||||
@@ -91,7 +91,7 @@ func TestMasterTimeline_RecordsAuthorityPublishedAfterMint(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -114,7 +114,7 @@ func TestClusterEvidenceService_WatchClusterEventsCursor(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -164,7 +164,7 @@ func TestClusterEvidenceService_WatchClusterEventsStreamsNewEvents(t *testing.T)
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -198,7 +198,7 @@ func TestClusterEvidenceService_WatchClusterEventsStreamsNewEvents(t *testing.T)
|
||||
EventType: "csi_reattach_observed",
|
||||
Severity: "info",
|
||||
VolumeId: "pvc-a",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
NewValue: "10.0.0.2:3260",
|
||||
}); err != nil {
|
||||
t.Fatalf("report event: %v", err)
|
||||
|
||||
@@ -174,7 +174,7 @@ func (h *Host) formatLevel() uint32 { return h.format.v.Load() }
|
||||
// formatEligible reports whether server may be GRANTED work (an authority
|
||||
// line published to it, and with it its lease) at the cluster's format
|
||||
// level: its own report says its binary reads that level; no report means
|
||||
// no grant (r2.875: NoStrand holds at grant). At level 0 every server is.
|
||||
// no grant (NoStrand holds at the grant). At level 0 every server is.
|
||||
func (h *Host) formatEligible(server string) bool {
|
||||
level := h.formatLevel()
|
||||
if level == 0 {
|
||||
@@ -277,7 +277,7 @@ func (h *Host) grantWaits(now time.Time) map[string][]grantWaitEntry {
|
||||
|
||||
// placementTooOld names why server may not be chosen as a placement target
|
||||
// (create, move, restore target, a failover candidate), or "" when it may:
|
||||
// only a KNOWN-old report refuses (r2.875). An unknown server is placeable,
|
||||
// only a KNOWN-old report refuses. An unknown server is placeable,
|
||||
// since with one process per volume and create-then-start a placement target
|
||||
// cannot have reported yet; the grant (formatTooOld) still needs its report.
|
||||
func (h *Host) placementTooOld(server string) string {
|
||||
|
||||
@@ -47,7 +47,7 @@ func binaryTooOld(err error) bool {
|
||||
}
|
||||
|
||||
// Every binary's heartbeat is taken and its read level recorded, at level 0
|
||||
// and at level 1 alike (r2.881: the refusal is at the grant, never at the
|
||||
// and at level 1 alike (the refusal is at the grant, never at the
|
||||
// heartbeat); at level 1 a host whose process reads only level 0 is then
|
||||
// known old, so placement skips it (its grant is refused at the publication
|
||||
// boundary: TestThePublicationBoundaryRefusesAnAskForAnOldServer).
|
||||
@@ -95,7 +95,7 @@ func TestFormatGateRefusesPlacementAndMoveOntoAnOldHost(t *testing.T) {
|
||||
TargetServerId: "node-b", TargetDataAddr: "127.0.0.1:19301", TargetCtrlAddr: "127.0.0.1:19302", Kind: "clean"})
|
||||
if level == 0 || !reported {
|
||||
// level 0, or an unknown (silent) host at level 1: placeable
|
||||
// (r2.875: placement refuses only a known-old report; the
|
||||
// (placement refuses only a known-old report; the
|
||||
// grant needs the holder's report).
|
||||
if placeErr != nil {
|
||||
t.Fatalf("%s: placement refused: %v", name, placeErr)
|
||||
@@ -142,7 +142,7 @@ func TestFormatGateRefusesPlacementAndMoveOntoAnOldHost(t *testing.T) {
|
||||
|
||||
// At level 1 the product loop never places a new volume on a host known to
|
||||
// read a lower level, and does on one that reads it, or that has not
|
||||
// reported yet (r2.875: unknown is placeable; the grant waits for its report).
|
||||
// reported yet (unknown is placeable; the grant waits for its report).
|
||||
func TestFormatGateProductLoopPlacesOnlyOnHostsThatReadTheLevel(t *testing.T) {
|
||||
const silent = ^uint32(0)
|
||||
for _, reads := range []uint32{0, 1, silent} {
|
||||
|
||||
@@ -74,7 +74,7 @@ func TestANewClusterStartsAtTheCurrentFormatLevel(t *testing.T) {
|
||||
// placement) and shows as awaiting report; it is not granted until its own
|
||||
// report: the publication of its line is refused and its publish never runs;
|
||||
// after its first heartbeat (reads level 1) the line is published and the
|
||||
// condition is gone (r2.875).
|
||||
// condition is gone.
|
||||
func TestANewClusterPlacesAnUnreportedNodeAndGrantsAfterItsReport(t *testing.T) {
|
||||
r := newIsolationRig(t, false, t.TempDir(), t.TempDir())
|
||||
if r.m.formatLevel() != 1 {
|
||||
@@ -206,7 +206,7 @@ func TestTheGrantReadsTheHoldersOwnReportNotASiblings(t *testing.T) {
|
||||
// On a new cluster an idle unreported host is info: the cluster stays ok. A
|
||||
// host that holds a placed volume waiting for its grant past the startup
|
||||
// window is a warning: the nodes degrade the cluster and the condition names
|
||||
// the volume and its wait (r2.877). Before the window it is still info.
|
||||
// the volume and its wait. Before the window it is still info.
|
||||
func TestAnIdleUnreportedHostLeavesTheClusterOKALateGrantDegradesIt(t *testing.T) {
|
||||
r := newIsolationRig(t, false, t.TempDir(), t.TempDir())
|
||||
if _, err := r.m.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{ServerID: "node-b", DataAddr: "127.0.0.1:19321", CtrlAddr: "127.0.0.1:19322"}); err != nil {
|
||||
|
||||
@@ -326,7 +326,7 @@ func New(cfg Config) (*Host, error) {
|
||||
_ = boot.Close()
|
||||
return nil, fmt.Errorf("master.New: lifecycle stores: %w", err)
|
||||
}
|
||||
// A new cluster starts at the current level (r2.869): with no prior
|
||||
// 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
|
||||
// lifecycle stores), the master writes the level-1 envelope durably now,
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestClusterEvidenceService_GetClusterStatusSharesObservationSnapshot(t *tes
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
t.Fatalf("product tick: %v", err)
|
||||
@@ -57,7 +57,7 @@ func TestClusterEvidenceService_GetClusterStatusSharesObservationSnapshot(t *tes
|
||||
|
||||
func TestNodeEvidenceToWirePreservesFrontendAddress(t *testing.T) {
|
||||
wire := nodeEvidenceToWire(ops.NodeEvidence{
|
||||
NodeName: "m01",
|
||||
NodeName: "node-a",
|
||||
InternalIP: "192.168.1.181",
|
||||
FrontendIP: "10.0.0.1",
|
||||
FrontendNetworkClass: "100gbe_tcp",
|
||||
@@ -84,7 +84,7 @@ func TestClusterEvidenceService_GRPCRegistered(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
t.Fatalf("product tick: %v", err)
|
||||
@@ -113,7 +113,7 @@ func TestClusterEvidenceService_ListVolumesAndGetVolumeStatus(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, false)
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
t.Fatalf("product tick: %v", err)
|
||||
@@ -176,7 +176,7 @@ func TestObservationService_ReportClusterEventAppearsInVolumeTimeline(t *testing
|
||||
EventTime: timestamppb.New(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
|
||||
VolumeId: "pvc-a",
|
||||
ReplicaId: "r2",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
EventType: "csi_reattach_observed",
|
||||
Severity: "warning",
|
||||
Message: "authority_published spoof",
|
||||
@@ -232,7 +232,7 @@ func TestObservationService_ReportClusterEventRejectsAuthorityOwnedType(t *testi
|
||||
|
||||
_, err := newServices(h).ReportClusterEvent(context.Background(), &control.ClusterEvent{
|
||||
VolumeId: "pvc-a",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
EventType: "authority_published",
|
||||
Severity: "info",
|
||||
})
|
||||
@@ -246,7 +246,7 @@ func TestObservationService_ReportClusterEventRejectsCSIEventWithoutVolumeOrNode
|
||||
defer closeTestMaster(t, h)
|
||||
|
||||
_, err := newServices(h).ReportClusterEvent(context.Background(), &control.ClusterEvent{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
EventType: "csi_reattach_observed",
|
||||
Severity: "info",
|
||||
})
|
||||
|
||||
@@ -37,7 +37,7 @@ func (h *Host) ObservationSnapshot(now time.Time) ops.ClusterEvidence {
|
||||
}
|
||||
// Info while the node is idle or its placed volumes wait within their
|
||||
// startup window; a warning (the cluster degraded) once one has waited
|
||||
// for its grant past the window (r2.877). Each wait is shown, before
|
||||
// for its grant past the window. Each wait is shown, before
|
||||
// it is late too.
|
||||
severity := "info"
|
||||
message := fmt.Sprintf("awaiting report: no grant to a process of this node before its own report (cluster format level %d)", h.formatLevel())
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestMasterObservationSnapshot_RF3HealthyReadOnly(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -66,17 +66,17 @@ func TestMasterObservationSnapshot_SeparatesManagementAndFrontendNodeAddress(t *
|
||||
h := newTestMaster(t, t.TempDir())
|
||||
defer closeTestMaster(t, h)
|
||||
if _, err := h.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{
|
||||
ServerID: "m01",
|
||||
ServerID: "node-a",
|
||||
DataAddr: "10.0.0.181:19101",
|
||||
CtrlAddr: "192.168.1.181:19102",
|
||||
Labels: map[string]string{
|
||||
lifecycle.KubernetesNodeNameLabel: "m01",
|
||||
lifecycle.KubernetesNodeNameLabel: "node-a",
|
||||
lifecycle.ManagementIPLabel: "192.168.1.181",
|
||||
lifecycle.FrontendIPLabel: "10.0.0.181",
|
||||
lifecycle.FrontendNetworkClassLabel: "100gbe_tcp",
|
||||
},
|
||||
Pools: []lifecycle.StoragePool{{
|
||||
PoolID: "pool-m01",
|
||||
PoolID: "pool-node-a",
|
||||
TotalBytes: 1 << 30,
|
||||
FreeBytes: 1 << 30,
|
||||
BlockSize: 4096,
|
||||
@@ -104,7 +104,7 @@ func TestMasterObservationSnapshot_MissingReplicaIsDegraded(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, false)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -139,7 +139,7 @@ func TestMasterObservationSnapshot_PrimaryMustConfirmReadiness(t *testing.T) {
|
||||
})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
@@ -203,7 +203,7 @@ func TestMasterObservationSnapshot_PreservesNVMeFrontendIdentityInVolumeEvidence
|
||||
DesiredRF: 1,
|
||||
Candidates: []lifecycle.PlacementCandidate{{
|
||||
VolumeID: "pvc-nvme",
|
||||
ServerID: "m01",
|
||||
ServerID: "node-a",
|
||||
ReplicaID: "r1",
|
||||
Source: lifecycle.PlacementSourceExistingReplica,
|
||||
}},
|
||||
@@ -211,7 +211,7 @@ func TestMasterObservationSnapshot_PreservesNVMeFrontendIdentityInVolumeEvidence
|
||||
t.Fatalf("apply placement: %v", err)
|
||||
}
|
||||
if err := ingestV11(h, authority.Observation{
|
||||
ServerID: "m01",
|
||||
ServerID: "node-a",
|
||||
ObservedAt: time.Now().UTC(),
|
||||
Server: authority.ServerFact{Reachable: true, Eligible: true},
|
||||
Slots: []authority.SlotFact{{
|
||||
@@ -264,9 +264,9 @@ func seedObservationSnapshotVolume(t *testing.T, h *Host) {
|
||||
serverID string
|
||||
ip string
|
||||
}{
|
||||
{serverID: "m01", ip: "192.168.1.181"},
|
||||
{serverID: "m02", ip: "192.168.1.184"},
|
||||
{serverID: "tp01", ip: "192.168.1.188"},
|
||||
{serverID: "node-a", ip: "192.168.1.181"},
|
||||
{serverID: "node-b", ip: "192.168.1.184"},
|
||||
{serverID: "node-c", ip: "192.168.1.188"},
|
||||
} {
|
||||
if _, err := h.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{
|
||||
ServerID: node.serverID,
|
||||
@@ -312,9 +312,9 @@ func ingestObservationSnapshotReplica(t *testing.T, h *Host, replica string, rea
|
||||
ip string
|
||||
score uint64
|
||||
}{
|
||||
"r1": {serverID: "m01", ip: "192.168.1.181", score: 30},
|
||||
"r2": {serverID: "m02", ip: "192.168.1.184", score: 29},
|
||||
"r3": {serverID: "tp01", ip: "192.168.1.188", score: 28},
|
||||
"r1": {serverID: "node-a", ip: "192.168.1.181", score: 30},
|
||||
"r2": {serverID: "node-b", ip: "192.168.1.184", score: 29},
|
||||
"r3": {serverID: "node-c", ip: "192.168.1.188", score: 28},
|
||||
}[replica]
|
||||
if !ok {
|
||||
t.Fatalf("unknown replica %s", replica)
|
||||
|
||||
@@ -166,7 +166,7 @@ func TestPortalAndPrimaryComeFromTheLineServerNotTheFreshestHeartbeat(t *testing
|
||||
h := newTestMasterWithControllerConfig(t, t.TempDir(), authority.TopologyControllerConfig{ExpectedSlotsPerVolume: 3})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
t.Fatalf("product tick: %v", err)
|
||||
@@ -179,7 +179,7 @@ func TestPortalAndPrimaryComeFromTheLineServerNotTheFreshestHeartbeat(t *testing
|
||||
}
|
||||
holderAddr := own.Frontends[0].Addr
|
||||
stale := ""
|
||||
for _, server := range []string{"m01", "m02", "tp01"} { // the fixture's placement servers
|
||||
for _, server := range []string{"node-a", "node-b", "node-c"} { // the fixture's placement servers
|
||||
if server != holder {
|
||||
stale = server
|
||||
break
|
||||
@@ -348,7 +348,7 @@ func TestCSIPublishesNoTargetWhenThePrimaryFrontendIsMissingOrRejected(t *testin
|
||||
h := newTestMasterWithControllerConfig(t, t.TempDir(), authority.TopologyControllerConfig{ExpectedSlotsPerVolume: 3})
|
||||
defer closeTestMaster(t, h)
|
||||
seedObservationSnapshotVolume(t, h)
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "m01", "m02", "tp01")
|
||||
seedRF3PlacementForServers(t, h, "pvc-a", "node-a", "node-b", "node-c")
|
||||
ingestObservationSnapshotRF3(t, h, true, true, true)
|
||||
if _, err := h.RunLifecycleProductTick(); err != nil {
|
||||
t.Fatalf("product tick: %v", err)
|
||||
|
||||
@@ -555,7 +555,7 @@ func (s *services) ReportHeartbeat(ctx context.Context, r *control.HeartbeatRepo
|
||||
return nil, status.Error(codes.FailedPrecondition, err.Error())
|
||||
}
|
||||
// The format gate: the reporting process's read level is recorded and
|
||||
// the heartbeat accepted whatever it reads (r2.881). An old binary is
|
||||
// the heartbeat accepted whatever it reads. An old binary is
|
||||
// refused where it matters: placement skips a host known to read a
|
||||
// lower level, and the grant (publication) refuses a holder process
|
||||
// whose own report is below the cluster's level, typed binary_too_old.
|
||||
|
||||
@@ -108,7 +108,7 @@ func loadStoreAttestations(dir string) (*storeAttestations, error) {
|
||||
// newClusterAtStart says a starting master holds no prior state in any of
|
||||
// its stores: no authority record reloaded or skipped, no attestation file,
|
||||
// and empty lifecycle stores. Only then does it start at the current format
|
||||
// level (r2.869, FormatGate Init); any existing state reads its own level
|
||||
// level (FormatGate Init); any existing state reads its own level
|
||||
// (an upgrade starts at 0; an empty authority store over an existing
|
||||
// inventory is not new).
|
||||
func newClusterAtStart(reloaded, skipped int, attestationAbsent, lifecycleEmpty bool) bool {
|
||||
|
||||
@@ -5,7 +5,7 @@ import "github.com/seaweedfs/seaweed-block/core/authority"
|
||||
// ingestV11 ingests obs as a v1.1 volume host's heartbeat delivers it: the
|
||||
// facts, and the reads_level (1) of each slot's process, which the
|
||||
// heartbeat carries and a direct ingest skips. A new cluster starts at
|
||||
// format level 1 (r2.869), where a server with no reported level counts as
|
||||
// format level 1, where a server with no reported level counts as
|
||||
// old; the tests' fake hosts are v1.1 hosts unless a test says otherwise.
|
||||
func ingestV11(h *Host, obs authority.Observation) error {
|
||||
server := obs.ServerID
|
||||
|
||||
@@ -281,7 +281,7 @@ func (h *Host) admitWorkspacePublicationNow(ask authority.AssignmentAsk, publish
|
||||
epoch = line.Epoch
|
||||
}
|
||||
server := h.workspaceSourceHost(ask.VolumeID, ask.ReplicaID, epoch)
|
||||
// The format gate at the grant (r2.875): an authority line is published
|
||||
// The format gate at the grant: an authority line is published
|
||||
// only to a server whose own report reads the cluster's level; no report
|
||||
// means no grant (the ask waits for it), and an ask decided on
|
||||
// observations taken before its server reported a lower level is not
|
||||
|
||||
@@ -464,7 +464,7 @@ func (s *services) workspaceMoveCheckLocked(q *control.WorkspaceMove) (req autho
|
||||
case !replay && s.host.colocatedTargetRefused(target.ServerID):
|
||||
refusal.text = fmt.Sprintf("move target node %q shares the authority store's file system (strict journal isolation)", target.ServerID)
|
||||
case !replay && s.host.placementTooOld(target.ServerID) != "":
|
||||
// Only a known-old report refuses a move target (r2.875); the
|
||||
// Only a known-old report refuses a move target; the
|
||||
// target's line is granted only after its own report.
|
||||
refusal = moveRefusal{"move target " + s.host.placementTooOld(target.ServerID), s.host.formatTooOldReason(target.ServerID)}
|
||||
case !matched:
|
||||
|
||||
@@ -14,23 +14,23 @@ func TestPhase37D2KubernetesNodeEvidenceEnrichesReadyAndBlockedNodes(t *testing.
|
||||
switch r.URL.Path {
|
||||
case "/api/v1/nodes":
|
||||
_, _ = w.Write([]byte(`{"items":[
|
||||
{"metadata":{"name":"m01"},"spec":{},"status":{"addresses":[{"type":"InternalIP","address":"192.168.1.181"}],"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"m02"},"spec":{"unschedulable":true},"status":{"addresses":[{"type":"InternalIP","address":"192.168.1.184"}],"conditions":[{"type":"Ready","status":"False"}]}}
|
||||
{"metadata":{"name":"node-a"},"spec":{},"status":{"addresses":[{"type":"InternalIP","address":"192.168.1.181"}],"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"node-b"},"spec":{"unschedulable":true},"status":{"addresses":[{"type":"InternalIP","address":"192.168.1.184"}],"conditions":[{"type":"Ready","status":"False"}]}}
|
||||
]}`))
|
||||
case "/api/v1/namespaces/kube-system/pods":
|
||||
if got := r.URL.Query().Get("labelSelector"); got != "app=sw-block-csi-node" {
|
||||
t.Fatalf("labelSelector=%q", got)
|
||||
}
|
||||
_, _ = w.Write([]byte(`{"items":[
|
||||
{"metadata":{"name":"csi-m01"},"spec":{"nodeName":"m01"},"status":{"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"csi-m02"},"spec":{"nodeName":"m02"},"status":{"conditions":[{"type":"Ready","status":"True"}]}}
|
||||
{"metadata":{"name":"csi-node-a"},"spec":{"nodeName":"node-a"},"status":{"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"csi-node-b"},"spec":{"nodeName":"node-b"},"status":{"conditions":[{"type":"Ready","status":"True"}]}}
|
||||
]}`))
|
||||
case "/apis/storage.k8s.io/v1/csidrivers/block.csi.seaweedfs.com":
|
||||
_, _ = w.Write([]byte(`{"metadata":{"name":"block.csi.seaweedfs.com"}}`))
|
||||
case "/apis/storage.k8s.io/v1/csinodes":
|
||||
_, _ = w.Write([]byte(`{"items":[
|
||||
{"metadata":{"name":"m01"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}},
|
||||
{"metadata":{"name":"m02"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}}
|
||||
{"metadata":{"name":"node-a"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}},
|
||||
{"metadata":{"name":"node-b"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}}
|
||||
]}`))
|
||||
default:
|
||||
t.Fatalf("unexpected Kubernetes API path %s", r.URL.String())
|
||||
@@ -42,8 +42,8 @@ func TestPhase37D2KubernetesNodeEvidenceEnrichesReadyAndBlockedNodes(t *testing.
|
||||
cluster := ClusterEvidence{
|
||||
CapturedAt: time.Date(2026, 6, 6, 12, 0, 0, 0, time.UTC),
|
||||
Nodes: []NodeEvidence{{
|
||||
NodeName: "m01",
|
||||
KubernetesNode: "m01",
|
||||
NodeName: "node-a",
|
||||
KubernetesNode: "node-a",
|
||||
LastHeartbeatAt: time.Date(2026, 6, 6, 11, 59, 0, 0, time.UTC),
|
||||
ReplicaCount: 1,
|
||||
}},
|
||||
@@ -56,32 +56,32 @@ func TestPhase37D2KubernetesNodeEvidenceEnrichesReadyAndBlockedNodes(t *testing.
|
||||
if len(enriched.Nodes) != 2 {
|
||||
t.Fatalf("nodes=%+v", enriched.Nodes)
|
||||
}
|
||||
m01 := nodeByKubernetesName(t, enriched.Nodes, "m01")
|
||||
if !m01.Ready || !m01.Schedulable || m01.InternalIP != "192.168.1.181" || m01.ReplicaCount != 1 {
|
||||
t.Fatalf("m01 evidence=%+v", m01)
|
||||
nodeA := nodeByKubernetesName(t, enriched.Nodes, "node-a")
|
||||
if !nodeA.Ready || !nodeA.Schedulable || nodeA.InternalIP != "192.168.1.181" || nodeA.ReplicaCount != 1 {
|
||||
t.Fatalf("nodeA evidence=%+v", nodeA)
|
||||
}
|
||||
status, reason := classifyNodeReadiness(m01)
|
||||
status, reason := classifyNodeReadiness(nodeA)
|
||||
if status != ManagedVolumeStatusReady || reason != ReasonNodeReady {
|
||||
t.Fatalf("m01 status=%s reason=%s", status, reason)
|
||||
t.Fatalf("nodeA status=%s reason=%s", status, reason)
|
||||
}
|
||||
m02 := nodeByKubernetesName(t, enriched.Nodes, "m02")
|
||||
if m02.Ready || m02.Schedulable {
|
||||
t.Fatalf("m02 raw facts=%+v", m02)
|
||||
nodeB := nodeByKubernetesName(t, enriched.Nodes, "node-b")
|
||||
if nodeB.Ready || nodeB.Schedulable {
|
||||
t.Fatalf("nodeB raw facts=%+v", nodeB)
|
||||
}
|
||||
status, reason = classifyNodeReadiness(m02)
|
||||
status, reason = classifyNodeReadiness(nodeB)
|
||||
if status != ManagedVolumeStatusUnknown || reason != ReasonNodeNotReady {
|
||||
t.Fatalf("m02 status=%s reason=%s", status, reason)
|
||||
t.Fatalf("nodeB status=%s reason=%s", status, reason)
|
||||
}
|
||||
if !conditionReason(m02.Conditions, ReasonNodeNotReady) || !conditionReason(m02.Conditions, ReasonNodeSchedulingDisabled) {
|
||||
t.Fatalf("m02 conditions=%+v", m02.Conditions)
|
||||
if !conditionReason(nodeB.Conditions, ReasonNodeNotReady) || !conditionReason(nodeB.Conditions, ReasonNodeSchedulingDisabled) {
|
||||
t.Fatalf("nodeB conditions=%+v", nodeB.Conditions)
|
||||
}
|
||||
assertCRDSafeNodeConditions(t, m02.Conditions)
|
||||
assertCRDSafeNodeConditions(t, nodeB.Conditions)
|
||||
}
|
||||
|
||||
func TestPhase37D2NodeNotReadyTakesPrecedenceOverCSIPodSymptoms(t *testing.T) {
|
||||
node := NodeEvidence{
|
||||
NodeName: "tp01",
|
||||
KubernetesNode: "tp01",
|
||||
NodeName: "node-c",
|
||||
KubernetesNode: "node-c",
|
||||
Ready: false,
|
||||
Schedulable: true,
|
||||
Conditions: []ObservationCondition{
|
||||
@@ -104,20 +104,20 @@ func TestPhase37D2KubernetesNodeEvidenceProjectsCSIRegistrationBlockers(t *testi
|
||||
switch r.URL.Path {
|
||||
case "/api/v1/nodes":
|
||||
_, _ = w.Write([]byte(`{"items":[
|
||||
{"metadata":{"name":"m01"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"m02"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}}
|
||||
{"metadata":{"name":"node-a"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"node-b"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}}
|
||||
]}`))
|
||||
case "/api/v1/namespaces/kube-system/pods":
|
||||
_, _ = w.Write([]byte(`{"items":[
|
||||
{"metadata":{"name":"csi-m01"},"spec":{"nodeName":"m01"},"status":{"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"csi-m02"},"spec":{"nodeName":"m02"},"status":{"conditions":[{"type":"Ready","status":"False"}]}}
|
||||
{"metadata":{"name":"csi-node-a"},"spec":{"nodeName":"node-a"},"status":{"conditions":[{"type":"Ready","status":"True"}]}},
|
||||
{"metadata":{"name":"csi-node-b"},"spec":{"nodeName":"node-b"},"status":{"conditions":[{"type":"Ready","status":"False"}]}}
|
||||
]}`))
|
||||
case "/apis/storage.k8s.io/v1/csidrivers/block.csi.seaweedfs.com":
|
||||
_, _ = w.Write([]byte(`{"metadata":{"name":"block.csi.seaweedfs.com"}}`))
|
||||
case "/apis/storage.k8s.io/v1/csinodes":
|
||||
_, _ = w.Write([]byte(`{"items":[
|
||||
{"metadata":{"name":"m01"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}},
|
||||
{"metadata":{"name":"m02"},"spec":{"drivers":[]}}
|
||||
{"metadata":{"name":"node-a"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}},
|
||||
{"metadata":{"name":"node-b"},"spec":{"drivers":[]}}
|
||||
]}`))
|
||||
default:
|
||||
t.Fatalf("unexpected Kubernetes API path %s", r.URL.String())
|
||||
@@ -130,21 +130,21 @@ func TestPhase37D2KubernetesNodeEvidenceProjectsCSIRegistrationBlockers(t *testi
|
||||
if err != nil {
|
||||
t.Fatalf("enrich: %v", err)
|
||||
}
|
||||
m02 := nodeByKubernetesName(t, enriched.Nodes, "m02")
|
||||
if !conditionReason(m02.Conditions, ReasonCSIDriverNotRegistered) || !conditionReason(m02.Conditions, ReasonCSINodePodNotReady) {
|
||||
t.Fatalf("m02 conditions=%+v", m02.Conditions)
|
||||
nodeB := nodeByKubernetesName(t, enriched.Nodes, "node-b")
|
||||
if !conditionReason(nodeB.Conditions, ReasonCSIDriverNotRegistered) || !conditionReason(nodeB.Conditions, ReasonCSINodePodNotReady) {
|
||||
t.Fatalf("nodeB conditions=%+v", nodeB.Conditions)
|
||||
}
|
||||
status, reason := classifyNodeReadiness(m02)
|
||||
status, reason := classifyNodeReadiness(nodeB)
|
||||
if status != ManagedVolumeStatusBlocked || reason != ReasonCSIDriverNotRegistered {
|
||||
t.Fatalf("m02 status=%s reason=%s conditions=%+v", status, reason, m02.Conditions)
|
||||
t.Fatalf("nodeB status=%s reason=%s conditions=%+v", status, reason, nodeB.Conditions)
|
||||
}
|
||||
crd := swBlockNodeStatuses([]NodeEvidence{m02})[0]
|
||||
crd := swBlockNodeStatuses([]NodeEvidence{nodeB})[0]
|
||||
if crd.Status != ManagedVolumeStatusBlocked || crd.ReasonCode != ReasonCSIDriverNotRegistered {
|
||||
t.Fatalf("CRD node status=%+v", crd)
|
||||
}
|
||||
assertCondition(t, crd.Conditions, ConditionReady, "False", ReasonCSIDriverNotRegistered)
|
||||
assertCondition(t, crd.Conditions, ConditionBlocked, "True", ReasonCSIDriverNotRegistered)
|
||||
if len(crd.EvidenceRefs) == 0 || !strings.Contains(strings.Join(crd.EvidenceRefs, ","), "kubernetes/csinode/m02") {
|
||||
if len(crd.EvidenceRefs) == 0 || !strings.Contains(strings.Join(crd.EvidenceRefs, ","), "kubernetes/csinode/node-b") {
|
||||
t.Fatalf("missing CRD evidence refs: %+v", crd.EvidenceRefs)
|
||||
}
|
||||
assertCRDSafeNodeConditions(t, crd.Conditions)
|
||||
@@ -154,13 +154,13 @@ func TestPhase37D2KubernetesNodeEvidenceProjectsMissingCSIDriver(t *testing.T) {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case "/api/v1/nodes":
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"m01"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}}]}`))
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"node-a"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}}]}`))
|
||||
case "/api/v1/namespaces/kube-system/pods":
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"csi-m01"},"spec":{"nodeName":"m01"},"status":{"conditions":[{"type":"Ready","status":"True"}]}}]}`))
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"csi-node-a"},"spec":{"nodeName":"node-a"},"status":{"conditions":[{"type":"Ready","status":"True"}]}}]}`))
|
||||
case "/apis/storage.k8s.io/v1/csidrivers/block.csi.seaweedfs.com":
|
||||
http.NotFound(w, r)
|
||||
case "/apis/storage.k8s.io/v1/csinodes":
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"m01"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}}]}`))
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"node-a"},"spec":{"drivers":[{"name":"block.csi.seaweedfs.com"}]}}]}`))
|
||||
default:
|
||||
t.Fatalf("unexpected Kubernetes API path %s", r.URL.String())
|
||||
}
|
||||
@@ -172,11 +172,11 @@ func TestPhase37D2KubernetesNodeEvidenceProjectsMissingCSIDriver(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("enrich: %v", err)
|
||||
}
|
||||
m01 := nodeByKubernetesName(t, enriched.Nodes, "m01")
|
||||
if status, reason := classifyNodeReadiness(m01); status != ManagedVolumeStatusBlocked || reason != ReasonCSIDriverNotRegistered {
|
||||
t.Fatalf("m01 status=%s reason=%s conditions=%+v", status, reason, m01.Conditions)
|
||||
nodeA := nodeByKubernetesName(t, enriched.Nodes, "node-a")
|
||||
if status, reason := classifyNodeReadiness(nodeA); status != ManagedVolumeStatusBlocked || reason != ReasonCSIDriverNotRegistered {
|
||||
t.Fatalf("nodeA status=%s reason=%s conditions=%+v", status, reason, nodeA.Conditions)
|
||||
}
|
||||
assertCRDSafeNodeConditions(t, m01.Conditions)
|
||||
assertCRDSafeNodeConditions(t, nodeA.Conditions)
|
||||
}
|
||||
|
||||
func TestPhase37D3KubernetesNodeEvidenceProjectsCSIImagePullBlocker(t *testing.T) {
|
||||
@@ -184,12 +184,12 @@ func TestPhase37D3KubernetesNodeEvidenceProjectsCSIImagePullBlocker(t *testing.T
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case "/api/v1/nodes":
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"m02"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}}]}`))
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"node-b"},"spec":{},"status":{"conditions":[{"type":"Ready","status":"True"}]}}]}`))
|
||||
case "/api/v1/namespaces/kube-system/pods":
|
||||
_, _ = w.Write([]byte(`{"items":[{
|
||||
"metadata":{"name":"sw-block-csi-node-m02"},
|
||||
"metadata":{"name":"sw-block-csi-node-b"},
|
||||
"spec":{
|
||||
"nodeName":"m02",
|
||||
"nodeName":"node-b",
|
||||
"initContainers":[{"image":"ghcr.io/seaweedfs/seaweed-block-csi:registrar"}],
|
||||
"containers":[{"image":"` + missingImage + `"}]
|
||||
},
|
||||
@@ -201,7 +201,7 @@ func TestPhase37D3KubernetesNodeEvidenceProjectsCSIImagePullBlocker(t *testing.T
|
||||
case "/apis/storage.k8s.io/v1/csidrivers/block.csi.seaweedfs.com":
|
||||
_, _ = w.Write([]byte(`{"metadata":{"name":"block.csi.seaweedfs.com"}}`))
|
||||
case "/apis/storage.k8s.io/v1/csinodes":
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"m02"},"spec":{"drivers":[]}}]}`))
|
||||
_, _ = w.Write([]byte(`{"items":[{"metadata":{"name":"node-b"},"spec":{"drivers":[]}}]}`))
|
||||
default:
|
||||
t.Fatalf("unexpected Kubernetes API path %s", r.URL.String())
|
||||
}
|
||||
@@ -213,7 +213,7 @@ func TestPhase37D3KubernetesNodeEvidenceProjectsCSIImagePullBlocker(t *testing.T
|
||||
if err != nil {
|
||||
t.Fatalf("enrich: %v", err)
|
||||
}
|
||||
node := nodeByKubernetesName(t, enriched.Nodes, "m02")
|
||||
node := nodeByKubernetesName(t, enriched.Nodes, "node-b")
|
||||
if len(node.MissingImages) != 1 || node.MissingImages[0] != missingImage {
|
||||
t.Fatalf("missing images=%+v", node.MissingImages)
|
||||
}
|
||||
@@ -233,7 +233,7 @@ func TestPhase37D3KubernetesNodeEvidenceProjectsCSIImagePullBlocker(t *testing.T
|
||||
}
|
||||
assertCondition(t, crd.Conditions, ConditionReady, "False", ReasonImageMissingOnNode)
|
||||
assertCondition(t, crd.Conditions, ConditionBlocked, "True", ReasonImageMissingOnNode)
|
||||
if !strings.Contains(strings.Join(crd.EvidenceRefs, ","), "kubernetes/pod/kube-system/sw-block-csi-node-m02") {
|
||||
if !strings.Contains(strings.Join(crd.EvidenceRefs, ","), "kubernetes/pod/kube-system/sw-block-csi-node-b") {
|
||||
t.Fatalf("missing pod evidence refs: %+v", crd.EvidenceRefs)
|
||||
}
|
||||
assertCRDSafeNodeConditions(t, crd.Conditions)
|
||||
|
||||
@@ -22,7 +22,7 @@ func TestManagedVolumeProjection_HealthyFirstVolumeReady(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
DurableFrontierKnown: true,
|
||||
@@ -30,7 +30,7 @@ func TestManagedVolumeProjection_HealthyFirstVolumeReady(t *testing.T) {
|
||||
FrontendAddr: "127.0.0.1:3260",
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "127.0.0.1:3260",
|
||||
}},
|
||||
Workload: &WorkloadCheckFact{
|
||||
@@ -161,7 +161,7 @@ func TestManagedVolumeProjection_BlocksMissingNVMeMultipath(t *testing.T) {
|
||||
FrontendNSID: 1,
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "/var/lib/kubelet/plugins/kubernetes.io/csi",
|
||||
}},
|
||||
Workload: &WorkloadCheckFact{
|
||||
@@ -220,18 +220,18 @@ func TestManagedVolumeProjection_LoopbackCrossNodeBlocked(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "127.0.0.1:3260",
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "127.0.0.1:3260",
|
||||
}},
|
||||
PodMounts: []PodMountFact{{
|
||||
PodName: "writer",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Phase: "Pending",
|
||||
}},
|
||||
})
|
||||
@@ -271,7 +271,7 @@ func TestManagedVolumeProjection_NVMeLoopbackCrossNodeBlocked(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendProtocol: "nvme",
|
||||
@@ -280,12 +280,12 @@ func TestManagedVolumeProjection_NVMeLoopbackCrossNodeBlocked(t *testing.T) {
|
||||
FrontendNSID: 1,
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m01",
|
||||
NodeName: "node-a",
|
||||
Target: "127.0.0.1:4420",
|
||||
}},
|
||||
PodMounts: []PodMountFact{{
|
||||
PodName: "writer",
|
||||
NodeName: "m01",
|
||||
NodeName: "node-a",
|
||||
Phase: "Pending",
|
||||
}},
|
||||
})
|
||||
@@ -349,7 +349,7 @@ func TestManagedVolumeProjection_WriterFailedMountBlocked(t *testing.T) {
|
||||
},
|
||||
PodMounts: []PodMountFact{{
|
||||
PodName: "writer",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Phase: "Pending",
|
||||
Reason: ReasonWriterMountFailed,
|
||||
Message: "MountVolume.MountDevice failed",
|
||||
@@ -374,7 +374,7 @@ func TestManagedVolumeProjection_CSINodeImagePullBlocked(t *testing.T) {
|
||||
Phase: "Bound",
|
||||
},
|
||||
KubernetesNodes: []KubernetesNodeFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Ready: true,
|
||||
CSINodeReady: false,
|
||||
Reason: ReasonCSINodeImagePullFailed,
|
||||
@@ -414,24 +414,24 @@ func TestManagedVolumeProjection_TransparentISCSIALUARecovered(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "unavailable",
|
||||
Observed: false,
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.184:3261",
|
||||
}, {
|
||||
ReplicaID: "r3",
|
||||
KubernetesNode: "tp01",
|
||||
KubernetesNode: "node-c",
|
||||
Role: "replica",
|
||||
Observed: true,
|
||||
}},
|
||||
HostPaths: []HostPathFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Protocol: "iscsi",
|
||||
Target: "192.168.1.184:3261",
|
||||
State: HostPathStateActiveOptimized,
|
||||
@@ -468,7 +468,7 @@ func TestManagedVolumeProjection_MissingMultipathBlocksTransparentClaim(t *testi
|
||||
PublishTarget: "192.168.1.184:3261",
|
||||
},
|
||||
HostPaths: []HostPathFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Protocol: "iscsi",
|
||||
Target: "192.168.1.184:3261",
|
||||
State: HostPathStateSinglePath,
|
||||
@@ -503,7 +503,7 @@ func TestManagedVolumeProjection_NVMeANASeamDoesNotInferTransparentRecovery(t *t
|
||||
PublishTarget: "10.0.0.1:4420",
|
||||
},
|
||||
HostPaths: []HostPathFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Protocol: "nvme",
|
||||
Target: "nqn.2026-05.io.seaweedfs:pvc-nvme",
|
||||
State: HostPathStateANAOptimized,
|
||||
@@ -530,19 +530,19 @@ func TestManagedVolumeProjection_FactOrderIndependent(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "unavailable",
|
||||
Observed: false,
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.184:3260",
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "192.168.1.184:3260",
|
||||
Reattach: true,
|
||||
}},
|
||||
@@ -569,11 +569,11 @@ func TestManagedVolumeProjection_ActionInvariantRefs(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{NodeName: "m02", Target: "127.0.0.1:3260"}},
|
||||
CSIStages: []CSIStageFact{{NodeName: "node-b", Target: "127.0.0.1:3260"}},
|
||||
})
|
||||
|
||||
action := findManagedVolumeAction(blocked.Actions, ManagedVolumeActionReinstallExternalISCSI)
|
||||
@@ -644,13 +644,13 @@ func TestManagedVolumeProjection_NodeLossReattachRecovered(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "unavailable",
|
||||
Observed: false,
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
DurableFrontierKnown: true,
|
||||
@@ -658,14 +658,14 @@ func TestManagedVolumeProjection_NodeLossReattachRecovered(t *testing.T) {
|
||||
FrontendAddr: "192.168.1.184:3260",
|
||||
}, {
|
||||
ReplicaID: "r3",
|
||||
KubernetesNode: "tp01",
|
||||
KubernetesNode: "node-c",
|
||||
Role: "replica",
|
||||
Observed: true,
|
||||
DurableFrontierKnown: true,
|
||||
DurableFrontierLSN: 52,
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
EndpointVersion: 1,
|
||||
@@ -709,7 +709,7 @@ func TestManagedVolumeProjection_ReturnedPreviousPrimaryStaysFrontendFenced(t *t
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "replica",
|
||||
ReplicationRole: "ready",
|
||||
@@ -722,7 +722,7 @@ func TestManagedVolumeProjection_ReturnedPreviousPrimaryStaysFrontendFenced(t *t
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
DurableFrontierKnown: true,
|
||||
@@ -777,7 +777,7 @@ func TestManagedVolumeProjection_ReturnedReplicaFailbackActionAfterAckEligibilit
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
DurableFrontierKnown: true,
|
||||
@@ -843,19 +843,19 @@ func TestManagedVolumeProjection_InvalidDualPrimaryBeatsReady(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.181:3260",
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.184:3260",
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "192.168.1.181:3260",
|
||||
}},
|
||||
Workload: &WorkloadCheckFact{
|
||||
|
||||
@@ -30,7 +30,7 @@ func TestObservationBundle_RendersNodeLossRecoveryStory(t *testing.T) {
|
||||
{
|
||||
ReplicaID: "r1",
|
||||
ServerID: "node-loss-r1",
|
||||
NodeName: "m01",
|
||||
NodeName: "node-a",
|
||||
Observed: true,
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.181:3260",
|
||||
@@ -42,7 +42,7 @@ func TestObservationBundle_RendersNodeLossRecoveryStory(t *testing.T) {
|
||||
{
|
||||
ReplicaID: "r2",
|
||||
ServerID: "node-loss-r2",
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Observed: true,
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.184:3260",
|
||||
@@ -64,7 +64,7 @@ func TestObservationBundle_RendersNodeLossRecoveryStory(t *testing.T) {
|
||||
{
|
||||
ReplicaID: "r3",
|
||||
ServerID: "node-loss-r3",
|
||||
NodeName: "tp01",
|
||||
NodeName: "node-c",
|
||||
Observed: true,
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.188:3260",
|
||||
@@ -87,9 +87,9 @@ func TestObservationBundle_RendersNodeLossRecoveryStory(t *testing.T) {
|
||||
"node_loss_recovery_summary_version=1",
|
||||
"result=promoted",
|
||||
"ack_profile=sync-quorum",
|
||||
"before_primary=r1@m01",
|
||||
"failed=r1@m01",
|
||||
"promoted=r2@m02",
|
||||
"before_primary=r1@node-a",
|
||||
"failed=r1@node-a",
|
||||
"promoted=r2@node-b",
|
||||
"before_frontend=192.168.1.181:3260",
|
||||
"after_frontend=192.168.1.184:3260",
|
||||
"pod_recreate_used=true",
|
||||
@@ -111,7 +111,7 @@ func TestObservationBundle_RendersNodeLossRecoveryStory(t *testing.T) {
|
||||
text := RenderObservationExplainText(cluster)
|
||||
for _, want := range []string{
|
||||
"volume pvc-node-loss status=ok rf=3 ack=sync-quorum",
|
||||
"primary r2 on m02 frontend=192.168.1.184:3260",
|
||||
"primary r2 on node-b frontend=192.168.1.184:3260",
|
||||
"CSI target changed 192.168.1.181:3260 -> 192.168.1.184:3260",
|
||||
"old primary stale I/O success count is 0",
|
||||
"timeline:",
|
||||
@@ -133,7 +133,7 @@ func TestObservationBundle_RendersNodeLossRecoveryStory(t *testing.T) {
|
||||
func TestObservationBundle_RendersImagePullBlockedStoryWithoutInventory(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mustWrite(t, filepath.Join(dir, "demo", KubeSystemPodsDeploysArtifact), `NAME READY STATUS RESTARTS AGE IP NODE
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 m02
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 node-b
|
||||
deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:local`)
|
||||
|
||||
cluster, err := BuildObservationFromBundle(ObservationBundleOptions{Dir: dir, VolumeID: "pvc-blocked"})
|
||||
@@ -144,7 +144,7 @@ deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:loca
|
||||
for _, want := range []string{
|
||||
"cluster status=blocked volumes=1 nodes=0",
|
||||
"volume pvc-blocked status=blocked rf=3 reason=csi_node_image_pull_failed",
|
||||
"waiting=ImagePullBackOff on node m02 image sw-block-csi:local",
|
||||
"waiting=ImagePullBackOff on node node-b image sw-block-csi:local",
|
||||
"next action: import sw-block-csi:local to the blocked node",
|
||||
} {
|
||||
if !strings.Contains(text, want) {
|
||||
@@ -211,7 +211,7 @@ func TestObservationBundle_ReplaysReturnedReplicaProjection(t *testing.T) {
|
||||
RequiredFrontierLSN: 52,
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "replica",
|
||||
ReplicationRole: "ready",
|
||||
@@ -222,7 +222,7 @@ func TestObservationBundle_ReplaysReturnedReplicaProjection(t *testing.T) {
|
||||
SupportBundlePath: "returned-replica-summary.txt",
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
DurableFrontierKnown: true,
|
||||
@@ -280,7 +280,7 @@ func TestObservationBundle_ReturnedReplicaProjectionIsVolumeScoped(t *testing.T)
|
||||
RequiredFrontierLSN: 42,
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "a-r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "previous_primary",
|
||||
ReplicationRole: "replica_ready",
|
||||
@@ -290,7 +290,7 @@ func TestObservationBundle_ReturnedReplicaProjectionIsVolumeScoped(t *testing.T)
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "a-r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
Healthy: true,
|
||||
@@ -312,7 +312,7 @@ func TestObservationBundle_ReturnedReplicaProjectionIsVolumeScoped(t *testing.T)
|
||||
EndpointVersion: 1,
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "b-r1",
|
||||
KubernetesNode: "tp01",
|
||||
KubernetesNode: "node-c",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
Healthy: true,
|
||||
@@ -376,7 +376,7 @@ func TestObservationBundle_ManagedVolumeUsesPrimaryFailureArtifactHints(t *testi
|
||||
PublishTarget: "192.168.1.184:3261",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.184:3261",
|
||||
@@ -421,7 +421,7 @@ func TestObservationBundle_D7PrefersNewestRestartClusterEvidence(t *testing.T) {
|
||||
AckProfile: "sync-quorum",
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
Epoch: 1,
|
||||
}}
|
||||
@@ -434,7 +434,7 @@ func TestObservationBundle_D7PrefersNewestRestartClusterEvidence(t *testing.T) {
|
||||
AckProfile: "sync-quorum",
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
}}
|
||||
@@ -449,11 +449,11 @@ func TestObservationBundle_D7PrefersNewestRestartClusterEvidence(t *testing.T) {
|
||||
t.Fatalf("volumes=%+v", out.Volumes)
|
||||
}
|
||||
volume := out.Volumes[0]
|
||||
if volume.PrimaryReplica != "r2" || volume.PrimaryNode != "m02" || volume.PublishTarget != "192.168.1.184:3260" || volume.Epoch != 2 {
|
||||
if volume.PrimaryReplica != "r2" || volume.PrimaryNode != "node-b" || volume.PublishTarget != "192.168.1.184:3260" || volume.Epoch != 2 {
|
||||
t.Fatalf("expected post-restart evidence, got %+v", volume)
|
||||
}
|
||||
summary := RenderObservationReportSummary(out)
|
||||
if !strings.Contains(summary, "primary=r2@m02 frontend=192.168.1.184:3260") {
|
||||
if !strings.Contains(summary, "primary=r2@node-b frontend=192.168.1.184:3260") {
|
||||
t.Fatalf("summary used stale primary:\n%s", summary)
|
||||
}
|
||||
}
|
||||
@@ -533,20 +533,20 @@ func TestObservationBundle_CarriesHostPrereqEvidenceIntoNodeStatus(t *testing.T)
|
||||
dir := t.TempDir()
|
||||
cluster := NewClusterEvidence(time.Date(2026, 6, 8, 13, 0, 0, 0, time.UTC))
|
||||
cluster.Nodes = []NodeEvidence{{
|
||||
NodeName: "m02",
|
||||
KubernetesNode: "m02",
|
||||
NodeName: "node-b",
|
||||
KubernetesNode: "node-b",
|
||||
Ready: true,
|
||||
Schedulable: true,
|
||||
}, {
|
||||
NodeName: "tp01",
|
||||
KubernetesNode: "tp01",
|
||||
NodeName: "node-c",
|
||||
KubernetesNode: "node-c",
|
||||
Ready: true,
|
||||
Schedulable: true,
|
||||
}}
|
||||
writeClusterEvidenceArtifact(t, filepath.Join(dir, "status", ClusterEvidenceArtifact), cluster)
|
||||
mustWrite(t, filepath.Join(dir, "host", ObservationHostPrereqArtifact), strings.Join([]string{
|
||||
"node=m02 iscsi_prereq=missing multipath_prereq=ok command_iscsiadm=missing",
|
||||
"node=tp01 iscsi_prereq=ok multipath_prereq=missing command_multipath=missing",
|
||||
"node=node-b iscsi_prereq=missing multipath_prereq=ok command_iscsiadm=missing",
|
||||
"node=node-c iscsi_prereq=ok multipath_prereq=missing command_multipath=missing",
|
||||
}, "\n"))
|
||||
|
||||
out, err := BuildObservationFromBundle(ObservationBundleOptions{Dir: dir})
|
||||
@@ -559,16 +559,16 @@ func TestObservationBundle_CarriesHostPrereqEvidenceIntoNodeStatus(t *testing.T)
|
||||
}
|
||||
if snapshot.Cluster.Nodes[0].Status != ManagedVolumeStatusBlocked ||
|
||||
snapshot.Cluster.Nodes[0].ReasonCode != ReasonISCSIPrereqMissing {
|
||||
t.Fatalf("m02 node=%+v", snapshot.Cluster.Nodes[0])
|
||||
t.Fatalf("node-b node=%+v", snapshot.Cluster.Nodes[0])
|
||||
}
|
||||
if snapshot.Cluster.Nodes[1].Status != ManagedVolumeStatusBlocked ||
|
||||
snapshot.Cluster.Nodes[1].ReasonCode != ReasonMultipathPrereqMissing {
|
||||
t.Fatalf("tp01 node=%+v", snapshot.Cluster.Nodes[1])
|
||||
t.Fatalf("node-c node=%+v", snapshot.Cluster.Nodes[1])
|
||||
}
|
||||
summary := RenderObservationReportSummary(out)
|
||||
for _, want := range []string{
|
||||
"node=m02 k8s=m02 status=blocked reason=iscsi_prereq_missing",
|
||||
"node=tp01 k8s=tp01 status=blocked reason=multipath_prereq_missing",
|
||||
"node=node-b k8s=node-b status=blocked reason=iscsi_prereq_missing",
|
||||
"node=node-c k8s=node-c status=blocked reason=multipath_prereq_missing",
|
||||
} {
|
||||
if !strings.Contains(summary, want) {
|
||||
t.Fatalf("summary missing %q:\n%s", want, summary)
|
||||
@@ -585,11 +585,11 @@ func TestObservationBundle_CarriesUnsupportedLoopbackAttachIntoManagedStatus(t *
|
||||
ReplicationFactor: 1,
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "127.0.0.1:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "127.0.0.1:3260",
|
||||
@@ -597,8 +597,8 @@ func TestObservationBundle_CarriesUnsupportedLoopbackAttachIntoManagedStatus(t *
|
||||
}})
|
||||
mustWrite(t, filepath.Join(dir, "demo", ObservationLoopbackAttachArtifact), strings.Join([]string{
|
||||
"issue=unsupported_cross_node_loopback_attach",
|
||||
"app_node=m02",
|
||||
"blockvolume_node=m01",
|
||||
"app_node=node-b",
|
||||
"blockvolume_node=node-a",
|
||||
"frontend=127.0.0.1:3260",
|
||||
"volume_id=pvc-loopback",
|
||||
"replica_id=r1",
|
||||
@@ -655,7 +655,7 @@ func TestObservationBundle_CarriesUnsupportedLoopbackAttachIntoManagedStatus(t *
|
||||
|
||||
summary := RenderObservationReportSummary(cluster)
|
||||
for _, want := range []string{
|
||||
"volume=pvc-loopback status=blocked pvc=default/demo-pvc primary=r1@m01 frontend=127.0.0.1:3260",
|
||||
"volume=pvc-loopback status=blocked pvc=default/demo-pvc primary=r1@node-a frontend=127.0.0.1:3260",
|
||||
"managed_volume=pvc-loopback status=blocked reason=publish_target_loopback_cross_node",
|
||||
"managed_volume_condition=Ready status=False reason=publish_target_loopback_cross_node severity=warning",
|
||||
"managed_volume_action=safe_k8s.reinstall_external_iscsi mode=dry_run side_effect=safe_k8s executor=installer_or_operator decision=allowed",
|
||||
@@ -695,11 +695,11 @@ func TestObservationBundle_DeleteSafetyBlocksWithResidue(t *testing.T) {
|
||||
ReplicationFactor: 1,
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "192.168.1.181:3260",
|
||||
@@ -780,11 +780,11 @@ func TestObservationBundle_DeleteSafetyUnknownWithoutCleanupEvidence(t *testing.
|
||||
ReplicationFactor: 1,
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "192.168.1.181:3260",
|
||||
@@ -843,11 +843,11 @@ func TestObservationBundle_DeleteSafetyUnknownWithStaleCleanupEvidence(t *testin
|
||||
ReplicationFactor: 1,
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "192.168.1.181:3260",
|
||||
@@ -912,11 +912,11 @@ func TestObservationBundle_DeleteSafetyReleasableWithCleanCleanupEvidence(t *tes
|
||||
ReplicationFactor: 1,
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "192.168.1.181:3260",
|
||||
@@ -973,7 +973,7 @@ func TestObservationBundle_LoopbackAttachTargetsNamedVolume(t *testing.T) {
|
||||
PVCName: "pvc-a",
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
},
|
||||
{
|
||||
@@ -982,14 +982,14 @@ func TestObservationBundle_LoopbackAttachTargetsNamedVolume(t *testing.T) {
|
||||
PVCName: "pvc-b",
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "127.0.0.1:3260",
|
||||
},
|
||||
})
|
||||
mustWrite(t, filepath.Join(dir, "demo", ObservationLoopbackAttachArtifact), strings.Join([]string{
|
||||
"issue=unsupported_cross_node_loopback_attach",
|
||||
"app_node=m02",
|
||||
"blockvolume_node=m01",
|
||||
"app_node=node-b",
|
||||
"blockvolume_node=node-a",
|
||||
"frontend=127.0.0.1:3260",
|
||||
"volume_id=pvc-b",
|
||||
"replica_id=r1",
|
||||
@@ -1023,11 +1023,11 @@ func TestManagedVolumeFactsFromEvidence_AllowsSameNodeLoopback(t *testing.T) {
|
||||
PVCName: "demo-pvc",
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "127.0.0.1:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "127.0.0.1:3260",
|
||||
@@ -1060,7 +1060,7 @@ func TestObservationBundle_D6ReplayGate_FirstVolumeBlockedAndRecovery(t *testing
|
||||
name: "blocked-image-pull",
|
||||
build: func(t *testing.T, dir string) {
|
||||
mustWrite(t, filepath.Join(dir, "demo", KubeSystemPodsDeploysArtifact), `NAME READY STATUS RESTARTS AGE IP NODE
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 m02
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 node-b
|
||||
deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:local`)
|
||||
},
|
||||
wantStatus: ManagedVolumeStatusBlocked,
|
||||
@@ -1088,7 +1088,7 @@ deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:loca
|
||||
PublishTarget: "192.168.1.184:3261",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.184:3261",
|
||||
@@ -1182,7 +1182,7 @@ func TestObservationBundle_DashboardReplayGate_FirstVolumeBlockedAndRecovery(t *
|
||||
name: "blocked-image-pull",
|
||||
build: func(t *testing.T, dir string) {
|
||||
mustWrite(t, filepath.Join(dir, "demo", KubeSystemPodsDeploysArtifact), `NAME READY STATUS RESTARTS AGE IP NODE
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 m02
|
||||
pod/sw-block-csi-node-n948t 0/2 Init:ErrImagePull 0 2m3s 192.168.1.184 node-b
|
||||
deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:local`)
|
||||
},
|
||||
wantHTML: ReasonCSINodeImagePullFailed,
|
||||
@@ -1212,7 +1212,7 @@ deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:loca
|
||||
PublishTarget: "192.168.1.184:3261",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
FrontendAddr: "192.168.1.184:3261",
|
||||
@@ -1347,7 +1347,7 @@ func writeStatusEndpointUnreachableInventory(t *testing.T, dir string) {
|
||||
Replicas: []VolumeInventoryReplicaInput{{
|
||||
ReplicaID: "r1",
|
||||
ServerID: "node-r1",
|
||||
NodeName: "m01",
|
||||
NodeName: "node-a",
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.181:3260",
|
||||
StatusAddress: "192.168.1.181:23260",
|
||||
|
||||
@@ -13,8 +13,8 @@ func TestObservation_RenderHealthyVolumeTextAndJSON(t *testing.T) {
|
||||
text := RenderVolumeEvidenceText(volume)
|
||||
for _, want := range []string{
|
||||
"volume pvc-healthy status=ok rf=3 ack=sync-quorum",
|
||||
"primary r1 on m01 frontend=192.168.1.181:3260",
|
||||
"r2 m02 unknown replica_ready durable_lsn=44 candidate_ready=true",
|
||||
"primary r1 on node-a frontend=192.168.1.181:3260",
|
||||
"r2 node-b unknown replica_ready durable_lsn=44 candidate_ready=true",
|
||||
"next action: none",
|
||||
} {
|
||||
if !strings.Contains(text, want) {
|
||||
@@ -50,14 +50,14 @@ func TestObservation_RenderRecoveringNodeLossStory(t *testing.T) {
|
||||
Status: ObservationStatusRecovering,
|
||||
Reason: ReasonPrimaryNodeLost,
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
EndpointVersion: 1,
|
||||
Replicas: []ReplicaEvidence{
|
||||
{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "unavailable",
|
||||
ReplicationRole: "unavailable",
|
||||
StalePrimaryFenced: true,
|
||||
@@ -71,7 +71,7 @@ func TestObservation_RenderRecoveringNodeLossStory(t *testing.T) {
|
||||
},
|
||||
{
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
ReplicationRole: "none",
|
||||
DurableFrontierKnown: true,
|
||||
@@ -91,8 +91,8 @@ func TestObservation_RenderRecoveringNodeLossStory(t *testing.T) {
|
||||
text := RenderVolumeEvidenceText(volume)
|
||||
for _, want := range []string{
|
||||
"volume pvc-recovering status=recovering rf=3 ack=sync-quorum reason=primary_node_lost",
|
||||
"primary r2 on m02 frontend=192.168.1.184:3260",
|
||||
"r1 m01 unavailable unavailable stale_primary_fenced=true",
|
||||
"primary r2 on node-b frontend=192.168.1.184:3260",
|
||||
"r1 node-a unavailable unavailable stale_primary_fenced=true",
|
||||
"condition Recovery severity=info reason=primary_node_lost CSI target changed 192.168.1.181:3260 -> 192.168.1.184:3260",
|
||||
"next action: wait for app pod readiness, then collect support bundle if stuck",
|
||||
} {
|
||||
@@ -106,8 +106,8 @@ func TestObservation_RenderBlockedImagePullStory(t *testing.T) {
|
||||
cluster := NewClusterEvidence(time.Date(2026, 5, 16, 16, 3, 6, 0, time.UTC))
|
||||
cluster.Status = ObservationStatusBlocked
|
||||
cluster.Nodes = []NodeEvidence{{
|
||||
NodeName: "m02",
|
||||
KubernetesNode: "m02",
|
||||
NodeName: "node-b",
|
||||
KubernetesNode: "node-b",
|
||||
InternalIP: "192.168.1.184",
|
||||
Schedulable: true,
|
||||
Ready: true,
|
||||
@@ -118,7 +118,7 @@ func TestObservation_RenderBlockedImagePullStory(t *testing.T) {
|
||||
Status: "false",
|
||||
Reason: ReasonImageMissingOnNode,
|
||||
Severity: "error",
|
||||
Message: "node m02 missing image sw-block-csi:local",
|
||||
Message: "node node-b missing image sw-block-csi:local",
|
||||
}},
|
||||
}}
|
||||
cluster.Volumes = []VolumeEvidence{{
|
||||
@@ -135,7 +135,7 @@ func TestObservation_RenderBlockedImagePullStory(t *testing.T) {
|
||||
Severity: "error",
|
||||
Message: "pod kube-system/sw-block-csi-node-abc waiting=ImagePullBackOff",
|
||||
}},
|
||||
NextActions: []string{"import the image to m02 or use a registry reachable by all nodes"},
|
||||
NextActions: []string{"import the image to node-b or use a registry reachable by all nodes"},
|
||||
}}
|
||||
|
||||
text := RenderClusterEvidenceText(cluster)
|
||||
@@ -143,7 +143,7 @@ func TestObservation_RenderBlockedImagePullStory(t *testing.T) {
|
||||
"cluster status=blocked volumes=1 nodes=1",
|
||||
"volume pvc-blocked status=blocked rf=3 reason=csi_node_image_pull_failed",
|
||||
"condition Attach severity=error reason=csi_node_image_pull_failed pod kube-system/sw-block-csi-node-abc waiting=ImagePullBackOff",
|
||||
"next action: import the image to m02 or use a registry reachable by all nodes",
|
||||
"next action: import the image to node-b or use a registry reachable by all nodes",
|
||||
} {
|
||||
if !strings.Contains(text, want) {
|
||||
t.Fatalf("text missing %q:\n%s", want, text)
|
||||
@@ -202,14 +202,14 @@ func healthyObservationVolume() VolumeEvidence {
|
||||
ObservedReplicas: 3,
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "192.168.1.181:3260",
|
||||
Epoch: 1,
|
||||
EndpointVersion: 1,
|
||||
Replicas: []ReplicaEvidence{
|
||||
{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "primary",
|
||||
ReplicationRole: "none",
|
||||
DurableFrontierKnown: true,
|
||||
@@ -217,7 +217,7 @@ func healthyObservationVolume() VolumeEvidence {
|
||||
},
|
||||
{
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "unknown",
|
||||
ReplicationRole: "replica_ready",
|
||||
DurableFrontierKnown: true,
|
||||
@@ -227,7 +227,7 @@ func healthyObservationVolume() VolumeEvidence {
|
||||
},
|
||||
{
|
||||
ReplicaID: "r3",
|
||||
KubernetesNode: "tp01",
|
||||
KubernetesNode: "node-c",
|
||||
Role: "unknown",
|
||||
ReplicationRole: "replica_ready",
|
||||
DurableFrontierKnown: true,
|
||||
|
||||
@@ -94,11 +94,11 @@ func TestOperatorFoundationSnapshot_BlockedVolumeCarriesWarningEvent(t *testing.
|
||||
Status: ObservationStatusBlocked,
|
||||
Reason: ReasonPublishTargetLoopbackCrossNode,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m01",
|
||||
PrimaryNode: "node-a",
|
||||
PublishTarget: "127.0.0.1:3260",
|
||||
Replicas: []ReplicaEvidence{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendAddr: "127.0.0.1:3260",
|
||||
@@ -154,16 +154,16 @@ func TestOperatorFoundationSnapshot_CountsStaleEvidenceVolumes(t *testing.T) {
|
||||
func TestOperatorFoundationSnapshot_IncludesNodeReadiness(t *testing.T) {
|
||||
cluster := NewClusterEvidence(time.Date(2026, 6, 5, 16, 30, 0, 0, time.UTC))
|
||||
cluster.Nodes = []NodeEvidence{{
|
||||
NodeName: "m02",
|
||||
KubernetesNode: "m02",
|
||||
NodeName: "node-b",
|
||||
KubernetesNode: "node-b",
|
||||
InternalIP: "192.168.1.184",
|
||||
Schedulable: true,
|
||||
Ready: true,
|
||||
ReplicaCount: 1,
|
||||
RequiredImages: []string{"sw-block:local"},
|
||||
}, {
|
||||
NodeName: "tp01",
|
||||
KubernetesNode: "tp01",
|
||||
NodeName: "node-c",
|
||||
KubernetesNode: "node-c",
|
||||
InternalIP: "192.168.1.188",
|
||||
Schedulable: true,
|
||||
Ready: true,
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestPhase32D3ReadyStatusSurfacesAgree(t *testing.T) {
|
||||
AckProfile: "best-effort",
|
||||
Status: ObservationStatusOK,
|
||||
PrimaryReplica: "r1",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "127.0.0.1:3260",
|
||||
Epoch: 1,
|
||||
EndpointVersion: 1,
|
||||
@@ -38,7 +38,7 @@ func TestPhase32D3ReadyStatusSurfacesAgree(t *testing.T) {
|
||||
Epoch: 1,
|
||||
EndpointVersion: 1,
|
||||
},
|
||||
CSIStages: []CSIStageFact{{NodeName: "m02", Target: "127.0.0.1:3260"}},
|
||||
CSIStages: []CSIStageFact{{NodeName: "node-b", Target: "127.0.0.1:3260"}},
|
||||
Workload: &WorkloadCheckFact{WriterVerified: true, ReaderVerified: true},
|
||||
EvidenceRefs: []string{"writer.log", "reader.log"},
|
||||
})}
|
||||
@@ -104,7 +104,7 @@ func TestPhase32D4BlockedStatusSurfacesAgree(t *testing.T) {
|
||||
PVCName: "demo-pvc",
|
||||
PVC: &PVCFact{Phase: "Bound"},
|
||||
KubernetesNodes: []KubernetesNodeFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Ready: true,
|
||||
Schedulable: true,
|
||||
CSINodeReady: false,
|
||||
@@ -178,7 +178,7 @@ func TestPhase32D5RestartPromotionStatusSurfacesAgree(t *testing.T) {
|
||||
Status: ObservationStatusOK,
|
||||
Reason: "authority_persisted",
|
||||
PrimaryReplica: "r2",
|
||||
PrimaryNode: "m02",
|
||||
PrimaryNode: "node-b",
|
||||
PublishTarget: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
EndpointVersion: 1,
|
||||
@@ -202,13 +202,13 @@ func TestPhase32D5RestartPromotionStatusSurfacesAgree(t *testing.T) {
|
||||
},
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r1",
|
||||
KubernetesNode: "m01",
|
||||
KubernetesNode: "node-a",
|
||||
Role: "unavailable",
|
||||
Observed: false,
|
||||
StalePrimaryFenced: true,
|
||||
}, {
|
||||
ReplicaID: "r2",
|
||||
KubernetesNode: "m02",
|
||||
KubernetesNode: "node-b",
|
||||
Role: "primary",
|
||||
Observed: true,
|
||||
DurableFrontierKnown: true,
|
||||
@@ -216,14 +216,14 @@ func TestPhase32D5RestartPromotionStatusSurfacesAgree(t *testing.T) {
|
||||
FrontendAddr: "192.168.1.184:3260",
|
||||
}, {
|
||||
ReplicaID: "r3",
|
||||
KubernetesNode: "tp01",
|
||||
KubernetesNode: "node-c",
|
||||
Role: "replica",
|
||||
Observed: true,
|
||||
DurableFrontierKnown: true,
|
||||
DurableFrontierLSN: 52,
|
||||
}},
|
||||
CSIStages: []CSIStageFact{{
|
||||
NodeName: "m02",
|
||||
NodeName: "node-b",
|
||||
Target: "192.168.1.184:3260",
|
||||
Epoch: 2,
|
||||
EndpointVersion: 1,
|
||||
@@ -235,7 +235,7 @@ func TestPhase32D5RestartPromotionStatusSurfacesAgree(t *testing.T) {
|
||||
|
||||
summary := RenderObservationReportSummary(cluster)
|
||||
for _, want := range []string{
|
||||
"volume=pvc-restart status=ok pvc=default/demo-pvc primary=r2@m02 frontend=192.168.1.184:3260 rf=3 ack=sync-quorum",
|
||||
"volume=pvc-restart status=ok pvc=default/demo-pvc primary=r2@node-b frontend=192.168.1.184:3260 rf=3 ack=sync-quorum",
|
||||
"managed_volume=pvc-restart status=recovered reason=csi_reattach_recovered",
|
||||
"managed_volume_condition=Ready status=True reason=csi_reattach_recovered severity=info",
|
||||
"managed_volume_condition=Recovered status=True reason=csi_reattach_recovered severity=info",
|
||||
@@ -261,9 +261,9 @@ func TestPhase32D5RestartPromotionStatusSurfacesAgree(t *testing.T) {
|
||||
func TestPhase32D6MultiVolumeStatusSurfacesKeepVolumesIndependent(t *testing.T) {
|
||||
cluster := NewClusterEvidence(time.Date(2026, 5, 25, 22, 15, 0, 0, time.UTC))
|
||||
cluster.Volumes = []VolumeEvidence{
|
||||
phase32VolumeEvidence("pvc-a", "app-a", "r1", "m01", "192.168.1.181:3260"),
|
||||
phase32VolumeEvidence("pvc-b", "app-b", "r2", "m02", "192.168.1.184:3260"),
|
||||
phase32VolumeEvidence("pvc-c", "app-c", "r3", "tp01", "192.168.1.188:3260"),
|
||||
phase32VolumeEvidence("pvc-a", "app-a", "r1", "node-a", "192.168.1.181:3260"),
|
||||
phase32VolumeEvidence("pvc-b", "app-b", "r2", "node-b", "192.168.1.184:3260"),
|
||||
phase32VolumeEvidence("pvc-c", "app-c", "r3", "node-c", "192.168.1.188:3260"),
|
||||
}
|
||||
cluster.ManagedVolumes = []ManagedVolumeProjection{
|
||||
phase32ReadyManagedProjection("pvc-a", "app-a", "r1", "192.168.1.181:3260"),
|
||||
@@ -298,9 +298,9 @@ func TestPhase32D6MultiVolumeStatusSurfacesKeepVolumesIndependent(t *testing.T)
|
||||
|
||||
summary := RenderObservationReportSummary(cluster)
|
||||
for _, want := range []string{
|
||||
"volume=pvc-a status=ok pvc=default/app-a primary=r1@m01 frontend=192.168.1.181:3260 rf=3 ack=sync-quorum",
|
||||
"volume=pvc-b status=ok pvc=default/app-b primary=r2@m02 frontend=192.168.1.184:3260 rf=3 ack=sync-quorum",
|
||||
"volume=pvc-c status=ok pvc=default/app-c primary=r3@tp01 frontend=192.168.1.188:3260 rf=3 ack=sync-quorum",
|
||||
"volume=pvc-a status=ok pvc=default/app-a primary=r1@node-a frontend=192.168.1.181:3260 rf=3 ack=sync-quorum",
|
||||
"volume=pvc-b status=ok pvc=default/app-b primary=r2@node-b frontend=192.168.1.184:3260 rf=3 ack=sync-quorum",
|
||||
"volume=pvc-c status=ok pvc=default/app-c primary=r3@node-c frontend=192.168.1.188:3260 rf=3 ack=sync-quorum",
|
||||
} {
|
||||
if !strings.Contains(summary, want) {
|
||||
t.Fatalf("summary missing %q:\n%s", want, summary)
|
||||
|
||||
@@ -326,7 +326,7 @@ func TestAFreshStoreAtLevelOneRunsNoUpgradePass(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// A store created at level 1 is born v1.1 (r2.882): its compare record is
|
||||
// A store created at level 1 is born v1.1: its compare record is
|
||||
// written as done, so a restart before its first cut (no longer created
|
||||
// this start) runs no pass either and its first cut is not held.
|
||||
func TestAStoreCreatedAtLevelOneNeverRunsTheUpgradePass(t *testing.T) {
|
||||
|
||||
@@ -55,7 +55,7 @@ func (l *chunkLayerImpl) openChunkRecordV11() (*chunkRecordShadow, error) {
|
||||
seed := &upgradeSeed{proof: l.cfg.CleanStop, head: l.head, ref: l.headRef, zero: l.zeroChunkSum()}
|
||||
err = upgradeChunkRecordSeeded(l.ctx, s, epoch, seed, l.attachProgress.add)
|
||||
}
|
||||
// A store this start created is born v1.1 (r2.882): there is nothing to
|
||||
// A store this start created is born v1.1: there is nothing to
|
||||
// compare (every chunk known-zero or absent), so its compare record is
|
||||
// written as done and the upgrade pass never runs for it, on this start
|
||||
// or a later one. A crash before this write leaves the upgrade's first
|
||||
|
||||
@@ -28,7 +28,7 @@ func chunkRecordStateCode(k chunkkernel.Kind) (uint8, error) {
|
||||
|
||||
// kindByCode is chunkRecordKind for a code the runtime itself stored (every
|
||||
// one valid): the record keeps each chunk's state as its one-byte page code,
|
||||
// not the kernel's string (16 B a chunk; r2.735).
|
||||
// not the kernel's string (16 B a chunk).
|
||||
var kindByCode = [6]chunkkernel.Kind{1: chunkkernel.Absent, 2: chunkkernel.Partial, 3: chunkkernel.Unknown, 4: chunkkernel.HashUnpublished, 5: chunkkernel.HashPublished}
|
||||
|
||||
func chunkRecordKind(code uint8) (chunkkernel.Kind, error) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
var errRefBeyondVolume = errors.New("storage: chunk reference beyond the volume")
|
||||
|
||||
// refTable is the holder's copy of the references HEAD names, one entry a
|
||||
// chunk, in fixed width (r2.777): what the flat chunk map held, without a
|
||||
// chunk, in fixed width: what the flat chunk map held, without a
|
||||
// per-entry key string or map overhead. It sits behind a narrow interface
|
||||
// (Get, Set, Delete, FillSegment, Len) so that a paged form can replace it
|
||||
// without touching its readers.
|
||||
@@ -37,7 +37,7 @@ type refTable struct {
|
||||
const prefixOther = ^uint16(0)
|
||||
|
||||
// chunkRefs is the narrow interface the layer reads HEAD's references
|
||||
// through (r2.777): a paged form can replace refTable behind it without
|
||||
// through: a paged form can replace refTable behind it without
|
||||
// touching a reader. Get, Set and Delete are O(1); FillSegment is O(its
|
||||
// range); Len is O(1).
|
||||
type chunkRefs interface {
|
||||
|
||||
@@ -141,7 +141,7 @@ func TestSpaceMeasurementControls(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// The SPACE baseline (V4-B PR 4's red, r2.736/r2.777): the holder's heap per
|
||||
// The SPACE baseline (V4-B PR 4's red): the holder's heap per
|
||||
// chunk for a 1 TiB volume's chunk count (262,144; one-block chunks, which
|
||||
// TestSpaceMeasurementControls shows stand for 4 MiB ones), every chunk
|
||||
// named by HEAD with canonical keys owned by the layer, after GC once the
|
||||
|
||||
@@ -13,7 +13,7 @@ It is intentionally small:
|
||||
- iSCSI mount into a pod
|
||||
- CSI `DeleteVolume` cleanup path exercised by the alpha smoke harness
|
||||
|
||||
The verified lab path is M02 single-node k3s. Treat this as an alpha MVP for
|
||||
The verified lab path is a single-node k3s cluster. Treat this as an alpha MVP for
|
||||
evaluation and contributor onboarding, not production storage.
|
||||
|
||||
## Current Storage Path
|
||||
|
||||
@@ -123,7 +123,7 @@ side payloads and preservation of other-prefix files/directories.
|
||||
## Backend proxy result
|
||||
|
||||
The source-identical `BenchmarkCutCOWProxy` was run parent/candidate interleaved
|
||||
three times, each row with three cuts, on tp04 (i7-13700, Go reports GOMAXPROCS
|
||||
three times, each row with three cuts, on a lab host (i7-13700, Go reports GOMAXPROCS
|
||||
24; actual work stays under the runner's quota). Parent is main d0e3895a plus
|
||||
only the benchmark, ref 3faecbd4. Candidate timing head is ee6c6f3b. Staging is
|
||||
disabled, copy/upload concurrency is 8, chunks are 4 MiB and each released
|
||||
|
||||
@@ -5,7 +5,7 @@ the common admission callback sampled `s.wal`, the legacy writer. V3 appends go
|
||||
to `s.v3.w`, so the inactive legacy occupancy stayed zero. A real provider and
|
||||
NVMe handler writing 128 KiB requests with Flush every 48 MiB hit WRITE
|
||||
InternalError / WAL region full at 66,977,792 submitted bytes. The same schedule
|
||||
reproduced on root WSL and non-root tp04. The preceding Flush and a direct Sync
|
||||
reproduced on root WSL and as non-root on a Linux lab host. The preceding Flush and a direct Sync
|
||||
after the failed Write succeeded. This does not establish the cause of the
|
||||
reported guest SyncAll EIO; a host fsync error is not by itself an observed
|
||||
backend Sync error.
|
||||
|
||||
@@ -398,11 +398,11 @@ Example healthy shape:
|
||||
```text
|
||||
volume pvc-... status=ok rf=3 ack=sync-quorum
|
||||
pvc default/mysql-data
|
||||
primary r1 on m01 frontend=192.168.1.181:3260
|
||||
primary r1 on node-a frontend=192.168.1.181:3260
|
||||
replicas desired=3 observed=3
|
||||
r1 m01 primary ready durable_lsn=44
|
||||
r2 m02 replica_ready candidate_ready=true durable_lsn=44
|
||||
r3 tp01 replica_ready candidate_ready=true durable_lsn=44
|
||||
r1 node-a primary ready durable_lsn=44
|
||||
r2 node-b replica_ready candidate_ready=true durable_lsn=44
|
||||
r3 node-c replica_ready candidate_ready=true durable_lsn=44
|
||||
next action: none
|
||||
```
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ normalization only. Those are prior author runs, not a claim that this PR reran
|
||||
TLC. This is an abstraction: physical fsync success, byte layout, crash recovery,
|
||||
both-slot retirement, timing and multiple writers remain covered by their other
|
||||
models and actual Go controls. Do not treat finite liveness checking as an
|
||||
end-to-end wall-clock latency guarantee. Keep long model runs off tp04.
|
||||
end-to-end wall-clock latency guarantee. Keep long model runs off the shared CI runner.
|
||||
|
||||
## HostBudget
|
||||
|
||||
|
||||
Reference in new issue
Block a user