mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
ops: classify unreachable status evidence
This commit is contained in:
1 parent
eb8e80d177
commit
d89e10f989
5 files changed
+73
-5
No files matched your search
@@ -121,6 +121,30 @@ func TestManagedVolumeProjection_EvidenceStaleIsNotReady(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestManagedVolumeProjection_StatusEndpointUnreachableIsNotReady(t *testing.T) {
|
||||
projection := ProjectManagedVolume(ManagedVolumeFacts{
|
||||
VolumeID: "pvc-unreachable",
|
||||
ProductStatus: ObservationStatusUnavailable,
|
||||
ProductReason: ReasonStatusEndpointUnreachable,
|
||||
EvidenceRefs: []string{"ops-inventory/volume-inventory.json"},
|
||||
})
|
||||
|
||||
ready := findObservationCondition(projection.Conditions, "Ready")
|
||||
stale := findObservationCondition(projection.Conditions, "EvidenceStale")
|
||||
if ready == nil || stale == nil {
|
||||
t.Fatalf("conditions=%+v", projection.Conditions)
|
||||
}
|
||||
if ready.Status != "Unknown" || ready.Reason != ReasonStatusEndpointUnreachable || ready.Severity != "warning" {
|
||||
t.Fatalf("ready=%+v", ready)
|
||||
}
|
||||
if stale.Status != "True" || stale.Reason != ReasonStatusEndpointUnreachable || stale.Severity != "warning" {
|
||||
t.Fatalf("stale=%+v", stale)
|
||||
}
|
||||
if projection.Status != ManagedVolumeStatusUnknown || projection.ReasonCode != ReasonStatusEndpointUnreachable {
|
||||
t.Fatalf("projection=%+v", projection)
|
||||
}
|
||||
}
|
||||
|
||||
func findObservationCondition(conditions []ObservationCondition, conditionType string) *ObservationCondition {
|
||||
for i := range conditions {
|
||||
if conditions[i].Type == conditionType {
|
||||
|
||||
@@ -541,6 +541,9 @@ func classifyManagedVolume(p ManagedVolumeProjection, facts ManagedVolumeFacts)
|
||||
if facts.EvidenceStale || facts.ProductReason == ReasonEvidenceStale {
|
||||
return ManagedVolumeStatusUnknown, defaultString(facts.EvidenceStaleReason, ReasonEvidenceStale)
|
||||
}
|
||||
if facts.ProductReason == ReasonStatusEndpointUnreachable {
|
||||
return ManagedVolumeStatusUnknown, ReasonStatusEndpointUnreachable
|
||||
}
|
||||
if p.States.HostPath == ManagedVolumeHostPathTransparentReady &&
|
||||
facts.Workload != nil &&
|
||||
facts.Workload.WriterVerified &&
|
||||
@@ -744,7 +747,7 @@ func managedVolumeConditionsForProjection(p ManagedVolumeProjection) []Observati
|
||||
Message: "insufficient managed volume facts",
|
||||
EvidenceRefs: append([]string(nil), p.EvidenceRefs...),
|
||||
}}
|
||||
if reason == ReasonEvidenceStale {
|
||||
if reason == ReasonEvidenceStale || reason == ReasonStatusEndpointUnreachable {
|
||||
conditions[0].Severity = "warning"
|
||||
conditions[0].Message = "managed volume evidence is stale or unreachable; readiness is not claimed"
|
||||
conditions = append(conditions, ObservationCondition{
|
||||
|
||||
@@ -350,6 +350,42 @@ deployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:loca
|
||||
wantReason: ReasonCSINodeImagePullFailed,
|
||||
wantEvent: "Warning",
|
||||
},
|
||||
{
|
||||
name: "status-endpoint-unreachable",
|
||||
build: func(t *testing.T, dir string) {
|
||||
inventoryDir := filepath.Join(dir, "demo", "ops-inventory-status-unreachable")
|
||||
inventory := BuildVolumeInventory(VolumeInventoryInput{
|
||||
CapturedAt: time.Date(2026, 5, 27, 12, 0, 0, 0, time.UTC),
|
||||
Source: ReportSource{Component: "component-test"},
|
||||
ProductRevision: "product-rev",
|
||||
Volumes: []VolumeInventoryVolumeInput{{
|
||||
VolumeID: "pvc-unreachable",
|
||||
Namespace: "default",
|
||||
PVCName: "demo-pvc",
|
||||
PVName: "pvc-unreachable",
|
||||
ReplicationFactor: 1,
|
||||
Replicas: []VolumeInventoryReplicaInput{{
|
||||
ReplicaID: "r1",
|
||||
ServerID: "node-r1",
|
||||
NodeName: "m01",
|
||||
Protocol: "iscsi",
|
||||
FrontendAddress: "192.168.1.181:3260",
|
||||
StatusAddress: "192.168.1.181:23260",
|
||||
Observed: true,
|
||||
AuthorityRole: "primary",
|
||||
Healthy: true,
|
||||
FrontendPrimaryReady: true,
|
||||
ReplicationRole: "none",
|
||||
Issues: []string{"status_endpoint_unreachable=192.168.1.181:23260"},
|
||||
}},
|
||||
}},
|
||||
})
|
||||
mustWriteInventory(t, inventoryDir, inventory)
|
||||
},
|
||||
wantStatus: ManagedVolumeStatusUnknown,
|
||||
wantReason: ReasonStatusEndpointUnreachable,
|
||||
wantEvent: "Warning",
|
||||
},
|
||||
{
|
||||
name: "stage2-recovery",
|
||||
build: func(t *testing.T, dir string) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Current Plan: Phase 33 - TestOps Failure Hardening
|
||||
|
||||
Status: active, 35% complete. Started on 2026-05-27.
|
||||
Status: active, 45% complete. Started on 2026-05-27.
|
||||
|
||||
Branch: `phase33-testops-failure-hardening`
|
||||
|
||||
@@ -78,11 +78,13 @@ no broad HA claim added
|
||||
|
||||
Goal: reduce shell gymnastics and make failed runs self-explaining.
|
||||
|
||||
Status: in progress, first helper landed.
|
||||
Status: in progress, failure snapshot helper and unreachable status projection
|
||||
landed.
|
||||
|
||||
Artifact:
|
||||
|
||||
- `scripts/collect-k8s-failure-snapshot.sh`
|
||||
- `core/ops/managed_volume_model.go`
|
||||
|
||||
P0 items:
|
||||
|
||||
@@ -184,5 +186,8 @@ release claims updated or explicitly unchanged
|
||||
- 30%: D2 failure snapshot helper and contract test added.
|
||||
- 35%: F1 support-bundle diagnostics gate wired to collect the failure
|
||||
snapshot contract.
|
||||
- 45%: F2 status endpoint unreachable projection tightened to
|
||||
`status=unknown reason=status_endpoint_unreachable`; replay tests prove no
|
||||
false `Ready=True`.
|
||||
|
||||
Next step: D2 runner/helper hardening for the P0 gates.
|
||||
Next step: D3 negative status gates for live/scenario surface agreement.
|
||||
@@ -46,7 +46,7 @@ before the surface can exist:
|
||||
| ID | Failure Class | Trigger | Expected Status / Reason | Required Evidence | Cleanup Gate | Source / Scenario Shape | Priority |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| F1 | CSI node image pull failure | Install with invalid CSI image or missing local image import | `Blocked`, `Ready=False`, `reason=csi_node_image_pull_failed` | K8s pods/events, support bundle, report, operator snapshot, explain dry-run action | zero k8s/iSCSI/multipath/process residue after cleanup | Existing: `helm-support-bundle-diagnostics-chain.yaml`; harden as release gate | P0 |
|
||||
| F2 | Blockmaster/API unreachable | Stop or block access to `sw-blockmaster` before status/report capture | `Unknown` or `Blocked`, no `Ready=True`, reason `blockmaster_unreachable` or equivalent stable code | port-forward/log artifact, kubectl deploy/pod state, report/explain showing inability to prove readiness | cleanup still succeeds without master API | New negative scenario | P0 |
|
||||
| F2 | Blockmaster/API unreachable | Stop or block access to `sw-blockmaster` before status/report capture | `Unknown`, no `Ready=True`, reason `status_endpoint_unreachable` | port-forward/log artifact, kubectl deploy/pod state, report/explain showing inability to prove readiness | cleanup still succeeds without master API | Product projection test landed; live negative scenario still needed | P0 |
|
||||
| F3 | Evidence stale / reconverging snapshot | Replay bundle where newest evidence is post-restart but not fully reconverged | `Ready=Unknown`, reason `evidence_stale` or `unknown`; never false `Ready=True` | multiple cluster snapshots with timestamps, replay output, dashboard snapshot | replay-only; no live residue expected | Existing D7 replay behavior; convert to explicit scenario or component gate | P0 |
|
||||
| F4 | Corrupt or partial bundle evidence | Put corrupt `cluster-evidence.json` beside a newer valid snapshot, or remove optional artifacts | replay skips corrupt candidate; status comes from newest valid evidence; if none valid, fail with clear error | corrupt file, valid file, replay stderr/stdout, report artifacts | replay-only; no live residue expected | Component gate around `BuildObservationFromBundle` plus CLI replay test | P0 |
|
||||
| F5 | Cleanup residue after failed install/run | Intentionally leave iSCSI node DB, multipath map, or generated Deployment | cleanup status fails before scrub, then passes after cleanup; reason names residue class | `cleanup-summary.txt`, iSCSI nodes, multipath/dmsetup, k8s resources | all residue counters zero after final cleanup | Existing: `cleanup-residue-chain.yaml`; extend with residue-specific assertions | P0 |
|
||||
|
||||
Reference in new issue
Block a user