From e17e30b4aac72b62d2d546ff66f5fb74dda9971e Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 03:20:55 -0800 Subject: [PATCH 01/29] seaweed-block: keep only the runner scenarios this tree uses (#13418) Removes lab-only runner scenarios and suites from seaweed-block/, keeps the scenarios this tree's CI uses with environment placeholders, and guards every artifact-root use before any cleanup. Includes the maintainer's follow-ups from #13419 and #13423. Co-Authored-By: Claude Opus 5.5 --- .../wiki/deep-dives/iscsi-alua-multipath.md | 3 + .../docs/wiki/deep-dives/testops-authoring.md | 1 - seaweed-block/docs/wiki/testops-map.md | 3 + .../internal/docs/product-roadmap.md | 10 +- .../ref/testops-runner-binary-contract.md | 24 +- .../release_gate_artifact_root_test.go | 73 +++ ...-operation-milestone-release-readiness.ps1 | 155 ------ .../testops-artifact-root-guard-test.sh | 14 + .../testops-run-protocol-release-gate.ps1 | 19 +- .../testops-run-protocol-release-gate.sh | 14 +- .../scripts/testops_artifact_root_test.go | 190 +++++++ seaweed-block/scripts/uninstall-k8s-alpha.sh | 5 +- .../scripts/uninstall_k8s_alpha_test.go | 48 ++ seaweed-block/testops/README.md | 318 ++---------- .../ack-eligibility-publication-chain.yaml | 80 --- .../activation-day1-first-volume-chain.yaml | 77 +-- .../activation-day1-install-chain.yaml | 92 ++-- .../authority-executor-callsite-chain.yaml | 168 ------ ...authority-executor-http-runtime-chain.yaml | 128 ----- .../authority-executor-live-close-chain.yaml | 166 ------ .../authority-executor-multivolume-chain.yaml | 152 ------ .../authority-executor-negative-chain.yaml | 128 ----- .../authority-executor-rbac-chain.yaml | 72 --- ...ty-executor-rebuild-target-rbac-chain.yaml | 128 ----- ...ority-executor-runtime-callsite-chain.yaml | 136 ----- .../authority-executor-target-rbac-chain.yaml | 80 --- .../blockvolume-runtime-endpoint-chain.yaml | 96 ---- ...caught-up-publication-preflight-chain.yaml | 72 --- .../scenarios/cleanup-residue-chain.yaml | 88 ---- .../cluster-ops-inventory-chain.yaml | 340 ------------- .../csi-lifecycle-component-gate.yaml | 94 ---- .../csi-rf1-durable-restart-chain.yaml | 278 ---------- ...si-rf1-durable-restart-component-gate.yaml | 120 ----- ...csi-rf1-durable-restart-failure-chain.yaml | 140 ----- .../data-plane-address-capability-chain.yaml | 97 ---- .../failback-authority-callsite-chain.yaml | 115 ----- .../failback-authority-runtime-chain.yaml | 125 ----- .../failback-chart-runtime-chain.yaml | 106 ---- .../failback-deployed-grpc-smoke-chain.yaml | 88 ---- .../failback-deployed-suite-chain.yaml | 106 ---- .../failback-docs-alignment-chain.yaml | 60 --- .../failback-executor-boundary-chain.yaml | 115 ----- .../failback-executor-grpc-runtime-chain.yaml | 115 ----- ...failback-executor-policy-safety-chain.yaml | 97 ---- ...ack-frontend-publication-target-chain.yaml | 97 ---- ...ailback-frontend-workload-close-chain.yaml | 96 ---- ...rpc-runtime-endpoint-decoupling-chain.yaml | 87 ---- .../failback-handoff-isolation-chain.yaml | 79 --- .../failback-integrated-grpc-smoke-chain.yaml | 96 ---- .../failback-live-deployed-suite-chain.yaml | 124 ----- .../failback-runtime-contract-chain.yaml | 106 ---- .../scenarios/failback-service-rpc-chain.yaml | 115 ----- ...ilback-target-activation-policy-chain.yaml | 88 ---- .../failback-target-authority-chain.yaml | 88 ---- ...ailback-target-executor-handoff-chain.yaml | 88 ---- .../failback-target-owner-chain.yaml | 116 ----- ...end-publication-authority-owner-chain.yaml | 96 ---- ...d-publication-executor-boundary-chain.yaml | 96 ---- ...d-publication-executor-callsite-chain.yaml | 97 ---- ...d-publication-live-api-boundary-chain.yaml | 167 ------ .../frontend-publication-preflight-chain.yaml | 72 --- ...nd-publication-runtime-contract-chain.yaml | 131 ----- ...end-publication-target-contract-chain.yaml | 96 ---- .../scenarios/helm-first-volume-chain.yaml | 270 ---------- ...m-first-volume-via-sw-block-cli-chain.yaml | 234 --------- ...helm-lifecycle-upgrade-rollback-chain.yaml | 181 ------- .../helm-multi-volume-day1-chain.yaml | 172 ------- ...volume-rf3-interleaved-failover-chain.yaml | 303 ----------- ...lti-volume-rf3-mounted-failover-chain.yaml | 268 ---------- ...helm-multi-volume-rf3-readiness-chain.yaml | 205 -------- ...ti-volume-rf3-reattach-recovery-chain.yaml | 174 ------- ...-multi-volume-rf3-restart-smoke-chain.yaml | 212 -------- .../scenarios/helm-release-hygiene-chain.yaml | 112 ---- ...3-promotion-restart-persistence-chain.yaml | 481 ------------------ .../helm-single-node-first-volume-chain.yaml | 221 -------- ...single-node-restart-persistence-chain.yaml | 415 --------------- ...helm-support-bundle-diagnostics-chain.yaml | 272 ---------- .../iscsi-os-initiator-compat-chain.yaml | 137 ----- .../iscsi-p6-alua-failover-chain.yaml | 135 ++--- .../scenarios/iscsi-p8-compat-soak-chain.yaml | 93 ++-- .../iscsi-returned-replica-chain.yaml | 408 --------------- .../layout-realcluster-integration-gate.yaml | 304 ----------- .../lifecycle-owner-admission-gate-chain.yaml | 97 ---- .../lifecycle-owner-api-boundary-chain.yaml | 44 -- ...le-owner-delete-safety-decision-chain.yaml | 62 --- .../light-use-first-volume-breaks-chain.yaml | 190 ------- .../light-use-first-volume-chain.yaml | 194 ------- ...use-first-volume-failure-bundle-chain.yaml | 110 ++-- .../light-use-first-volume-retry-chain.yaml | 254 --------- ...master-failback-runtime-factory-chain.yaml | 97 ---- ...unted-failover-rf2-app-baseline-chain.yaml | 208 -------- ...d-failover-rf2-degraded-replica-chain.yaml | 234 --------- .../mounted-failover-rf2-placement-chain.yaml | 228 --------- ...f2-primary-failure-safe-refusal-chain.yaml | 296 ----------- ...ed-failover-rf2-promotion-ready-chain.yaml | 207 -------- ...failover-rf2-promotion-recovery-chain.yaml | 338 ------------ ...unted-failover-rf2-safe-refusal-chain.yaml | 218 -------- ...ilover-rf3-sync-quorum-recovery-chain.yaml | 338 ------------ ...node-loss-survival-rf3-reattach-chain.yaml | 217 ++++---- .../node-loss-topology-eligibility-chain.yaml | 289 ----------- .../scenarios/nvme-ana-baseline-chain.yaml | 71 --- .../nvme-ana-change-notice-chain.yaml | 93 ---- .../nvme-ana-change-notice-host-chain.yaml | 94 ---- .../scenarios/nvme-bounded-soak-chain.yaml | 112 ---- .../nvme-csi-multipath-component-chain.yaml | 63 --- .../nvme-csi-multipath-live-chain.yaml | 107 ---- .../nvme-k8s-mounted-restage-chain.yaml | 34 +- .../nvme-k8s-reconnect-owner-chain.yaml | 71 --- .../nvme-multihost-roce-preflight-chain.yaml | 79 --- .../nvme-p4-multipath-failover-chain.yaml | 117 +++-- .../scenarios/nvme-p5-csi-protocol-chain.yaml | 75 +-- .../nvme-p5-protocol-component-gate.yaml | 79 +-- .../nvme-path-failure-status-chain.yaml | 95 ---- ...me-rdma-k8s-multipath-reconnect-chain.yaml | 201 -------- .../nvme-rdma-k8s-publish-attach-chain.yaml | 85 ---- .../nvme-rdma-standalone-hardening-chain.yaml | 121 ----- .../nvme-rdma-standalone-live-chain.yaml | 89 ---- .../nvme-rdma-transport-seam-chain.yaml | 79 --- .../nvme-release-artifact-smoke-chain.yaml | 111 ---- .../nvme-stage-unstage-residue-chain.yaml | 112 ---- .../nvme-tcp-100gbe-baseline-chain.yaml | 127 ----- ...p-backend-write-instrumentation-chain.yaml | 119 ----- .../nvme-tcp-bottleneck-triage-chain.yaml | 111 ---- ...nvme-tcp-cross-node-live-attach-chain.yaml | 187 ------- ...ross-node-multivolume-isolation-chain.yaml | 182 ------- ...node-multivolume-lifecycle-soak-chain.yaml | 75 +-- .../nvme-tcp-cross-node-publish-chain.yaml | 95 ---- ...-durable-backend-write-batching-chain.yaml | 111 ---- ...p-frontend-request-size-profile-chain.yaml | 143 ------ ...vme-tcp-k8s-desired-path-change-chain.yaml | 162 ------ ...me-tcp-k8s-mounted-path-loss-io-chain.yaml | 122 ----- ...me-tcp-k8s-mounted-path-restore-chain.yaml | 154 ------ ...ivolume-mounted-path-churn-soak-chain.yaml | 138 ----- ...tivolume-mounted-path-isolation-chain.yaml | 154 ------ .../nvme-tcp-k8s-path-loss-crd-chain.yaml | 114 ----- .../nvme-tcp-k8s-reconnect-live-chain.yaml | 146 ------ .../nvme-tcp-k8s-stale-path-prune-chain.yaml | 178 ------- .../nvme-tcp-large-h2c-retriage-chain.yaml | 231 --------- .../nvme-tcp-max-h2c-boundary-chain.yaml | 143 ------ .../nvme-tcp-multihost-topology-chain.yaml | 95 ---- ...me-tcp-path-loss-status-surface-chain.yaml | 70 +-- .../nvme-tcp-performance-baseline-chain.yaml | 128 ----- .../nvme-tcp-post-batch-retriage-chain.yaml | 103 ---- ...p-reduce-wal-record-encode-copy-chain.yaml | 127 ----- .../nvme-tcp-release-image-smoke-chain.yaml | 139 ----- ...vme-tcp-status-surface-evidence-chain.yaml | 87 ++-- ...-tcp-target-backend-shape-split-chain.yaml | 143 ------ ...l-append-batch-shape-coalescing-chain.yaml | 119 ----- ...al-append-copy-checksum-profile-chain.yaml | 127 ----- ...cp-wal-append-large-h2c-profile-chain.yaml | 215 -------- ...-wal-encode-append-pair-profile-chain.yaml | 207 -------- ...ultiblock-head-lsn-confirmation-chain.yaml | 225 -------- ...-wal-multiblock-mounted-profile-chain.yaml | 175 ------- ...ltiblock-recovery-compatibility-chain.yaml | 217 -------- ...d-materialization-effectiveness-chain.yaml | 167 ------ ...ecord-materialization-reduction-chain.yaml | 175 ------- ...e-tcp-wal-writeat-shape-profile-chain.yaml | 119 ----- .../nvme-tcp-write-path-profile-chain.yaml | 119 ----- .../operations-status-diagnostics-chain.yaml | 109 ---- .../operations-volume-status-cli-gate.yaml | 239 --------- ...s-volume-status-report-component-gate.yaml | 257 ---------- ...operator-status-api-conformance-chain.yaml | 91 ---- .../rebuild-catchup-datapath-chain.yaml | 160 ------ .../rebuild-planning-close-chain.yaml | 112 ---- ...rebuild-runtime-target-contract-chain.yaml | 112 ---- .../rebuild-target-owner-rbac-chain.yaml | 96 ---- .../returned-replica-component-gate.yaml | 102 ---- ...urned-replica-failback-contract-chain.yaml | 96 ---- ...turned-replica-rebuild-contract-chain.yaml | 80 --- ...rned-replica-status-schema-rbac-chain.yaml | 120 ----- .../roce-live-io-feasibility-chain.yaml | 63 --- .../runtime-terminal-evidence-chain.yaml | 80 --- .../same-node-alpha-attach-chain.yaml | 234 --------- ...same-node-alpha-attach-negative-chain.yaml | 173 ------- ...2-iscsi-alua-multipath-baseline-chain.yaml | 163 +++--- ...2-iscsi-alua-multipath-failover-chain.yaml | 131 ++--- ...tatus-endpoint-unreachable-live-chain.yaml | 356 ------------- ...tus-endpoint-unreachable-replay-chain.yaml | 200 -------- .../swblockvolume-authority-facts-chain.yaml | 97 ---- .../testops/suites/beta-hardening-gate.yaml | 40 -- .../suites/nvme-release-artifact-smoke.yaml | 16 - .../suites/nvme-tcp-release-image-smoke.yaml | 17 - .../testops/suites/protocol-release-gate.yaml | 23 - 183 files changed, 1253 insertions(+), 23940 deletions(-) create mode 100644 seaweed-block/scripts/release_gate_artifact_root_test.go delete mode 100644 seaweed-block/scripts/run-operation-milestone-release-readiness.ps1 create mode 100644 seaweed-block/scripts/testops-artifact-root-guard-test.sh create mode 100644 seaweed-block/scripts/testops_artifact_root_test.go delete mode 100644 seaweed-block/testops/scenarios/ack-eligibility-publication-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-callsite-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-http-runtime-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-live-close-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-multivolume-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-negative-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-rbac-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-rebuild-target-rbac-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-runtime-callsite-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/authority-executor-target-rbac-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/blockvolume-runtime-endpoint-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/cleanup-residue-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/cluster-ops-inventory-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/csi-lifecycle-component-gate.yaml delete mode 100644 seaweed-block/testops/scenarios/csi-rf1-durable-restart-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/csi-rf1-durable-restart-component-gate.yaml delete mode 100644 seaweed-block/testops/scenarios/csi-rf1-durable-restart-failure-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/data-plane-address-capability-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-authority-callsite-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-authority-runtime-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-deployed-grpc-smoke-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-deployed-suite-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-docs-alignment-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-executor-boundary-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-executor-grpc-runtime-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-executor-policy-safety-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-frontend-publication-target-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-frontend-workload-close-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-grpc-runtime-endpoint-decoupling-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-handoff-isolation-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-integrated-grpc-smoke-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-live-deployed-suite-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-runtime-contract-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-service-rpc-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-target-activation-policy-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-target-authority-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-target-executor-handoff-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/failback-target-owner-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-authority-owner-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-executor-boundary-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-executor-callsite-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-live-api-boundary-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-runtime-contract-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/frontend-publication-target-contract-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-first-volume-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-first-volume-via-sw-block-cli-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-lifecycle-upgrade-rollback-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-multi-volume-day1-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-multi-volume-rf3-interleaved-failover-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-multi-volume-rf3-mounted-failover-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-multi-volume-rf3-readiness-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-multi-volume-rf3-reattach-recovery-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-multi-volume-rf3-restart-smoke-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-release-hygiene-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-rf3-promotion-restart-persistence-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-single-node-first-volume-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-single-node-restart-persistence-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/helm-support-bundle-diagnostics-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/iscsi-os-initiator-compat-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/iscsi-returned-replica-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/layout-realcluster-integration-gate.yaml delete mode 100644 seaweed-block/testops/scenarios/lifecycle-owner-admission-gate-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/lifecycle-owner-api-boundary-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/lifecycle-owner-delete-safety-decision-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/light-use-first-volume-breaks-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/light-use-first-volume-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/light-use-first-volume-retry-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/master-failback-runtime-factory-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-app-baseline-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-degraded-replica-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-placement-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-primary-failure-safe-refusal-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-ready-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-recovery-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf2-safe-refusal-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/mounted-failover-rf3-sync-quorum-recovery-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/node-loss-topology-eligibility-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-ana-baseline-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-ana-change-notice-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-ana-change-notice-host-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-bounded-soak-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-csi-multipath-component-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-csi-multipath-live-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-k8s-reconnect-owner-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-multihost-roce-preflight-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-path-failure-status-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-rdma-k8s-multipath-reconnect-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-rdma-k8s-publish-attach-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-rdma-standalone-hardening-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-rdma-standalone-live-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-rdma-transport-seam-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-release-artifact-smoke-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-stage-unstage-residue-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-100gbe-baseline-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-backend-write-instrumentation-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-bottleneck-triage-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-cross-node-live-attach-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-isolation-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-cross-node-publish-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-durable-backend-write-batching-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-frontend-request-size-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-desired-path-change-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-loss-io-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-restore-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-churn-soak-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-isolation-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-path-loss-crd-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-reconnect-live-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-k8s-stale-path-prune-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-large-h2c-retriage-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-max-h2c-boundary-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-multihost-topology-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-performance-baseline-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-post-batch-retriage-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-reduce-wal-record-encode-copy-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-release-image-smoke-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-target-backend-shape-split-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-append-batch-shape-coalescing-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-append-copy-checksum-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-append-large-h2c-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-encode-append-pair-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-mounted-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-recovery-compatibility-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-reduction-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-writeat-shape-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/nvme-tcp-write-path-profile-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/operations-status-diagnostics-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/operations-volume-status-cli-gate.yaml delete mode 100644 seaweed-block/testops/scenarios/operations-volume-status-report-component-gate.yaml delete mode 100644 seaweed-block/testops/scenarios/operator-status-api-conformance-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/rebuild-catchup-datapath-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/rebuild-planning-close-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/rebuild-runtime-target-contract-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/rebuild-target-owner-rbac-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/returned-replica-component-gate.yaml delete mode 100644 seaweed-block/testops/scenarios/returned-replica-failback-contract-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/returned-replica-rebuild-contract-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/returned-replica-status-schema-rbac-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/roce-live-io-feasibility-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/runtime-terminal-evidence-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/same-node-alpha-attach-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/same-node-alpha-attach-negative-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/status-endpoint-unreachable-live-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/status-endpoint-unreachable-replay-chain.yaml delete mode 100644 seaweed-block/testops/scenarios/swblockvolume-authority-facts-chain.yaml delete mode 100644 seaweed-block/testops/suites/beta-hardening-gate.yaml delete mode 100644 seaweed-block/testops/suites/nvme-release-artifact-smoke.yaml delete mode 100644 seaweed-block/testops/suites/nvme-tcp-release-image-smoke.yaml delete mode 100644 seaweed-block/testops/suites/protocol-release-gate.yaml diff --git a/seaweed-block/docs/wiki/deep-dives/iscsi-alua-multipath.md b/seaweed-block/docs/wiki/deep-dives/iscsi-alua-multipath.md index 54d755c583..8e614064a9 100644 --- a/seaweed-block/docs/wiki/deep-dives/iscsi-alua-multipath.md +++ b/seaweed-block/docs/wiki/deep-dives/iscsi-alua-multipath.md @@ -439,6 +439,9 @@ Use this checklist when changing the feature. | `same-node-alpha-attach-chain.yaml` | loopback same-node accepted path | | `same-node-alpha-attach-negative-chain.yaml` | cross-node loopback blocked as unsupported | +The last three run only against the project's lab and are kept in a private test repository; the first three +are in `testops/scenarios/`. + The runner must not pass a Stage 2 gate by grepping only lines it wrote itself. It needs independent evidence: pod UID, host sessions, multipath map, RTPG state, stale-I/O probe, and cleanup verifier. diff --git a/seaweed-block/docs/wiki/deep-dives/testops-authoring.md b/seaweed-block/docs/wiki/deep-dives/testops-authoring.md index 6da768fb5f..a8368d824a 100644 --- a/seaweed-block/docs/wiki/deep-dives/testops-authoring.md +++ b/seaweed-block/docs/wiki/deep-dives/testops-authoring.md @@ -85,7 +85,6 @@ Prefer gates that compare at least two surfaces: | Area | Path | |---|---| | scenario definitions | `testops/scenarios/` | -| suites | `testops/suites/` | | runner contracts | `internal/docs/ref/testops-runner-binary-contract.md` | | control/data contract | `internal/docs/ref/testops-control-data-contract.md` | | QA sign-offs | `internal/docs/qa-assignments/` | diff --git a/seaweed-block/docs/wiki/testops-map.md b/seaweed-block/docs/wiki/testops-map.md index 8d3cbb39c8..9f2f4feb23 100644 --- a/seaweed-block/docs/wiki/testops-map.md +++ b/seaweed-block/docs/wiki/testops-map.md @@ -27,6 +27,9 @@ injection. | Cleanup | `cleanup-residue-chain.yaml` and cleanup verifier | zero-residue contract | | Protocol | `iscsi-*`, `nvme-*` | frontend-specific gates | +Scenarios that run against the project's lab are kept in a private test repository. This repository keeps +the ones its own tests and scripts use; [testops/README.md](../../testops/README.md) lists them and the settings each needs. + ## Release Evidence Release claims should point to: diff --git a/seaweed-block/internal/docs/product-roadmap.md b/seaweed-block/internal/docs/product-roadmap.md index e4b25c6b92..b837d630e1 100644 --- a/seaweed-block/internal/docs/product-roadmap.md +++ b/seaweed-block/internal/docs/product-roadmap.md @@ -1164,11 +1164,11 @@ Approximate engineering effort if scope remains tight: baseline and corrects stale audit wording: ANA log/Identify/provider and CSI single-path NVMe stage/unstage are present. Phase 100 closed the Kubernetes CSI NVMe multipath attach follow-up for the supported lab path. -- Operation milestone release readiness is active and blocked only on matching - published images. Run `scripts/run-operation-milestone-release-readiness.ps1` - plus the published-image Day-1 smoke before marking the operation milestone - released. Development has moved ahead in parallel; this does not mark the - operation milestone released. +- Operation milestone release readiness is blocked only on matching published + images. Its readiness script ran against the project lab and is kept outside + this repository with the lab scenarios; run it and the published-image Day-1 + smoke there before marking the operation milestone released. Development has + moved ahead in parallel; this does not mark the operation milestone released. - Phase 100 Kubernetes CSI NVMe Multipath Attach is closed. It implements and gates the path from dynamic PVC `protocol=nvme` and `replicationFactor=2` to master NVMe frontend grouping, CSI `nvmeAddrs` publish context, NodeStage diff --git a/seaweed-block/internal/docs/ref/testops-runner-binary-contract.md b/seaweed-block/internal/docs/ref/testops-runner-binary-contract.md index a4425ebde3..aed5ff028c 100644 --- a/seaweed-block/internal/docs/ref/testops-runner-binary-contract.md +++ b/seaweed-block/internal/docs/ref/testops-runner-binary-contract.md @@ -88,25 +88,27 @@ Default output: Validate a product-owned scenario: ```bash -swblock validate testops/scenarios/csi-rf1-durable-restart-chain.yaml +swblock validate testops/scenarios/nvme-p5-protocol-component-gate.yaml ``` -Run a product-owned scenario against m02: +Run a product-owned scenario against a test node (every setting is required; +testops/README.md lists them): ```bash -swblock run testops/scenarios/csi-rf1-durable-restart-chain.yaml \ - --env product_root=/tmp/seaweed_block \ - --env ssh_key=C:/work/dev_server/testdev_key +swblock run testops/scenarios/nvme-p5-protocol-component-gate.yaml \ + --env product_root=/path/to/seaweed-block \ + --env node_host= \ + --env node_user= \ + --env ssh_key=/path/to/key \ + --env artifact_root=/path/to/shared/artifacts ``` -Run the full protocol release gate: +Run the full protocol release gate (the four protocol chains in order): ```bash -swblock suite \ - --results-dir /g15d-k8s/testops-runs/protocol-release-gate-native \ - --env product_root=/tmp/seaweed-block-nvme-p4l \ - --env ssh_key=C:/work/dev_server/testdev_key \ - C:/work/seaweed_block/testops/suites/protocol-release-gate.yaml +SW_BLOCK_SSH_KEY=/path/to/key SW_BLOCK_NODE_HOST= \ +SW_BLOCK_NODE_USER= SW_BLOCK_NODE_ARTIFACT_ROOT=/path/to/shared/artifacts \ + bash scripts/testops-run-protocol-release-gate.sh ``` Validate a finished protocol release gate bundle: diff --git a/seaweed-block/scripts/release_gate_artifact_root_test.go b/seaweed-block/scripts/release_gate_artifact_root_test.go new file mode 100644 index 0000000000..7620270597 --- /dev/null +++ b/seaweed-block/scripts/release_gate_artifact_root_test.go @@ -0,0 +1,73 @@ +package scripts_test + +import ( + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" +) + +func TestReleaseGateRefusesArtifactRootOutsideAllowlist(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("bash script") + } + bash, err := exec.LookPath("bash") + if err != nil { + t.Skip("bash not available") + } + script := filepath.Join(repoRoot(t), "scripts", "testops-run-protocol-release-gate.sh") + run := func(root string) (string, string, error) { + artifacts := filepath.Join(t.TempDir(), "gate") + cmd := exec.Command(bash, script, t.TempDir()) + cmd.Env = append(os.Environ(), + "SW_BLOCK_SSH_KEY=/k", + "SW_BLOCK_NODE_HOST=192.0.2.10", + "SW_BLOCK_NODE_USER=tester", + "SW_BLOCK_NODE_ARTIFACT_ROOT="+root, + "SW_BLOCK_ARTIFACT_DIR="+artifacts, + "SWBLOCK_CMD=/nonexistent-swblock", + ) + out, err := cmd.CombinedOutput() + return string(out), artifacts, err + } + const refusal = "must be an absolute path other than /" + marker := filepath.Join(t.TempDir(), "substituted") + for _, root := range []string{ + "/srv/test artifacts", + "/srv/test\tartifacts", + "/", + "relative/dir", + "/srv/*", + "/srv/'$(touch " + marker + ")'", + "/srv/x\n", + } { + out, artifacts, err := run(root) + if err == nil { + t.Fatalf("artifact root %q accepted; output:\n%s", root, out) + } + if !strings.Contains(out, refusal) { + t.Fatalf("artifact root %q: unexpected output:\n%s", root, out) + } + if _, err := os.Stat(artifacts); !os.IsNotExist(err) { + t.Fatalf("artifact root %q: %s created before the check (stat err %v)", root, artifacts, err) + } + } + if _, err := os.Stat(marker); !os.IsNotExist(err) { + t.Fatalf("a command substitution in the artifact root ran (stat err %v)", err) + } + if out, _, _ := run("/srv/evidence-2/block_v1.1"); strings.Contains(out, refusal) { + t.Fatalf("plain absolute artifact root refused:\n%s", out) + } + + ps, err := os.ReadFile(filepath.Join(repoRoot(t), "scripts", "testops-run-protocol-release-gate.ps1")) + if err != nil { + t.Fatal(err) + } + check := strings.Index(string(ps), `$NodeArtifactRoot -cnotmatch '^/[A-Za-z0-9._/-]+\z'`) + mkdir := strings.Index(string(ps), "New-Item -ItemType Directory") + if check < 0 || mkdir < 0 || check > mkdir { + t.Fatalf(".ps1 must refuse a NodeArtifactRoot outside the allowlist before it creates directories (check at %d, New-Item at %d)", check, mkdir) + } +} diff --git a/seaweed-block/scripts/run-operation-milestone-release-readiness.ps1 b/seaweed-block/scripts/run-operation-milestone-release-readiness.ps1 deleted file mode 100644 index 5591ca28a9..0000000000 --- a/seaweed-block/scripts/run-operation-milestone-release-readiness.ps1 +++ /dev/null @@ -1,155 +0,0 @@ -param( - [string]$ProductRoot = (Get-Location).Path, - [string]$ArtifactDir = "", - [string]$ReleaseImage = $env:SW_BLOCK_RELEASE_IMAGE, - [string]$ReleaseCSIImage = $env:SW_BLOCK_CSI_RELEASE_IMAGE -) - -$ErrorActionPreference = "Stop" - -if ([string]::IsNullOrWhiteSpace($ArtifactDir)) { - $stamp = (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmssZ") - $ArtifactDir = Join-Path $ProductRoot "results\operation-milestone-release-readiness-$stamp" -} - -New-Item -ItemType Directory -Force -Path $ArtifactDir | Out-Null - -$summary = Join-Path $ArtifactDir "operation-milestone-release-readiness-summary.txt" -$result = Join-Path $ArtifactDir "result.json" -Set-Content -Path $summary -Value "operation_milestone_release_readiness_status=running" - -function Add-Summary { - param([string]$Line) - Add-Content -Path $summary -Value $Line -} - -function Parse-ImageRef { - param([string]$Image) - if ($Image -match '^(?.+)@(?sha256:[0-9a-fA-F]+)$') { - return [ordered]@{ - repository = $Matches.repo - tag = "" - digest = $Matches.digest - } - } - $lastColon = $Image.LastIndexOf(':') - $lastSlash = $Image.LastIndexOf('/') - if ($lastColon -le $lastSlash) { - throw "image must include an explicit tag or digest: $Image" - } - return [ordered]@{ - repository = $Image.Substring(0, $lastColon) - tag = $Image.Substring($lastColon + 1) - digest = "" - } -} - -function Invoke-Step { - param( - [string]$Name, - [string]$FilePath, - [string[]]$Arguments - ) - $stdout = Join-Path $ArtifactDir "$Name.stdout.txt" - $stderr = Join-Path $ArtifactDir "$Name.stderr.txt" - $process = Start-Process -FilePath $FilePath -ArgumentList $Arguments -WorkingDirectory $ProductRoot -NoNewWindow -Wait -PassThru -RedirectStandardOutput $stdout -RedirectStandardError $stderr - if ($process.ExitCode -eq 0) { - Add-Summary "$Name=ok" - return $true - } - Add-Summary "$Name=failed" - return $false -} - -if ([string]::IsNullOrWhiteSpace($ReleaseImage) -or [string]::IsNullOrWhiteSpace($ReleaseCSIImage)) { - Add-Summary "operation_milestone_release_readiness_status=blocked_missing_release_images" - Add-Summary "required_env=SW_BLOCK_RELEASE_IMAGE,SW_BLOCK_CSI_RELEASE_IMAGE" - Add-Summary "example_SW_BLOCK_RELEASE_IMAGE=ghcr.io/seaweedfs/seaweed-block:sha-" - Add-Summary "example_SW_BLOCK_CSI_RELEASE_IMAGE=ghcr.io/seaweedfs/seaweed-block-csi:sha-" - [ordered]@{ - schema_version = "1.0" - scenario = "operation-milestone-release-readiness" - status = "blocked" - reason = "missing_release_images" - artifact_dir = $ArtifactDir - } | ConvertTo-Json -Depth 4 | Set-Content -Path $result - exit 2 -} - -$status = "ok" -$image = Parse-ImageRef $ReleaseImage -$csiImage = Parse-ImageRef $ReleaseCSIImage - -Add-Summary "release_image=$ReleaseImage" -Add-Summary "release_csi_image=$ReleaseCSIImage" - -if (-not (Invoke-Step -Name "docker_manifest_release_image" -FilePath "docker" -Arguments @("manifest", "inspect", $ReleaseImage))) { - $status = "failed" -} -if (-not (Invoke-Step -Name "docker_manifest_release_csi_image" -FilePath "docker" -Arguments @("manifest", "inspect", $ReleaseCSIImage))) { - $status = "failed" -} -if (-not (Invoke-Step -Name "go_test_release_scope" -FilePath "go" -Arguments @("test", "./core/ops", "./cmd/sw-block", "./cmd/blockcsi", "./cmd/blockmaster", "./cmd/blockvolume", "./scripts", "-count=1"))) { - $status = "failed" -} -if (-not (Invoke-Step -Name "helm_lint" -FilePath "helm" -Arguments @("lint", "charts/seaweed-block"))) { - $status = "failed" -} - -$templateArgs = @( - "template", "sw-block", "charts/seaweed-block", - "--namespace", "kube-system", - "--include-crds", - "--set", "image.repository=$($image.repository)", - "--set", "csiImage.repository=$($csiImage.repository)", - "--set", "image.pullPolicy=Always", - "--set", "csiImage.pullPolicy=Always", - "--set", "operatorStatus.create=true", - "--set", "operatorStatus.dryRun=false", - "--set", "lifecycleOwner.create=true", - "--set", "lifecycleOwner.dryRun=false", - "--set", "lifecycleOwner.admission.create=true" -) -if ($image.digest) { - $templateArgs += @("--set", "image.digest=$($image.digest)") -} else { - $templateArgs += @("--set", "image.tag=$($image.tag)") -} -if ($csiImage.digest) { - $templateArgs += @("--set", "csiImage.digest=$($csiImage.digest)") -} else { - $templateArgs += @("--set", "csiImage.tag=$($csiImage.tag)") -} - -if (-not (Invoke-Step -Name "helm_template_operation_components" -FilePath "helm" -Arguments $templateArgs)) { - $status = "failed" -} -if (-not (Invoke-Step -Name "validate_day1_published_image_scenario" -FilePath "C:\work\swblock.exe" -Arguments @("validate", "testops\scenarios\helm-first-volume-via-sw-block-cli-chain.yaml"))) { - $status = "failed" -} -if (-not (Invoke-Step -Name "validate_phase98_operation_close_scenario" -FilePath "C:\work\swblock.exe" -Arguments @("validate", "testops\scenarios\failback-frontend-workload-close-chain.yaml"))) { - $status = "failed" -} -if (-not (Invoke-Step -Name "git_diff_check" -FilePath "git" -Arguments @("diff", "--check"))) { - $status = "failed" -} - -Add-Summary "published_image_day1_lab_required=true" -Add-Summary "published_image_operator_lifecycle_lab_required=true" -Add-Summary "source_gated_phase98_regression_required=true" -Add-Summary "nvme_not_in_release_claim=true" -Add-Summary "operation_milestone_release_readiness_status=$status" - -[ordered]@{ - schema_version = "1.0" - scenario = "operation-milestone-release-readiness" - status = $status - release_image = $ReleaseImage - release_csi_image = $ReleaseCSIImage - artifact_dir = $ArtifactDir - lab_qa_required = $true -} | ConvertTo-Json -Depth 4 | Set-Content -Path $result - -if ($status -ne "ok") { - exit 1 -} diff --git a/seaweed-block/scripts/testops-artifact-root-guard-test.sh b/seaweed-block/scripts/testops-artifact-root-guard-test.sh new file mode 100644 index 0000000000..e995a57af3 --- /dev/null +++ b/seaweed-block/scripts/testops-artifact-root-guard-test.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Parse commands AND env parameters, then execute every complete guarded action +# with cleanup stubs. Requires Go and a POSIX shell; never contacts a cluster. +# Usage: bash scripts/testops-artifact-root-guard-test.sh [scenario dir] +set -euo pipefail +here=$(cd "$(dirname "$0")" && pwd) +dir=$(cd "${1:-$here/../testops/scenarios}" && pwd) +go_cmd=${GO:-go} +if [ "$("$go_cmd" env GOOS)" = windows ]; then + echo 'artifact-root controls require a POSIX Go runtime (for example, in WSL)' >&2 + exit 2 +fi +cd "$here/.." +TESTOPS_SCENARIO_DIR="$dir" "$go_cmd" test ./scripts -run '^TestTestopsArtifactRootGuards$' -count=1 diff --git a/seaweed-block/scripts/testops-run-protocol-release-gate.ps1 b/seaweed-block/scripts/testops-run-protocol-release-gate.ps1 index 04163809aa..2772303a64 100644 --- a/seaweed-block/scripts/testops-run-protocol-release-gate.ps1 +++ b/seaweed-block/scripts/testops-run-protocol-release-gate.ps1 @@ -1,14 +1,22 @@ param( [string]$ProductRepoRoot = (Get-Location).Path, - [string]$RunnerRoot = "C:\work\seaweedfs\learn\sw-test-runner-standalone", + [string]$RunnerRoot = "", [string]$RemoteProductRoot = "/tmp/seaweed-block-nvme-p4l", - [string]$SshKey = "C:\work\dev_server\testdev_key", + [Parameter(Mandatory = $true)][string]$SshKey, + [Parameter(Mandatory = $true)][string]$NodeHost, + [Parameter(Mandatory = $true)][string]$NodeUser, + [Parameter(Mandatory = $true)][string]$NodeArtifactRoot, [string]$ArtifactRoot = "", [string]$RunId = "" ) $ErrorActionPreference = "Stop" +# The scenarios put artifact_root into shell commands as raw text. +if ($NodeArtifactRoot -cnotmatch '^/[A-Za-z0-9._/-]+\z') { + throw "NodeArtifactRoot must be an absolute path other than / using only A-Za-z0-9._/-: $NodeArtifactRoot" +} + if ([string]::IsNullOrWhiteSpace($RunId)) { $RunId = "protocol-release-gate-" + (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmssZ") } @@ -23,7 +31,7 @@ $ProductCommit = "unknown" $RunnerCommit = "unknown" try { $ProductCommit = (& git -C $ProductRepoRoot rev-parse HEAD).Trim() } catch {} try { - if (Test-Path $RunnerRoot) { + if ($RunnerRoot -and (Test-Path $RunnerRoot)) { $RunnerCommit = (& git -C $RunnerRoot rev-parse HEAD).Trim() } } catch {} @@ -200,13 +208,16 @@ function Invoke-Chain { "run", "--env", "product_root=$RemoteProductRoot", "--env", "ssh_key=$SshKey", + "--env", "node_host=$NodeHost", + "--env", "node_user=$NodeUser", + "--env", "artifact_root=$NodeArtifactRoot", "--results-dir", $stepResults, $scenarioPath ) Set-Content -Path (Join-Path $stepDir "swblock.command.txt") -Value ("swblock " + ($swblockArgs -join " ")) $rc = 0 try { - if (Test-Path $RunnerRoot) { + if ($RunnerRoot -and (Test-Path $RunnerRoot)) { $rc = Invoke-NativeRedirect -FilePath "go" -Arguments (@("run", "./cmd/swblock") + $swblockArgs) -WorkingDirectory $RunnerRoot -StdoutPath $stdout -StderrPath $stderr } else { $rc = Invoke-NativeRedirect -FilePath "swblock" -Arguments $swblockArgs -WorkingDirectory $ProductRepoRoot -StdoutPath $stdout -StderrPath $stderr diff --git a/seaweed-block/scripts/testops-run-protocol-release-gate.sh b/seaweed-block/scripts/testops-run-protocol-release-gate.sh index 8844e2ab96..59f3ab41ee 100755 --- a/seaweed-block/scripts/testops-run-protocol-release-gate.sh +++ b/seaweed-block/scripts/testops-run-protocol-release-gate.sh @@ -6,7 +6,16 @@ RUN_ID="${SW_BLOCK_RUN_ID:-protocol-release-gate-$(date -u +%Y%m%dT%H%M%SZ)}" ARTIFACT_ROOT="${SW_BLOCK_ARTIFACT_DIR:-$ROOT/results/$RUN_ID}" RESULTS_ROOT="${SW_BLOCK_RESULTS_DIR:-$ARTIFACT_ROOT/runs}" REMOTE_PRODUCT_ROOT="${SW_BLOCK_REMOTE_PRODUCT_ROOT:-/tmp/seaweed-block-nvme-p4l}" -SSH_KEY="${SW_BLOCK_SSH_KEY:-C:\\work\\dev_server\\testdev_key}" +# The test node and its access: required, with no default host, user, key or share. +SSH_KEY="${SW_BLOCK_SSH_KEY:?set SW_BLOCK_SSH_KEY to the private key for the test node}" +NODE_HOST="${SW_BLOCK_NODE_HOST:?set SW_BLOCK_NODE_HOST to the test node address}" +NODE_USER="${SW_BLOCK_NODE_USER:?set SW_BLOCK_NODE_USER to the ssh user on the test node}" +NODE_ARTIFACT_ROOT="${SW_BLOCK_NODE_ARTIFACT_ROOT:?set SW_BLOCK_NODE_ARTIFACT_ROOT to the shared artifact directory on the test node}" +# The scenarios put artifact_root into shell commands as raw text. +if [[ ! "$NODE_ARTIFACT_ROOT" =~ ^/[A-Za-z0-9._/-]+$ ]]; then + echo "SW_BLOCK_NODE_ARTIFACT_ROOT must be an absolute path other than / using only A-Za-z0-9._/-: $NODE_ARTIFACT_ROOT" >&2 + exit 2 +fi SWBLOCK_CMD="${SWBLOCK_CMD:-swblock}" SWBLOCK_RUNNER_ROOT="${SWBLOCK_RUNNER_ROOT:-}" SUITE_STARTED_EPOCH="$(date -u +%s)" @@ -167,6 +176,9 @@ run_chain() { run_swblock run \ --env "product_root=$REMOTE_PRODUCT_ROOT" \ --env "ssh_key=$SSH_KEY" \ + --env "node_host=$NODE_HOST" \ + --env "node_user=$NODE_USER" \ + --env "artifact_root=$NODE_ARTIFACT_ROOT" \ --results-dir "$step_results" \ "$ROOT/$scenario" \ >"$step_dir/swblock.stdout.log" \ diff --git a/seaweed-block/scripts/testops_artifact_root_test.go b/seaweed-block/scripts/testops_artifact_root_test.go new file mode 100644 index 0000000000..a548e721c9 --- /dev/null +++ b/seaweed-block/scripts/testops_artifact_root_test.go @@ -0,0 +1,190 @@ +package scripts_test + +import ( + "context" + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "runtime" + "sort" + "strings" + "testing" + "time" + + "gopkg.in/yaml.v3" +) + +type artifactRootScenario struct { + Env map[string]string + Phases []struct { + Name string + Always bool + Actions []map[string]string + } +} + +// Exercise whole action copies, including the runner's quoted environment +// prefix. No real cleanup executable is reachable in the test's stub PATH. +func TestTestopsArtifactRootGuards(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("POSIX shell controls") + } + dir := os.Getenv("TESTOPS_SCENARIO_DIR") + if dir == "" { + dir = filepath.Join(repoRoot(t), "testops", "scenarios") + } + files, err := filepath.Glob(filepath.Join(dir, "*.yaml")) + if err != nil { + t.Fatal(err) + } + guarded, uninstalls := 0, 0 + for _, path := range files { + raw, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } + var scenario artifactRootScenario + if err := yaml.Unmarshal(raw, &scenario); err != nil { + t.Fatalf("%s: %v", path, err) + } + if _, exists := scenario.Env["artifact_root"]; !exists { + continue + } + for _, phase := range scenario.Phases { + for index, action := range phase.Actions { + cmd := action["cmd"] + if action["action"] != "exec" { + continue + } + usesRoot := strings.Contains(cmd, "{{ artifact_root }}") + for key, value := range action { + if strings.HasPrefix(key, "env.") && strings.Contains(value, "{{ artifact_root }}") { + usesRoot = true + } + } + needsGuard := usesRoot && (phase.Always || strings.Contains(cmd, "rm -") || strings.Contains(cmd, "case ")) + if !needsGuard { + continue + } + guarded++ + if phase.Always && strings.Contains(cmd, "uninstall-k8s-alpha.sh") { + uninstalls++ + } + name := fmt.Sprintf("%s/%s/%d", filepath.Base(path), phase.Name, index) + t.Run(name, func(t *testing.T) { checkArtifactRootAction(t, action) }) + } + } + } + if guarded < 24 || uninstalls != 6 { + t.Fatalf("coverage: guarded actions=%d, always uninstalls=%d; want >=24 and 6", guarded, uninstalls) + } +} + +func checkArtifactRootAction(t *testing.T, action map[string]string) { + t.Helper() + work := t.TempDir() + bin := filepath.Join(work, "bin") + if err := os.Mkdir(bin, 0o755); err != nil { + t.Fatal(err) + } + if _, overridesPath := action["env.PATH"]; overridesPath { + t.Fatal("cleanup controls must retain their stub-only PATH") + } + if err := os.Symlink("/bin/sh", filepath.Join(bin, "sh")); err != nil { + t.Fatal(err) + } + if err := os.Symlink("/bin/cat", filepath.Join(bin, "cat")); err != nil { + t.Fatal(err) + } + // Make the uncordon branch real in the supported-root control. + nodeFile := filepath.Join(work, "g15d-k8s", "guard-test-node-loss-survival", "demo", "cordoned-primary-node.txt") + if err := os.MkdirAll(filepath.Dir(nodeFile), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(nodeFile, []byte("node-test\n"), 0o644); err != nil { + t.Fatal(err) + } + trace := filepath.Join(work, "cleanup-started") + for _, name := range []string{"rm", "mkdir", "kubectl", "helm", "sudo", "nvme", "iscsiadm", "bash", "touch", "go"} { + stub := "#!/bin/sh\nprintf '%s %s\\n' '" + name + "' \"$*\" >> \"$GUARD_TRACE\"\nexit 0\n" + if err := os.WriteFile(filepath.Join(bin, name), []byte(stub), 0o755); err != nil { + t.Fatal(err) + } + } + bad := []string{"", "/", "relative/dir", "/srv/with space", "/srv/*", "/srv/x\n", "/srv/'$(touch injected)'", "/srv/x'; touch injected; '"} + for index, root := range bad { + t.Run(fmt.Sprintf("invalid-%d", index), func(t *testing.T) { + _ = os.Remove(trace) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, "bash", "-c", renderArtifactRootAction(action, root, work)) + cmd.Dir = work + cmd.Env = append(os.Environ(), "PATH="+bin, "GUARD_TRACE="+trace) + out, err := cmd.CombinedOutput() + if ctx.Err() != nil { + t.Fatalf("invalid-root control expired: %v; %s", ctx.Err(), out) + } + var exit *exec.ExitError + if !errors.As(err, &exit) { + t.Fatalf("invalid-root command did not complete with a refusal: %v; %s", err, out) + } + if exit.ExitCode() != 2 { + t.Errorf("invalid root %q: exit=%d want2; %s", root, exit.ExitCode(), out) + } + if raw, readErr := os.ReadFile(trace); readErr == nil || !os.IsNotExist(readErr) { + t.Fatalf("invalid root %q started cleanup: %q (read=%v)", root, raw, readErr) + } + }) + } + // A real supported path must reach the original action, not a blanket + // refusal. Every complete body must finish and leave a command witness. + _ = os.Remove(trace) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, "bash", "-c", renderArtifactRootAction(action, work, work)) + cmd.Dir = work + cmd.Env = append(os.Environ(), "PATH="+bin, "GUARD_TRACE="+trace) + out, err := cmd.CombinedOutput() + if ctx.Err() != nil || err != nil { + t.Fatalf("supported root command did not complete: %v (context=%v); %s", err, ctx.Err(), out) + } + witness, err := os.ReadFile(trace) + if err != nil || len(witness) == 0 { + t.Fatalf("supported root did not reach its action: %v; %s", err, out) + } + for _, target := range []string{"scripts/run-phase129-nvme-k8s-mounted-restage-gate.sh", "scripts/uninstall-k8s-alpha.sh"} { + if strings.Contains(action["cmd"], target) && !strings.Contains(string(witness), "bash "+target+" ") { + t.Fatalf("missing script witness %s: %s", target, witness) + } + } + if strings.Contains(action["cmd"], "kubectl uncordon") { + for _, target := range []string{"kubectl uncordon node-test", "kubectl get node node-test"} { + if !strings.Contains(string(witness), target) { + t.Fatalf("missing node-file witness %s: %s", target, witness) + } + } + } +} + +func renderArtifactRootAction(action map[string]string, root, product string) string { + render := strings.NewReplacer("{{ artifact_root }}", root, "{{ product_root }}", product, "{{ run_id }}", "guard-test") + var keys []string + for key := range action { + if strings.HasPrefix(key, "env.") { + keys = append(keys, key) + } + } + sort.Strings(keys) + var prefix strings.Builder + for _, key := range keys { + fmt.Fprintf(&prefix, "%s=%s ", strings.TrimPrefix(key, "env."), artifactShellQuote(render.Replace(action[key]))) + } + // The runner applies env.* to the complete command through sh -c. + return prefix.String() + "sh -c " + artifactShellQuote(render.Replace(action["cmd"])) +} + +func artifactShellQuote(value string) string { + return "'" + strings.ReplaceAll(value, "'", "'\\''") + "'" +} diff --git a/seaweed-block/scripts/uninstall-k8s-alpha.sh b/seaweed-block/scripts/uninstall-k8s-alpha.sh index ec26e226a1..b56e9fe7f2 100755 --- a/seaweed-block/scripts/uninstall-k8s-alpha.sh +++ b/seaweed-block/scripts/uninstall-k8s-alpha.sh @@ -8,7 +8,10 @@ DELETE_ALL_BLOCKVOLUMES="${SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES:-0}" CHAP_SECRET_NAME="${SW_BLOCK_ISCSI_CHAP_SECRET_NAME:-sw-block-iscsi-chap}" STORAGECLASS_NAME="${SW_BLOCK_STORAGECLASS_NAME:-sw-block-dynamic}" -mkdir -p "$ARTIFACT_DIR" +if ! mkdir -p "$ARTIFACT_DIR" 2>/dev/null; then + printf '[alpha-uninstall] cannot create %s; refusing cleanup\n' "$ARTIFACT_DIR" >&2 + exit 2 +fi if [[ -z "${KUBECONFIG:-}" && -f /etc/rancher/k3s/k3s.yaml ]]; then export KUBECONFIG=/etc/rancher/k3s/k3s.yaml diff --git a/seaweed-block/scripts/uninstall_k8s_alpha_test.go b/seaweed-block/scripts/uninstall_k8s_alpha_test.go index 87f1456e0b..3a9b94c5a7 100644 --- a/seaweed-block/scripts/uninstall_k8s_alpha_test.go +++ b/seaweed-block/scripts/uninstall_k8s_alpha_test.go @@ -2,7 +2,9 @@ package scripts_test import ( "os" + "os/exec" "path/filepath" + "runtime" "strings" "testing" ) @@ -28,6 +30,52 @@ func TestUninstallK8sAlphaDeletesSeaweedISCSINodeRecords(t *testing.T) { } } +func TestUninstallK8sAlphaRefusesBeforeCleanupWhenArtifactDirCannotBeCreated(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("bash script") + } + bash, err := exec.LookPath("bash") + if err != nil { + t.Skip("bash not available") + } + work := t.TempDir() + bin := filepath.Join(work, "bin") + if err := os.Mkdir(bin, 0o755); err != nil { + t.Fatal(err) + } + calls := filepath.Join(work, "calls.log") + for _, name := range []string{"kubectl", "iscsiadm", "helm", "sudo", "nvme"} { + stub := "#!/bin/sh\necho \"" + name + " $*\" >> \"" + calls + "\"\nexit 0\n" + if err := os.WriteFile(filepath.Join(bin, name), []byte(stub), 0o755); err != nil { + t.Fatal(err) + } + } + blocker := filepath.Join(work, "not-a-dir") + if err := os.WriteFile(blocker, nil, 0o644); err != nil { + t.Fatal(err) + } + cmd := exec.Command(bash, filepath.Join(repoRoot(t), "scripts", "uninstall-k8s-alpha.sh"), repoRoot(t)) + cmd.Env = append(os.Environ(), + "PATH="+bin+string(os.PathListSeparator)+os.Getenv("PATH"), + "SW_BLOCK_ARTIFACT_DIR="+filepath.Join(blocker, "cleanup"), + "TMPDIR="+work, + ) + if out, err := cmd.CombinedOutput(); err == nil { + t.Fatalf("uninstall continued without its artifact directory:\n%s", out) + } + if log, err := os.ReadFile(calls); !os.IsNotExist(err) { + t.Fatalf("uninstall started cleanup without its artifact directory: %q (read=%v)", log, err) + } + good := exec.Command(bash, filepath.Join(repoRoot(t), "scripts", "uninstall-k8s-alpha.sh"), repoRoot(t)) + good.Env = append(os.Environ(), "PATH="+bin+string(os.PathListSeparator)+os.Getenv("PATH"), "SW_BLOCK_ARTIFACT_DIR="+filepath.Join(work, "artifacts"), "TMPDIR="+work) + if out, err := good.CombinedOutput(); err != nil { + t.Fatalf("valid artifact directory refused: %v\n%s", err, out) + } + if log, err := os.ReadFile(calls); err != nil || !strings.Contains(string(log), "kubectl delete") { + t.Fatalf("valid artifact directory did not reach cleanup: %q (%v)", log, err) + } +} + func TestFailureSnapshotScriptCapturesRequiredEvidenceLayers(t *testing.T) { root := repoRoot(t) raw, err := os.ReadFile(filepath.Join(root, "scripts", "collect-k8s-failure-snapshot.sh")) diff --git a/seaweed-block/testops/README.md b/seaweed-block/testops/README.md index 47638a232c..7dcd0e56e4 100644 --- a/seaweed-block/testops/README.md +++ b/seaweed-block/testops/README.md @@ -1,78 +1,65 @@ -# V3 TestOps Scenarios +# TestOps scenarios -This directory holds product-owned scenario content for the standalone -`sw-test-runner` stack. +This directory holds runner scenarios for the `swblock` binary of `sw-test-runner`. +The product owns the test intent: which scripts represent a gate, what each +artifact proves, and what cleanup must hold. The runner owns orchestration: +target cleanup, command execution, run-bundle layout and artifact collection. -The intended boundary is: +The scenarios kept here are the ones this repository's tests or scripts use: +`cmd/blockcsi/g15d_manifest_test.go` checks the contents of some of them, and +scripts under `scripts/` run others. -- Product repo owns the test intent: which scripts or checks represent the - product gate, what artifacts prove each hop, and what cleanup must be true. -- Standalone runner owns orchestration: target cleanup, command execution, - build/import coordination, progress checks, run-bundle layout, and artifact - collection. -- QA can run the same YAML locally or from CI; developers can run it before - pushing to avoid stale-image / stale-process / scattered-artifact loops. +## Running a scenario -## Runner Binary - -`swblock` is the `sw-test-runner` binary used for Seaweed Block / V3 tests. - -- Source repo: `pingqiu/sw-test-runner` -- Source path: `cmd/swblock/main.go` -- Build command from the runner repo: - - ```bash - go build -o swblock ./cmd/swblock - ``` - -- Windows QA convention: `C:\work\swblock.exe` -- Linux controller convention: put `swblock` on `PATH`, or set a shell alias to - the built binary. - -`swblock` is not built from this product repo. If a developer only has -`seaweed_block` checked out, runner-native scenarios can still be authored and -statically reviewed here, but `swblock validate`, `swblock run`, and -`swblock suite` require the external runner binary. - -Convenience build helpers are available when the runner source is accessible: - -```powershell -.\internal\tools\build-swblock.ps1 -``` +`swblock` is built from the runner's source (`go build -o swblock ./cmd/swblock`), +not from this repository. Check a scenario before running it: ```bash -bash internal/tools/build-swblock.sh +swblock validate testops/scenarios/nvme-p5-protocol-component-gate.yaml ``` -They build into `.tools/swblock(.exe)`, write `.tools/swblock.path`, and print -the final binary path. +Apart from `helm-multi-volume-rf3-app-spread-failover-chain.yaml`, which still targets +the project's lab, no scenario names a host, user, key or share. Each one reads them +from its `env` block, where they are empty, so set every one on the command line: -Related runner binaries share the same engine but link different product/action -sets: - -- `swblock`: V3 / Seaweed Block product pack. -- `weedblock`: V2 product pack. -- `cmd/sw-test-runner`: kitchen-sink/dev binary. - -Recommended local check before running scenarios: +| Setting | Meaning | +| --- | --- | +| `product_root` | this repository's checkout on the test node | +| `node_host` | address of the test node | +| `node_user` | ssh user on the test node | +| `ssh_key` | private key for `node_user`, on the controller | +| `artifact_root` | shared directory for run artifacts, as the test node sees it; an absolute path other than `/` using only `A-Za-z0-9._/-` | +| `import_nodes` | every other k3s node, for the image import (`nvme-tcp-status-surface-evidence-chain`, `nvme-tcp-cross-node-multivolume-lifecycle-soak-chain`); without it only the test node gets the images | +| `node_ssh_key` | key path on the test node for the image import (those two chains and `node-loss-survival-rf3-reattach-chain`) | ```bash -swblock list -swblock validate testops/scenarios/csi-rf1-durable-restart-chain.yaml +swblock run \ + -env product_root=/path/to/seaweed-block \ + -env node_host=192.0.2.10 \ + -env node_user=tester \ + -env ssh_key=/path/to/key \ + -env artifact_root=/path/to/shared/artifacts \ + testops/scenarios/nvme-p5-protocol-component-gate.yaml ``` -## Which Gate To Run +Destructive and artifact-dependent always actions validate the root independently, +before cleanup starts. The value reaches the guard through the runner's quoted +`env.SW_BLOCK_ARTIFACT_ROOT` parameter, rather than being rendered into shell +syntax. This also protects a direct `swblock run` when an earlier phase fails. +Uninstall refuses cleanup if its artifact directory cannot be created. -Use the smallest gate that can prove the contract you changed. +Check every complete guard/action copy locally, with cleanup stubs and no cluster: +`bash scripts/testops-artifact-root-guard-test.sh` (requires Go on a POSIX system). -| Change type | Default gate | Why | -| --- | --- | --- | -| Package-local logic, parser, renderer, state-machine helper | `go test -count=1 ./` | Fastest feedback; no m02 or runner dependency. | -| CSI protocol propagation, lifecycle persistence, launcher render shape | `swblock run testops/scenarios/nvme-p5-protocol-component-gate.yaml` | Proves the known NVMe/iSCSI protocol-shape contracts with a runner bundle in seconds. | -| RF=1 restart contract, durable-root/status manifest shape | `swblock run testops/scenarios/csi-rf1-durable-restart-component-gate.yaml` | Proves restart/recovery contract shape without a full K8s restart. | -| Operations read-only volume status report shape | `swblock run testops/scenarios/operations-volume-status-report-component-gate.yaml` | Proves schema, frontend identity, unavailable fields, and residue copy behavior without starting product processes. | -| Kernel initiator, k3s, mounted filesystem, failover, or stale-session behavior | The matching child chain, for example `nvme-p5-csi-protocol-chain` or `csi-rf1-durable-restart-chain` | These require real Linux/K8s/initiator behavior. | -| Milestone readiness or cross-protocol release confidence | `swblock suite testops/suites/beta-hardening-gate.yaml` plus `swblock validate-bundle --profile beta-hardening` | Slow, evidence-heavy gate. Use for release/milestone claims, not first debugging. | +## Which gate to run + +Use the smallest gate that proves the contract you changed. + +| Change type | Gate | +| --- | --- | +| Package-local logic, parser, renderer, state-machine helper | `go test -count=1 ./` | +| CSI protocol propagation, lifecycle persistence, launcher render shape | `nvme-p5-protocol-component-gate` | +| Kernel initiator, k3s, mounted filesystem, failover or stale-session behaviour | the matching chain, for example `nvme-p5-csi-protocol-chain`, `nvme-p4-multipath-failover-chain` or `iscsi-p6-alua-failover-chain` | **Node loss (`node-loss-survival-rf3-reattach-chain`).** This release claims no automatic promotion on node loss: the gate cordons the primary's node and stops it, requires that no other replica is promoted during the hold @@ -83,214 +70,3 @@ data. Manual failover (a `SwBlockReplicaFailback` handled by the failback execut (`core/host/master/failback_runtime_test.go`), `TestFailbackAuthorityRuntimeAdapterRejectsStaleExpectedCurrent` (`core/ops/failback_authority_runtime_adapter_test.go`) and `TestFailbackExecutorInvokesRuntimeWhenExplicitlyEnabled` (`core/ops/failback_executor_controller_test.go`). - -Default ownership: - -- Developers run unit/component tests, fast runner-native component gates, and - single-child chains while iterating. -- QA runs full-suite repeatability, long soak, ambiguous lab failures, and - independent milestone validation. -- If QA would only execute a single known command and return stdout, run it - yourself and reserve QA for scenario design or trust-critical validation. - -Example: - -```bash -swblock run \ - -env product_root=/path/to/seaweed_block/on/m02 \ - -env ssh_key=/path/to/testdev_key/on/controller \ - testops/scenarios/nvme-p5-csi-protocol-chain.yaml -``` - -Fast component gates are available for developer loops before running the -heavier K8s or initiator paths. For example, the NVMe-P5 protocol component -gate pins CSI protocol extraction, lifecycle protocol planning, and launcher -protocol persistence/planning, plus launcher NVMe/iSCSI manifest shape without -launching k3s: - -```bash -swblock run \ - -env product_root=/path/to/seaweed_block/on/m02 \ - -env ssh_key=/path/to/testdev_key/on/controller \ - testops/scenarios/nvme-p5-protocol-component-gate.yaml -``` - -The RF=1 durable restart path also has a component gate that checks restart -wrapper shape, generated hostPath/status manifest behavior, master frontend -projection, and durable status lineage without doing the full K8s restart: - -```bash -swblock run \ - -env product_root=/path/to/seaweed_block/on/m02 \ - -env ssh_key=/path/to/testdev_key/on/controller \ - testops/scenarios/csi-rf1-durable-restart-component-gate.yaml -``` - -The first operations-layer status report contract has its own component gate. -It is read-only, does not start product processes, and is not a block/data -snapshot: - -```bash -swblock run \ - -env product_root=/path/to/seaweed_block/on/m02 \ - -env ssh_key=/path/to/testdev_key/on/controller \ - testops/scenarios/operations-volume-status-report-component-gate.yaml -``` - -The same runner-native shape is used for the longer iSCSI P8 soak: - -```bash -swblock run \ - -env product_root=/path/to/seaweed_block/on/m02 \ - -env ssh_key=/path/to/testdev_key/on/controller \ - testops/scenarios/iscsi-p8-compat-soak-chain.yaml -``` - -The scenario still shells out to existing bash payloads. That is deliberate: -the first migration step is to move orchestration and evidence collection into -the runner without rewriting the product smoke tests. - -## Protocol Release Gate - -The product-owned release gate composes the current protocol chains: - -- `iscsi-p6-alua-failover-chain` -- `nvme-p4-multipath-failover-chain` -- `nvme-p5-csi-protocol-chain` -- `iscsi-p8-compat-soak-chain` - -The primary operator path is the runner-native suite command. Run it from the -controller, pointing it at the remote product checkout on m02: - -```powershell -swblock suite ` - --results-dir /g15d-k8s/testops-runs/protocol-release-gate-native ` - --env product_root=/tmp/seaweed-block-nvme-p4l ` - --env ssh_key=C:/work/dev_server/testdev_key ` - C:/work/seaweed_block/testops/suites/protocol-release-gate.yaml -``` - -Validate the bundle before manual artifact review: - -```powershell -swblock validate-bundle --profile protocol-release-gate ` - /g15d-k8s/testops-runs/protocol-release-gate-native/ -``` - -QA close evidence: - -- product commit: `033028e74c1ac3bc06f19c0563bc2e6a0495af59`, -- runner commit: `3c1b6603aefcf4c1bf0b22f9a9c081a67e786d8d`, -- suite run: `20260509-151531-9c6c`, -- result: PASS, validated by `swblock validate-bundle --profile - protocol-release-gate`. - -The older wrappers remain available for compatibility and local debugging. The -PowerShell wrapper supports both Windows PowerShell 5.1 and PowerShell 7+; -native runner stderr is captured into the child artifact directory instead of -being treated as a PowerShell exception. - -```powershell -.\scripts\testops-run-protocol-release-gate.ps1 ` - -RunnerRoot C:\work\seaweedfs\learn\sw-test-runner-standalone ` - -RemoteProductRoot /tmp/seaweed-block-nvme-p4l ` - -SshKey C:\work\dev_server\testdev_key ` - -ArtifactRoot C:\work\tmp\protocol-release-gate-$(Get-Date -Format yyyyMMddTHHmmssZ) -``` - -Linux / Git Bash controllers can use the bash wrapper: - -```bash -SWBLOCK_RUNNER_ROOT=/c/work/seaweedfs/learn/sw-test-runner-standalone \ -SW_BLOCK_REMOTE_PRODUCT_ROOT=/tmp/seaweed-block-nvme-p4l \ -SW_BLOCK_SSH_KEY='C:\work\dev_server\testdev_key' \ -SW_BLOCK_ARTIFACT_DIR=/c/work/tmp/protocol-release-gate-$(date -u +%Y%m%dT%H%M%SZ) \ - bash scripts/testops-run-protocol-release-gate.sh "$PWD" -``` - -The suite writes a top-level `result.json` and `status.json` with -`started_at`, `ended_at`, `wall_clock_s`, child run IDs, per-child PASS/FAIL, -and artifact pointers. Each child bundle still owns its own `status.json`, -`result.json`, `scenario.yaml`, and collected remote artifacts under -`//runs//`. - -After a run, validate the suite bundle offline before manual artifact review: - -```powershell -.\scripts\testops-validate-latest-protocol-release-gate.ps1 ` - -RunnerRoot C:\work\seaweedfs\learn\sw-test-runner-standalone ` - -ArtifactRoot C:\work\tmp\protocol-release-gate-20260509T000000Z ` - -ExpectCommit 033028e74c1ac3bc06f19c0563bc2e6a0495af59 -``` - -Linux / Git Bash: - -```bash -SWBLOCK_RUNNER_ROOT=/c/work/seaweedfs/learn/sw-test-runner-standalone \ -SW_BLOCK_ARTIFACT_DIR=/c/work/tmp/protocol-release-gate-20260509T000000Z \ -SW_BLOCK_EXPECT_COMMIT=033028e74c1ac3bc06f19c0563bc2e6a0495af59 \ - bash scripts/testops-validate-latest-protocol-release-gate.sh "$PWD" -``` - -The wrapper calls the platform validator profile: - -```bash -swblock validate-bundle --profile protocol-release-gate \ - --expect-commit 033028e74c1ac3bc06f19c0563bc2e6a0495af59 \ - /path/to/protocol-release-gate-artifact -``` - -The older product-specific Python checker remains available for local -debugging but is no longer the primary operator path: - -```bash -python3 scripts/testops-validate-protocol-release-gate.py \ - /path/to/protocol-release-gate-artifact \ - --expect-product-commit 033028e74c1ac3bc06f19c0563bc2e6a0495af59 -``` - -Use `--allow-fail` when validating the schema of an intentionally failed or -cancelled run; without it the checker requires all four child chains to be -`pass` with complete phase counts. - -## Beta Hardening Gate - -`testops/suites/beta-hardening-gate.yaml` is the seed suite for the current -beta-hardening plan. It composes the protocol release children plus the new -component/restart/reintegration gates: - -- `iscsi-p6-alua-failover-chain` -- `nvme-p4-multipath-failover-chain` -- `nvme-p5-csi-protocol-chain` -- `iscsi-p8-compat-soak-chain` -- `csi-lifecycle-component-gate` -- `csi-rf1-durable-restart-chain` -- `operations-status-diagnostics-chain` -- `returned-replica-component-gate` -- `iscsi-returned-replica-chain` -- `cleanup-residue-chain` - -Run shape: - -```powershell -swblock suite ` - --results-dir /g15d-k8s/testops-runs/beta-hardening-gate ` - --env product_root=/tmp/seaweed-block-plan-roadmap-refresh-devrun ` - --env ssh_key=C:/work/dev_server/testdev_key ` - C:/work/seaweed_block/testops/suites/beta-hardening-gate.yaml -``` - -Repeatability evidence: - -- product commit: - `8822f20e91c2b88727ead9e49f9bf75eec28c791` -- runner commit: - `cf65daaf2ce5cf500e1efa48b411f7cb66dbac0b` -- run 1: `20260511-031605-8258`, PASS, `21m46s`, - `validate-bundle --profile beta-hardening` VALID. -- run 2: `20260511-040412-ac38`, PASS, `22m55s`, - `validate-bundle --profile beta-hardening` VALID. -- no manual cleanup between runs; final residue audit clean. - -Use this suite for milestone readiness or release-candidate confidence. Do not -use it as the first debug loop for a package-level change. diff --git a/seaweed-block/testops/scenarios/ack-eligibility-publication-chain.yaml b/seaweed-block/testops/scenarios/ack-eligibility-publication-chain.yaml deleted file mode 100644 index 965dee8828..0000000000 --- a/seaweed-block/testops/scenarios/ack-eligibility-publication-chain.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Runner-native Phase 67 gate: caught-up rebuild to ACK eligibility publication. - -name: ack-eligibility-publication-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: ack_eligibility_publication_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication bash scripts/run-phase67-ack-eligibility-publication-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt" - pattern: "^phase67_ack_eligibility_publication_status=ok$" - save_as: phase67_ok - - action: assert_greater - actual: "{{ phase67_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt" - pattern: "^ack_publication_after_caught_up=true$" - save_as: ack_after_caught_up - - action: assert_greater - actual: "{{ ack_after_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt" - pattern: "^ack_publication_requires_rebuild_caught_up=true$" - save_as: requires_caught_up - - action: assert_greater - actual: "{{ requires_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt" - pattern: "^ack_publication_rejects_running_rebuild=true$" - save_as: rejects_running - - action: assert_greater - actual: "{{ rejects_running }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt" - pattern: "^ack_publication_rejects_unexpected_publication_allowed=true$" - save_as: rejects_unexpected_policy - - action: assert_greater - actual: "{{ rejects_unexpected_policy }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication/phase67-ack-eligibility-publication-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase67-ack-eligibility-publication" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/activation-day1-first-volume-chain.yaml b/seaweed-block/testops/scenarios/activation-day1-first-volume-chain.yaml index 7ac31fcd4a..aed52b5e3d 100644 --- a/seaweed-block/testops/scenarios/activation-day1-first-volume-chain.yaml +++ b/seaweed-block/testops/scenarios/activation-day1-first-volume-chain.yaml @@ -10,42 +10,46 @@ timeout: 24m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-28a99ce4f644" sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-28a99ce4f644" topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/activation /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume/activation $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - name: activate_alpha_stack actions: - action: exec - node: m02 + node: node-a timeout: 12m cmd: "cd {{ product_root }} && bash scripts/activate-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/activation" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/activation" env.SW_BLOCK_ACTIVATION_IMAGE_MODE: "published" env.SW_BLOCK_IMAGE: "{{ sw_block_image }}" env.SW_BLOCK_CSI_IMAGE: "{{ sw_block_csi_image }}" @@ -53,81 +57,81 @@ phases: - name: first_volume_user_loop actions: - action: exec - node: m02 + node: node-a timeout: 10m cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app" env.SW_BLOCK_BASIC_APP_CLEANUP: "1" - name: first_volume_asserts actions: - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" pattern: "^first_volume_status=ok$" save_as: first_volume_ok_count - action: assert_greater actual: "{{ first_volume_ok_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" pattern: "^pvc=sw-block-example-pvc$" save_as: pvc_count - action: assert_greater actual: "{{ pvc_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" pattern: "^writer_verified=true$" save_as: writer_verified_count - action: assert_greater actual: "{{ writer_verified_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" pattern: "^reader_verified=true$" save_as: reader_verified_count - action: assert_greater actual: "{{ reader_verified_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/writer.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/writer.log" pattern: "/data/demo.bin: OK" save_as: writer_checksum_count - action: assert_greater actual: "{{ writer_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/reader.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/reader.log" pattern: "/data/demo.bin: OK" save_as: reader_checksum_count - action: assert_greater actual: "{{ reader_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/first-volume-summary.txt" pattern: "^cleanup_status=ok$" save_as: basic_cleanup_count - action: assert_greater actual: "{{ basic_cleanup_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/cluster-evidence.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/cluster-evidence.json" pattern: "\"volumes\"" save_as: cluster_volumes_count - action: assert_greater actual: "{{ cluster_volumes_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/inventory/volume-inventory-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/basic-app/status/inventory/volume-inventory-summary.txt" pattern: "pvc=sw-block-example-pvc" save_as: inventory_pvc_count - action: assert_greater @@ -138,14 +142,15 @@ phases: always: true actions: - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-first-volume/cleanup" env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " diff --git a/seaweed-block/testops/scenarios/activation-day1-install-chain.yaml b/seaweed-block/testops/scenarios/activation-day1-install-chain.yaml index 33152430e8..bfeec21b15 100644 --- a/seaweed-block/testops/scenarios/activation-day1-install-chain.yaml +++ b/seaweed-block/testops/scenarios/activation-day1-install-chain.yaml @@ -7,8 +7,11 @@ # # Expected invocation: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/activation-day1-install-chain.yaml name: activation-day1-install-chain @@ -16,127 +19,131 @@ timeout: 18m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1 && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation /mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/cleanup" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-day1 && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-day1/activation $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-activation-day1/cleanup" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - name: activate_alpha_stack actions: - action: exec - node: m02 + node: node-a timeout: 12m cmd: "cd {{ product_root }} && bash scripts/activate-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation" env.SW_BLOCK_ACTIVATION_IMPORT_K3S: "1" - name: activation_asserts actions: - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^activation_status=ok$" save_as: activation_ok_count - action: assert_greater actual: "{{ activation_ok_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^master_ready_replicas=1$" save_as: master_ready_count - action: assert_greater actual: "{{ master_ready_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^csi_controller_ready_replicas=1$" save_as: csi_controller_ready_count - action: assert_greater actual: "{{ csi_controller_ready_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^csi_node_ready=[1-9][0-9]*/[1-9][0-9]*$" save_as: csi_node_ready_count - action: assert_greater actual: "{{ csi_node_ready_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^storageclass=sw-block-dynamic$" save_as: storageclass_count - action: assert_greater actual: "{{ storageclass_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^storageclass_provider=block.csi.seaweedfs.com$" save_as: storageclass_provider_count - action: assert_greater actual: "{{ storageclass_provider_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^protocol=iscsi$" save_as: protocol_count - action: assert_greater actual: "{{ protocol_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "^ack_profile=best-effort$" save_as: ack_profile_count - action: assert_greater actual: "{{ ack_profile_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "next_create_volume=kubectl apply -f examples/kubernetes/basic-app/storageclass-pvc.yaml" save_as: next_create_volume_count - action: assert_greater actual: "{{ next_create_volume_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/activation-summary.txt" pattern: "non_claims=alpha_only,no_backup_restore,no_upgrade_safety,no_mutating_dashboard_actions,no_broad_performance_slo" save_as: non_claims_count - action: assert_greater actual: "{{ non_claims_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/activation/readiness.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/activation/readiness.txt" pattern: "sw-block-csi-node" save_as: readiness_csi_node_count - action: assert_greater @@ -147,20 +154,21 @@ phases: always: true actions: - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/cleanup" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/cleanup" env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-activation-day1/cleanup/delete-storageclass.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-activation-day1/cleanup/delete-storageclass.log" pattern: "sw-block-dynamic" save_as: storageclass_cleanup_count - action: assert_greater diff --git a/seaweed-block/testops/scenarios/authority-executor-callsite-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-callsite-chain.yaml deleted file mode 100644 index 8abb5d29cf..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-callsite-chain.yaml +++ /dev/null @@ -1,168 +0,0 @@ -# Runner-native Phase 54 D4 gate: authority-executor ACK eligibility call-site. - -name: authority-executor-callsite-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_callsite_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite bash scripts/run-phase54-authority-executor-callsite-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^phase54_authority_executor_callsite_status=ok$" - save_as: phase54_callsite_ok - - action: assert_greater - actual: "{{ phase54_callsite_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^target_missing_mutation_attempts=0$" - save_as: target_missing_no_mutation - - action: assert_greater - actual: "{{ target_missing_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^target_missing_created_targets=0$" - save_as: target_missing_no_create - - action: assert_greater - actual: "{{ target_missing_no_create }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^terminal_missing_mutation_attempts=0$" - save_as: terminal_missing_no_mutation - - action: assert_greater - actual: "{{ terminal_missing_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^terminal_missing_target_reason_absent=$" - save_as: terminal_missing_no_status - - action: assert_greater - actual: "{{ terminal_missing_no_status }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_mutation_attempts=1$" - save_as: complete_one_mutation - - action: assert_greater - actual: "{{ complete_one_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_ack_eligibility_mutation_attempts=1$" - save_as: complete_one_ack_mutation - - action: assert_greater - actual: "{{ complete_one_ack_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_reason=ack_eligibility_recorded$" - save_as: complete_reason - - action: assert_greater - actual: "{{ complete_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_ack_eligible=true$" - save_as: complete_ack_eligible - - action: assert_greater - actual: "{{ complete_ack_eligible }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_frontend_fenced=true$" - save_as: complete_frontend_fenced - - action: assert_greater - actual: "{{ complete_frontend_fenced }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_primary_unchanged=true$" - save_as: complete_primary_unchanged - - action: assert_greater - actual: "{{ complete_primary_unchanged }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_frontier_covered=true$" - save_as: complete_frontier_covered - - action: assert_greater - actual: "{{ complete_frontier_covered }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_no_cross_volume=true$" - save_as: complete_no_cross_volume - - action: assert_greater - actual: "{{ complete_no_cross_volume }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_swblockvolume_ack_still_false=false$" - save_as: complete_source_unchanged - - action: assert_greater - actual: "{{ complete_source_unchanged }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^complete_target_nonclaims_ok=true$" - save_as: complete_nonclaims - - action: assert_greater - actual: "{{ complete_nonclaims }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^exec_patch_swblockvolumes_status_denied=no$" - save_as: boundary_volume_status_denied - - action: assert_greater - actual: "{{ boundary_volume_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite/phase54-authority-executor-callsite-summary.txt" - pattern: "^exec_create_events_denied=no$" - save_as: boundary_events_denied - - action: assert_greater - actual: "{{ boundary_events_denied }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-callsite" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-http-runtime-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-http-runtime-chain.yaml deleted file mode 100644 index 300f733144..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-http-runtime-chain.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Runner-native Phase 62 gate: authority-executor HTTP rebuild runtime transport. - -name: authority-executor-http-runtime-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_http_runtime_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime bash scripts/run-phase62-authority-executor-http-runtime-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^phase62_authority_executor_http_runtime_status=ok$" - save_as: phase62_ok - - action: assert_greater - actual: "{{ phase62_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^http_runtime_posts_request=true$" - save_as: posts_request - - action: assert_greater - actual: "{{ posts_request }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^http_runtime_decodes_terminal_frontier=true$" - save_as: decodes_frontier - - action: assert_greater - actual: "{{ decodes_frontier }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^cli_rebuild_runtime_url_enabled=true$" - save_as: cli_enabled - - action: assert_greater - actual: "{{ cli_enabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^cli_rebuild_runtime_url_requires_rebuild_traffic=true$" - save_as: cli_guard - - action: assert_greater - actual: "{{ cli_guard }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^rebuild_status_running_written=true$" - save_as: running_written - - action: assert_greater - actual: "{{ running_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^rebuild_status_caught_up_written=true$" - save_as: caught_up_written - - action: assert_greater - actual: "{{ caught_up_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^rebuild_status_blocked_on_runtime_failure=true$" - save_as: blocked_written - - action: assert_greater - actual: "{{ blocked_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^planned_status_preserved_without_runtime=true$" - save_as: planned_preserved - - action: assert_greater - actual: "{{ planned_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^blockvolume_runtime_endpoint_wired=false$" - save_as: endpoint_not_wired - - action: assert_greater - actual: "{{ endpoint_not_wired }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime/phase62-authority-executor-http-runtime-summary.txt" - pattern: "^failback_allowed=false$" - save_as: no_failback - - action: assert_greater - actual: "{{ no_failback }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase62-authority-executor-http-runtime" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-live-close-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-live-close-chain.yaml deleted file mode 100644 index a89e7675a3..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-live-close-chain.yaml +++ /dev/null @@ -1,166 +0,0 @@ -# Runner-native Phase 54 D7 gate: live returned-replica close with bounded ACK eligibility execution. - -name: authority-executor-live-close-chain -timeout: 22m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - unmount: "/tmp/sw-block-phase54-live-close/mnt" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: authority_executor_live_close_gate - actions: - - action: exec - node: m02 - timeout: 18m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close bash scripts/run-phase54-authority-executor-live-close-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^phase54_authority_executor_live_close_status=ok$" - save_as: phase54_live_close_ok - - action: assert_greater - actual: "{{ phase54_live_close_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^previous_primary_frontend_fenced=true$" - save_as: previous_primary_fenced - - action: assert_greater - actual: "{{ previous_primary_fenced }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^current_primary_unchanged=true$" - save_as: current_primary_unchanged - - action: assert_greater - actual: "{{ current_primary_unchanged }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^durable_frontier_covered=true$" - save_as: durable_frontier_covered - - action: assert_greater - actual: "{{ durable_frontier_covered }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^executor_ack_mutation_attempts=1$" - save_as: one_ack_mutation - - action: assert_greater - actual: "{{ one_ack_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_reason=ack_eligibility_recorded$" - save_as: target_ack_recorded - - action: assert_greater - actual: "{{ target_ack_recorded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_ack_eligible=true$" - save_as: target_ack_eligible - - action: assert_greater - actual: "{{ target_ack_eligible }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_frontend_fenced=true$" - save_as: target_frontend_fenced - - action: assert_greater - actual: "{{ target_frontend_fenced }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_primary_unchanged=true$" - save_as: target_primary_unchanged - - action: assert_greater - actual: "{{ target_primary_unchanged }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_frontier_covered=true$" - save_as: target_frontier_covered - - action: assert_greater - actual: "{{ target_frontier_covered }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_no_cross_volume=true$" - save_as: target_no_cross_volume - - action: assert_greater - actual: "{{ target_no_cross_volume }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^source_ack_still_false=false$" - save_as: source_ack_unchanged - - action: assert_greater - actual: "{{ source_ack_unchanged }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close/phase54-authority-executor-live-close-summary.txt" - pattern: "^target_nonclaims_ok=true$" - save_as: target_nonclaims_ok - - action: assert_greater - actual: "{{ target_nonclaims_ok }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - unmount: "/tmp/sw-block-phase54-live-close/mnt" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-live-close" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-multivolume-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-multivolume-chain.yaml deleted file mode 100644 index 7f75a0557d..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-multivolume-chain.yaml +++ /dev/null @@ -1,152 +0,0 @@ -# Runner-native Phase 54 D6 gate: authority-executor multi-volume isolation. - -name: authority-executor-multivolume-chain -timeout: 10m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_multivolume_gate - actions: - - action: exec - node: m02 - timeout: 9m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume bash scripts/run-phase54-authority-executor-multivolume-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^phase54_authority_executor_multivolume_status=ok$" - save_as: phase54_multivolume_ok - - action: assert_greater - actual: "{{ phase54_multivolume_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^multivolume_contracts=4$" - save_as: multivolume_contracts - - action: assert_greater - actual: "{{ multivolume_contracts }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^multivolume_mutation_attempts=2$" - save_as: multivolume_two_mutations - - action: assert_greater - actual: "{{ multivolume_two_mutations }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^multivolume_ack_mutation_attempts=2$" - save_as: multivolume_two_ack_mutations - - action: assert_greater - actual: "{{ multivolume_two_ack_mutations }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^multivolume_terminal_missing=1$" - save_as: multivolume_one_terminal_missing - - action: assert_greater - actual: "{{ multivolume_one_terminal_missing }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^multivolume_target_missing=1$" - save_as: multivolume_one_target_missing - - action: assert_greater - actual: "{{ multivolume_one_target_missing }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^eligible_a_reason=ack_eligibility_recorded$" - save_as: eligible_a_written - - action: assert_greater - actual: "{{ eligible_a_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^eligible_b_reason=ack_eligibility_recorded$" - save_as: eligible_b_written - - action: assert_greater - actual: "{{ eligible_b_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^blocked_c_reason_absent=$" - save_as: blocked_c_held - - action: assert_greater - actual: "{{ blocked_c_held }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^mismatch_e_reason_absent=$" - save_as: mismatch_e_held - - action: assert_greater - actual: "{{ mismatch_e_held }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^no_contract_d_target_count=0$" - save_as: no_contract_d_no_target - - action: assert_greater - actual: "{{ no_contract_d_no_target }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^eligible_written_count=2$" - save_as: exactly_two_written - - action: assert_greater - actual: "{{ exactly_two_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^cross_contamination_count=0$" - save_as: no_cross_contamination - - action: assert_greater - actual: "{{ no_cross_contamination }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^exec_patch_swblockvolumes_status_denied=no$" - save_as: boundary_volume_status_denied - - action: assert_greater - actual: "{{ boundary_volume_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume/phase54-authority-executor-multivolume-summary.txt" - pattern: "^exec_create_events_denied=no$" - save_as: boundary_events_denied - - action: assert_greater - actual: "{{ boundary_events_denied }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-multivolume" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-negative-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-negative-chain.yaml deleted file mode 100644 index 7ebc95e98d..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-negative-chain.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Runner-native Phase 54 D5 gate: authority-executor negative/hold matrix. - -name: authority-executor-negative-chain -timeout: 10m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_negative_gate - actions: - - action: exec - node: m02 - timeout: 9m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative bash scripts/run-phase54-authority-executor-negative-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^phase54_authority_executor_negative_status=ok$" - save_as: phase54_negative_ok - - action: assert_greater - actual: "{{ phase54_negative_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^blocked-preflight_mutation_attempts=0$" - save_as: blocked_preflight_no_mutation - - action: assert_greater - actual: "{{ blocked_preflight_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^stale-frontier_mutation_attempts=0$" - save_as: stale_frontier_no_mutation - - action: assert_greater - actual: "{{ stale_frontier_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^unsafe-frontend_mutation_attempts=0$" - save_as: unsafe_frontend_no_mutation - - action: assert_greater - actual: "{{ unsafe_frontend_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^ambiguous_target_mutation_attempts=0$" - save_as: ambiguous_no_mutation - - action: assert_greater - actual: "{{ ambiguous_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^identity_mismatch_mutation_attempts=0$" - save_as: identity_mismatch_no_mutation - - action: assert_greater - actual: "{{ identity_mismatch_no_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^partial_mutation_attempts=1$" - save_as: partial_one_mutation - - action: assert_greater - actual: "{{ partial_one_mutation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^partial_terminal_missing=1$" - save_as: partial_one_hold - - action: assert_greater - actual: "{{ partial_one_hold }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^partial_a_reason=ack_eligibility_recorded$" - save_as: partial_a_written - - action: assert_greater - actual: "{{ partial_a_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^partial_b_reason_absent=$" - save_as: partial_b_held - - action: assert_greater - actual: "{{ partial_b_held }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^exec_patch_swblockvolumes_status_denied=no$" - save_as: boundary_volume_status_denied - - action: assert_greater - actual: "{{ boundary_volume_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative/phase54-authority-executor-negative-summary.txt" - pattern: "^exec_create_events_denied=no$" - save_as: boundary_events_denied - - action: assert_greater - actual: "{{ boundary_events_denied }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-negative" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-rbac-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-rbac-chain.yaml deleted file mode 100644 index 5c88478ad5..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-rbac-chain.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Runner-native Phase 53 gate: authority-executor RBAC boundary. - -name: authority-executor-rbac-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_rbac_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac bash scripts/run-phase53-authority-executor-rbac-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt" - pattern: "^phase53_authority_executor_rbac_status=ok$" - save_as: phase53_rbac_ok - - action: assert_greater - actual: "{{ phase53_rbac_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt" - pattern: "^authority_executor_get_swblockvolumes_allowed=yes$" - save_as: phase53_get_allowed - - action: assert_greater - actual: "{{ phase53_get_allowed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt" - pattern: "^authority_executor_patch_swblockvolumes_denied=no$" - save_as: phase53_patch_denied - - action: assert_greater - actual: "{{ phase53_patch_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt" - pattern: "^authority_executor_patch_status_denied=no$" - save_as: phase53_status_denied - - action: assert_greater - actual: "{{ phase53_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac/phase53-authority-executor-rbac-summary.txt" - pattern: "^authority_executor_create_events_denied=no$" - save_as: phase53_events_denied - - action: assert_greater - actual: "{{ phase53_events_denied }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase53-authority-executor-rbac" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-rebuild-target-rbac-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-rebuild-target-rbac-chain.yaml deleted file mode 100644 index b0c4fa8fdb..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-rebuild-target-rbac-chain.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Runner-native Phase 57 gate: authority-executor rebuild target RBAC boundary. - -name: authority-executor-rebuild-target-rbac-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_rebuild_target_rbac_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac bash scripts/run-phase57-authority-executor-rebuild-target-rbac-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^phase57_authority_executor_rebuild_target_rbac_status=ok$" - save_as: phase57_rbac_ok - - action: assert_greater - actual: "{{ phase57_rbac_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^default_patch_swblockreplicarebuilds_status_denied=no$" - save_as: default_rebuild_status_denied - - action: assert_greater - actual: "{{ default_rebuild_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^exec_patch_swblockreplicarebuilds_status_allowed=yes$" - save_as: exec_rebuild_status_allowed - - action: assert_greater - actual: "{{ exec_rebuild_status_allowed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^exec_patch_swblockreplicarebuilds_main_denied=no$" - save_as: exec_rebuild_main_denied - - action: assert_greater - actual: "{{ exec_rebuild_main_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^exec_patch_swblockvolumes_status_denied=no$" - save_as: exec_swblockvolume_status_denied - - action: assert_greater - actual: "{{ exec_swblockvolume_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^exec_patch_swblockreplicaeligibilities_status_denied=no$" - save_as: exec_eligibility_status_denied - - action: assert_greater - actual: "{{ exec_eligibility_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^exec_create_events_denied=no$" - save_as: exec_events_denied - - action: assert_greater - actual: "{{ exec_events_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^default_rebuild_status_patch_runtime_denied=true$" - save_as: default_runtime_patch_denied - - action: assert_greater - actual: "{{ default_runtime_patch_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^runtime_rebuild_status_state=planned$" - save_as: runtime_state_planned - - action: assert_greater - actual: "{{ runtime_state_planned }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^runtime_rebuild_status_reason=rebuild_progress_planned$" - save_as: runtime_reason_planned - - action: assert_greater - actual: "{{ runtime_reason_planned }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^runtime_rebuild_traffic_started=false$" - save_as: runtime_no_traffic - - action: assert_greater - actual: "{{ runtime_no_traffic }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac/phase57-authority-executor-rebuild-target-rbac-summary.txt" - pattern: "^runtime_no_frontend_publication=true$" - save_as: runtime_no_frontend_publication - - action: assert_greater - actual: "{{ runtime_no_frontend_publication }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase57-authority-executor-rebuild-target-rbac" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-runtime-callsite-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-runtime-callsite-chain.yaml deleted file mode 100644 index 1d855dc875..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-runtime-callsite-chain.yaml +++ /dev/null @@ -1,136 +0,0 @@ -# Runner-native Phase 61 gate: authority-executor rebuild runtime call-site. - -name: authority-executor-runtime-callsite-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_runtime_callsite_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite bash scripts/run-phase61-authority-executor-runtime-callsite-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^phase61_authority_executor_runtime_callsite_status=ok$" - save_as: phase61_ok - - action: assert_greater - actual: "{{ phase61_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^planned_without_runtime_test=true$" - save_as: planned_preserved - - action: assert_greater - actual: "{{ planned_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^runtime_callsite_caught_up_test=true$" - save_as: runtime_caught_up - - action: assert_greater - actual: "{{ runtime_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^runtime_failure_blocked_test=true$" - save_as: runtime_blocked - - action: assert_greater - actual: "{{ runtime_blocked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^runtime_callsite_invoked=true$" - save_as: callsite_invoked - - action: assert_greater - actual: "{{ callsite_invoked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^rebuild_status_running_written=true$" - save_as: running_written - - action: assert_greater - actual: "{{ running_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^rebuild_status_caught_up_written=true$" - save_as: caught_up_written - - action: assert_greater - actual: "{{ caught_up_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^rebuild_status_blocked_on_runtime_failure=true$" - save_as: blocked_written - - action: assert_greater - actual: "{{ blocked_written }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^rebuild_traffic_started_when_runtime_invoked=true$" - save_as: traffic_started - - action: assert_greater - actual: "{{ traffic_started }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^durable_frontier_caught_up_after_runtime=true$" - save_as: frontier_caught_up - - action: assert_greater - actual: "{{ frontier_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^blockvolume_rpc_wired=false$" - save_as: rpc_not_wired - - action: assert_greater - actual: "{{ rpc_not_wired }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite/phase61-authority-executor-runtime-callsite-summary.txt" - pattern: "^failback_allowed=false$" - save_as: no_failback - - action: assert_greater - actual: "{{ no_failback }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase61-authority-executor-runtime-callsite" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/authority-executor-target-rbac-chain.yaml b/seaweed-block/testops/scenarios/authority-executor-target-rbac-chain.yaml deleted file mode 100644 index 1af99792c8..0000000000 --- a/seaweed-block/testops/scenarios/authority-executor-target-rbac-chain.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Runner-native Phase 54 D3 gate: authority-executor ACK target RBAC boundary. - -name: authority-executor-target-rbac-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: authority_executor_target_rbac_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac bash scripts/run-phase54-authority-executor-target-rbac-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt" - pattern: "^phase54_authority_executor_target_rbac_status=ok$" - save_as: phase54_rbac_ok - - action: assert_greater - actual: "{{ phase54_rbac_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt" - pattern: "^default_patch_swblockreplicaeligibilities_status_denied=no$" - save_as: default_target_status_denied - - action: assert_greater - actual: "{{ default_target_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt" - pattern: "^exec_patch_swblockreplicaeligibilities_status_allowed=yes$" - save_as: exec_target_status_allowed - - action: assert_greater - actual: "{{ exec_target_status_allowed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt" - pattern: "^exec_patch_swblockreplicaeligibilities_main_denied=no$" - save_as: exec_target_main_denied - - action: assert_greater - actual: "{{ exec_target_main_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt" - pattern: "^exec_patch_swblockvolumes_status_denied=no$" - save_as: exec_swblockvolume_status_denied - - action: assert_greater - actual: "{{ exec_swblockvolume_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac/phase54-authority-executor-target-rbac-summary.txt" - pattern: "^exec_create_events_denied=no$" - save_as: exec_events_denied - - action: assert_greater - actual: "{{ exec_events_denied }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase54-authority-executor-target-rbac" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/blockvolume-runtime-endpoint-chain.yaml b/seaweed-block/testops/scenarios/blockvolume-runtime-endpoint-chain.yaml deleted file mode 100644 index 270e3ab1fb..0000000000 --- a/seaweed-block/testops/scenarios/blockvolume-runtime-endpoint-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 64 gate: blockvolume runtime rebuild start endpoint. - -name: blockvolume-runtime-endpoint-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: blockvolume_runtime_endpoint_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint bash scripts/run-phase64-blockvolume-runtime-endpoint-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^phase64_blockvolume_runtime_endpoint_status=ok$" - save_as: phase64_ok - - action: assert_greater - actual: "{{ phase64_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^runtime_state_started_supported=true$" - save_as: started_supported - - action: assert_greater - actual: "{{ started_supported }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^authority_executor_started_result_not_blocked=true$" - save_as: started_not_blocked - - action: assert_greater - actual: "{{ started_not_blocked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^blockvolume_runtime_endpoint_opt_in=true$" - save_as: opt_in - - action: assert_greater - actual: "{{ opt_in }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^blockvolume_runtime_endpoint_posts_started=true$" - save_as: posts_started - - action: assert_greater - actual: "{{ posts_started }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^blockvolume_runtime_endpoint_requires_primary=true$" - save_as: requires_primary - - action: assert_greater - actual: "{{ requires_primary }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^replication_runtime_rejects_lineage_drift=true$" - save_as: rejects_drift - - action: assert_greater - actual: "{{ rejects_drift }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint/phase64-blockvolume-runtime-endpoint-summary.txt" - pattern: "^runtime_endpoint_terminal_frontier_claimed=false$" - save_as: no_terminal_claim - - action: assert_greater - actual: "{{ no_terminal_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase64-blockvolume-runtime-endpoint" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml b/seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml deleted file mode 100644 index 1fb074fb12..0000000000 --- a/seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Runner-native Phase 66 gate: caught-up publication preflight surface. - -name: caught-up-publication-preflight-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: publication_preflight_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight bash scripts/run-phase66-caught-up-publication-preflight-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt" - pattern: "^phase66_caught_up_publication_preflight_status=ok$" - save_as: phase66_ok - - action: assert_greater - actual: "{{ phase66_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt" - pattern: "^publication_decision_schema_locked=true$" - save_as: schema_locked - - action: assert_greater - actual: "{{ schema_locked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt" - pattern: "^publication_blocked_until_caught_up=true$" - save_as: blocked_until_caught_up - - action: assert_greater - actual: "{{ blocked_until_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt" - pattern: "^publication_disabled_after_caught_up=true$" - save_as: disabled_after_caught_up - - action: assert_greater - actual: "{{ disabled_after_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight/phase66-caught-up-publication-preflight-summary.txt" - pattern: "^publication_mutation_allowed=false$" - save_as: mutation_false - - action: assert_greater - actual: "{{ mutation_false }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase66-caught-up-publication-preflight" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/cleanup-residue-chain.yaml b/seaweed-block/testops/scenarios/cleanup-residue-chain.yaml deleted file mode 100644 index 6d5e6ba88c..0000000000 --- a/seaweed-block/testops/scenarios/cleanup-residue-chain.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Runner-native cleanup residue audit. -# -# Goal: -# Prove the lab is clean before the next workload starts. This is not an -# install/uninstall functional test; it is a repeatability guard for beta -# suites that should fail when stale iSCSI/NVMe/K8s/process state leaks from -# earlier children. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/cleanup-residue-chain.yaml - -name: cleanup-residue-chain -timeout: 6m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: host_protocol_residue - actions: - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/uninstall /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build" - - action: exec - node: m02 - cmd: "cd {{ product_root }} && if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.status; else echo no-git-worktree > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.sha; : > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/pin_build/git.status; fi" - - action: exec - node: m02 - cmd: "command -v iscsiadm >/dev/null && (sudo -n iscsiadm -m session > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/iscsi-sessions.after-cleanup.txt 2>&1 || grep -q 'No active sessions' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/iscsi-sessions.after-cleanup.txt)" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: exec - node: m02 - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/verify-cleanup bash scripts/verify-helm-cleanup.sh {{ product_root }}" - - action: exec - node: m02 - cmd: "sudo nvme list-subsys -o json > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/nvme-list-subsys.after-cleanup.json 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/nvme-list-subsys.after-cleanup.err && ! grep -Ei 'nqn\\.[^[:space:]\"}]*seaweedfs|nqn\\.[^[:space:]\"}]*sw-block|nqn\\.[^[:space:]\"}]*weedblock' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/nvme-list-subsys.after-cleanup.json" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: kubernetes_residue - actions: - - action: exec - node: m02 - cmd: "bash -e -c 'kubectl get deploy,daemonset,statefulset,pod,svc,pvc,pv -A -o name > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.txt 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.err; kubectl get storageclass,csidriver -o name >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.txt 2>> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.err; if grep -E \"(sw-block|seaweed-block|block\\.csi\\.seaweedfs\\.com)\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-resources.after-cleanup.txt > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/k8s-residue.after-cleanup.txt; then exit 1; fi'" - - - name: hostpath_residue - actions: - - action: exec - node: m02 - cmd: "if sudo test -d /var/lib/sw-block; then sudo find /var/lib/sw-block -maxdepth 1 -mindepth 1 -print > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath.all.txt; sudo find /var/lib/sw-block -maxdepth 1 -mindepth 1 -type d -name 'testops-*' -print > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath-testops-residue.txt; else : > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath.all.txt; : > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath-testops-residue.txt; fi; test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/sw-block-hostpath-testops-residue.txt" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: exec - node: m02 - cmd: "kubectl delete storageclass sw-block sw-block-example sw-block-dynamic sw-block-dynamic-nvme --ignore-not-found=true > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue/delete-storageclasses.log 2>&1 || true" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - unmount: "/tmp/sw-block-iscsi-os/mnt,/tmp/sw-block-iscsi-failover/mnt,/tmp/sw-block-iscsi-mpath/mnt,/tmp/sw-block-nvme-failover/mnt" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cleanup-residue" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/cluster-ops-inventory-chain.yaml b/seaweed-block/testops/scenarios/cluster-ops-inventory-chain.yaml deleted file mode 100644 index b81d853e14..0000000000 --- a/seaweed-block/testops/scenarios/cluster-ops-inventory-chain.yaml +++ /dev/null @@ -1,340 +0,0 @@ -# Runner-native cluster operations inventory chain. -# -# Goal: -# Prove that an operator can discover the live alpha Kubernetes volume from -# the cluster itself, not from TestOps artifacts, and collect nested -# per-replica status bundles through sw-block ops inventory. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/cluster-ops-inventory-chain.yaml - -name: cluster-ops-inventory-chain -timeout: 22m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: live_volume_boundary - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=blockvolume-ready SW_BLOCK_DEMO_KEEP_ON_STOP=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo/controlled-stop.exit_code; test \"$rc\" -eq 42'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo/run.log" - pattern: "\\[app-demo\\] controlled stop after blockvolume ready" - save_as: controlled_stop_count - - action: assert_greater - actual: "{{ controlled_stop_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/demo/generated-blockvolume.yaml" - pattern: "--status-addr=" - save_as: generated_status_addr_count - - action: assert_greater - actual: "{{ generated_status_addr_count }}" - threshold: "0" - - - name: second_volume_boundary - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cat > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-pvc.yaml <<'YAML'\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n name: sw-block-demo-pvc-2\n namespace: default\nspec:\n accessModes:\n - ReadWriteOnce\n storageClassName: sw-block-dynamic\n resources:\n requests:\n storage: 1Mi\nYAML\nkubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log 2>&1\nkubectl -n default wait --for=jsonpath='{.status.phase}'=Bound pvc/sw-block-demo-pvc-2 --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log 2>&1\nfor i in $(seq 1 120); do count=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -ge 2 && break; sleep 1; done\ncount=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -ge 2\nkubectl -n default wait --for=condition=available deploy -l app=sw-blockvolume --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log 2>&1\nkubectl -n kube-system exec deploy/sw-blockmaster -c blockmaster -- sh -c 'cat /manifests/*.yaml' > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-volume-generated-blockvolume.yaml 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-volume-generated-blockvolume.err\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/product-owned-blockvolumes.after-second-pvc.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/apply-second-pvc.log" - pattern: "persistentvolumeclaim/sw-block-demo-pvc-2 created" - save_as: second_pvc_created_count - - action: assert_greater - actual: "{{ second_pvc_created_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/product-owned-blockvolumes.after-second-pvc.txt" - pattern: "^sw-blockvolume-" - save_as: second_volume_ready_count - - action: assert_greater - actual: "{{ second_volume_ready_count }}" - threshold: "1" - - action: exec - node: m02 - cmd: "test ! -e /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/second-volume/apply.log" - - - name: inventory_live_cluster - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; find \"$OUT/volumes\" -name ops-status-bundle.json -exec cat {} \\; > \"$OUT/nested-ops-status-bundles.json\" 2>/dev/null || true; exit \"$rc\"'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/exit_code.txt" - pattern: "^0$" - save_as: inventory_exit_zero_count - - action: assert_greater - actual: "{{ inventory_exit_zero_count }}" - threshold: "0" - - - name: inventory_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "^inventory_status: \\(ok\\|unhealthy\\)$" - save_as: inventory_status_count - - action: assert_greater - actual: "{{ inventory_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "^volumes: total=2 ok=[0-2] unhealthy=[0-2] invalid=0$" - save_as: two_volume_count - - action: assert_greater - actual: "{{ two_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "rf=1 desired=1 observed=1" - save_as: two_observed_volume_count - - action: assert_greater - actual: "{{ two_observed_volume_count }}" - threshold: "1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "protocols=iscsi" - save_as: two_iscsi_protocol_count - - action: assert_greater - actual: "{{ two_iscsi_protocol_count }}" - threshold: "1" - - action: exec - node: m02 - cmd: "! grep -q 'generated_deployment_missing\\|observed_replicas=0 desired_replicas=1\\|replica_slot_missing' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - - action: exec - node: m02 - cmd: "! grep -q 'replica_unhealthy' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - - action: exec - node: m02 - cmd: "! grep -E 'replica: .*status=ok .*epoch=0 endpoint_version=0' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - - action: exec - node: m02 - cmd: "! grep -q 'ops_status=unhealthy reason=authority_not_assigned epoch=' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "lifecycle_owner=pvc-owner-ref" - save_as: lifecycle_owner_count - - action: assert_greater - actual: "{{ lifecycle_owner_count }}" - threshold: "1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc" - save_as: pvc_owner_ref_count - - action: assert_greater - actual: "{{ pvc_owner_ref_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc-2" - save_as: second_pvc_owner_ref_count - - action: assert_greater - actual: "{{ second_pvc_owner_ref_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc" - save_as: pvc_identity_count - - action: assert_greater - actual: "{{ pvc_identity_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc-2" - save_as: second_pvc_identity_count - - action: assert_greater - actual: "{{ second_pvc_identity_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory-summary.txt" - pattern: "support_bundle=volumes/" - save_as: replica_support_bundle_count - - action: assert_greater - actual: "{{ replica_support_bundle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory.json" - pattern: "\"pvc_name\": \"sw-block-demo-pvc\"" - save_as: json_pvc_count - - action: assert_greater - actual: "{{ json_pvc_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory.json" - pattern: "\"pvc_name\": \"sw-block-demo-pvc-2\"" - save_as: json_second_pvc_count - - action: assert_greater - actual: "{{ json_second_pvc_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/volume-inventory.json" - pattern: "\"status_address\": \"127.0.0.1:" - save_as: json_status_addr_count - - action: assert_greater - actual: "{{ json_status_addr_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory/nested-ops-status-bundles.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: nested_status_bundle_count - - action: assert_greater - actual: "{{ nested_status_bundle_count }}" - threshold: "0" - - - name: scoped_delete_inventory - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "kubectl -n default delete pvc sw-block-demo-pvc-2 --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/delete-second-pvc.log 2>&1\nfor i in $(seq 1 120); do if ! kubectl -n default get deploy -l app=sw-blockvolume -o jsonpath='{range .items[*]}{.metadata.ownerReferences[0].name}{\"\\n\"}{end}' 2>/dev/null | grep -q '^sw-block-demo-pvc-2$'; then break; fi; sleep 1; done\nif kubectl -n default get deploy -l app=sw-blockvolume -o jsonpath='{range .items[*]}{.metadata.ownerReferences[0].name}{\"\\n\"}{end}' 2>/dev/null | grep -q '^sw-block-demo-pvc-2$'; then echo 'second PVC-owned deployment still present after delete' >&2; exit 1; fi\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/blockvolumes.after-delete-second-pvc.txt" - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; exit \"$rc\"'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete/volume-inventory-summary.txt" - pattern: "^volumes: total=1 ok=[0-1] unhealthy=[0-1] invalid=0$" - save_as: one_volume_after_delete_count - - action: assert_greater - actual: "{{ one_volume_after_delete_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc" - save_as: surviving_pvc_count - - action: assert_greater - actual: "{{ surviving_pvc_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q 'pvc=sw-block-demo-pvc-2\\|owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc-2\\|generated_deployment_missing\\|orphan-blockvolume-deploy' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/inventory-after-delete/volume-inventory-summary.txt" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-demo-pvc-2 --ignore-not-found=true --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/delete-second-pvc.log 2>&1 || true" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-cluster-inventory" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/csi-lifecycle-component-gate.yaml b/seaweed-block/testops/scenarios/csi-lifecycle-component-gate.yaml deleted file mode 100644 index dd0f465e29..0000000000 --- a/seaweed-block/testops/scenarios/csi-lifecycle-component-gate.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# Runner-native CSI lifecycle component gate. -# -# Goal: -# Run the fast CSI controller/node component tests that pin publish, -# stage, unpublish, unstage, and reattach semantics without requiring a -# privileged Linux initiator or Kubernetes workload. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/csi-lifecycle-component-gate.yaml - -name: csi-lifecycle-component-gate -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build" - - - name: pin_build - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/pin_build/git.status" - - - name: csi_component_tests - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -v ./core/csi | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log" - pattern: "--- PASS: TestG15e_CSIReattachUsesFreshPublishTargetAfterUnstage" - save_as: reattach_component_count - - action: assert_greater - actual: "{{ reattach_component_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log" - pattern: "--- PASS: TestNodeStage_FailsClosedOnStaleLoggedInSessionWithoutStagedIdentity" - save_as: stale_session_component_count - - action: assert_greater - actual: "{{ stale_session_component_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component/core-csi-go-test.log" - pattern: "--- PASS: TestNodeStageUnstage_RepeatedCyclesLeaveNoLocalState" - save_as: repeated_cycle_component_count - - action: assert_greater - actual: "{{ repeated_cycle_component_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-lifecycle-component" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/csi-rf1-durable-restart-chain.yaml b/seaweed-block/testops/scenarios/csi-rf1-durable-restart-chain.yaml deleted file mode 100644 index 3bb285aa17..0000000000 --- a/seaweed-block/testops/scenarios/csi-rf1-durable-restart-chain.yaml +++ /dev/null @@ -1,278 +0,0 @@ -# Runner-native RF=1 durable blockvolume restart chain. -# -# Goal: -# clean target -> build/import alpha images -> run dynamic PVC with durable -# generated blockvolume hostPath state -> restart generated blockvolume -# Deployment -> verify replacement app pod reads pre-restart bytes -> collect. -# -# Expected invocation from sw-test-runner-standalone: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/csi-rf1-durable-restart-chain.yaml - -name: csi-rf1-durable-restart-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: pin_image_id_count - - action: assert_greater - actual: "{{ pin_image_id_count }}" - threshold: "0" - - - name: durable_blockvolume_restart - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-k8s-blockvolume-restart.sh {{ product_root }}" - env.SW_BLOCK_ALPHA_IMAGES_ENV: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/pin_build/alpha-images.env" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart" - env.SW_BLOCK_LAUNCHER_STATE_HOSTPATH: "/var/lib/sw-block/testops-{{ run_id }}-csi-rf1-restart" - env.SW_BLOCK_COLLECT_INVENTORY_AFTER_RESTART: "1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/run.log" - pattern: "\\[app-demo\\] PASS:" - save_as: app_pass_count - - action: assert_greater - actual: "{{ app_pass_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/run.log" - pattern: "restart_blockvolume_before_reader=1" - save_as: restart_mode_count - - action: assert_greater - actual: "{{ restart_mode_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/block-stack.rendered.yaml" - pattern: "--launcher-status" - save_as: launcher_status_count - - action: assert_greater - actual: "{{ launcher_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/block-stack.rendered.yaml" - pattern: "--launcher-state-hostpath=/var/lib/sw-block/testops-{{ run_id }}-csi-rf1-restart" - save_as: launcher_state_hostpath_count - - action: assert_greater - actual: "{{ launcher_state_hostpath_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml" - pattern: "hostPath:" - save_as: generated_hostpath_count - - action: assert_greater - actual: "{{ generated_hostpath_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml" - pattern: "type: DirectoryOrCreate" - save_as: generated_hostpath_type_count - - action: assert_greater - actual: "{{ generated_hostpath_type_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml" - pattern: "--status-addr=127.0.0.1:" - save_as: generated_status_addr_count - - action: assert_greater - actual: "{{ generated_status_addr_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "awk 'BEGIN{in_volumes=0;in_state=0;bad=0} /^[[:space:]]*volumes:[[:space:]]*$/{in_volumes=1;next} in_volumes && /^[^[:space:]]/{in_volumes=0;in_state=0} in_volumes && /^[[:space:]]*-[[:space:]]*name:[[:space:]]*state[[:space:]]*$/{in_state=1;next} in_state && /^[[:space:]]*-[[:space:]]*name:[[:space:]]*/{in_state=0} in_state && /emptyDir:/{bad=1} END{exit bad}' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/generated-blockvolume.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.before-restart.tsv && test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.after-restart.tsv && ! cmp -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.before-restart.tsv /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-pod-ids.after-restart.tsv" - - action: exec - node: m02 - cmd: "! grep -q 'iqn.2026-05.io.seaweedfs' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/iscsi-sessions.before-blockvolume-restart.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/restart-blockvolume-status.log" - pattern: "successfully rolled out" - save_as: blockvolume_rollout_count - - action: assert_greater - actual: "{{ blockvolume_rollout_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/reader.describe.before-delete.txt" - pattern: "Status: Succeeded" - save_as: reader_succeeded_describe_count - - action: assert_greater - actual: "{{ reader_succeeded_describe_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json" - pattern: "\"ReplicaID\"[[:space:]]*:[[:space:]]*\"r1\"" - save_as: durable_status_replica_count - - action: assert_greater - actual: "{{ durable_status_replica_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json" - pattern: "\"Epoch\"[[:space:]]*:[[:space:]]*[1-9][0-9]*" - save_as: durable_status_epoch_count - - action: assert_greater - actual: "{{ durable_status_epoch_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json" - pattern: "\"Latched\"[[:space:]]*:[[:space:]]*true" - save_as: durable_status_latched_count - - action: assert_greater - actual: "{{ durable_status_latched_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/status-durable-after-blockvolume-restart.json" - pattern: "\"Operational\"[[:space:]]*:[[:space:]]*true" - save_as: durable_status_operational_count - - action: assert_greater - actual: "{{ durable_status_operational_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/blockvolume-generated.after-restart.log" - pattern: "\"phase\":\"iscsi-listening\"" - save_as: blockvolume_iscsi_listening_count - - action: assert_greater - actual: "{{ blockvolume_iscsi_listening_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/lifecycle-volumes.after-blockvolume-restart.json" - pattern: "\"protocol\"[[:space:]]*:[[:space:]]*\"iscsi\"" - save_as: lifecycle_after_restart_protocol_count - - action: assert_greater - actual: "{{ lifecycle_after_restart_protocol_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volume-inventory-summary.txt" - pattern: "^volume: .*pvc=sw-block-demo-pvc .*protocols=iscsi" - save_as: inventory_after_restart_volume_count - - action: assert_greater - actual: "{{ inventory_after_restart_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volume-inventory-summary.txt" - pattern: "^replica: .*support_bundle=volumes/" - save_as: inventory_after_restart_support_bundle_count - - action: assert_greater - actual: "{{ inventory_after_restart_support_bundle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volume-inventory-summary.txt" - pattern: "lifecycle_owner=pvc-owner-ref owner_ref=PersistentVolumeClaim/default/sw-block-demo-pvc" - save_as: inventory_after_restart_owner_ref_count - - action: assert_greater - actual: "{{ inventory_after_restart_owner_ref_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/nested-ops-status-bundles.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: nested_ops_status_bundle_count - - action: assert_greater - actual: "{{ nested_ops_status_bundle_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "find /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain/durable_blockvolume_restart/ops-inventory-after-restart/volumes -name volume-status-summary.txt -exec grep -q '^durable_entry: .*latched=true .*operational=true' {} \\; -print | grep -q ." - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-csi-rf1-restart" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-chain" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/csi-rf1-durable-restart-component-gate.yaml b/seaweed-block/testops/scenarios/csi-rf1-durable-restart-component-gate.yaml deleted file mode 100644 index 79be56d15d..0000000000 --- a/seaweed-block/testops/scenarios/csi-rf1-durable-restart-component-gate.yaml +++ /dev/null @@ -1,120 +0,0 @@ -# Runner-native RF=1 durable restart component gate. -# -# Goal: -# Pin the cheap contracts behind csi-rf1-durable-restart-chain without -# launching k3s: restart wrapper shape, generated hostPath/status manifests, -# master frontend status projection, and durable status endpoint lineage. -# The full csi-rf1-durable-restart-chain remains the end-to-end proof for -# pod restart, reattach timing, and mounted data continuity. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/csi-rf1-durable-restart-component-gate.yaml - -name: csi-rf1-durable-restart-component-gate -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build" - - - name: pin_build - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/pin_build/git.status" - - - name: restart_component_tests - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -json -run \"^(TestCSIRF1DurableRestartScripts_PinBlockvolumeRestartContract|TestG15d_K8sRenderer_CanUseHostPathStateVolume|TestG15d_K8sRenderer_DurableHostPathPreservesOwnerRefAndStatus|TestG15d_K8sRenderer_CanOptIntoBlockVolumeStatusEndpoint|TestStatusFrontendsForAssignedLine_ReturnsObservedFrontendFacts|TestStatusServer_DurableStatusEndpoint_EnabledAfterStart_ReturnsLineage)$\" ./internal/testops ./core/host/master ./core/host/volume ./core/launcher | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestCSIRF1DurableRestartScripts_PinBlockvolumeRestartContract\"" - save_as: restart_wrapper_shape_count - - action: assert_greater - actual: "{{ restart_wrapper_shape_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestG15d_K8sRenderer_CanUseHostPathStateVolume\"" - save_as: hostpath_render_count - - action: assert_greater - actual: "{{ hostpath_render_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestG15d_K8sRenderer_DurableHostPathPreservesOwnerRefAndStatus\"" - save_as: hostpath_owner_ref_status_count - - action: assert_greater - actual: "{{ hostpath_owner_ref_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestG15d_K8sRenderer_CanOptIntoBlockVolumeStatusEndpoint\"" - save_as: status_render_count - - action: assert_greater - actual: "{{ status_render_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusFrontendsForAssignedLine_ReturnsObservedFrontendFacts\"" - save_as: master_frontend_projection_count - - action: assert_greater - actual: "{{ master_frontend_projection_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component/restart-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_DurableStatusEndpoint_EnabledAfterStart_ReturnsLineage\"" - save_as: durable_status_lineage_count - - action: assert_greater - actual: "{{ durable_status_lineage_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-component" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/csi-rf1-durable-restart-failure-chain.yaml b/seaweed-block/testops/scenarios/csi-rf1-durable-restart-failure-chain.yaml deleted file mode 100644 index df25ff003e..0000000000 --- a/seaweed-block/testops/scenarios/csi-rf1-durable-restart-failure-chain.yaml +++ /dev/null @@ -1,140 +0,0 @@ -# Runner-native RF=1 durable restart partial-state chain. -# -# Goal: -# Prove that a controlled post-restart blockvolume outage produces an -# actionable inventory bundle instead of a silent reader timeout. - -name: csi-rf1-durable-restart-failure-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: pin_image_id_count - - action: assert_greater - actual: "{{ pin_image_id_count }}" - threshold: "0" - - - name: durable_hostpath_unwritable - actions: - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/proc/sw-block-testops-{{ run_id }} SW_BLOCK_COLLECT_INVENTORY_ON_FAILURE=1 bash scripts/run-k8s-blockvolume-restart.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/exit_code.txt; test \"$rc\" -ne 0'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/run.log" - pattern: "launcher_state_hostpath=/proc/sw-block-testops-{{ run_id }}" - save_as: bad_hostpath_count - - action: assert_greater - actual: "{{ bad_hostpath_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/exit_code.txt" - pattern: "^[1-9][0-9]*$" - save_as: failed_exit_count - - action: assert_greater - actual: "{{ failed_exit_count }}" - threshold: "0" - - - name: failure_bundle_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt" - pattern: "^inventory_status: unhealthy$" - save_as: inventory_unhealthy_count - - action: assert_greater - actual: "{{ inventory_unhealthy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc" - save_as: pvc_row_count - - action: assert_greater - actual: "{{ pvc_row_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt" - pattern: "generated_deployment_missing\\|observed_replicas=0 desired_replicas=1\\|replica_degraded=r1 status=unhealthy\\|ops_status=unhealthy" - save_as: actionable_issue_count - - action: assert_greater - actual: "{{ actionable_issue_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/ops-inventory-bundle.json" - pattern: "\"command\": \"sw-block ops inventory\"" - save_as: inventory_bundle_count - - action: assert_greater - actual: "{{ inventory_bundle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure/restart_failure/ops-inventory-on-failure/volume-inventory-summary.txt" - pattern: "collection_error: ops_status:" - save_as: collection_error_count - - action: assert_greater - actual: "{{ collection_error_count }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-csi-rf1-restart-failure" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/data-plane-address-capability-chain.yaml b/seaweed-block/testops/scenarios/data-plane-address-capability-chain.yaml deleted file mode 100644 index 4a7876febd..0000000000 --- a/seaweed-block/testops/scenarios/data-plane-address-capability-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -name: data-plane-address-capability-chain -timeout: 10m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address bash scripts/run-phase121-data-plane-address-capability-gate.sh {{ product_root }}" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^phase121_data_plane_address_capability_status=ok$" - save_as: phase121_status_ok - - action: assert_greater - actual: "{{ phase121_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^management_ip_m01=192\\.168\\.1\\.181$" - save_as: management_ip_recorded - - action: assert_greater - actual: "{{ management_ip_recorded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^publish_target_ip_m01=10\\.0\\.0\\.181$" - save_as: data_plane_ip_recorded - - action: assert_greater - actual: "{{ data_plane_ip_recorded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^publish_target_network_class=100gbe_tcp$" - save_as: network_class_recorded - - action: assert_greater - actual: "{{ network_class_recorded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^frontend_transport=tcp$" - save_as: tcp_transport - - action: assert_greater - actual: "{{ tcp_transport }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^nvme_rdma_supported=false$" - save_as: rdma_not_supported - - action: assert_greater - actual: "{{ rdma_not_supported }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^internal_ip_not_reused_as_performance_target=true$" - save_as: internal_ip_not_reused - - action: assert_greater - actual: "{{ internal_ip_not_reused }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address/phase121-data-plane-address-capability-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase121-data-plane-address" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-authority-callsite-chain.yaml b/seaweed-block/testops/scenarios/failback-authority-callsite-chain.yaml deleted file mode 100644 index 8ffbc64abb..0000000000 --- a/seaweed-block/testops/scenarios/failback-authority-callsite-chain.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Runner-native Phase 79 gate: the failback executor can call the -# authority-owned runtime adapter. Execution remains explicit-policy gated, and -# stale expected-current evidence blocks the call-site without a false failback. - -name: failback-authority-callsite-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_authority_callsite_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite bash scripts/run-phase79-failback-authority-callsite-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^phase79_failback_authority_callsite_status=ok$" - save_as: phase79_ok - - action: assert_greater - actual: "{{ phase79_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^authority_runtime_adapter_invoked_by_executor=true$" - save_as: adapter_invoked - - action: assert_greater - actual: "{{ adapter_invoked }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^publisher_authority_line_advanced=true$" - save_as: publisher_advanced - - action: assert_greater - actual: "{{ publisher_advanced }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^stale_expected_current_blocks_callsite=true$" - save_as: stale_guard - - action: assert_greater - actual: "{{ stale_guard }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^execution_policy_still_required=true$" - save_as: policy_gate - - action: assert_greater - actual: "{{ policy_gate }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^failed_back_status_written=true$" - save_as: failed_back_status - - action: assert_greater - actual: "{{ failed_back_status }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^runtime_failure_no_false_failback=true$" - save_as: no_false_failback - - action: assert_greater - actual: "{{ no_false_failback }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite/phase79-failback-authority-callsite-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase79-failback-authority-callsite" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-authority-runtime-chain.yaml b/seaweed-block/testops/scenarios/failback-authority-runtime-chain.yaml deleted file mode 100644 index de3401caa2..0000000000 --- a/seaweed-block/testops/scenarios/failback-authority-runtime-chain.yaml +++ /dev/null @@ -1,125 +0,0 @@ -# Runner-native Phase 78 gate: failback has a first authority-owned runtime -# seam. It mints authority reassignment through Publisher.apply only after -# expected-current and terminal-evidence guards pass. Default behavior remains -# disabled and non-mutating. - -name: failback-authority-runtime-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_authority_runtime_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime bash scripts/run-phase78-failback-authority-runtime-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^phase78_failback_authority_runtime_status=ok$" - save_as: phase78_ok - - action: assert_greater - actual: "{{ phase78_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^authority_failback_reassign_minted=true$" - save_as: reassign_minted - - action: assert_greater - actual: "{{ reassign_minted }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^stale_expected_current_rejected=true$" - save_as: stale_guard - - action: assert_greater - actual: "{{ stale_guard }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^terminal_preconditions_required=true$" - save_as: terminal_guard - - action: assert_greater - actual: "{{ terminal_guard }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^failback_target_endpoint_fields=true$" - save_as: endpoint_fields - - action: assert_greater - actual: "{{ endpoint_fields }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^failback_target_expected_current_fields=true$" - save_as: expected_current_fields - - action: assert_greater - actual: "{{ expected_current_fields }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^executable_failback_requires_authority_endpoint=true$" - save_as: executable_requires_endpoint - - action: assert_greater - actual: "{{ executable_requires_endpoint }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^explicit_runtime_authority_mutation_allowed=true$" - save_as: authority_mutation - - action: assert_greater - actual: "{{ authority_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime/phase78-failback-authority-runtime-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase78-failback-authority-runtime" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml b/seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml deleted file mode 100644 index a8cfb445ea..0000000000 --- a/seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Runner-native Phase 83 gate: Helm chart wiring for the failback gRPC -# runtime transport. The default chart remains non-mutating; explicit values -# render the blockmaster RPC flag plus executor execution/gRPC flags. - -name: failback-chart-runtime-chain -timeout: 6m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_chart_runtime_gate - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime bash scripts/run-phase83-failback-chart-runtime-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^phase83_failback_chart_runtime_status=ok$" - save_as: phase83_ok - - action: assert_greater - actual: "{{ phase83_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^default_omits_failback_runtime_rpc=true$" - save_as: default_rpc_off - - action: assert_greater - actual: "{{ default_rpc_off }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^enabled_renders_failback_runtime_rpc=true$" - save_as: enabled_rpc - - action: assert_greater - actual: "{{ enabled_rpc }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^enabled_renders_failback_grpc_addr=true$" - save_as: enabled_grpc - - action: assert_greater - actual: "{{ enabled_grpc }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^rejects_execution_with_dry_run=true$" - save_as: rejects_dryrun - - action: assert_greater - actual: "{{ rejects_dryrun }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^rejects_execution_without_policy=true$" - save_as: rejects_policy - - action: assert_greater - actual: "{{ rejects_policy }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^rejects_ambiguous_runtime_transports=true$" - save_as: rejects_ambiguous - - action: assert_greater - actual: "{{ rejects_ambiguous }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" - pattern: "^chart_default_remains_non_mutating=true$" - save_as: default_non_mutating - - action: assert_greater - actual: "{{ default_non_mutating }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-deployed-grpc-smoke-chain.yaml b/seaweed-block/testops/scenarios/failback-deployed-grpc-smoke-chain.yaml deleted file mode 100644 index 0755e0b2bf..0000000000 --- a/seaweed-block/testops/scenarios/failback-deployed-grpc-smoke-chain.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Runner-native Phase 94 gate: full opt-in failback suite renders coherently and -# the executor can call a real blockmaster FailbackService in local test. -# This is not a live Kubernetes install claim. - -name: failback-deployed-grpc-smoke-chain -timeout: 6m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_deployed_grpc_smoke_gate - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke bash scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt" - pattern: "^phase94_failback_deployed_grpc_smoke_status=ok$" - save_as: phase94_ok - - action: assert_greater - actual: "{{ phase94_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt" - pattern: "^enabled_renders_failback_runtime_rpc=true$" - save_as: runtime_rpc - - action: assert_greater - actual: "{{ runtime_rpc }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt" - pattern: "^enabled_target_owner_activates_targets=true$" - save_as: target_activation - - action: assert_greater - actual: "{{ target_activation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt" - pattern: "^enabled_executor_grpc_runtime=true$" - save_as: executor_grpc - - action: assert_greater - actual: "{{ executor_grpc }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt" - pattern: "^executor_grpc_uses_real_master_service=true$" - save_as: real_master_grpc - - action: assert_greater - actual: "{{ real_master_grpc }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt" - pattern: "^live_kubernetes_install_claimed=false$" - save_as: no_live_install_claim - - action: assert_greater - actual: "{{ no_live_install_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-deployed-suite-chain.yaml b/seaweed-block/testops/scenarios/failback-deployed-suite-chain.yaml deleted file mode 100644 index c817f2a6f5..0000000000 --- a/seaweed-block/testops/scenarios/failback-deployed-suite-chain.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Runner-native Phase 88 gate: returned-replica failback can be packaged as a -# deployable component suite. This is still a chart/RBAC gate, not a live -# authority-mutation claim. - -name: failback-deployed-suite-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_deployed_suite_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite bash scripts/run-phase88-failback-deployed-suite-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^phase88_failback_deployed_suite_status=ok$" - save_as: phase88_ok - - action: assert_greater - actual: "{{ phase88_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^default_omits_failback_target_owner=true$" - save_as: target_default_off - - action: assert_greater - actual: "{{ target_default_off }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^enabled_renders_failback_target_owner=true$" - save_as: target_owner_enabled - - action: assert_greater - actual: "{{ target_owner_enabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^enabled_renders_failback_executor=true$" - save_as: executor_enabled - - action: assert_greater - actual: "{{ executor_enabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^values_schema_covers_failback_suite=true$" - save_as: schema_covers_suite - - action: assert_greater - actual: "{{ schema_covers_suite }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^target_owner_rbac_create_targets_only=true$" - save_as: target_owner_rbac - - action: assert_greater - actual: "{{ target_owner_rbac }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^executor_rbac_status_only=true$" - save_as: executor_rbac - - action: assert_greater - actual: "{{ executor_rbac }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite/phase88-failback-deployed-suite-summary.txt" - pattern: "^automatic_failback_claimed=false$" - save_as: no_auto_claim - - action: assert_greater - actual: "{{ no_auto_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase88-failback-deployed-suite" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-docs-alignment-chain.yaml b/seaweed-block/testops/scenarios/failback-docs-alignment-chain.yaml deleted file mode 100644 index 10b2df4b6a..0000000000 --- a/seaweed-block/testops/scenarios/failback-docs-alignment-chain.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Runner-native Phase 87 gate: docs agree that returned-replica failback -# runtime is opt-in/source-gated and automatic deployed failback is not claimed. - -name: failback-docs-alignment-chain -timeout: 4m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_docs_alignment - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment bash scripts/run-phase87-failback-docs-alignment-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment/phase87-failback-docs-alignment-summary.txt" - pattern: "^phase87_failback_docs_alignment_status=ok$" - save_as: phase87_ok - - action: assert_greater - actual: "{{ phase87_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment/phase87-failback-docs-alignment-summary.txt" - pattern: "^automatic_failback_not_claimed=true$" - save_as: no_auto - - action: assert_greater - actual: "{{ no_auto }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment/phase87-failback-docs-alignment-summary.txt" - pattern: "^frontend_publication_after_failback_not_claimed=true$" - save_as: no_publication - - action: assert_greater - actual: "{{ no_publication }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase87-failback-docs-alignment" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-executor-boundary-chain.yaml b/seaweed-block/testops/scenarios/failback-executor-boundary-chain.yaml deleted file mode 100644 index e1e1dc28c0..0000000000 --- a/seaweed-block/testops/scenarios/failback-executor-boundary-chain.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Runner-native Phase 76 gate: SwBlockReplicaFailback executor writes -# disabled/blocked status only. It does not execute failback, advance authority, -# swap publish targets, publish frontend paths, or mutate storage. - -name: failback-executor-boundary-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_executor_boundary_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary bash scripts/run-phase76-failback-executor-boundary-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^phase76_failback_executor_boundary_status=ok$" - save_as: phase76_ok - - action: assert_greater - actual: "{{ phase76_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^failback_executor_writes_disabled_status=true$" - save_as: writes_disabled - - action: assert_greater - actual: "{{ writes_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^failback_executor_dry_run_no_status_write=true$" - save_as: dry_run_no_write - - action: assert_greater - actual: "{{ dry_run_no_write }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^kubernetes_writer_failback_status_subresource=true$" - save_as: status_subresource - - action: assert_greater - actual: "{{ status_subresource }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^failback_executor_rbac_status_only=true$" - save_as: rbac_status_only - - action: assert_greater - actual: "{{ rbac_status_only }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^failback_attempts=0$" - save_as: no_failback_attempt - - action: assert_greater - actual: "{{ no_failback_attempt }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^authority_mutation_allowed=false$" - save_as: no_authority_mutation - - action: assert_greater - actual: "{{ no_authority_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary/phase76-failback-executor-boundary-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase76-failback-executor-boundary" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-executor-grpc-runtime-chain.yaml b/seaweed-block/testops/scenarios/failback-executor-grpc-runtime-chain.yaml deleted file mode 100644 index 4d0e1e2cf5..0000000000 --- a/seaweed-block/testops/scenarios/failback-executor-grpc-runtime-chain.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Runner-native Phase 82 gate: failback executor can use the blockmaster -# FailbackService gRPC runtime transport, still behind explicit execution -# policy. HTTP runtime remains supported; HTTP and gRPC are mutually exclusive. - -name: failback-executor-grpc-runtime-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_executor_grpc_runtime_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime bash scripts/run-phase82-failback-executor-grpc-runtime-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^phase82_failback_executor_grpc_runtime_status=ok$" - save_as: phase82_ok - - action: assert_greater - actual: "{{ phase82_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^grpc_runtime_calls_failback_service=true$" - save_as: grpc_calls_service - - action: assert_greater - actual: "{{ grpc_calls_service }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^cmd_grpc_runtime_writes_failed_back_status=true$" - save_as: grpc_status - - action: assert_greater - actual: "{{ grpc_status }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^cmd_grpc_runtime_requires_enable=true$" - save_as: requires_enable - - action: assert_greater - actual: "{{ requires_enable }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^cmd_rejects_ambiguous_runtime_transports=true$" - save_as: ambiguous_rejected - - action: assert_greater - actual: "{{ ambiguous_rejected }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^cmd_http_runtime_still_supported=true$" - save_as: http_still_supported - - action: assert_greater - actual: "{{ http_still_supported }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^execution_policy_still_required=true$" - save_as: policy_gate - - action: assert_greater - actual: "{{ policy_gate }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime/phase82-failback-executor-grpc-runtime-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase82-failback-executor-grpc-runtime" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-executor-policy-safety-chain.yaml b/seaweed-block/testops/scenarios/failback-executor-policy-safety-chain.yaml deleted file mode 100644 index 566ec9dbe2..0000000000 --- a/seaweed-block/testops/scenarios/failback-executor-policy-safety-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Runner-native Phase 85 gate: failback executor policy safety. Explicit -# execution flags do not cause runtime calls unless a valid executable target -# exists. - -name: failback-executor-policy-safety-chain -timeout: 6m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_executor_policy_safety - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety bash scripts/run-phase85-failback-executor-policy-safety-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^phase85_failback_executor_policy_safety_status=ok$" - save_as: phase85_ok - - action: assert_greater - actual: "{{ phase85_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^no_targets_no_runtime_call=true$" - save_as: no_targets - - action: assert_greater - actual: "{{ no_targets }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^invalid_target_no_runtime_call=true$" - save_as: invalid_target - - action: assert_greater - actual: "{{ invalid_target }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^execution_flags_alone_insufficient=true$" - save_as: flags_insufficient - - action: assert_greater - actual: "{{ flags_insufficient }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^runtime_requires_valid_target=true$" - save_as: requires_valid - - action: assert_greater - actual: "{{ requires_valid }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety/phase85-failback-executor-policy-safety-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage - - action: assert_greater - actual: "{{ no_storage }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase85-failback-executor-policy-safety" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-frontend-publication-target-chain.yaml b/seaweed-block/testops/scenarios/failback-frontend-publication-target-chain.yaml deleted file mode 100644 index d9c3bba02c..0000000000 --- a/seaweed-block/testops/scenarios/failback-frontend-publication-target-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Runner-native Phase 96 gate: terminal SwBlockReplicaFailback evidence creates -# a disabled SwBlockFrontendPublication target. This is not a frontend -# publication execution or data-path claim. - -name: failback-frontend-publication-target-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_frontend_publication_target_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target bash scripts/run-phase96-failback-frontend-publication-target-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^phase96_failback_frontend_publication_target_status=ok$" - save_as: phase96_ok - - action: assert_greater - actual: "{{ phase96_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^terminal_failed_back_creates_frontend_publication_target=true$" - save_as: target_created - - action: assert_greater - actual: "{{ target_created }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^non_terminal_failback_rejected=true$" - save_as: rejects_non_terminal - - action: assert_greater - actual: "{{ rejects_non_terminal }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^executor_accepts_failback_target_as_disabled=true$" - save_as: executor_disabled - - action: assert_greater - actual: "{{ executor_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_publication_attempts - - action: assert_greater - actual: "{{ no_publication_attempts }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^failback_attempts=0$" - save_as: no_failback_attempts - - action: assert_greater - actual: "{{ no_failback_attempts }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target/phase96-failback-frontend-publication-target-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase96-failback-frontend-publication-target" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-frontend-workload-close-chain.yaml b/seaweed-block/testops/scenarios/failback-frontend-workload-close-chain.yaml deleted file mode 100644 index fc1df7b4ba..0000000000 --- a/seaweed-block/testops/scenarios/failback-frontend-workload-close-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 98 close gate: deployed failback, product-owned frontend -# publication runtime confirmation, post-publication workload I/O, and cleanup. - -name: failback-frontend-workload-close-chain -timeout: 35m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_frontend_workload_close_gate - actions: - - action: exec - node: m02 - timeout: 34m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close bash scripts/run-phase98-failback-frontend-workload-close-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^phase98_failback_frontend_workload_close_status=ok$" - save_as: phase98_ok - - action: assert_greater - actual: "{{ phase98_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^executor_status_failed_back=true$" - save_as: failback_done - - action: assert_greater - actual: "{{ failback_done }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^frontend_published=true$" - save_as: frontend_published - - action: assert_greater - actual: "{{ frontend_published }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^frontend_publication_failback_started=false$" - save_as: no_second_failback - - action: assert_greater - actual: "{{ no_second_failback }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^post_failback_publication_writer_verified=true$" - save_as: post_writer - - action: assert_greater - actual: "{{ post_writer }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^post_failback_publication_reader_verified=true$" - save_as: post_reader - - action: assert_greater - actual: "{{ post_reader }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close/phase98-failback-frontend-workload-close-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase98-failback-frontend-workload-close" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-grpc-runtime-endpoint-decoupling-chain.yaml b/seaweed-block/testops/scenarios/failback-grpc-runtime-endpoint-decoupling-chain.yaml deleted file mode 100644 index a9be0971ab..0000000000 --- a/seaweed-block/testops/scenarios/failback-grpc-runtime-endpoint-decoupling-chain.yaml +++ /dev/null @@ -1,87 +0,0 @@ -# Runner-native Phase 86 gate: an explicit gRPC failback runtime address is -# sufficient; the target does not need the legacy HTTP runtimeEndpoint field. - -name: failback-grpc-runtime-endpoint-decoupling-chain -timeout: 6m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_grpc_runtime_endpoint_decoupling - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling bash scripts/run-phase86-failback-grpc-runtime-endpoint-decoupling-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt" - pattern: "^phase86_failback_grpc_runtime_endpoint_decoupling_status=ok$" - save_as: phase86_ok - - action: assert_greater - actual: "{{ phase86_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt" - pattern: "^grpc_runtime_does_not_require_target_runtime_endpoint=true$" - save_as: grpc_no_endpoint - - action: assert_greater - actual: "{{ grpc_no_endpoint }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt" - pattern: "^legacy_http_runtime_endpoint_still_supported=true$" - save_as: http_supported - - action: assert_greater - actual: "{{ http_supported }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt" - pattern: "^real_master_grpc_service_without_target_endpoint=true$" - save_as: real_master - - action: assert_greater - actual: "{{ real_master }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling/phase86-failback-grpc-runtime-endpoint-decoupling-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage - - action: assert_greater - actual: "{{ no_storage }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase86-failback-grpc-runtime-endpoint-decoupling" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-handoff-isolation-chain.yaml b/seaweed-block/testops/scenarios/failback-handoff-isolation-chain.yaml deleted file mode 100644 index 49cbc90fcc..0000000000 --- a/seaweed-block/testops/scenarios/failback-handoff-isolation-chain.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# Runner-native Phase 93 gate: multi-volume target-owner -> executor handoff -# isolation. Runtime requests must not mix expected-current authority or target -# addresses across volumes. - -name: failback-handoff-isolation-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_handoff_isolation_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation bash scripts/run-phase93-failback-handoff-isolation-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt" - pattern: "^phase93_failback_handoff_isolation_status=ok$" - save_as: phase93_ok - - action: assert_greater - actual: "{{ phase93_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt" - pattern: "^multi_volume_target_create_count=2$" - save_as: target_count - - action: assert_greater - actual: "{{ target_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt" - pattern: "^multi_volume_runtime_request_count=2$" - save_as: request_count - - action: assert_greater - actual: "{{ request_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt" - pattern: "^cross_volume_expected_current_mixup=false$" - save_as: no_expected_current_mixup - - action: assert_greater - actual: "{{ no_expected_current_mixup }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation/phase93-failback-handoff-isolation-summary.txt" - pattern: "^cross_volume_target_addr_mixup=false$" - save_as: no_target_addr_mixup - - action: assert_greater - actual: "{{ no_target_addr_mixup }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase93-failback-handoff-isolation" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-integrated-grpc-smoke-chain.yaml b/seaweed-block/testops/scenarios/failback-integrated-grpc-smoke-chain.yaml deleted file mode 100644 index cea0203a29..0000000000 --- a/seaweed-block/testops/scenarios/failback-integrated-grpc-smoke-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 84 gate: local integrated smoke for failback executor -> -# gRPC runtime -> real blockmaster FailbackService -> master Publisher. - -name: failback-integrated-grpc-smoke-chain -timeout: 6m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_integrated_grpc_smoke - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc bash scripts/run-phase84-failback-integrated-grpc-smoke.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^phase84_failback_integrated_grpc_status=ok$" - save_as: phase84_ok - - action: assert_greater - actual: "{{ phase84_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^service_default_disabled_test=true$" - save_as: default_disabled - - action: assert_greater - actual: "{{ default_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^executor_grpc_uses_real_master_service=true$" - save_as: integrated - - action: assert_greater - actual: "{{ integrated }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^master_publisher_epoch_advanced=true$" - save_as: epoch_advanced - - action: assert_greater - actual: "{{ epoch_advanced }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^publish_target_swapped_after_failback=true$" - save_as: target_swapped - - action: assert_greater - actual: "{{ target_swapped }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc/phase84-failback-integrated-grpc-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage - - action: assert_greater - actual: "{{ no_storage }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase84-failback-integrated-grpc" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-live-deployed-suite-chain.yaml b/seaweed-block/testops/scenarios/failback-live-deployed-suite-chain.yaml deleted file mode 100644 index a3a168c31a..0000000000 --- a/seaweed-block/testops/scenarios/failback-live-deployed-suite-chain.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# Runner-native Phase 95 gate: install the failback target-owner/executor -# suite in k3s and drive one real blockmaster gRPC failback authority call -# from an in-cluster executor. This is not a frontend publication claim. - -name: failback-live-deployed-suite-chain -timeout: 35m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_live_deployed_suite_gate - actions: - - action: exec - node: m02 - timeout: 34m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite bash scripts/run-phase95-failback-live-deployed-suite-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^phase95_failback_live_deployed_suite_status=ok$" - save_as: phase95_ok - - action: assert_greater - actual: "{{ phase95_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^helm_install=pass$" - save_as: helm_install_pass - - action: assert_greater - actual: "{{ helm_install_pass }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^first_volume_writer_reader=pass$" - save_as: first_volume_pass - - action: assert_greater - actual: "{{ first_volume_pass }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^failback_target_created=true$" - save_as: target_created - - action: assert_greater - actual: "{{ target_created }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^failback_executor_completed=true$" - save_as: executor_completed - - action: assert_greater - actual: "{{ executor_completed }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^executor_status_failed_back=true$" - save_as: failed_back - - action: assert_greater - actual: "{{ failed_back }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^master_publisher_epoch_advanced=true$" - save_as: epoch_advanced - - action: assert_greater - actual: "{{ epoch_advanced }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^publish_target_swapped_after_failback=true$" - save_as: target_swapped - - action: assert_greater - actual: "{{ target_swapped }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^frontend_publication_after_failback_claimed=false$" - save_as: no_frontend_claim - - action: assert_greater - actual: "{{ no_frontend_claim }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite/phase95-failback-live-deployed-suite-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase95-failback-live-deployed-suite" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-runtime-contract-chain.yaml b/seaweed-block/testops/scenarios/failback-runtime-contract-chain.yaml deleted file mode 100644 index 3770d43f04..0000000000 --- a/seaweed-block/testops/scenarios/failback-runtime-contract-chain.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Runner-native Phase 77 gate: failback has a typed runtime contract and -# explicit execution-policy gate. Default reconciliation remains disabled; a -# fake runtime can report terminal evidence only in tests. - -name: failback-runtime-contract-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_runtime_contract_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract bash scripts/run-phase77-failback-runtime-contract-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^phase77_failback_runtime_contract_status=ok$" - save_as: phase77_ok - - action: assert_greater - actual: "{{ phase77_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^failback_execution_policy_gate=true$" - save_as: policy_gate - - action: assert_greater - actual: "{{ policy_gate }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^failback_runtime_invoked_only_when_enabled=true$" - save_as: runtime_gated - - action: assert_greater - actual: "{{ runtime_gated }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^runtime_failure_no_false_failback=true$" - save_as: failure_no_false - - action: assert_greater - actual: "{{ failure_no_false }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^runtime_invalid_terminal_evidence_no_false_failback=true$" - save_as: invalid_no_false - - action: assert_greater - actual: "{{ invalid_no_false }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^http_runtime_contract_posts_request=true$" - save_as: http_contract - - action: assert_greater - actual: "{{ http_contract }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^target_writer_serializes_runtime_fields=true$" - save_as: writer_contract - - action: assert_greater - actual: "{{ writer_contract }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract/phase77-failback-runtime-contract-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase77-failback-runtime-contract" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-service-rpc-chain.yaml b/seaweed-block/testops/scenarios/failback-service-rpc-chain.yaml deleted file mode 100644 index c2da5ac3ef..0000000000 --- a/seaweed-block/testops/scenarios/failback-service-rpc-chain.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Runner-native Phase 81 gate: blockmaster has a FailbackService RPC that is -# registered but disabled by default. Enabling it is explicit and still requires -# expected-current + terminal evidence. - -name: failback-service-rpc-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_service_rpc_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc bash scripts/run-phase81-failback-service-rpc-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^phase81_failback_service_rpc_status=ok$" - save_as: phase81_ok - - action: assert_greater - actual: "{{ phase81_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^failback_service_default_disabled=true$" - save_as: default_disabled - - action: assert_greater - actual: "{{ default_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^failback_runtime_rpc_flag_default_false=true$" - save_as: flag_default_false - - action: assert_greater - actual: "{{ flag_default_false }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^failback_runtime_rpc_flag_opt_in=true$" - save_as: flag_opt_in - - action: assert_greater - actual: "{{ flag_opt_in }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^failback_service_registered=true$" - save_as: service_registered - - action: assert_greater - actual: "{{ service_registered }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^enabled_failback_service_advances_publisher=true$" - save_as: enabled_advances - - action: assert_greater - actual: "{{ enabled_advances }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^public_rpc_enabled_by_default=false$" - save_as: public_rpc_default_off - - action: assert_greater - actual: "{{ public_rpc_default_off }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc/phase81-failback-service-rpc-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase81-failback-service-rpc" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-target-activation-policy-chain.yaml b/seaweed-block/testops/scenarios/failback-target-activation-policy-chain.yaml deleted file mode 100644 index 48ddcb8eb3..0000000000 --- a/seaweed-block/testops/scenarios/failback-target-activation-policy-chain.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Runner-native Phase 91 gate: failback target activation is explicit, -# default-off, and requires both policy and runtime endpoint. The target owner -# may stamp enabled targets, but it does not call the runtime. - -name: failback-target-activation-policy-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_target_activation_policy_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy bash scripts/run-phase91-failback-target-activation-policy-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt" - pattern: "^phase91_failback_target_activation_policy_status=ok$" - save_as: phase91_ok - - action: assert_greater - actual: "{{ phase91_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt" - pattern: "^activation_default_off=true$" - save_as: activation_default_off - - action: assert_greater - actual: "{{ activation_default_off }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt" - pattern: "^activation_policy_required=true$" - save_as: policy_required - - action: assert_greater - actual: "{{ policy_required }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt" - pattern: "^activation_runtime_endpoint_required=true$" - save_as: runtime_required - - action: assert_greater - actual: "{{ runtime_required }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt" - pattern: "^activated_target_failback_decision=enabled$" - save_as: target_enabled - - action: assert_greater - actual: "{{ target_enabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy/phase91-failback-target-activation-policy-summary.txt" - pattern: "^failback_runtime_call_attempted=false$" - save_as: no_runtime_call - - action: assert_greater - actual: "{{ no_runtime_call }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase91-failback-target-activation-policy" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-target-authority-chain.yaml b/seaweed-block/testops/scenarios/failback-target-authority-chain.yaml deleted file mode 100644 index 40fbb66fb2..0000000000 --- a/seaweed-block/testops/scenarios/failback-target-authority-chain.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Runner-native Phase 90 gate: failback target owner consumes current -# SwBlockVolume.status authority facts before creating a failback target. -# This does not execute failback or publish a frontend. - -name: failback-target-authority-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_target_authority_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority bash scripts/run-phase90-failback-target-authority-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt" - pattern: "^phase90_failback_target_authority_status=ok$" - save_as: phase90_ok - - action: assert_greater - actual: "{{ phase90_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt" - pattern: "^expected_current_replica_from_swblockvolume_status=true$" - save_as: expected_replica_from_status - - action: assert_greater - actual: "{{ expected_replica_from_status }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt" - pattern: "^expected_current_epoch_from_swblockvolume_status=true$" - save_as: expected_epoch_from_status - - action: assert_greater - actual: "{{ expected_epoch_from_status }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt" - pattern: "^missing_current_authority_target_create_count=0$" - save_as: missing_authority_no_target - - action: assert_greater - actual: "{{ missing_authority_no_target }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt" - pattern: "^created_target_failback_decision=disabled$" - save_as: target_disabled - - action: assert_greater - actual: "{{ target_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority/phase90-failback-target-authority-summary.txt" - pattern: "^failback_runtime_call_attempted=false$" - save_as: no_runtime_call - - action: assert_greater - actual: "{{ no_runtime_call }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase90-failback-target-authority" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-target-executor-handoff-chain.yaml b/seaweed-block/testops/scenarios/failback-target-executor-handoff-chain.yaml deleted file mode 100644 index f68457c457..0000000000 --- a/seaweed-block/testops/scenarios/failback-target-executor-handoff-chain.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Runner-native Phase 92 gate: target owner creates an enabled failback target, -# executor consumes it through a fake/local runtime, and expected-current -# authority facts reach the runtime request. - -name: failback-target-executor-handoff-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_target_executor_handoff_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff bash scripts/run-phase92-failback-target-executor-handoff-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt" - pattern: "^phase92_failback_target_executor_handoff_status=ok$" - save_as: phase92_ok - - action: assert_greater - actual: "{{ phase92_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt" - pattern: "^target_owner_created_enabled_target=true$" - save_as: owner_created - - action: assert_greater - actual: "{{ owner_created }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt" - pattern: "^executor_consumed_target=true$" - save_as: executor_consumed - - action: assert_greater - actual: "{{ executor_consumed }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt" - pattern: "^runtime_request_expected_current_replica=r2$" - save_as: expected_replica - - action: assert_greater - actual: "{{ expected_replica }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt" - pattern: "^runtime_request_expected_current_epoch=7$" - save_as: expected_epoch - - action: assert_greater - actual: "{{ expected_epoch }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff/phase92-failback-target-executor-handoff-summary.txt" - pattern: "^frontend_publication_after_failback_claimed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase92-failback-target-executor-handoff" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/failback-target-owner-chain.yaml b/seaweed-block/testops/scenarios/failback-target-owner-chain.yaml deleted file mode 100644 index fcf58ea46e..0000000000 --- a/seaweed-block/testops/scenarios/failback-target-owner-chain.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# Runner-native Phase 75 gate: returned-replica failback can create a -# failback target handoff CR only after terminal evidence is present. The owner -# remains disabled by default, dry-run by default, and has no status/finalizer, -# storage, authority, or frontend publication mutation power. - -name: failback-target-owner-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: failback_target_owner_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner bash scripts/run-phase75-failback-target-owner-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^phase75_failback_target_owner_status=ok$" - save_as: phase75_ok - - action: assert_greater - actual: "{{ phase75_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^failback_target_owner_creates_target=true$" - save_as: creates_target - - action: assert_greater - actual: "{{ creates_target }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^failback_target_owner_dry_run_no_create=true$" - save_as: dry_run_no_create - - action: assert_greater - actual: "{{ dry_run_no_create }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^failback_target_owner_requires_terminal_evidence=true$" - save_as: terminal_evidence_required - - action: assert_greater - actual: "{{ terminal_evidence_required }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^failback_target_crd_schema=true$" - save_as: target_crd_schema - - action: assert_greater - actual: "{{ target_crd_schema }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^failback_target_owner_chart_boundary=true$" - save_as: chart_boundary - - action: assert_greater - actual: "{{ chart_boundary }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^failback_attempts=0$" - save_as: no_failback_attempt - - action: assert_greater - actual: "{{ no_failback_attempt }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner/phase75-failback-target-owner-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase75-failback-target-owner" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-authority-owner-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-authority-owner-chain.yaml deleted file mode 100644 index 3c26e08401..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-authority-owner-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 73 gate: returned-replica frontend publication requires -# a real authority/failback owner and must not be faked by runtime status. - -name: frontend-publication-authority-owner-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_authority_owner_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner bash scripts/run-phase73-frontend-publication-authority-owner-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^phase73_frontend_publication_authority_owner_status=ok$" - save_as: phase73_ok - - action: assert_greater - actual: "{{ phase73_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^frontend_publication_requires_authority_owner=true$" - save_as: authority_owner_required - - action: assert_greater - actual: "{{ authority_owner_required }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^returned_replica_runtime_invocations=0$" - save_as: no_returned_runtime - - action: assert_greater - actual: "{{ no_returned_runtime }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^returned_replica_frontend_published=false$" - save_as: no_false_publish - - action: assert_greater - actual: "{{ no_false_publish }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^generic_runtime_seam_preserved=true$" - save_as: generic_seam_preserved - - action: assert_greater - actual: "{{ generic_seam_preserved }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_publication_attempts - - action: assert_greater - actual: "{{ no_publication_attempts }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner/phase73-frontend-publication-authority-owner-summary.txt" - pattern: "^failback_attempts=0$" - save_as: no_failback_attempts - - action: assert_greater - actual: "{{ no_failback_attempts }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase73-frontend-publication-authority-owner" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-executor-boundary-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-executor-boundary-chain.yaml deleted file mode 100644 index 669c8669ec..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-executor-boundary-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 70 gate: frontend publication executor status boundary. - -name: frontend-publication-executor-boundary-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_executor_boundary_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary bash scripts/run-phase70-frontend-publication-executor-boundary-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^phase70_frontend_publication_executor_boundary_status=ok$" - save_as: phase70_ok - - action: assert_greater - actual: "{{ phase70_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^frontend_publication_executor_status_writes=true$" - save_as: status_writes - - action: assert_greater - actual: "{{ status_writes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^frontend_publication_executor_status=blocked$" - save_as: status_blocked - - action: assert_greater - actual: "{{ status_blocked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^frontend_publication_executor_reason=frontend_publication_policy_disabled$" - save_as: reason_disabled - - action: assert_greater - actual: "{{ reason_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_frontend_attempts - - action: assert_greater - actual: "{{ no_frontend_attempts }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^frontend_published=false$" - save_as: no_frontend_published - - action: assert_greater - actual: "{{ no_frontend_published }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^failback_started=false$" - save_as: no_failback_started - - action: assert_greater - actual: "{{ no_failback_started }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary/phase70-frontend-publication-executor-boundary-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase70-frontend-publication-executor-boundary" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-executor-callsite-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-executor-callsite-chain.yaml deleted file mode 100644 index 84605db701..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-executor-callsite-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Runner-native Phase 97 gate: explicit-policy frontend publication executor -# call-site after terminal failback evidence. This proves executor/runtime -# handoff only; workload-visible I/O remains a later gate. - -name: frontend-publication-executor-callsite-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_executor_callsite_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite bash scripts/run-phase97-frontend-publication-executor-callsite-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^phase97_frontend_publication_executor_callsite_status=ok$" - save_as: phase97_ok - - action: assert_greater - actual: "{{ phase97_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^failback_target_runtime_invoked=true$" - save_as: runtime_invoked - - action: assert_greater - actual: "{{ runtime_invoked }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^frontend_publication_attempts=1$" - save_as: publication_attempt - - action: assert_greater - actual: "{{ publication_attempt }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^frontend_published=true$" - save_as: frontend_published - - action: assert_greater - actual: "{{ frontend_published }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^failback_attempts=0$" - save_as: no_failback_attempts - - action: assert_greater - actual: "{{ no_failback_attempts }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^failback_started=false$" - save_as: no_failback_started - - action: assert_greater - actual: "{{ no_failback_started }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite/phase97-frontend-publication-executor-callsite-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase97-frontend-publication-executor-callsite" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-live-api-boundary-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-live-api-boundary-chain.yaml deleted file mode 100644 index ac4171821a..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-live-api-boundary-chain.yaml +++ /dev/null @@ -1,167 +0,0 @@ -# Runner-native Phase 71 gate: frontend publication executor live API boundary. - -name: frontend-publication-live-api-boundary-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_live_api_boundary_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary bash scripts/run-phase71-frontend-publication-live-api-boundary-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^phase71_frontend_publication_live_api_boundary_status=ok$" - save_as: phase71_ok - - action: assert_greater - actual: "{{ phase71_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^executor_status_patch_succeeded=true$" - save_as: status_patch - - action: assert_greater - actual: "{{ status_patch }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_publication_executor_status_writes=true$" - save_as: status_writes - - action: assert_greater - actual: "{{ status_writes }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_publication_executor_status=blocked$" - save_as: status_blocked - - action: assert_greater - actual: "{{ status_blocked }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_publication_executor_reason=frontend_publication_policy_disabled$" - save_as: reason_disabled - - action: assert_greater - actual: "{{ reason_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_publication_executor_status_mutation_allowed=true$" - save_as: status_mutation - - action: assert_greater - actual: "{{ status_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_publication_mutation_allowed=false$" - save_as: frontend_mutation_denied - - action: assert_greater - actual: "{{ frontend_mutation_denied }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_published=false$" - save_as: no_frontend_published - - action: assert_greater - actual: "{{ no_frontend_published }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^failback_started=false$" - save_as: no_failback_started - - action: assert_greater - actual: "{{ no_failback_started }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^frontend_publication_executor_rbac_status_only=true$" - save_as: rbac_status_only - - action: assert_greater - actual: "{{ rbac_status_only }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^executor_spec_patch_allowed=false$" - save_as: spec_patch_denied - - action: assert_greater - actual: "{{ spec_patch_denied }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^executor_label_patch_allowed=false$" - save_as: label_patch_denied - - action: assert_greater - actual: "{{ label_patch_denied }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^executor_finalizers_endpoint_allowed=false$" - save_as: finalizers_denied - - action: assert_greater - actual: "{{ finalizers_denied }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary/phase71-frontend-publication-live-api-boundary-summary.txt" - pattern: "^target_object_integrity_preserved=true$" - save_as: integrity_preserved - - action: assert_greater - actual: "{{ integrity_preserved }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase71-frontend-publication-live-api-boundary" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml deleted file mode 100644 index 60405b3966..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-preflight-chain.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Runner-native Phase 68 gate: ACK eligibility to frontend publication preflight. - -name: frontend-publication-preflight-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_preflight_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight bash scripts/run-phase68-frontend-publication-preflight-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" - pattern: "^phase68_frontend_publication_preflight_status=ok$" - save_as: phase68_ok - - action: assert_greater - actual: "{{ phase68_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" - pattern: "^frontend_publication_decision_schema_locked=true$" - save_as: schema_locked - - action: assert_greater - actual: "{{ schema_locked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" - pattern: "^frontend_publication_decision=disabled$" - save_as: decision_disabled - - action: assert_greater - actual: "{{ decision_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" - pattern: "^frontend_publication_mutation_allowed=false$" - save_as: mutation_false - - action: assert_greater - actual: "{{ mutation_false }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight/phase68-frontend-publication-preflight-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_frontend_attempts - - action: assert_greater - actual: "{{ no_frontend_attempts }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase68-frontend-publication-preflight" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-runtime-contract-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-runtime-contract-chain.yaml deleted file mode 100644 index 1350272285..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-runtime-contract-chain.yaml +++ /dev/null @@ -1,131 +0,0 @@ -# Runner-native Phase 72 gate: frontend publication runtime contract. - -name: frontend-publication-runtime-contract-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_runtime_contract_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract bash scripts/run-phase72-frontend-publication-runtime-contract-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^phase72_frontend_publication_runtime_contract_status=ok$" - save_as: phase72_ok - - action: assert_greater - actual: "{{ phase72_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_runtime_contract_schema_locked=true$" - save_as: schema_locked - - action: assert_greater - actual: "{{ schema_locked }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_runtime_endpoint_field=true$" - save_as: endpoint_field - - action: assert_greater - actual: "{{ endpoint_field }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_execution_policy_gate=true$" - save_as: policy_gate - - action: assert_greater - actual: "{{ policy_gate }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_runtime_invoked_only_when_enabled=true$" - save_as: runtime_invoked_only_when_enabled - - action: assert_greater - actual: "{{ runtime_invoked_only_when_enabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_runtime_failure_no_false_publish=true$" - save_as: no_false_publish - - action: assert_greater - actual: "{{ no_false_publish }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_runtime_invalid_terminal_evidence_no_false_publish=true$" - save_as: invalid_terminal_no_false_publish - - action: assert_greater - actual: "{{ invalid_terminal_no_false_publish }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_publication_attempts=1$" - save_as: one_frontend_attempt - - action: assert_greater - actual: "{{ one_frontend_attempt }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^frontend_published=true$" - save_as: frontend_published - - action: assert_greater - actual: "{{ frontend_published }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^failback_started=false$" - save_as: failback_not_started - - action: assert_greater - actual: "{{ failback_not_started }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract/phase72-frontend-publication-runtime-contract-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase72-frontend-publication-runtime-contract" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/frontend-publication-target-contract-chain.yaml b/seaweed-block/testops/scenarios/frontend-publication-target-contract-chain.yaml deleted file mode 100644 index 864c6b570b..0000000000 --- a/seaweed-block/testops/scenarios/frontend-publication-target-contract-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 69 gate: frontend publication target contract. - -name: frontend-publication-target-contract-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: frontend_publication_target_contract_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract bash scripts/run-phase69-frontend-publication-target-contract-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^phase69_frontend_publication_target_contract_status=ok$" - save_as: phase69_ok - - action: assert_greater - actual: "{{ phase69_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^frontend_publication_target_schema_locked=true$" - save_as: schema_locked - - action: assert_greater - actual: "{{ schema_locked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^frontend_publication_target_owner_creates_target=true$" - save_as: creates_target - - action: assert_greater - actual: "{{ creates_target }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^frontend_publication_target_owner_dry_run_no_create=true$" - save_as: dry_run_no_create - - action: assert_greater - actual: "{{ dry_run_no_create }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^frontend_publication_target_owner_rejects_enabled_publication=true$" - save_as: rejects_enabled - - action: assert_greater - actual: "{{ rejects_enabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^frontend_publication_target_owner_rbac_narrow=true$" - save_as: rbac_narrow - - action: assert_greater - actual: "{{ rbac_narrow }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_frontend_attempts - - action: assert_greater - actual: "{{ no_frontend_attempts }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract/phase69-frontend-publication-target-contract-summary.txt" - pattern: "^failback_attempts=0$" - save_as: no_failback_attempts - - action: assert_greater - actual: "{{ no_failback_attempts }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase69-frontend-publication-target-contract" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/helm-first-volume-chain.yaml b/seaweed-block/testops/scenarios/helm-first-volume-chain.yaml deleted file mode 100644 index 4fa90e32e0..0000000000 --- a/seaweed-block/testops/scenarios/helm-first-volume-chain.yaml +++ /dev/null @@ -1,270 +0,0 @@ -# Runner-native Phase 21 D3 Helm first-volume chain. -# -# Goal: -# Prove the PM/user Helm path: -# generate values.day1.yaml -> helm install -> first PVC -> -# writer checksum -> reader checksum -> read-only report -> helm uninstall. -# -# Lab prerequisite: -# helm must be installed on the runner node. k3s labs also need explicit -# KUBECONFIG because helm does not auto-load /etc/rancher/k3s/k3s.yaml the -# way the k3s-wrapped kubectl command does. - -name: helm-first-volume-chain -timeout: 26m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-28a99ce4f644" - sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-28a99ce4f644" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: generate_day1_values - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm version --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/helm-version.txt && cd {{ product_root }} && bash scripts/generate-helm-values-day1.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_HELM_VALUES_OUT: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml" - env.SW_BLOCK_ACTIVATION_IMAGE_MODE: "published" - env.SW_BLOCK_IMAGE: "{{ sw_block_image }}" - env.SW_BLOCK_CSI_IMAGE: "{{ sw_block_csi_image }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml" - pattern: "^blockNodes:$" - save_as: block_nodes_count - - action: assert_greater - actual: "{{ block_nodes_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml" - pattern: "externalISCSI: true" - save_as: external_iscsi_count - - action: assert_greater - actual: "{{ external_iscsi_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml" - pattern: "enabled: true" - save_as: chap_enabled_count - - action: assert_greater - actual: "{{ chap_enabled_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml --wait --timeout 5m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/helm-install.txt && kubectl -n {{ helm_namespace }} rollout status deploy/sw-blockmaster --timeout=180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/wait-blockmaster.txt && kubectl -n {{ helm_namespace }} rollout status deploy/sw-block-csi-controller --timeout=180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/wait-csi-controller.txt && kubectl -n {{ helm_namespace }} rollout status ds/sw-block-csi-node --timeout=180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/wait-csi-node.txt && helm status {{ helm_release }} --namespace {{ helm_namespace }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/helm-status.txt && kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/kube-system-ready.txt && kubectl get sc sw-block-dynamic -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/storageclass.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/helm-status.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/install/storageclass.txt" - pattern: "block.csi.seaweedfs.com" - save_as: storageclass_provider_count - - action: assert_greater - actual: "{{ storageclass_provider_count }}" - threshold: "0" - - - name: first_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "1" - env.SW_BLOCK_INSTALL_MODE: "helm" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/values/values.day1.yaml" - env.SW_BLOCK_IMAGE: "{{ sw_block_image }}" - env.SW_BLOCK_CSI_IMAGE: "{{ sw_block_csi_image }}" - - - name: first_volume_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^install_mode=helm$" - save_as: install_mode_count - - action: assert_greater - actual: "{{ install_mode_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^helm_release={{ helm_release }}$" - save_as: helm_release_count - - action: assert_greater - actual: "{{ helm_release_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^image={{ sw_block_image }}$" - save_as: image_count - - action: assert_greater - actual: "{{ image_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^image_digest=" - save_as: image_digest_count - - action: assert_greater - actual: "{{ image_digest_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified_count - - action: assert_greater - actual: "{{ writer_verified_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified_count - - action: assert_greater - actual: "{{ reader_verified_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/writer.log" - pattern: "/data/demo.bin: OK" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/first-volume-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: basic_cleanup_count - - action: assert_greater - actual: "{{ basic_cleanup_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/status/report/index.html" - pattern: "]*>(promote|repair|delete|rebuild|cleanup)|data-action=\"(promote|repair|delete|rebuild|cleanup)\"|href=\"[^\"]*/(promote|repair|delete|rebuild|cleanup)' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/basic-app/status/report/index.html" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh; kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/cleanup/kube-system-after-uninstall.txt 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-first-volume/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-first-volume-via-sw-block-cli-chain.yaml b/seaweed-block/testops/scenarios/helm-first-volume-via-sw-block-cli-chain.yaml deleted file mode 100644 index 50a9f7734a..0000000000 --- a/seaweed-block/testops/scenarios/helm-first-volume-via-sw-block-cli-chain.yaml +++ /dev/null @@ -1,234 +0,0 @@ -# Runner-native v0.3 pre-release gate: documented Go CLI Helm values path. -# -# Goal: -# Prove the literal user-facing path: -# go build ./cmd/sw-block -# -> sw-block ops generate-helm-values -# -> helm install -# -> first PVC writer/reader -# -> read-only report -# -> helm uninstall cleanup -# -# This exists because the older Helm gates used scripts/generate-helm-values-day1.sh -# and did not cover the documented Go CLI generator. - -name: helm-first-volume-via-sw-block-cli-chain -timeout: 28m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b" - sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: build_sw_block_cli - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin/sw-block --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin/sw-block.version.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin/sw-block.version.txt" - pattern: "sw-block" - save_as: sw_block_version_count - - action: assert_greater - actual: "{{ sw_block_version_count }}" - threshold: "0" - - - name: generate_day1_values_via_cli - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm version --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/helm-version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/generate.stdout.txt && ! grep -q '^ dataPort: 3260$' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml" - pattern: "dataPort: 19101" - save_as: data_port_19101_count - - action: assert_greater - actual: "{{ data_port_19101_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml" - pattern: "launcherReplicationAckFlag: false" - save_as: compat_ack_false_count - - action: assert_greater - actual: "{{ compat_ack_false_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "1" - env.SW_BLOCK_INSTALL_MODE: "helm" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/values/values.day1.yaml" - - - name: first_volume_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app/first-volume-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified_count - - action: assert_greater - actual: "{{ writer_verified_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app/first-volume-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified_count - - action: assert_greater - actual: "{{ reader_verified_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app/first-volume-summary.txt" - pattern: "^status_report=status/report/index.html$" - save_as: report_html_count - - action: assert_greater - actual: "{{ report_html_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app/first-volume-summary.txt" - pattern: "^operator_snapshot=status/report/operator-snapshot.json$" - save_as: operator_snapshot_summary_count - - action: assert_greater - actual: "{{ operator_snapshot_summary_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 1m - cmd: | - set -e; - out=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app/status/report/dashboard-route; - mkdir -p "$out"; - port=$(python3 - <<'PY' - import socket - s = socket.socket() - s.bind(("127.0.0.1", 0)) - print(s.getsockname()[1]) - s.close() - PY - ); - echo "$port" > "$out/dashboard.port"; - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/bin/sw-block ops dashboard --from-bundle /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/basic-app --listen 127.0.0.1:${port} > "$out/dashboard.stdout.txt" 2> "$out/dashboard.stderr.txt" & - pid=$!; - trap 'kill $pid >/dev/null 2>&1 || true; wait $pid >/dev/null 2>&1 || true' EXIT; - for i in $(seq 1 100); do - code=$(curl -s -o "$out/operator-snapshot.json" -w '%{http_code}' "http://127.0.0.1:${port}/operator-snapshot.json" || true); - if [ "$code" = "200" ] && python3 - "$out/operator-snapshot.json" <<'PY' - import json, sys - doc = json.load(open(sys.argv[1])) - if doc.get("read_only") is not True: - raise SystemExit(1) - if (doc.get("mutation") or {}).get("mutation_allowed") is not False: - raise SystemExit(1) - PY - then - exit 0; - fi; - sleep 0.2; - done; - echo "operator-snapshot route failed" >&2; - cat "$out/dashboard.stderr.txt" >&2 || true; - exit 1 - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-cli-first-volume/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-lifecycle-upgrade-rollback-chain.yaml b/seaweed-block/testops/scenarios/helm-lifecycle-upgrade-rollback-chain.yaml deleted file mode 100644 index c2b55c0381..0000000000 --- a/seaweed-block/testops/scenarios/helm-lifecycle-upgrade-rollback-chain.yaml +++ /dev/null @@ -1,181 +0,0 @@ -# Runner-native Phase 26 D2 gate: Helm install / upgrade / rollback lifecycle. -# -# Goal: -# Prove the chart handles a narrow release lifecycle smoke: -# generate values -# -> helm install -# -> first PVC writer/reader, keep PVC -# -> helm upgrade with the same chart/values -# -> verify existing PVC data -# -> helm rollback to revision 1 -# -> verify existing PVC data again -# -> helm uninstall and strict cleanup - -name: helm-lifecycle-upgrade-rollback-chain -timeout: 32m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b" - sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/first-volume /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/upgrade /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/after-upgrade /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/rollback /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/after-rollback /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/generate.stdout.txt && cd {{ product_root }} && bash scripts/verify-helm-release-hygiene.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/hygiene" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/values.day1.yaml" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/install/helm-install.txt && helm history {{ helm_release }} --namespace {{ helm_namespace }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/install/helm-history.after-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_keep_pvc - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/first-volume" - env.SW_BLOCK_BASIC_APP_CLEANUP: "0" - env.SW_BLOCK_INSTALL_MODE: "helm-lifecycle" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/values.day1.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/first-volume/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - - name: helm_upgrade_and_verify - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm upgrade {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/upgrade/helm-upgrade.txt && helm history {{ helm_release }} --namespace {{ helm_namespace }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/upgrade/helm-history.after-upgrade.txt && bash scripts/verify-basic-app-existing-pvc.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/after-upgrade" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/after-upgrade/existing-pvc-summary.txt" - pattern: "^existing_pvc_status=ok$" - save_as: after_upgrade_reader_ok_count - - action: assert_greater - actual: "{{ after_upgrade_reader_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/upgrade/helm-history.after-upgrade.txt" - pattern: "superseded" - save_as: helm_superseded_count - - action: assert_greater - actual: "{{ helm_superseded_count }}" - threshold: "0" - - - name: helm_rollback_and_verify - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "helm rollback {{ helm_release }} 1 --namespace {{ helm_namespace }} --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/rollback/helm-rollback.txt && helm history {{ helm_release }} --namespace {{ helm_namespace }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/rollback/helm-history.after-rollback.txt && cd {{ product_root }} && bash scripts/verify-basic-app-existing-pvc.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/after-rollback" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/after-rollback/existing-pvc-summary.txt" - pattern: "^existing_pvc_status=ok$" - save_as: after_rollback_reader_ok_count - - action: assert_greater - actual: "{{ after_rollback_reader_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/rollback/helm-history.after-rollback.txt" - pattern: "deployed" - save_as: helm_deployed_after_rollback_count - - action: assert_greater - actual: "{{ helm_deployed_after_rollback_count }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-lifecycle/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-multi-volume-day1-chain.yaml b/seaweed-block/testops/scenarios/helm-multi-volume-day1-chain.yaml deleted file mode 100644 index b4ff7a714d..0000000000 --- a/seaweed-block/testops/scenarios/helm-multi-volume-day1-chain.yaml +++ /dev/null @@ -1,172 +0,0 @@ -# Runner-native Phase 26 D3 gate: multi-volume Day-1 smoke. -# -# Goal: -# Prove the Helm-installed StorageClass can handle a small multi-PVC user -# shape and that ops report/dashboard evidence distinguishes each volume. - -name: helm-multi-volume-day1-chain -timeout: 34m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase26-d3" - sw_block_csi_image: "sw-block-csi:phase26-d3" - volume_count: "3" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE={{ sw_block_image }}" - save_as: local_image_built_count - - action: assert_greater - actual: "{{ local_image_built_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/values/generate.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_CLEANUP: "1" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume/multi-volume-summary.txt" - pattern: "^multi_volume_status=ok$" - save_as: multi_volume_ok_count - - action: assert_greater - actual: "{{ multi_volume_ok_count }}" - threshold: "0" - - - name: multi_volume_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume/multi-volume-summary.txt" - pattern: "^writer_verified_count=3$" - save_as: writer_count_ok - - action: assert_greater - actual: "{{ writer_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume/multi-volume-summary.txt" - pattern: "^reader_verified_count=3$" - save_as: reader_count_ok - - action: assert_greater - actual: "{{ reader_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume/multi-volume-summary.txt" - pattern: "^managed_volume_count=3$" - save_as: managed_volume_count_ok - - action: assert_greater - actual: "{{ managed_volume_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/multi-volume/status/report/summary.txt" - pattern: "^volumes=3$" - save_as: report_volume_count_ok - - action: assert_greater - actual: "{{ report_volume_count_ok }}" - threshold: "0" - - action: exec - node: m02 - timeout: 3m - cmd: "for i in $(seq 1 60); do out=$(kubectl -n default get deploy -l app=sw-blockvolume -o name 2>/dev/null); if [ -z \"$out\" ]; then exit 0; fi; sleep 2; done; echo \"timeout: launcher-rendered deployments still present\" >&2; kubectl -n default get deploy -l app=sw-blockvolume -o wide >&2; exit 1" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/cleanup/helm-uninstall.txt || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-interleaved-failover-chain.yaml b/seaweed-block/testops/scenarios/helm-multi-volume-rf3-interleaved-failover-chain.yaml deleted file mode 100644 index 54cafc87c9..0000000000 --- a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-interleaved-failover-chain.yaml +++ /dev/null @@ -1,303 +0,0 @@ -# Phase 27 D4: multi-volume RF=3 interleaved mounted failover. -# -# Pass = three RF=3 PVCs are mounted by long-running writer pods on the same -# kubelet, two target volumes have their current primaries stopped in one bounded window, the same -# writer pod UID verifies old data and writes new data through dm-multipath, -# non-target mounted workloads keep working, and cleanup is clean. - -name: helm-multi-volume-rf3-interleaved-failover-chain -timeout: 52m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase27-d4" - sw_block_csi_image: "sw-block-csi:phase27-d4" - volume_count: "3" - target_volume_count: "2" - replication_factor: "3" - app_node: "m02" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 6m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume-mounted-failover --ignore-not-found=true --wait=true --timeout=180s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-mounted-writer-$i --ignore-not-found=true --wait=true --timeout=180s; kubectl -n default delete pvc sw-block-multi-mounted-pvc-$i --ignore-not-found=true --wait=true --timeout=180s; done; kubectl delete storageclass sw-block-multi-mounted sw-block-dynamic --ignore-not-found=true --wait=true --timeout=180s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n multipath -F >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/preclean/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_MULTIPATH_FLUSH: "1" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/preflight.txt 2>&1" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: host_multipath_prereq - actions: - - action: exec - node: m02 - cmd: "set -e; B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover; { echo stage2_protocol=iscsi-alua; command -v iscsiadm >/dev/null && echo command_iscsiadm=present; command -v multipath >/dev/null && echo command_multipath=present; command -v sg_rtpg >/dev/null && echo command_sg_rtpg=present; sudo modprobe iscsi_tcp; sudo modprobe dm_multipath; sudo modprobe scsi_dh_alua; test -d /sys/module/iscsi_tcp && echo module_iscsi_tcp=loaded; test -d /sys/module/dm_multipath && echo module_dm_multipath=loaded; test -d /sys/module/scsi_dh_alua && echo module_scsi_dh_alua=loaded; sudo multipath -t > \"$B/multipath-prereq.config.txt\" 2>&1; echo multipath_prereq=pass; } > \"$B/multipath-prereq.txt\" 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/multipath-prereq.txt" - pattern: "multipath_prereq=pass" - save_as: multipath_prereq_count - - action: assert_greater - actual: "{{ multipath_prereq_count }}" - threshold: "0" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --replication-factor {{ replication_factor }} --ack-profile sync-quorum --stage2-multipath > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\np=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml')\ns=p.read_text()\ns=s.replace('launcherReplicationAckFlag: false','launcherReplicationAckFlag: true')\np.write_text(s)\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml" - pattern: "replicationFactor: 3" - save_as: rf3_in_values - - action: assert_greater - actual: "{{ rf3_in_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml" - pattern: "ackProfile: sync-quorum" - save_as: sync_quorum_in_values - - action: assert_greater - actual: "{{ sync_quorum_in_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml" - pattern: "enabled: true" - save_as: stage2_enabled_count - - action: assert_greater - actual: "{{ stage2_enabled_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml" - pattern: "launcherReplicationAckFlag: true" - save_as: ack_flag_in_values - - action: assert_greater - actual: "{{ ack_flag_in_values }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/install/helm-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_interleaved_failover - actions: - - action: exec - node: m02 - timeout: 34m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-mounted-failover.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_RF: "{{ replication_factor }}" - env.SW_BLOCK_MULTI_VOLUME_FAILOVER_MODE: "interleaved" - env.SW_BLOCK_MULTI_VOLUME_TARGET_COUNT: "{{ target_volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_APP_NODE: "{{ app_node }}" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^multi_volume_interleaved_failover_status=ok$" - save_as: interleaved_failover_ok_count - - action: assert_greater - actual: "{{ interleaved_failover_ok_count }}" - threshold: "0" - - - name: interleaved_failover_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^recovered_volume_count=2$" - save_as: recovered_count_ok - - action: assert_greater - actual: "{{ recovered_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^mounted_workload_checksum_passed_count=2$" - save_as: mounted_workload_ok - - action: assert_greater - actual: "{{ mounted_workload_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^failover_mode=interleaved$" - save_as: interleaved_mode_ok - - action: assert_greater - actual: "{{ interleaved_mode_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^target_volume_count=2$" - save_as: target_count_ok - - action: assert_greater - actual: "{{ target_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^untouched_volume_stable=true$" - save_as: untouched_stable_ok - - action: assert_greater - actual: "{{ untouched_stable_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^untouched_workload_ok=true$" - save_as: untouched_workload_ok - - action: assert_greater - actual: "{{ untouched_workload_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^pod_recreate_used=false$" - save_as: no_pod_recreate - - action: assert_greater - actual: "{{ no_pod_recreate }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^cross_interference_observed=false$" - save_as: no_cross_interference - - action: assert_greater - actual: "{{ no_cross_interference }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/host/multipath.before.txt" - pattern: "hwhandler='1 alua'" - save_as: multipath_alua_count - - action: assert_greater - actual: "{{ multipath_alua_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/host/sg-rtpg.before.txt" - pattern: "asymmetric access state" - save_as: rtpg_before_count - - action: assert_greater - actual: "{{ rtpg_before_count }}" - threshold: "2" - - action: exec - node: m02 - timeout: 2m - cmd: "for i in 1 2; do D=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/failover/volume-$i; S=$D/summary.txt; P=$D/stale-primary-probe.log; B=$D/rtpg-before-states.txt; A=$D/rtpg-after-states.txt; grep -q '^interleaved_fault=true$' \"$S\"; grep -q '^failover_status=promoted$' \"$S\"; grep -q '^target_recovered=true$' \"$S\"; grep -q '^pod_recreate_used=false$' \"$S\"; grep -q '^data_check_after_failover=mounted_workload_checksum_passed$' \"$S\"; grep -q '^post_failure_primary_count=1$' \"$S\"; grep -q '^stale_primary_probe=direct_read$' \"$S\"; grep -q '^old_primary_stale_io_success_count=0$' \"$S\"; test -s \"$P\"; grep -q '^stale_primary_probe=direct_read$' \"$P\"; grep -q '^old_primary_stale_io_success_count=0$' \"$P\"; test -s \"$B\"; test -s \"$A\"; grep -q '^rtpg_before_old_primary_aas=0x00$' \"$S\"; grep -q '^rtpg_after_promoted_aas=0x00$' \"$S\"; grep -q '^rtpg_transition_verified=true$' \"$S\"; grep -q '^cross_interference_observed=false$' \"$S\"; done; grep -q '^non_target_workload_ok$' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/recovery/failover/untouched-volume-3.log" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume-mounted-failover --ignore-not-found=true --force --grace-period=0 --wait=false; for i in 1 2 3; do kubectl -n default delete pvc sw-block-multi-mounted-pvc-$i --ignore-not-found=true --wait=false; done; kubectl delete storageclass sw-block-multi-mounted sw-block-dynamic --ignore-not-found=true --wait=false; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: exec - node: m02 - timeout: 3m - cmd: "for _ in $(seq 1 60); do if ! sudo -n iscsiadm -m session 2>/dev/null | grep -q io.seaweedfs; then break; fi; sudo -n iscsiadm -m session 2>/dev/null | awk '/io.seaweedfs/ {print $3, $4}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" --logout || true; done; sleep 2; done; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n multipath -F >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_MULTIPATH_FLUSH: "1" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-interleaved-failover/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-mounted-failover-chain.yaml b/seaweed-block/testops/scenarios/helm-multi-volume-rf3-mounted-failover-chain.yaml deleted file mode 100644 index 3f47f22c2e..0000000000 --- a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-mounted-failover-chain.yaml +++ /dev/null @@ -1,268 +0,0 @@ -# Phase 27 D3: multi-volume RF=3 mounted transparent failover. -# -# Pass = three RF=3 PVCs are mounted by long-running writer pods on the same -# kubelet, each target volume's current primary is stopped in turn, the same -# writer pod UID verifies old data and writes new data through dm-multipath, -# non-target mounted workloads keep working, and cleanup is clean. - -name: helm-multi-volume-rf3-mounted-failover-chain -timeout: 52m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase27-d3" - sw_block_csi_image: "sw-block-csi:phase27-d3" - volume_count: "3" - replication_factor: "3" - app_node: "m02" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 6m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume-mounted-failover --ignore-not-found=true --wait=true --timeout=180s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-mounted-writer-$i --ignore-not-found=true --wait=true --timeout=180s; kubectl -n default delete pvc sw-block-multi-mounted-pvc-$i --ignore-not-found=true --wait=true --timeout=180s; done; kubectl delete storageclass sw-block-multi-mounted sw-block-dynamic --ignore-not-found=true --wait=true --timeout=180s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n multipath -F >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/preclean/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_MULTIPATH_FLUSH: "1" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/preflight.txt 2>&1" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: host_multipath_prereq - actions: - - action: exec - node: m02 - cmd: "set -e; B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover; { echo stage2_protocol=iscsi-alua; command -v iscsiadm >/dev/null && echo command_iscsiadm=present; command -v multipath >/dev/null && echo command_multipath=present; command -v sg_rtpg >/dev/null && echo command_sg_rtpg=present; sudo modprobe iscsi_tcp; sudo modprobe dm_multipath; sudo modprobe scsi_dh_alua; test -d /sys/module/iscsi_tcp && echo module_iscsi_tcp=loaded; test -d /sys/module/dm_multipath && echo module_dm_multipath=loaded; test -d /sys/module/scsi_dh_alua && echo module_scsi_dh_alua=loaded; sudo multipath -t > \"$B/multipath-prereq.config.txt\" 2>&1; echo multipath_prereq=pass; } > \"$B/multipath-prereq.txt\" 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/multipath-prereq.txt" - pattern: "multipath_prereq=pass" - save_as: multipath_prereq_count - - action: assert_greater - actual: "{{ multipath_prereq_count }}" - threshold: "0" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --replication-factor {{ replication_factor }} --ack-profile sync-quorum --stage2-multipath > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\np=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml')\ns=p.read_text()\ns=s.replace('launcherReplicationAckFlag: false','launcherReplicationAckFlag: true')\np.write_text(s)\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml" - pattern: "replicationFactor: 3" - save_as: rf3_in_values - - action: assert_greater - actual: "{{ rf3_in_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml" - pattern: "ackProfile: sync-quorum" - save_as: sync_quorum_in_values - - action: assert_greater - actual: "{{ sync_quorum_in_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml" - pattern: "enabled: true" - save_as: stage2_enabled_count - - action: assert_greater - actual: "{{ stage2_enabled_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml" - pattern: "launcherReplicationAckFlag: true" - save_as: ack_flag_in_values - - action: assert_greater - actual: "{{ ack_flag_in_values }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/install/helm-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_mounted_failover - actions: - - action: exec - node: m02 - timeout: 34m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-mounted-failover.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_RF: "{{ replication_factor }}" - env.SW_BLOCK_MULTI_VOLUME_APP_NODE: "{{ app_node }}" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^multi_volume_mounted_failover_status=ok$" - save_as: mounted_failover_ok_count - - action: assert_greater - actual: "{{ mounted_failover_ok_count }}" - threshold: "0" - - - name: mounted_failover_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^recovered_volume_count=3$" - save_as: recovered_count_ok - - action: assert_greater - actual: "{{ recovered_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^mounted_workload_checksum_passed_count=3$" - save_as: mounted_workload_ok - - action: assert_greater - actual: "{{ mounted_workload_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^pod_recreate_used=false$" - save_as: no_pod_recreate - - action: assert_greater - actual: "{{ no_pod_recreate }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/multi-volume-mounted-failover-summary.txt" - pattern: "^cross_interference_observed=false$" - save_as: no_cross_interference - - action: assert_greater - actual: "{{ no_cross_interference }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/host/multipath.before.txt" - pattern: "hwhandler='1 alua'" - save_as: multipath_alua_count - - action: assert_greater - actual: "{{ multipath_alua_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/host/sg-rtpg.before.txt" - pattern: "asymmetric access state" - save_as: rtpg_before_count - - action: assert_greater - actual: "{{ rtpg_before_count }}" - threshold: "2" - - action: exec - node: m02 - timeout: 2m - cmd: "for i in 1 2 3; do D=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/recovery/failover/volume-$i; S=$D/summary.txt; P=$D/stale-primary-probe.log; B=$D/rtpg-before-states.txt; A=$D/rtpg-after-states.txt; grep -q '^failover_status=promoted$' \"$S\"; grep -q '^target_recovered=true$' \"$S\"; grep -q '^pod_recreate_used=false$' \"$S\"; grep -q '^data_check_after_failover=mounted_workload_checksum_passed$' \"$S\"; grep -q '^post_failure_primary_count=1$' \"$S\"; grep -q '^stale_primary_probe=direct_read$' \"$S\"; grep -q '^old_primary_stale_io_success_count=0$' \"$S\"; test -s \"$P\"; grep -q '^stale_primary_probe=direct_read$' \"$P\"; grep -q '^old_primary_stale_io_success_count=0$' \"$P\"; test -s \"$B\"; test -s \"$A\"; grep -q '^rtpg_before_old_primary_aas=0x00$' \"$S\"; grep -q '^rtpg_after_promoted_aas=0x00$' \"$S\"; grep -q '^rtpg_transition_verified=true$' \"$S\"; grep -q '^cross_interference_observed=false$' \"$S\"; done" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume-mounted-failover --ignore-not-found=true --force --grace-period=0 --wait=false; for i in 1 2 3; do kubectl -n default delete pvc sw-block-multi-mounted-pvc-$i --ignore-not-found=true --wait=false; done; kubectl delete storageclass sw-block-multi-mounted sw-block-dynamic --ignore-not-found=true --wait=false; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: exec - node: m02 - timeout: 3m - cmd: "for _ in $(seq 1 60); do if ! sudo -n iscsiadm -m session 2>/dev/null | grep -q io.seaweedfs; then break; fi; sudo -n iscsiadm -m session 2>/dev/null | awk '/io.seaweedfs/ {print $3, $4}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" --logout || true; done; sleep 2; done; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n multipath -F >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_MULTIPATH_FLUSH: "1" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-mounted-failover/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-readiness-chain.yaml b/seaweed-block/testops/scenarios/helm-multi-volume-rf3-readiness-chain.yaml deleted file mode 100644 index 0f25600a6c..0000000000 --- a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-readiness-chain.yaml +++ /dev/null @@ -1,205 +0,0 @@ -# Phase 27 D1 spike: multi-volume Day-1 at RF=3, no fault injection. -# -# Goal: -# First signal on whether the v0.3.1 placement / port-assignment scheme can -# actually host N concurrent RF=3 volumes (N=3 PVCs => 9 blockvolume pods -# total, 3 per node on a 3-node lab). This is the lowest-bar readiness gate -# for the multi-volume HA independence track; it does NOT inject faults. -# -# Pass = 3 PVCs bind, 3 writers verify, 3 readers verify, report shows -# replication_factor=3 and three ManagedVolumes, cleanup is clean. -# Fail = first signal that the port / placement scheme needs more work before -# multi-volume HA gates can even be authored. - -name: helm-multi-volume-rf3-readiness-chain -timeout: 34m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase27-rf3" - sw_block_csi_image: "sw-block-csi:phase27-rf3" - volume_count: "3" - replication_factor: "3" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3 && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE={{ sw_block_image }}" - save_as: local_image_built_count - - action: assert_greater - actual: "{{ local_image_built_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --replication-factor {{ replication_factor }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values/generate.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values/values.day1.yaml" - pattern: "replicationFactor: 3" - save_as: rf3_in_values - - action: assert_greater - actual: "{{ rf3_in_values }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 18m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_RF: "{{ replication_factor }}" - env.SW_BLOCK_MULTI_VOLUME_CLEANUP: "1" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/multi-volume-summary.txt" - pattern: "^multi_volume_status=ok$" - save_as: multi_volume_ok_count - - action: assert_greater - actual: "{{ multi_volume_ok_count }}" - threshold: "0" - - - name: multi_volume_rf3_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/multi-volume-summary.txt" - pattern: "^replication_factor=3$" - save_as: rf3_in_summary - - action: assert_greater - actual: "{{ rf3_in_summary }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/multi-volume-summary.txt" - pattern: "^writer_verified_count=3$" - save_as: writer_count_ok - - action: assert_greater - actual: "{{ writer_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/multi-volume-summary.txt" - pattern: "^reader_verified_count=3$" - save_as: reader_count_ok - - action: assert_greater - actual: "{{ reader_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/multi-volume-summary.txt" - pattern: "^managed_volume_count=3$" - save_as: managed_volume_count_ok - - action: assert_greater - actual: "{{ managed_volume_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/status/report/summary.txt" - pattern: "^volumes=3$" - save_as: report_volume_count_ok - - action: assert_greater - actual: "{{ report_volume_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/multi-volume/status/report/summary.txt" - pattern: "rf=3" - save_as: rf3_in_report - - action: assert_greater - actual: "{{ rf3_in_report }}" - threshold: "0" - - action: exec - node: m02 - timeout: 3m - cmd: "for i in $(seq 1 60); do out=$(kubectl -n default get deploy -l app=sw-blockvolume -o name 2>/dev/null); if [ -z \"$out\" ]; then exit 0; fi; sleep 2; done; echo \"timeout: launcher-rendered deployments still present\" >&2; kubectl -n default get deploy -l app=sw-blockvolume -o wide >&2; exit 1" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/cleanup/helm-uninstall.txt || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-reattach-recovery-chain.yaml b/seaweed-block/testops/scenarios/helm-multi-volume-rf3-reattach-recovery-chain.yaml deleted file mode 100644 index df537e0e30..0000000000 --- a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-reattach-recovery-chain.yaml +++ /dev/null @@ -1,174 +0,0 @@ -# Phase 27 D2: multi-volume RF=3 CSI reattach recovery. -# -# Pass = three RF=3 PVCs are ready, then each volume's current primary is -# stopped in turn; only the target volume changes primary, a replacement -# reader verifies persisted data through CSI/pod recreate, and cleanup is -# clean. - -name: helm-multi-volume-rf3-reattach-recovery-chain -timeout: 48m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase27-d2" - sw_block_csi_image: "sw-block-csi:phase27-d2" - volume_count: "3" - replication_factor: "3" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pod -l sw-block-test=multi-volume-reattach --ignore-not-found=true --wait=true --timeout=120s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i sw-block-multi-reattach-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/recovery /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --replication-factor {{ replication_factor }} --ack-profile sync-quorum > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\np=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml')\ns=p.read_text()\ns=s.replace('launcherReplicationAckFlag: false','launcherReplicationAckFlag: true')\np.write_text(s)\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml" - pattern: "replicationFactor: 3" - save_as: rf3_in_values - - action: assert_greater - actual: "{{ rf3_in_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml" - pattern: "ackProfile: sync-quorum" - save_as: sync_quorum_in_values - - action: assert_greater - actual: "{{ sync_quorum_in_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml" - pattern: "launcherReplicationAckFlag: true" - save_as: ack_flag_in_values - - action: assert_greater - actual: "{{ ack_flag_in_values }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/install/helm-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_reattach_recovery - actions: - - action: exec - node: m02 - timeout: 26m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-reattach-recovery.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/recovery" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_RF: "{{ replication_factor }}" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/recovery/multi-volume-reattach-summary.txt" - pattern: "^multi_volume_reattach_status=ok$" - save_as: recovery_ok_count - - action: assert_greater - actual: "{{ recovery_ok_count }}" - threshold: "0" - - - name: recovery_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/recovery/multi-volume-reattach-summary.txt" - pattern: "^recovered_volume_count=3$" - save_as: recovered_count_ok - - action: assert_greater - actual: "{{ recovered_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/recovery/multi-volume-reattach-summary.txt" - pattern: "^cross_interference_observed=false$" - save_as: no_cross_interference - - action: assert_greater - actual: "{{ no_cross_interference }}" - threshold: "0" - - action: exec - node: m02 - timeout: 2m - cmd: "for i in 1 2 3; do S=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/recovery/failover/volume-$i/summary.txt; grep -q '^failover_status=promoted$' \"$S\"; grep -q '^target_recovered=true$' \"$S\"; grep -q '^reader_verified=true$' \"$S\"; grep -q '^pod_recreate_used=true$' \"$S\"; grep -q '^post_failure_primary_count=1$' \"$S\"; grep -q '^cross_interference_observed=false$' \"$S\"; done" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pod -l sw-block-test=multi-volume-reattach --ignore-not-found=true --wait=true --timeout=120s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i sw-block-multi-reattach-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-reattach/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-restart-smoke-chain.yaml b/seaweed-block/testops/scenarios/helm-multi-volume-rf3-restart-smoke-chain.yaml deleted file mode 100644 index 236c368554..0000000000 --- a/seaweed-block/testops/scenarios/helm-multi-volume-rf3-restart-smoke-chain.yaml +++ /dev/null @@ -1,212 +0,0 @@ -# Phase 31 D5: multi-volume RF3 restart smoke. -# -# Goal: -# Prove a Helm-installed RF=3 sync-quorum stack with hostPath restart -# persistence can restart k3s/product and keep three independent PVCs readable -# without mixing per-volume authority or publish targets. -# -# Product boundary: -# Three PVCs, RF=3, sync-quorum, no injected primary failure. This is restart -# persistence smoke, not rebuild/failback or physical-host-loss recovery. - -name: helm-multi-volume-rf3-restart-smoke-chain -timeout: 42m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase31-d5" - sw_block_csi_image: "sw-block-csi:phase31-d5" - volume_count: "3" - replication_factor: "3" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 6m - cmd: "sudo -n chmod 644 /etc/rancher/k3s/k3s.yaml || true; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s; done; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n rm -rf /var/lib/sw-block/testops-{{ run_id }}-rf3-restart-smoke; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/after-restart /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --replication-factor {{ replication_factor }} --ack-profile sync-quorum --restart-persistence hostpath --state-hostpath /var/lib/sw-block/testops-{{ run_id }}-rf3-restart-smoke > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\np=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml')\ns=p.read_text()\ns=s.replace('launcherReplicationAckFlag: false','launcherReplicationAckFlag: true')\np.write_text(s)\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/generate.stdout.txt" - pattern: "^restart_persistence_mode=hostpath$" - save_as: restart_mode_count - - action: assert_greater - actual: "{{ restart_mode_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml" - pattern: "replicationFactor: 3" - save_as: rf3_values_count - - action: assert_greater - actual: "{{ rf3_values_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml" - pattern: "ackProfile: sync-quorum" - save_as: sync_quorum_values_count - - action: assert_greater - actual: "{{ sync_quorum_values_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install/helm-template.yaml && grep -q -- '--launcher-state-hostpath=/var/lib/sw-block/testops-{{ run_id }}-rf3-restart-smoke' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install/helm-template.yaml && grep -q -- '--launcher-replication-ack=sync-quorum' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/values/values.restart.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install/helm-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_before_restart - actions: - - action: exec - node: m02 - timeout: 16m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_RF: "{{ replication_factor }}" - env.SW_BLOCK_MULTI_VOLUME_CLEANUP: "0" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume/multi-volume-summary.txt" - pattern: "^writer_verified_count=3$" - save_as: writer_before_count - - action: assert_greater - actual: "{{ writer_before_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume/multi-volume-summary.txt" - pattern: "^reader_verified_count=3$" - save_as: reader_before_count - - action: assert_greater - actual: "{{ reader_before_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume/status/cluster-evidence.json" - pattern: "\"volumes\"" - save_as: cluster_before_count - - action: assert_greater - actual: "{{ cluster_before_count }}" - threshold: "0" - - - name: restart_k3s_and_compare_volumes - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "set -e; cp /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume/status/cluster-evidence.json /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/cluster-before-restart.json; date -u > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/restart-start.txt; sudo -n systemctl restart k3s; for i in $(seq 1 180); do if sudo -n k3s kubectl get nodes >/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/nodes.wait.txt 2>&1; then break; fi; sleep 2; done; sudo -n chmod 644 /etc/rancher/k3s/k3s.yaml; kubectl wait --for=condition=Ready node/m02 --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/wait-node-ready.txt; kubectl -n {{ helm_namespace }} rollout status deploy/sw-blockmaster --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/wait-blockmaster.txt; kubectl -n {{ helm_namespace }} rollout status deploy/sw-block-csi-controller --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/wait-csi-controller.txt; kubectl -n {{ helm_namespace }} rollout status ds/sw-block-csi-node --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/wait-csi-node.txt; for d in $(kubectl -n default get deploy -l app=sw-blockvolume -o name); do kubectl -n default rollout status \"$d\" --timeout=300s; done > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/wait-blockvolumes.txt; port=$(/usr/bin/python3 - <<'PY'\nimport socket\ns=socket.socket(); s.bind(('127.0.0.1',0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n {{ helm_namespace }} port-forward deploy/sw-blockmaster ${port}:9333 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/blockmaster-port-forward.log 2>&1 & pf=$!; trap 'kill $pf >/dev/null 2>&1 || true; wait $pf >/dev/null 2>&1 || true' EXIT; for i in $(seq 1 60); do if (echo >/dev/tcp/127.0.0.1/$port) >/dev/null 2>&1; then break; fi; sleep 1; done; /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/bin/sw-block ops cluster --master-api 127.0.0.1:${port} --timeout 30s -o json > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/cluster-after-restart.json; /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/bin/sw-block ops report --master-api 127.0.0.1:${port} --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/report > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/report.stdout.txt; python3 - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/cluster-before-restart.json /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/cluster-after-restart.json /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/multi-volume-restart-summary.txt <<'PY'\nimport json, sys\nbefore=json.load(open(sys.argv[1])); after=json.load(open(sys.argv[2])); out=sys.argv[3]\ndef by_id(doc):\n return {v.get('volume_id'): v for v in doc.get('volumes', []) if v.get('volume_id')}\nb=by_id(before); a=by_id(after)\nstatus='ok'; reasons=[]\nif len(b)!=3 or len(a)!=3:\n status='failed'; reasons.append(f'volume_count_before_{len(b)}_after_{len(a)}')\nfor vid, bv in b.items():\n av=a.get(vid)\n if not av:\n status='failed'; reasons.append(f'missing_{vid}'); continue\n for field in ('primary_replica','publish_target'):\n if bv.get(field) != av.get(field):\n status='failed'; reasons.append(f'{vid}_{field}_changed')\n be=int(bv.get('epoch') or bv.get('authority_epoch') or 0)\n ae=int(av.get('epoch') or av.get('authority_epoch') or 0)\n if ae < be:\n status='failed'; reasons.append(f'{vid}_epoch_rollback')\npublish=[v.get('publish_target') for v in a.values() if v.get('publish_target')]\nduplicate=len(publish)!=len(set(publish))\nif duplicate:\n status='failed'; reasons.append('duplicate_publish_target_for_distinct_volume')\nwith open(out,'w',encoding='utf-8') as f:\n f.write(f'multi_volume_restart_status={status}\\n')\n f.write(f'before_volume_count={len(b)}\\n')\n f.write(f'after_volume_count={len(a)}\\n')\n f.write('reader_verified_count=pending\\n')\n f.write(f'managed_volume_count={sum(1 for line in open(sys.argv[3].replace(\"multi-volume-restart-summary.txt\",\"report/summary.txt\"), encoding=\"utf-8\") if line.startswith(\"managed_volume=\"))}\\n')\n f.write(f'duplicate_publish_target_for_distinct_volume={str(duplicate).lower()}\\n')\n f.write(f'cross_volume_authority_mixup={\"true\" if status != \"ok\" else \"false\"}\\n')\n f.write(f'reason={\",\".join(reasons) if reasons else \"all_volumes_persisted\"}\\n')\nif status!='ok':\n raise SystemExit(','.join(reasons))\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/multi-volume-restart-summary.txt" - pattern: "^multi_volume_restart_status=ok$" - save_as: restart_status_ok_count - - action: assert_greater - actual: "{{ restart_status_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/multi-volume-restart-summary.txt" - pattern: "^managed_volume_count=3$" - save_as: managed_volume_after_count - - action: assert_greater - actual: "{{ managed_volume_after_count }}" - threshold: "0" - - - name: readers_after_restart - actions: - - action: exec - node: m02 - timeout: 14m - cmd: "set -e; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s; kubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/multi-volume/manifests/reader-$i.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/after-restart/apply-reader-$i.log; kubectl -n default wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-multi-reader-$i --timeout=240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/after-restart/wait-reader-$i.log; kubectl -n default logs sw-block-multi-reader-$i > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/after-restart/reader-$i.log; grep -q '/data/demo.bin: OK' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/after-restart/reader-$i.log; done; count=$(grep -l '/data/demo.bin: OK' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/after-restart/reader-*.log | wc -l | tr -d ' '); echo \"reader_verified_count=$count\" >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/multi-volume-restart-summary.txt; test \"$count\" = \"3\"" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/restart/multi-volume-restart-summary.txt" - pattern: "^reader_verified_count=3$" - save_as: reader_count_ok - - action: assert_greater - actual: "{{ reader_count_ok }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 9m - cmd: "mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/cleanup/diagnostics; for n in $(seq 1 90); do kubectl get nodes >/dev/null 2>&1 && break; sleep 2; done; kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/cleanup/diagnostics/kube-system.before-cleanup.txt 2>&1 || true; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=180s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i sw-block-multi-reattach-reader-$i --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s || true; done; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=true --timeout=180s || true; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s || true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n rm -rf /var/lib/sw-block/testops-{{ run_id }}-rf3-restart-smoke; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_HOSTPATH_PREFIX: "testops-{{ run_id }}-rf3-restart-smoke" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-multi-volume-rf3-restart" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/helm-release-hygiene-chain.yaml b/seaweed-block/testops/scenarios/helm-release-hygiene-chain.yaml deleted file mode 100644 index 92db0ac8fc..0000000000 --- a/seaweed-block/testops/scenarios/helm-release-hygiene-chain.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# Runner-native Phase 26 D1 gate: Helm release hygiene. -# -# Goal: -# Prove the chart is a repeatable release artifact before running heavier -# lifecycle gates: -# build sw-block CLI -# -> generate Day-1 values from the live cluster -# -> helm lint -# -> helm template -# -> helm package -# -> assert rendered release-critical resources exist - -name: helm-release-hygiene-chain -timeout: 12m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-28a99ce4f644" - sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-28a99ce4f644" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_sw_block_cli - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/bin/sw-block --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/bin/sw-block.version.txt" - - - name: generate_day1_values - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm version --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/values/helm-version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/values/generate.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - - name: helm_release_hygiene - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/verify-helm-release-hygiene.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/values/values.day1.yaml" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - - name: helm_release_hygiene_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/helm-release-hygiene-summary.txt" - pattern: "^helm_hygiene_status=ok$" - save_as: hygiene_ok_count - - action: assert_greater - actual: "{{ hygiene_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/helm-release-hygiene-summary.txt" - pattern: "^rendered_storageclass_count=1$" - save_as: rendered_sc_count - - action: assert_greater - actual: "{{ rendered_sc_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/helm-release-hygiene-summary.txt" - pattern: "^rendered_csidriver_count=1$" - save_as: rendered_csidriver_count - - action: assert_greater - actual: "{{ rendered_csidriver_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/helm-release-hygiene-summary.txt" - pattern: "^rendered_master_count=1$" - save_as: rendered_master_count - - action: assert_greater - actual: "{{ rendered_master_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 1m - cmd: "ls /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/*.tgz >/dev/null && test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/helm-template.yaml && test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-release-hygiene/hygiene/helm-lint.txt" diff --git a/seaweed-block/testops/scenarios/helm-rf3-promotion-restart-persistence-chain.yaml b/seaweed-block/testops/scenarios/helm-rf3-promotion-restart-persistence-chain.yaml deleted file mode 100644 index 1d8c300f91..0000000000 --- a/seaweed-block/testops/scenarios/helm-rf3-promotion-restart-persistence-chain.yaml +++ /dev/null @@ -1,481 +0,0 @@ -# Phase 31 D4: RF3 promotion state survives Kubernetes restart. -# -# Goal: -# Prove that after an RF=3 sync-quorum volume promotes a surviving replica, -# a k3s/product restart does not resurrect the old primary or roll authority -# back to the pre-promotion target. -# -# Product boundary: -# One PVC, RF=3, sync-quorum, CSI/pod recreate recovery after failover, then -# CSI/pod recreate after k3s restart. This is not backup/restore, returned -# replica rebuild/failback, or physical host loss. - -name: helm-rf3-promotion-restart-persistence-chain -timeout: 44m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase31-d4" - sw_block_csi_image: "sw-block-csi:phase31-d4" - volume_count: "1" - replication_factor: "3" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 6m - cmd: "sudo -n chmod 644 /etc/rancher/k3s/k3s.yaml || true; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pod -l sw-block-test=multi-volume-reattach --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pod sw-block-multi-writer-1 sw-block-multi-reader-1 sw-block-multi-reattach-reader-1 --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=true --timeout=180s; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n rm -rf /var/lib/sw-block/testops-{{ run_id }}-rf3-promotion-restart; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/restart /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/cleanup; leftover=$(kubectl -n default get deploy -l app=sw-blockvolume -o name 2>/dev/null || true); if [ -n \"$leftover\" ]; then echo \"$leftover\" > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/pre-clean-blockvolume-leftover.txt; exit 3; fi" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --replication-factor {{ replication_factor }} --ack-profile sync-quorum --restart-persistence hostpath --state-hostpath /var/lib/sw-block/testops-{{ run_id }}-rf3-promotion-restart > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\np=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml')\ns=p.read_text()\ns=s.replace('launcherReplicationAckFlag: false','launcherReplicationAckFlag: true')\np.write_text(s)\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/generate.stdout.txt" - pattern: "^restart_persistence_mode=hostpath$" - save_as: restart_mode_count - - action: assert_greater - actual: "{{ restart_mode_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml" - pattern: "ackProfile: sync-quorum" - save_as: sync_quorum_values_count - - action: assert_greater - actual: "{{ sync_quorum_values_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml" - pattern: "launcherReplicationAckFlag: true" - save_as: ack_flag_values_count - - action: assert_greater - actual: "{{ ack_flag_values_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install/helm-template.yaml && grep -q -- '--launcher-state-hostpath=/var/lib/sw-block/testops-{{ run_id }}-rf3-promotion-restart' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install/helm-template.yaml && grep -q -- '--launcher-replication-ack=sync-quorum' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/values/values.restart.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install/helm-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: promote_and_reattach - actions: - - action: exec - node: m02 - timeout: 22m - cmd: "cd {{ product_root }} && bash scripts/run-multi-volume-reattach-recovery.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_RF: "{{ replication_factor }}" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery/multi-volume-reattach-summary.txt" - pattern: "^multi_volume_reattach_status=ok$" - save_as: recovery_ok_count - - action: assert_greater - actual: "{{ recovery_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery/failover/volume-1/summary.txt" - pattern: "^failover_status=promoted$" - save_as: promoted_count - - action: assert_greater - actual: "{{ promoted_count }}" - threshold: "0" - - - name: restart_k3s_and_verify_authority - actions: - - action: exec - node: m02 - timeout: 9m - cmd: | - set -e - out=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/restart - date -u > "$out/restart-start.txt" - sudo -n systemctl restart k3s - for i in $(seq 1 180); do - if sudo -n k3s kubectl get nodes > "$out/nodes.wait.txt" 2>&1; then break; fi - sleep 2 - done - sudo -n chmod 644 /etc/rancher/k3s/k3s.yaml - kubectl wait --for=condition=Ready node/m02 --timeout=300s > "$out/wait-node-ready.txt" - kubectl -n {{ helm_namespace }} rollout status deploy/sw-blockmaster --timeout=300s > "$out/wait-blockmaster.txt" - kubectl -n {{ helm_namespace }} rollout status deploy/sw-block-csi-controller --timeout=300s > "$out/wait-csi-controller.txt" - kubectl -n {{ helm_namespace }} rollout status ds/sw-block-csi-node --timeout=300s > "$out/wait-csi-node.txt" - for d in $(kubectl -n default get deploy -l app=sw-blockvolume -o name); do - kubectl -n default rollout status "$d" --timeout=300s - done > "$out/wait-blockvolumes.txt" - port=$(/usr/bin/python3 - <<'PY' - import socket - s=socket.socket(); s.bind(('127.0.0.1',0)); print(s.getsockname()[1]); s.close() - PY - ) - pf='' - cluster_ready=false - for attempt in $(seq 1 10); do - pod=$(kubectl -n {{ helm_namespace }} get pods -l app.kubernetes.io/component=blockmaster --field-selector=status.phase=Running -o name 2>/dev/null | head -1 || true) - if [ -z "$pod" ]; then - pod=$(kubectl -n {{ helm_namespace }} get pods -o name 2>/dev/null | grep '/sw-blockmaster-' | head -1 || true) - fi - if [ -z "$pod" ]; then sleep 2; continue; fi - echo "$pod" > "$out/blockmaster-port-forward-pod.txt" - kubectl -n {{ helm_namespace }} wait --for=condition=Ready "$pod" --timeout=30s >> "$out/wait-blockmaster-pod.txt" 2>&1 || { sleep 2; continue; } - kubectl -n {{ helm_namespace }} port-forward "$pod" "${port}:9333" > "$out/blockmaster-port-forward.log" 2>&1 & - pf=$! - sleep 2 - if /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/bin/sw-block ops cluster --master-api "127.0.0.1:${port}" --timeout 30s -o json > "$out/cluster-after-restart.json.tmp" 2> "$out/cluster-after-restart.stderr.txt"; then - mv "$out/cluster-after-restart.json.tmp" "$out/cluster-after-restart.json" - cluster_ready=true - break - fi - kill "$pf" >/dev/null 2>&1 || true - wait "$pf" >/dev/null 2>&1 || true - sleep 2 - done - test "$cluster_ready" = true - trap 'kill "$pf" >/dev/null 2>&1 || true; wait "$pf" >/dev/null 2>&1 || true' EXIT - python3 - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery/failover/volume-1/summary.txt /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery/failover/volume-1/after.json "$out/cluster-after-restart.json" "$out/restart-promotion-summary.txt" <<'PY' - import json, sys - summary_path, before_json, after_json, out_path = sys.argv[1:] - summary = {} - for line in open(summary_path, encoding='utf-8'): - if '=' in line: - k, v = line.strip().split('=', 1) - summary[k] = v - volume_id = summary['volume_id'] - promoted = summary['promoted_replica'] - target = summary['after_publish_target'] - before = json.load(open(before_json)) - after = json.load(open(after_json)) - def find(doc): - for v in doc.get('volumes', []): - if v.get('volume_id') == volume_id: - return v - raise SystemExit('volume_not_found') - b = find(before) - a = find(after) - before_epoch = int(b.get('epoch') or b.get('authority_epoch') or 0) - after_epoch = int(a.get('epoch') or a.get('authority_epoch') or 0) - primary_count = sum(1 for r in a.get('replicas', []) if r.get('role') == 'primary') - status = 'ok' - reasons = [] - if a.get('primary_replica') != promoted: - status = 'failed'; reasons.append('primary_rolled_back') - if a.get('publish_target') != target: - status = 'failed'; reasons.append('publish_target_changed') - if after_epoch < before_epoch: - status = 'failed'; reasons.append('epoch_rolled_back') - if primary_count != 1: - status = 'failed'; reasons.append('primary_count_not_one') - with open(out_path, 'w', encoding='utf-8') as f: - f.write(f'restart_promotion_status={status}\n') - f.write(f'volume_id={volume_id}\n') - f.write(f'before_restart_primary={promoted}\n') - f.write(f'after_restart_primary={a.get("primary_replica", "")}\n') - f.write(f'before_restart_publish_target={target}\n') - f.write(f'after_restart_publish_target={a.get("publish_target", "")}\n') - f.write(f'before_restart_epoch={before_epoch}\n') - f.write(f'after_restart_epoch={after_epoch}\n') - f.write(f'post_restart_primary_count={primary_count}\n') - f.write(f'reason={",".join(reasons) if reasons else "authority_persisted"}\n') - if status != 'ok': - raise SystemExit(','.join(reasons)) - PY - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/restart/restart-promotion-summary.txt" - pattern: "^restart_promotion_status=ok$" - save_as: restart_promotion_ok_count - - action: assert_greater - actual: "{{ restart_promotion_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/restart/restart-promotion-summary.txt" - pattern: "^reason=authority_persisted$" - save_as: authority_persisted_count - - action: assert_greater - actual: "{{ authority_persisted_count }}" - threshold: "0" - - - name: reader_after_restart - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "set -e; kubectl -n default delete pod sw-block-multi-reattach-reader-1 --ignore-not-found=true --wait=true --timeout=120s; kubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/recovery/manifests/sw-block-multi-reattach-reader-1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/apply-reader-after-restart.log; kubectl -n default wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-multi-reattach-reader-1 --timeout=240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/wait-reader-after-restart.log; kubectl -n default logs sw-block-multi-reattach-reader-1 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/reader-after-restart.log; grep -q '/data/demo.bin: OK' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/reader-after-restart.log" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/reader-after-restart.log" - pattern: "/data/demo.bin: OK" - save_as: reader_after_restart_count - - action: assert_greater - actual: "{{ reader_after_restart_count }}" - threshold: "0" - - - name: post_restart_degraded_status_boundary - actions: - - action: exec - node: m02 - timeout: 4m - cmd: | - set -e - out=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/convergence - mkdir -p "$out" - python3 - "$out" <<'PY' - import json - import socket - import subprocess - import sys - import time - from pathlib import Path - - out = Path(sys.argv[1]) - root = Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart") - sw_block = root / "bin/sw-block" - restart_summary = root / "restart/restart-promotion-summary.txt" - volume_id = "" - for line in restart_summary.read_text(encoding="utf-8").splitlines(): - if line.startswith("volume_id="): - volume_id = line.split("=", 1)[1] - break - if not volume_id: - raise SystemExit("volume_id unavailable") - - def run(*args, **kwargs): - return subprocess.run(args, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) - - pods = run( - "kubectl", "-n", "{{ helm_namespace }}", "get", "pods", - "-l", "app.kubernetes.io/component=blockmaster", - "--field-selector=status.phase=Running", - "-o", "json", - check=True, - ) - pod_items = json.loads(pods.stdout).get("items") or [] - if not pod_items: - pods = run( - "kubectl", "-n", "{{ helm_namespace }}", "get", "pods", - "--field-selector=status.phase=Running", - "-o", "json", - check=True, - ) - pod_items = [ - item for item in json.loads(pods.stdout).get("items") or [] - if item.get("metadata", {}).get("name", "").startswith("sw-blockmaster-") - ] - ready_pod = "" - for item in pod_items: - conditions = {c.get("type"): c.get("status") for c in (item.get("status") or {}).get("conditions") or []} - if conditions.get("Ready") == "True": - ready_pod = item["metadata"]["name"] - break - if not ready_pod: - raise SystemExit("no Ready blockmaster pod") - (out / "blockmaster-pod.txt").write_text(ready_pod + "\n", encoding="utf-8") - - sock = socket.socket() - sock.bind(("127.0.0.1", 0)) - port = sock.getsockname()[1] - sock.close() - (out / "port.txt").write_text(str(port) + "\n", encoding="utf-8") - - pf_log = open(out / "blockmaster-port-forward.log", "w", encoding="utf-8") - pf = subprocess.Popen( - ["kubectl", "-n", "{{ helm_namespace }}", "port-forward", f"pod/{ready_pod}", f"{port}:9333"], - stdout=pf_log, - stderr=subprocess.STDOUT, - text=True, - ) - - def port_ready(): - try: - with socket.create_connection(("127.0.0.1", port), timeout=1): - return True - except OSError: - return False - - try: - deadline = time.time() + 30 - while time.time() < deadline: - if pf.poll() is not None: - raise SystemExit("port-forward exited early") - if port_ready(): - break - time.sleep(0.5) - else: - raise SystemExit("port-forward did not become ready") - - consecutive = 0 - max_consecutive = 0 - observations = [] - final_reason = "" - for attempt in range(1, 31): - report_dir = out / f"report-{attempt:02d}" - evidence_dir = out / f"evidence-{attempt:02d}" - cmd = [ - str(sw_block), "ops", "report", - "--namespace", "default", - "--master", f"127.0.0.1:{port}", - "--out", str(report_dir), - "--evidence-out", str(evidence_dir), - "--timeout", "30s", - ] - proc = run(*cmd) - (out / f"report-{attempt:02d}.stdout.txt").write_text(proc.stdout, encoding="utf-8") - (out / f"report-{attempt:02d}.stderr.txt").write_text(proc.stderr, encoding="utf-8") - if proc.returncode != 0: - observations.append(f"{attempt}: report_failed rc={proc.returncode}") - consecutive = 0 - time.sleep(3) - continue - snap_path = report_dir / "operator-snapshot.json" - snap = json.loads(snap_path.read_text(encoding="utf-8")) - vols = snap.get("volumes") or [] - target = next((v for v in vols if (v.get("status") or {}).get("volume_id") == volume_id), None) - if target is None: - observations.append(f"{attempt}: volume_missing") - consecutive = 0 - time.sleep(3) - continue - status = target.get("status") or {} - conditions = status.get("conditions") or [] - ready_true = any(c.get("type") == "Ready" and c.get("status") == "True" for c in conditions) - blocked_true = any(c.get("type") == "Blocked" and c.get("status") == "True" for c in conditions) - status_value = status.get("status", "") - reason = status.get("reason_code", "") - final_reason = reason - stable_degraded_unknown = status_value == "unknown" and reason == "status_endpoint_unreachable" - stable_ready = status_value == "ready" and ready_true - if (stable_ready or stable_degraded_unknown) and not blocked_true: - consecutive += 1 - else: - consecutive = 0 - max_consecutive = max(max_consecutive, consecutive) - observations.append( - f"{attempt}: status={status_value} reason={reason} ready_true={str(ready_true).lower()} " - f"blocked_true={str(blocked_true).lower()} consecutive_stable={consecutive}" - ) - if consecutive >= 3: - break - time.sleep(3) - - (out / "observations.txt").write_text("\n".join(observations) + "\n", encoding="utf-8") - status = "ok" if consecutive >= 3 else "failed" - with open(out / "convergence-summary.txt", "w", encoding="utf-8") as f: - f.write(f"restart_status_boundary={status}\n") - f.write(f"volume_id={volume_id}\n") - f.write(f"required_consecutive_stable=3\n") - f.write(f"max_consecutive_stable={max_consecutive}\n") - f.write(f"final_reason={final_reason or 'unknown'}\n") - f.write("evidence=observations.txt\n") - if status != "ok": - raise SystemExit("post-restart status did not reach a stable safe surface") - finally: - pf.terminate() - try: - pf.wait(timeout=5) - except subprocess.TimeoutExpired: - pf.kill() - pf.wait(timeout=5) - pf_log.close() - PY - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/convergence/convergence-summary.txt" - pattern: "^restart_status_boundary=ok$" - save_as: restart_status_boundary_ok_count - - action: assert_greater - actual: "{{ restart_status_boundary_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/after-restart/convergence/convergence-summary.txt" - pattern: "^max_consecutive_stable=3$" - save_as: restart_consecutive_stable_count - - action: assert_greater - actual: "{{ restart_consecutive_stable_count }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 9m - cmd: "mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/cleanup/diagnostics; kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/cleanup/diagnostics/kube-system.before-cleanup.txt 2>&1 || true; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pod -l sw-block-test=multi-volume-reattach --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pod sw-block-multi-writer-1 sw-block-multi-reader-1 sw-block-multi-reattach-reader-1 --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-multi sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n rm -rf /var/lib/sw-block/testops-{{ run_id }}-rf3-promotion-restart; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_HOSTPATH_PREFIX: "testops-{{ run_id }}-rf3-promotion-restart" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-rf3-promotion-restart" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/helm-single-node-first-volume-chain.yaml b/seaweed-block/testops/scenarios/helm-single-node-first-volume-chain.yaml deleted file mode 100644 index c2f50d1088..0000000000 --- a/seaweed-block/testops/scenarios/helm-single-node-first-volume-chain.yaml +++ /dev/null @@ -1,221 +0,0 @@ -# Runner-native Phase 21 D3a Helm single-node first-volume chain. -# -# Goal: -# Prove the README-friendly single-node product path. This can run on a -# real single-node Linux k3s lab, or on the 3-node lab by selecting one node -# and pinning the writer/reader pods to that same node. -# -# Product boundary: -# This is RF=1 / loopback / first-volume evidence. It is not an HA claim. - -name: helm-single-node-first-volume-chain -timeout: 22m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - single_node: "m02" - sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-28a99ce4f644" - sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-28a99ce4f644" - sw_block_ref: "sha-28a99ce4f644" # tested image tag (the artifact under test) - sw_block_commit: "28a99ce4f644" # its commit sha - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: generate_single_node_values - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm version --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/helm-version.txt && cd {{ product_root }} && bash scripts/generate-helm-values-day1.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_HELM_VALUES_OUT: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml" - env.SW_BLOCK_HELM_TARGET_NODE: "{{ single_node }}" - env.SW_BLOCK_HELM_NODE_LIMIT: "1" - env.SW_BLOCK_HELM_REPLICATION_FACTOR: "1" - env.SW_BLOCK_ACTIVATION_IMAGE_MODE: "published" - env.SW_BLOCK_IMAGE: "{{ sw_block_image }}" - env.SW_BLOCK_CSI_IMAGE: "{{ sw_block_csi_image }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml" - pattern: "externalISCSI: false" - save_as: external_iscsi_false_count - - action: assert_greater - actual: "{{ external_iscsi_false_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml" - pattern: "internalIP: \"127.0.0.1\"" - save_as: loopback_count - - action: assert_greater - actual: "{{ loopback_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml" - pattern: "kubernetesNode: \"{{ single_node }}\"" - save_as: selected_node_count - - action: assert_greater - actual: "{{ selected_node_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/helm-lint.txt && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml --wait --timeout 5m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/helm-install.txt && kubectl -n {{ helm_namespace }} rollout status deploy/sw-blockmaster --timeout=180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/wait-blockmaster.txt && kubectl -n {{ helm_namespace }} rollout status deploy/sw-block-csi-controller --timeout=180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/wait-csi-controller.txt && kubectl -n {{ helm_namespace }} rollout status ds/sw-block-csi-node --timeout=180s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/wait-csi-node.txt && helm status {{ helm_release }} --namespace {{ helm_namespace }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/helm-status.txt && kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/kube-system-ready.txt && kubectl get sc sw-block-dynamic -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/storageclass.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/install/helm-status.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "1" - env.SW_BLOCK_BASIC_APP_NODE_SELECTOR: "{{ single_node }}" - env.SW_BLOCK_INSTALL_MODE: "helm-single-node" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/values/values.day1.yaml" - env.SW_BLOCK_IMAGE: "{{ sw_block_image }}" - env.SW_BLOCK_CSI_IMAGE: "{{ sw_block_csi_image }}" - - - name: first_volume_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app/first-volume-summary.txt" - pattern: "^install_mode=helm-single-node$" - save_as: install_mode_count - - action: assert_greater - actual: "{{ install_mode_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app/first-volume-summary.txt" - pattern: "^app_node_selector={{ single_node }}$" - save_as: node_selector_count - - action: assert_greater - actual: "{{ node_selector_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app/first-volume-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified_count - - action: assert_greater - actual: "{{ writer_verified_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app/first-volume-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified_count - - action: assert_greater - actual: "{{ reader_verified_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/basic-app/status/report/index.html" - pattern: "/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh; kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/cleanup/kube-system-after-uninstall.txt 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/helm-single-node-restart-persistence-chain.yaml b/seaweed-block/testops/scenarios/helm-single-node-restart-persistence-chain.yaml deleted file mode 100644 index 68dccef8f9..0000000000 --- a/seaweed-block/testops/scenarios/helm-single-node-restart-persistence-chain.yaml +++ /dev/null @@ -1,415 +0,0 @@ -# Phase 31 D3: Helm single-node restart persistence gate. -# -# Goal: -# Prove the smallest Kubernetes user path survives a k3s/product restart when -# Helm is installed with explicit hostPath restart persistence. -# -# Product boundary: -# RF=1 / single selected Kubernetes node / loopback iSCSI / pod recreate -# after restart. This is not an HA, node-loss, or disaster-recovery claim. - -name: helm-single-node-restart-persistence-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - single_node: "m02" - sw_block_image: "sw-block:local" - sw_block_csi_image: "sw-block-csi:local" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n rm -rf /var/lib/sw-block/testops-{{ run_id }}-restart-persistence; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: build_sw_block_cli - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block.version.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block.version.txt" - pattern: "sw-block" - save_as: sw_block_version_count - - action: assert_greater - actual: "{{ sw_block_version_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: pin_image_id_count - - action: assert_greater - actual: "{{ pin_image_id_count }}" - threshold: "0" - - - name: generate_restart_values - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/values.restart.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} --target-node {{ single_node }} --node-limit 1 --restart-persistence hostpath --state-hostpath /var/lib/sw-block/testops-{{ run_id }}-restart-persistence > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/generate.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/generate.stdout.txt" - pattern: "^restart_persistence_mode=hostpath$" - save_as: restart_mode_count - - action: assert_greater - actual: "{{ restart_mode_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/generate.stdout.txt" - pattern: "^state_hostpath=/var/lib/sw-block/testops-{{ run_id }}-restart-persistence$" - save_as: state_hostpath_stdout_count - - action: assert_greater - actual: "{{ state_hostpath_stdout_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/values.restart.yaml" - pattern: "stateHostPath: /var/lib/sw-block/testops-{{ run_id }}-restart-persistence" - save_as: state_hostpath_values_count - - action: assert_greater - actual: "{{ state_hostpath_values_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/values.restart.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/values.restart.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install/helm-template.yaml && grep -q -- '--launcher-state-hostpath=/var/lib/sw-block/testops-{{ run_id }}-restart-persistence' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/values.restart.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install/helm-install.txt && kubectl -n {{ helm_namespace }} rollout status deploy/sw-blockmaster --timeout=180s && kubectl -n {{ helm_namespace }} rollout status deploy/sw-block-csi-controller --timeout=180s && kubectl -n {{ helm_namespace }} rollout status ds/sw-block-csi-node --timeout=180s && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_before_restart - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "0" - env.SW_BLOCK_BASIC_APP_NODE_SELECTOR: "{{ single_node }}" - env.SW_BLOCK_INSTALL_MODE: "helm-single-node-restart-persistence" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/values/values.restart.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/basic-app/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_before_restart_count - - action: assert_greater - actual: "{{ reader_before_restart_count }}" - threshold: "0" - - - name: restart_k3s_and_verify - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "set -e; date -u > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/restart-start.txt; sudo -n systemctl restart k3s; for i in $(seq 1 180); do if sudo -n k3s kubectl get nodes >/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/nodes.wait.txt 2>&1; then break; fi; sleep 2; done; sudo -n chmod 644 /etc/rancher/k3s/k3s.yaml; kubectl wait --for=condition=Ready node/{{ single_node }} --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/wait-node-ready.txt; kubectl -n {{ helm_namespace }} rollout status deploy/sw-blockmaster --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/wait-blockmaster.txt; kubectl -n {{ helm_namespace }} rollout status deploy/sw-block-csi-controller --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/wait-csi-controller.txt; kubectl -n {{ helm_namespace }} rollout status ds/sw-block-csi-node --timeout=300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/wait-csi-node.txt; for d in $(kubectl -n default get deploy -l app=sw-blockvolume -o name); do kubectl -n default rollout status \"$d\" --timeout=300s; done > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/wait-blockvolumes.txt; kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/kube-system.after-restart.txt; kubectl -n default get pods,pvc,pv,deploy -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/default.after-restart.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/restart/wait-blockmaster.txt" - pattern: "successfully rolled out" - save_as: blockmaster_restart_ready_count - - action: assert_greater - actual: "{{ blockmaster_restart_ready_count }}" - threshold: "0" - - - name: reader_after_restart - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "set -e; kubectl -n default delete pod sw-block-example-reader --ignore-not-found=true --wait=true --timeout=120s; kubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/basic-app/reader-pod.rendered.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/apply-reader-after-restart.log; kubectl -n default wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-example-reader --timeout=240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/wait-reader-after-restart.log; kubectl -n default logs sw-block-example-reader > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/reader-after-restart.log; grep -q '/data/demo.bin: OK' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/reader-after-restart.log; port=$(/usr/bin/python3 - <<'PY'\nimport socket\ns=socket.socket(); s.bind(('127.0.0.1',0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n {{ helm_namespace }} port-forward deploy/sw-blockmaster ${port}:9333 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/blockmaster-port-forward.log 2>&1 & pf=$!; trap 'kill $pf >/dev/null 2>&1 || true; wait $pf >/dev/null 2>&1 || true' EXIT; for i in $(seq 1 60); do if (echo >/dev/tcp/127.0.0.1/$port) >/dev/null 2>&1; then break; fi; sleep 1; done; /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block ops cluster --master-api 127.0.0.1:${port} --timeout 30s -o json > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/cluster-after-restart.json; /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/bin/sw-block ops report --master-api 127.0.0.1:${port} --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/report > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/report.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/reader-after-restart.log" - pattern: "/data/demo.bin: OK" - save_as: reader_after_restart_count - - action: assert_greater - actual: "{{ reader_after_restart_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/report/summary.txt" - pattern: "managed_volume=.*status=ready" - save_as: managed_volume_ready_count - - action: assert_greater - actual: "{{ managed_volume_ready_count }}" - threshold: "0" - - - name: post_restart_status_convergence - actions: - - action: exec - node: m02 - timeout: 4m - cmd: | - set -e - out=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/convergence - mkdir -p "$out" - python3 - "$out" <<'PY' - import json - import socket - import subprocess - import sys - import time - from pathlib import Path - - out = Path(sys.argv[1]) - root = Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart") - sw_block = root / "bin/sw-block" - summary = root / "basic-app/first-volume-summary.txt" - volume_id = "" - for line in summary.read_text(encoding="utf-8").splitlines(): - if line.startswith("volume_id="): - volume_id = line.split("=", 1)[1] - break - if not volume_id: - raise SystemExit("volume_id unavailable") - - def run(*args, **kwargs): - return subprocess.run(args, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) - - pods = run( - "kubectl", "-n", "{{ helm_namespace }}", "get", "pods", - "-l", "app.kubernetes.io/component=blockmaster", - "--field-selector=status.phase=Running", - "-o", "json", - check=True, - ) - pod_items = json.loads(pods.stdout).get("items") or [] - if not pod_items: - pods = run( - "kubectl", "-n", "{{ helm_namespace }}", "get", "pods", - "--field-selector=status.phase=Running", - "-o", "json", - check=True, - ) - pod_items = [ - item for item in json.loads(pods.stdout).get("items") or [] - if item.get("metadata", {}).get("name", "").startswith("sw-blockmaster-") - ] - ready_pod = "" - for item in pod_items: - conditions = {c.get("type"): c.get("status") for c in (item.get("status") or {}).get("conditions") or []} - if conditions.get("Ready") == "True": - ready_pod = item["metadata"]["name"] - break - if not ready_pod: - raise SystemExit("no Ready blockmaster pod") - (out / "blockmaster-pod.txt").write_text(ready_pod + "\n", encoding="utf-8") - - sock = socket.socket() - sock.bind(("127.0.0.1", 0)) - port = sock.getsockname()[1] - sock.close() - (out / "port.txt").write_text(str(port) + "\n", encoding="utf-8") - - pf_log = open(out / "blockmaster-port-forward.log", "w", encoding="utf-8") - pf = subprocess.Popen( - ["kubectl", "-n", "{{ helm_namespace }}", "port-forward", f"pod/{ready_pod}", f"{port}:9333"], - stdout=pf_log, - stderr=subprocess.STDOUT, - text=True, - ) - - def port_ready(): - try: - with socket.create_connection(("127.0.0.1", port), timeout=1): - return True - except OSError: - return False - - try: - deadline = time.time() + 30 - while time.time() < deadline: - if pf.poll() is not None: - raise SystemExit("port-forward exited early") - if port_ready(): - break - time.sleep(0.5) - else: - raise SystemExit("port-forward did not become ready") - - consecutive = 0 - max_consecutive = 0 - observations = [] - final_reason = "" - for attempt in range(1, 31): - report_dir = out / f"report-{attempt:02d}" - evidence_dir = out / f"evidence-{attempt:02d}" - proc = run( - str(sw_block), "ops", "report", - "--namespace", "default", - "--master", f"127.0.0.1:{port}", - "--out", str(report_dir), - "--evidence-out", str(evidence_dir), - "--timeout", "30s", - ) - (out / f"report-{attempt:02d}.stdout.txt").write_text(proc.stdout, encoding="utf-8") - (out / f"report-{attempt:02d}.stderr.txt").write_text(proc.stderr, encoding="utf-8") - if proc.returncode != 0: - observations.append(f"{attempt}: report_failed rc={proc.returncode}") - consecutive = 0 - time.sleep(3) - continue - snap = json.loads((report_dir / "operator-snapshot.json").read_text(encoding="utf-8")) - vols = snap.get("volumes") or [] - target = next((v for v in vols if (v.get("status") or {}).get("volume_id") == volume_id), None) - if target is None: - observations.append(f"{attempt}: volume_missing") - consecutive = 0 - time.sleep(3) - continue - status = target.get("status") or {} - conditions = status.get("conditions") or [] - ready_true = any(c.get("type") == "Ready" and c.get("status") == "True" for c in conditions) - blocked_true = any(c.get("type") == "Blocked" and c.get("status") == "True" for c in conditions) - status_value = status.get("status", "") - reason = status.get("reason_code", "") - final_reason = reason - if status_value == "ready" and ready_true and not blocked_true: - consecutive += 1 - else: - consecutive = 0 - max_consecutive = max(max_consecutive, consecutive) - observations.append( - f"{attempt}: status={status_value} reason={reason} ready_true={str(ready_true).lower()} " - f"blocked_true={str(blocked_true).lower()} consecutive_ready={consecutive}" - ) - if consecutive >= 3: - break - time.sleep(3) - - (out / "observations.txt").write_text("\n".join(observations) + "\n", encoding="utf-8") - status = "ok" if consecutive >= 3 else "failed" - with open(out / "convergence-summary.txt", "w", encoding="utf-8") as f: - f.write(f"restart_status_convergence={status}\n") - f.write(f"volume_id={volume_id}\n") - f.write(f"required_consecutive_ready=3\n") - f.write(f"max_consecutive_ready={max_consecutive}\n") - f.write(f"final_reason={final_reason or 'unknown'}\n") - f.write("evidence=observations.txt\n") - if status != "ok": - raise SystemExit("post-restart status did not converge to stable Ready") - finally: - pf.terminate() - try: - pf.wait(timeout=5) - except subprocess.TimeoutExpired: - pf.kill() - pf.wait(timeout=5) - pf_log.close() - PY - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/convergence/convergence-summary.txt" - pattern: "^restart_status_convergence=ok$" - save_as: restart_convergence_ok_count - - action: assert_greater - actual: "{{ restart_convergence_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/after-restart/convergence/convergence-summary.txt" - pattern: "^max_consecutive_ready=3$" - save_as: restart_consecutive_ready_count - - action: assert_greater - actual: "{{ restart_consecutive_ready_count }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/diagnostics; kubectl -n {{ helm_namespace }} get pods,deploy,ds,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/diagnostics/kube-system.before-cleanup.txt 2>&1 || true; kubectl -n {{ helm_namespace }} logs deploy/sw-blockmaster --all-containers=true --tail=200 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/diagnostics/blockmaster.before-cleanup.log 2>&1 || true; kubectl -n {{ helm_namespace }} get events --sort-by=.lastTimestamp > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/diagnostics/events.before-cleanup.txt 2>&1 || true; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 300s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; sudo -n rm -rf /var/lib/sw-block/testops-{{ run_id }}-restart-persistence; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLEANUP_HOSTPATH_PREFIX: "testops-{{ run_id }}-restart-persistence" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: exec - node: m02 - cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-restart-persistence" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-single-node-restart" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/helm-support-bundle-diagnostics-chain.yaml b/seaweed-block/testops/scenarios/helm-support-bundle-diagnostics-chain.yaml deleted file mode 100644 index f41240b490..0000000000 --- a/seaweed-block/testops/scenarios/helm-support-bundle-diagnostics-chain.yaml +++ /dev/null @@ -1,272 +0,0 @@ -# Runner-native Phase 26 D4 gate: Helm support bundle diagnostics. -# -# Goal: -# Prove a Helm-installed first-volume run produces a cold, read-only support -# bundle that can be consumed later by sw-block ops report/explain/timeline. -# Also prove a blocked ImagePullBackOff bundle explains itself without a live -# cluster. - -name: helm-support-bundle-diagnostics-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "sw-block:phase26-d4" - sw_block_csi_image: "sw-block-csi:phase26-d4" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/blocked-bundle/demo /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: build_and_generate_values - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && SW_BLOCK_IMAGE={{ sw_block_image }} SW_BLOCK_CSI_IMAGE={{ sw_block_csi_image }} SW_BLOCK_IMPORT_K3S=1 SW_BLOCK_IMPORT_K3S_NODES='192.168.1.181,192.168.1.188' SW_BLOCK_IMPORT_K3S_SSH_USER=testdev SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/build bash scripts/build-alpha-images.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE={{ sw_block_image }}" - save_as: local_image_built_count - - action: assert_greater - actual: "{{ local_image_built_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/values/generate.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_kept_for_bundle - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "0" - env.SW_BLOCK_INSTALL_MODE: "helm" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/values/values.day1.yaml" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - - name: collect_support_bundle - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/collect-helm-support-bundle.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_SUPPORT_BUNDLE_SOURCE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app" - env.SW_BLOCK_SUPPORT_BUNDLE_OUT: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle/support-bundle-summary.txt" - pattern: "^support_bundle_status=ok$" - save_as: support_bundle_ok_count - - action: assert_greater - actual: "{{ support_bundle_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle/support-bundle-summary.txt" - pattern: "^read_only=true$" - save_as: support_bundle_readonly_count - - action: assert_greater - actual: "{{ support_bundle_readonly_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle/replayed-report/summary.txt" - pattern: "^status=ok$" - save_as: replayed_report_ok_count - - action: assert_greater - actual: "{{ replayed_report_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle/explain.txt" - pattern: "managed_volume " - save_as: explain_managed_count - - action: assert_greater - actual: "{{ explain_managed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle/helm/status.txt" - pattern: "STATUS: deployed" - save_as: helm_status_bundle_count - - action: assert_greater - actual: "{{ helm_status_bundle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/basic-app/support-bundle/k8s/pods.txt" - pattern: "sw-block" - save_as: k8s_pods_bundle_count - - action: assert_greater - actual: "{{ k8s_pods_bundle_count }}" - threshold: "0" - - - name: blocked_bundle_asserts - actions: - - action: exec - node: m02 - timeout: 2m - cmd: "cat > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/blocked-bundle/demo/kube-system-pods-deploys.txt <<'EOF'\nNAME READY STATUS RESTARTS AGE IP NODE\npod/sw-block-csi-node-n948t 0/2 ImagePullBackOff 0 2m3s 192.168.1.184 m02\ndeployment.apps/sw-block-csi-controller 1/1 1 1 2m3s block-csi sw-block-csi:local\nEOF\n/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/bin/sw-block ops explain volume --from-bundle /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/blocked-bundle pvc-blocked > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/blocked-bundle/explain.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/blocked-bundle/explain.txt" - pattern: "reason=csi_node_image_pull_failed" - save_as: blocked_reason_count - - action: assert_greater - actual: "{{ blocked_reason_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/blocked-bundle/explain.txt" - pattern: "ImagePullBackOff" - save_as: blocked_image_pull_count - - action: assert_greater - actual: "{{ blocked_image_pull_count }}" - threshold: "0" - - - name: failure_snapshot - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/collect-k8s-failure-snapshot.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_FAILURE_SNAPSHOT_OUT: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/failure-snapshot" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/failure-snapshot/failure-snapshot-summary.txt" - pattern: "^read_only=true$" - save_as: failure_snapshot_readonly_count - - action: assert_greater - actual: "{{ failure_snapshot_readonly_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/failure-snapshot/k8s/events-all.txt" - pattern: "." - save_as: failure_snapshot_events_count - - action: assert_greater - actual: "{{ failure_snapshot_events_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/failure-snapshot/logs/csi-node.current.log" - pattern: "." - save_as: failure_snapshot_csi_log_count - - action: assert_greater - actual: "{{ failure_snapshot_csi_log_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/failure-snapshot/host/iscsi-nodes.txt" - pattern: "." - save_as: failure_snapshot_iscsi_nodes_count - - action: assert_greater - actual: "{{ failure_snapshot_iscsi_nodes_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/failure-snapshot/host/processes.txt" - pattern: "." - save_as: failure_snapshot_process_count - - action: assert_greater - actual: "{{ failure_snapshot_process_count }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/cleanup/helm-uninstall.txt || true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-helm-support-bundle/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: helm_cleanup_ok_count - - action: assert_greater - actual: "{{ helm_cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/iscsi-os-initiator-compat-chain.yaml b/seaweed-block/testops/scenarios/iscsi-os-initiator-compat-chain.yaml deleted file mode 100644 index 7c99aa1fb1..0000000000 --- a/seaweed-block/testops/scenarios/iscsi-os-initiator-compat-chain.yaml +++ /dev/null @@ -1,137 +0,0 @@ -# Runner-native iSCSI OS-initiator compatibility gate. -# -# Goal: -# Prove the Linux open-iscsi path against a real kernel initiator: -# iscsiadm discovery/login -> mkfs.ext4 -> mount -> write/read checksum -# -> optional fio stress -> logout -> no residue. -# -# This is an iSCSI correctness gate. It is not a performance, HA, multipath, -# Windows, or Kubernetes claim. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/iscsi-os-initiator-compat-chain.yaml - -name: iscsi-os-initiator-compat-chain -timeout: 20m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - os_iterations: "1" - os_stress: "fio" - os_fio_runtime: "60" - os_fio_size: "128m" - durable_blocks: "65536" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: pin_build - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/pin_build/git.status && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/bin/blockmaster ./cmd/blockmaster && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/bin/blockvolume ./cmd/blockvolume" - - action: exec - node: m02 - cmd: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/bin/blockmaster --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/pin_build/blockmaster.version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/bin/blockvolume --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/pin_build/blockvolume.version.txt" - - - name: os_initiator_smoke - actions: - - action: exec - node: m02 - cmd: "sudo dmesg > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke/dmesg.before.txt 2>&1 || true" - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && bash scripts/run-iscsi-os-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/bin" - env.SW_BLOCK_ISCSI_ITERATIONS: "{{ os_iterations }}" - env.SW_BLOCK_ISCSI_STRESS: "{{ os_stress }}" - env.SW_BLOCK_ISCSI_FIO_RUNTIME: "{{ os_fio_runtime }}" - env.SW_BLOCK_ISCSI_FIO_SIZE: "{{ os_fio_size }}" - env.SW_BLOCK_DURABLE_BLOCKS: "{{ durable_blocks }}" - - action: exec - node: m02 - cmd: "sudo dmesg > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke/dmesg.after.txt 2>&1 || true" - - action: exec - node: m02 - cmd: "python3 - <<'PY'\nimport re, sys\nbase = '/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke'\nts_re = re.compile(r'^\\[\\s*([0-9]+(?:\\.[0-9]+)?)\\]')\ndef read_lines(name):\n with open(base + '/' + name, encoding='utf-8', errors='replace') as f:\n return f.read().splitlines()\ndef ts(line):\n m = ts_re.match(line)\n return float(m.group(1)) if m else None\nbefore = read_lines('dmesg.before.txt')\nafter = read_lines('dmesg.after.txt')\nbefore_ts = [v for v in (ts(line) for line in before) if v is not None]\nif before_ts:\n cutoff = max(before_ts)\n new = [line for line in after if (ts(line) is not None and ts(line) > cutoff)]\nelse:\n i = 0\n while i < len(before) and i < len(after) and before[i] == after[i]:\n i += 1\n new = after[i:]\nwith open(base + '/dmesg.new.txt', 'w', encoding='utf-8') as f:\n f.write('\\n'.join(new))\n if new:\n f.write('\\n')\nbad = re.compile(r'DID_BAD_TARGET|I/O error|Buffer I/O|rejecting I/O|blk_update_request|connection.*failed', re.I)\nhits = [line for line in new if bad.search(line)]\nif hits:\n print('\\n'.join(hits), file=sys.stderr)\n sys.exit(1)\nPY" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke/run.log" - pattern: "\\[iscsi-os\\] PASS:" - save_as: os_pass_count - - action: assert_greater - actual: "{{ os_pass_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke/mkfs.iter1.log" - pattern: "Writing superblocks and filesystem accounting information" - save_as: mkfs_success_count - - action: assert_greater - actual: "{{ mkfs_success_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke/sha256-check.iter1.log" - pattern: "payload.iter1.bin: OK" - save_as: checksum_success_count - - action: assert_greater - actual: "{{ checksum_success_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat/os_smoke/fio.iter1.log" - pattern: "err= 0" - save_as: fio_success_count - - action: assert_greater - actual: "{{ fio_success_count }}" - threshold: "0" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-os-compat" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/iscsi-p6-alua-failover-chain.yaml b/seaweed-block/testops/scenarios/iscsi-p6-alua-failover-chain.yaml index 7be16c870a..b0fba7659a 100644 --- a/seaweed-block/testops/scenarios/iscsi-p6-alua-failover-chain.yaml +++ b/seaweed-block/testops/scenarios/iscsi-p6-alua-failover-chain.yaml @@ -7,8 +7,11 @@ # # Expected invocation from sw-test-runner-standalone: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/iscsi-p6-alua-failover-chain.yaml name: iscsi-p6-alua-failover-chain @@ -16,46 +19,50 @@ timeout: 25m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" unmount: "/tmp/sw-block-iscsi-failover/mnt,/tmp/sw-block-iscsi-mpath/mnt" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p6-chain && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: pin_build actions: - action: exec - node: m02 + node: node-a timeout: 8m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockmaster ./cmd/blockmaster && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockvolume ./cmd/blockvolume" + cmd: "cd {{ product_root }} && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockmaster ./cmd/blockmaster && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockvolume ./cmd/blockvolume" - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/git.sha && git status --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/git.status && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockmaster --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/blockmaster.version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockvolume --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/blockvolume.version.txt" + node: node-a + cmd: "cd {{ product_root }} && git rev-parse HEAD > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/git.sha && git status --short > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/git.status && {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockmaster --version > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/blockmaster.version.txt && {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin/blockvolume --version > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/blockvolume.version.txt" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/blockvolume.version.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/pin_build/blockvolume.version.txt" pattern: "blockvolume revision=" save_as: blockvolume_version_count - action: assert_greater @@ -65,16 +72,16 @@ phases: - name: alua_multipath actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/run-iscsi-alua-multipath-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath" + env.SW_BLOCK_BIN_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin" # Bash-level gate: smoke's own PASS line ran. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/run.log" pattern: "\\[iscsi-mpath\\] PASS:" save_as: alua_pass_count - action: assert_greater @@ -83,8 +90,8 @@ phases: # Field-level gate: one path reports Active/Optimized. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/run.log" pattern: "rtpg_state_r1=0x00" save_as: r1_active_optimized_count - action: assert_greater @@ -93,8 +100,8 @@ phases: # Field-level gate: standby path reports ALUA standby, not unavailable. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/run.log" pattern: "rtpg_state_r2=0x02" save_as: r2_standby_count - action: assert_greater @@ -103,16 +110,16 @@ phases: # Field-level gate: VPD 0x83 contains path-distinguishing identity. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/sg_inq.r1.vpd83.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/sg_inq.r1.vpd83.txt" pattern: "Target port group" save_as: r1_vpd83_identity_count - action: assert_greater actual: "{{ r1_vpd83_identity_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/sg_inq.r2.vpd83.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/sg_inq.r2.vpd83.txt" pattern: "Target port group" save_as: r2_vpd83_identity_count - action: assert_greater @@ -121,8 +128,8 @@ phases: # Field-level gate: standby raw writes are rejected and surfaced as I/O errors. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/standby-write.stderr" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/standby-write.stderr" pattern: "Input/output error" save_as: standby_write_reject_count - action: assert_greater @@ -131,16 +138,16 @@ phases: # Field-level gate: multipath groups both paths as one ALUA-handled map. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/multipath-map-name.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/multipath-map-name.txt" pattern: "mpath" save_as: multipath_map_name_count - action: assert_greater actual: "{{ multipath_map_name_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/multipath.ll.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/alua_multipath/multipath.ll.txt" pattern: "hwhandler='1 alua'" save_as: alua_handler_count - action: assert_greater @@ -148,25 +155,25 @@ phases: threshold: "0" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: mounted_failover actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/run-iscsi-alua-mounted-failover-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover" + env.SW_BLOCK_BIN_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/bin" # Bash-level gate: smoke's own PASS line ran. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/run.log" pattern: "\\[iscsi-failover\\] PASS:" save_as: failover_pass_count - action: assert_greater @@ -175,16 +182,16 @@ phases: # Mounted workload survived the primary kill. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/pre-check-after-failover.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/pre-check-after-failover.log" pattern: "/pre.bin: OK" save_as: pre_checksum_count - action: assert_greater actual: "{{ pre_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/post-check.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/post-check.log" pattern: "/post.bin: OK" save_as: post_checksum_count - action: assert_greater @@ -193,24 +200,24 @@ phases: # Field-level gate: r2 promoted at epoch 2 and is frontend-ready. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/status-r2-healthy.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/status-r2-healthy.json" pattern: "\"Epoch\":2" save_as: r2_epoch2_count - action: assert_greater actual: "{{ r2_epoch2_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/status-r2-healthy.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/status-r2-healthy.json" pattern: "\"AuthorityRole\":\"primary\"" save_as: r2_role_primary_count - action: assert_greater actual: "{{ r2_role_primary_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/status-r2-healthy.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/status-r2-healthy.json" pattern: "\"FrontendPrimaryReady\":true" save_as: r2_frontend_ready_count - action: assert_greater @@ -219,8 +226,8 @@ phases: # Field-level gate: r2's ALUA state becomes Active/Optimized after failover. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/sg_rtpg.r2.after.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/mounted_failover/sg_rtpg.r2.after.txt" pattern: "asymmetric access state" save_as: r2_after_active_optimized_count - action: assert_greater @@ -228,35 +235,35 @@ phases: threshold: "0" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: final_asserts actions: - action: exec - node: m02 - cmd: "sudo iscsiadm -m session > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/iscsi-sessions.final.txt 2>&1 || true; sudo multipath -ll > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain/multipath.final.txt 2>&1 || true" + node: node-a + cmd: "sudo iscsiadm -m session > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/iscsi-sessions.final.txt 2>&1 || true; sudo multipath -ll > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain/multipath.final.txt 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: collect_and_cleanup always: true actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" unmount: "/tmp/sw-block-iscsi-failover/mnt,/tmp/sw-block-iscsi-mpath/mnt" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p6-chain" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p6-chain" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/iscsi-p8-compat-soak-chain.yaml b/seaweed-block/testops/scenarios/iscsi-p8-compat-soak-chain.yaml index 0c7fd5f9d1..3155c8a785 100644 --- a/seaweed-block/testops/scenarios/iscsi-p8-compat-soak-chain.yaml +++ b/seaweed-block/testops/scenarios/iscsi-p8-compat-soak-chain.yaml @@ -6,8 +6,11 @@ # # Expected invocation from sw-test-runner-standalone: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/iscsi-p8-compat-soak-chain.yaml name: iscsi-p8-compat-soak-chain @@ -15,7 +18,10 @@ timeout: 35m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= os_iterations: "2" os_fio_runtime: "120" os_fio_size: "128m" @@ -23,47 +29,48 @@ env: topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/os_fio_repeat /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_fio /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_attach_detach" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p8-chain && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p8-chain/os_fio_repeat $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_fio $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_attach_detach" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: pin_build actions: - action: exec - node: m02 + node: node-a timeout: 8m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockmaster ./cmd/blockmaster && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockvolume ./cmd/blockvolume" + cmd: "cd {{ product_root }} && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockmaster ./cmd/blockmaster && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockvolume ./cmd/blockvolume" - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build" - action: exec - node: m02 - cmd: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockmaster --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/blockmaster.version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockvolume --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/blockvolume.version.txt" + node: node-a + cmd: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockmaster --version > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/blockmaster.version.txt && {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin/blockvolume --version > {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/blockvolume.version.txt" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: pin_image_id_count - action: assert_greater @@ -73,86 +80,86 @@ phases: - name: os_fio_repeat actions: - action: exec - node: m02 + node: node-a timeout: 12m cmd: "cd {{ product_root }} && bash scripts/run-iscsi-os-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/os_fio_repeat" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/os_fio_repeat" + env.SW_BLOCK_BIN_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/bin" env.SW_BLOCK_ISCSI_ITERATIONS: "{{ os_iterations }}" env.SW_BLOCK_ISCSI_STRESS: "fio" env.SW_BLOCK_ISCSI_FIO_RUNTIME: "{{ os_fio_runtime }}" env.SW_BLOCK_ISCSI_FIO_SIZE: "{{ os_fio_size }}" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/os_fio_repeat/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/os_fio_repeat/run.log" pattern: "\\[iscsi-os\\] PASS:" save_as: os_pass_count - action: assert_greater actual: "{{ os_pass_count }}" threshold: "0" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: k8s_fio actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/run-k8s-alpha-fio.sh {{ product_root }}" - env.SW_BLOCK_ALPHA_IMAGES_ENV: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/alpha-images.env" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_fio" + env.SW_BLOCK_ALPHA_IMAGES_ENV: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/alpha-images.env" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_fio" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_fio/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_fio/run.log" pattern: "\\[alpha-fio\\] PASS:" save_as: k8s_fio_pass_count - action: assert_greater actual: "{{ k8s_fio_pass_count }}" threshold: "0" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: k8s_attach_detach actions: - action: exec - node: m02 + node: node-a timeout: 12m - cmd: "cd {{ product_root }} && set -a && . /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/alpha-images.env && set +a && bash scripts/run-k8s-attach-detach-loop.sh {{ product_root }}" + cmd: "cd {{ product_root }} && set -a && . {{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/pin_build/alpha-images.env && set +a && bash scripts/run-k8s-attach-detach-loop.sh {{ product_root }}" env.SW_BLOCK_ATTACH_DETACH_ITERATIONS: "{{ attach_iterations }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_attach_detach" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_attach_detach" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_attach_detach/summary.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain/k8s_attach_detach/summary.log" pattern: "\\[attach-loop\\] PASS:" save_as: attach_pass_count - action: assert_greater actual: "{{ attach_pass_count }}" threshold: "0" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: collect_and_cleanup always: true actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-p8-chain" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-iscsi-p8-chain" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/iscsi-returned-replica-chain.yaml b/seaweed-block/testops/scenarios/iscsi-returned-replica-chain.yaml deleted file mode 100644 index f2346ba508..0000000000 --- a/seaweed-block/testops/scenarios/iscsi-returned-replica-chain.yaml +++ /dev/null @@ -1,408 +0,0 @@ -# Runner-native iSCSI returned-replica reintegration chain. -# -# Goal: -# Exercise a real RF=2 iSCSI ALUA mounted failover, then restart the old -# primary and assert it returns as a non-frontend replica while r2 remains -# primary. This is the integration companion to returned-replica-component-gate. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/iscsi-returned-replica-chain.yaml - -name: iscsi-returned-replica-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - unmount: "/tmp/sw-block-iscsi-returned/mnt" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: pin_build - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/blockmaster ./cmd/blockmaster && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/blockvolume ./cmd/blockvolume && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/sw-block ./cmd/sw-block" - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/pin_build/git.sha && git status --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/pin_build/git.status && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/blockmaster --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/pin_build/blockmaster.version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/blockvolume --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/pin_build/blockvolume.version.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/pin_build/blockvolume.version.txt" - pattern: "blockvolume revision=" - save_as: blockvolume_version_count - - action: assert_greater - actual: "{{ blockvolume_version_count }}" - threshold: "0" - - - name: returned_failover - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-iscsi-alua-mounted-failover-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin" - env.SW_BLOCK_ISCSI_FAILOVER_WORK_DIR: "/tmp/sw-block-iscsi-returned" - env.SW_BLOCK_RETURN_R1_AFTER_FAILOVER: "1" - env.SW_BLOCK_DEGRADED_PROBE_INTERVAL: "1s" - env.SW_BLOCK_DEGRADED_PROBE_COOLDOWN_BASE: "1s" - env.SW_BLOCK_DEGRADED_PROBE_COOLDOWN_CAP: "3s" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/run.log" - pattern: "\\[iscsi-failover\\] PASS:" - save_as: failover_pass_count - - action: assert_greater - actual: "{{ failover_pass_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/run.log" - pattern: "restart returned r1 after r2 promotion" - save_as: r1_return_phase_count - - action: assert_greater - actual: "{{ r1_return_phase_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/pre-check-after-failover.log" - pattern: "/pre.bin: OK" - save_as: pre_checksum_count - - action: assert_greater - actual: "{{ pre_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/post-check.log" - pattern: "/post.bin: OK" - save_as: post_checksum_count - - action: assert_greater - actual: "{{ post_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-healthy.json" - pattern: "\"AuthorityRole\":\"primary\"" - save_as: r2_primary_count - - action: assert_greater - actual: "{{ r2_primary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r1-returned.summary" - pattern: "^authority_non_primary=true$" - save_as: r1_nonprimary_summary_count - - action: assert_greater - actual: "{{ r1_nonprimary_summary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r1-returned.summary" - pattern: "^frontend_primary_ready=false$" - save_as: r1_frontend_not_ready_summary_count - - action: assert_greater - actual: "{{ r1_frontend_not_ready_summary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r1-returned.summary" - pattern: "^healthy=false$" - save_as: r1_not_healthy_summary_count - - action: assert_greater - actual: "{{ r1_not_healthy_summary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-after-r1-return.json" - pattern: "\"AuthorityRole\":\"primary\"" - save_as: r2_still_primary_count - - action: assert_greater - actual: "{{ r2_still_primary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-after-r1-return.json" - pattern: "\"FrontendPrimaryReady\":true" - save_as: r2_still_frontend_ready_count - - action: assert_greater - actual: "{{ r2_still_frontend_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-after-r1-return.json" - pattern: "\"Healthy\":true" - save_as: r2_still_healthy_count - - action: assert_greater - actual: "{{ r2_still_healthy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-peers-after-r1-return.json" - pattern: "\"ReplicaID\":\"r1\"" - save_as: r1_peer_present_count - - action: assert_greater - actual: "{{ r1_peer_present_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-peers-after-r1-return.json" - pattern: "\"State\":\"healthy\"" - save_as: r1_peer_healthy_count - - action: assert_greater - actual: "{{ r1_peer_healthy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-peers-after-r1-return.json" - pattern: "\"Epoch\":2" - save_as: r1_peer_epoch_count - - action: assert_greater - actual: "{{ r1_peer_epoch_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-peers-after-r1-return.json" - pattern: "\"ProbeInFlight\":false" - save_as: r1_peer_probe_idle_count - - action: assert_greater - actual: "{{ r1_peer_probe_idle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-r2-peers-after-r1-return.json" - pattern: "\"Closed\":false" - save_as: r1_peer_open_count - - action: assert_greater - actual: "{{ r1_peer_open_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/blockvolume-r1-returned.log" - pattern: "durable recovered: recovered LSN=" - save_as: r1_returned_local_recovery_count - - action: assert_greater - actual: "{{ r1_returned_local_recovery_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/blockvolume-r1-returned.log" - pattern: "admitted as SUPPORTING replica r1" - save_as: r1_returned_supersede_observed_count - - action: assert_greater - actual: "{{ r1_returned_supersede_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-durable-r2-primary-after-r1-return.summary" - pattern: "^replica=r2$" - save_as: r2_durable_replica_count - - action: assert_greater - actual: "{{ r2_durable_replica_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-durable-r2-primary-after-r1-return.summary" - pattern: "^epoch_gte_2=true$" - save_as: r2_durable_epoch_gte_2_count - - action: assert_greater - actual: "{{ r2_durable_epoch_gte_2_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/status-durable-r2-primary-after-r1-return.summary" - pattern: "^operational=true$" - save_as: r2_durable_operational_count - - action: assert_greater - actual: "{{ r2_durable_operational_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 2m - cmd: | - ROOT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover - mkdir -p "$ROOT/product-observation" "$ROOT/report" - python3 - "$ROOT" <<'PY' - import datetime, json, pathlib, sys - root = pathlib.Path(sys.argv[1]) - r1 = json.loads((root / 'status-r1-returned.json').read_text()) - r2 = json.loads((root / 'status-r2-after-r1-return.json').read_text()) - dr1 = json.loads((root / 'status-durable-r1-returned.json').read_text())['Volumes'][0] - dr2 = json.loads((root / 'status-durable-r2-primary-after-r1-return.json').read_text())['Volumes'][0] - required = int(dr2.get('DurableLSN') or 0) - r1_durable = int(dr1.get('DurableLSN') or 0) - cluster = { - 'schema_version': '1.0', - 'captured_at': datetime.datetime.now(datetime.timezone.utc).isoformat().replace('+00:00', 'Z'), - 'product_revision': 'returned-replica-live-gate', - 'status': 'recovering', - 'volumes': [{ - 'volume_id': 'v1', - 'namespace': 'testops', - 'pvc_name': 'iscsi-returned-replica-chain', - 'replication_factor': 2, - 'ack_profile': 'sync-quorum', - 'status': 'recovering', - 'reason': 'returned_replica_frontend_fenced', - 'primary_replica': 'r2', - 'primary_node': 'm02', - 'publish_target': '127.0.0.1:3281', - 'epoch': int(r2.get('Epoch') or 0), - 'endpoint_version': int(r2.get('EndpointVersion') or 0), - 'required_frontier_known': required > 0, - 'required_frontier_lsn': required, - 'replicas': [{ - 'replica_id': 'r1', - 'server_id': 's1', - 'kubernetes_node': 'm02', - 'observed': True, - 'role': 'returned', - 'replication_role': str(r1.get('ReplicationRole') or 'replica_ready'), - 'durable_latched': bool(dr1.get('Latched')), - 'durable_frontier_known': bool(dr1.get('FrontierKnown')), - 'durable_frontier_lsn': r1_durable, - 'healthy': bool(r1.get('Healthy')), - 'frontend_primary_ready': bool(r1.get('FrontendPrimaryReady')), - 'frontend_protocol': 'iscsi', - 'frontend_addr': '127.0.0.1:3280', - 'status_addr': '127.0.0.1:19603', - 'stale_primary_fenced': True, - 'support_bundle_path': 'status-r1-returned.json' - }, { - 'replica_id': 'r2', - 'server_id': 's2', - 'kubernetes_node': 'm02', - 'observed': True, - 'role': 'primary', - 'replication_role': str(r2.get('ReplicationRole') or 'none'), - 'durable_latched': bool(dr2.get('Latched')), - 'durable_frontier_known': bool(dr2.get('FrontierKnown')), - 'durable_frontier_lsn': required, - 'healthy': bool(r2.get('Healthy')), - 'frontend_primary_ready': bool(r2.get('FrontendPrimaryReady')), - 'frontend_protocol': 'iscsi', - 'frontend_addr': '127.0.0.1:3281', - 'status_addr': '127.0.0.1:19613' - }] - }], - 'non_claims': ['no automatic returned-replica failback or rebuild mutation executed'] - } - (root / 'product-observation' / 'cluster-evidence.json').write_text(json.dumps(cluster, indent=2) + '\n') - (root / 'returned-replica-live-evidence-summary.txt').write_text('\n'.join([ - 'returned_replica_live_evidence_status=ok', - f'required_frontier_lsn={required}', - f'r1_durable_lsn={r1_durable}', - f'r2_durable_lsn={required}', - f'frontier_covered={str(r1_durable >= required).lower()}', - ]) + '\n') - PY - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/sw-block ops report --from-bundle "$ROOT" --out "$ROOT/report" > "$ROOT/report.stdout.txt" 2> "$ROOT/report.stderr.txt" - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/sw-block ops explain volume --from-bundle "$ROOT" v1 > "$ROOT/explain.txt" 2> "$ROOT/explain.stderr.txt" - port=19487 - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/bin/sw-block ops dashboard --from-bundle "$ROOT" --listen "127.0.0.1:${port}" --serve-duration 8s > "$ROOT/dashboard.stdout.txt" 2> "$ROOT/dashboard.stderr.txt" & - dashboard_pid=$! - for _ in $(seq 1 80); do - if curl -fsS "http://127.0.0.1:${port}/operator-snapshot.json" > "$ROOT/dashboard-operator-snapshot.json" 2> "$ROOT/dashboard-curl.stderr.txt"; then - break - fi - sleep 0.1 - done - test -s "$ROOT/dashboard-operator-snapshot.json" - wait "$dashboard_pid" || true - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/returned-replica-live-evidence-summary.txt" - pattern: "^frontier_covered=true$" - save_as: returned_live_frontier_covered_count - - action: assert_greater - actual: "{{ returned_live_frontier_covered_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/report/summary.txt" - pattern: "managed_volume_returned_replica=v1 replica=r1 state=fenced reason=returned_replica_frontend_fenced" - save_as: returned_live_projection_count - - action: assert_greater - actual: "{{ returned_live_projection_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/report/summary.txt" - pattern: "managed_volume_action=authority.reintegrate_returned_replica mode=dry_run side_effect=authority_mutating executor=authority_recovery_executor decision=allowed" - save_as: returned_live_action_allowed_count - - action: assert_greater - actual: "{{ returned_live_action_allowed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/explain.txt" - pattern: "managed_volume_action authority.reintegrate_returned_replica mode=dry_run" - save_as: returned_live_explain_action_count - - action: assert_greater - actual: "{{ returned_live_explain_action_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain/returned_failover/dashboard-operator-snapshot.json" - pattern: "\"type\": \"authority.reintegrate_returned_replica\"" - save_as: returned_live_dashboard_action_count - - action: assert_greater - actual: "{{ returned_live_dashboard_action_count }}" - threshold: "0" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - unmount: "/tmp/sw-block-iscsi-returned/mnt" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-iscsi-returned-chain" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/layout-realcluster-integration-gate.yaml b/seaweed-block/testops/scenarios/layout-realcluster-integration-gate.yaml deleted file mode 100644 index f90df901c2..0000000000 --- a/seaweed-block/testops/scenarios/layout-realcluster-integration-gate.yaml +++ /dev/null @@ -1,304 +0,0 @@ -# Runner-native real-cluster gate for the content-named layout. -# -# One scenario for the layout's real-process tests. Each entry is one tagged Go -# test that owns its stock filer, block processes and NVMe frontend; the -# scenario builds an exact product commit, runs the selected entries, and -# passes an entry only on that test's own top-level "--- PASS" line together -# with exit code 0. A test that is skipped, renamed, or not compiled in by its -# tags prints no such line, so it fails the entry. -# -# Parameters never enter shell source: every value reaches the commands as an -# environment variable (the runner single-quotes env.* params), and each is -# validated before use. The verified product commit and weed digest are -# recorded in result.json (emit_provenance) whether or not the entries pass. -# -# Entries (all six by default; select a subset with -env tests="..."): -# move TestIntegrationWorkspaceLayoutMove (clean and forced move) -# lease TestBinaryWorkspaceLeaseOptInOwnsCLEANShutdown -# systemd TestSystemdExpiredStartupExits75ThenRegrantServes -# (system systemd; run as a user allowed to systemd-run) -# catalog TestIntegration_CatalogRestoreAndDelete -# cutover-e2e TestCutoverWriteSnapshotKillRestartRestore (write, snapshot, -# kill, restart, restore) -# cutover-create TestCutoverCreateFromSnapshot (the master creates the -# target identity and its restored image in one request) -# fence-heal TestFencingRoundHealContinuesThePrimary (a failed fencing -# round heals by continuing the primary). Not in the default -# set until the promotion fence is on the base. -# fence-rejoin TestFencingRoundSurvivorRejoins (the fence-heal scenario -# carried on: the survivor that could not fence rejoins the -# healed primary). Not in the default set until the promotion -# fence is on the base. -# double-failover TestDoubleFailoverReadsBackEveryAckedWrite (RF3 -# sync_quorum: two failovers, the first primary rejoining in -# between; every acknowledged write reads back on the last -# primary). Not in the default set until the promotion fence -# is on the base. -# -# Expected invocation (on the Linux host): -# swblock run \ -# -env product_repo=/path/to/seaweed-block -env head=<40-hex commit> \ -# -env weed_binary=/path/to/weed -env weed_sha256= \ -# -env go_bin=/path/to/go/bin \ -# -env tests="move lease systemd catalog cutover-e2e cutover-create" \ -# testops/scenarios/layout-realcluster-integration-gate.yaml - -name: layout-realcluster-integration-gate -timeout: 120m -always_timeout: 5m - -env: - product_repo: "/path/to/seaweed-block" - head: "" - weed_binary: "/path/to/weed" - weed_sha256: "" - go_bin: "/usr/local/go/bin" - tests: "move lease systemd catalog cutover-e2e cutover-create" - scratch_root: "/tmp/sw-layout-gate" - -topology: - nodes: - host: - is_local: true - -phases: - - name: prepare - actions: - - action: exec - node: host - timeout: 2m - env.GATE_RUN: "{{ run_id }}" - env.GATE_ROOT: "{{ scratch_root }}" - env.GATE_HEAD: "{{ head }}" - env.GATE_TESTS: "{{ tests }}" - env.GATE_REPO: "{{ product_repo }}" - env.GATE_WEED: "{{ weed_binary }}" - env.GATE_WEED_SHA: "{{ weed_sha256 }}" - env.GATE_GO: "{{ go_bin }}" - save_as: gate_token - cmd: | - set -euf - fail() { echo "$1" >&2; exit 2; } - case "$GATE_HEAD" in *[!0-9a-f]*|'') fail 'head must be a full lowercase hexadecimal commit' ;; esac - [ ${#GATE_HEAD} -eq 40 ] || fail 'head must be 40 characters' - case "$GATE_WEED_SHA" in *[!0-9a-f]*|'') fail 'weed_sha256 must be lowercase hexadecimal' ;; esac - [ ${#GATE_WEED_SHA} -eq 64 ] || fail 'weed_sha256 must be 64 characters' - case "$GATE_RUN" in *[!0-9A-Za-z_-]*|'') fail 'run_id has unexpected characters' ;; esac - case "$GATE_ROOT" in /*) ;; *) fail 'scratch_root must be absolute' ;; esac - case "$GATE_ROOT" in *[!0-9A-Za-z_./-]*|*..*) fail 'scratch_root has unexpected characters' ;; esac - case "$GATE_TESTS" in *[!0-9a-z\ -]*|'') fail 'tests must be entry names separated by spaces' ;; esac - n=0 - for t in $GATE_TESTS; do - case "$t" in move|lease|systemd|catalog|cutover-e2e|cutover-create|fence-heal|fence-rejoin|double-failover) ;; *) fail "unknown entry: $t" ;; esac - n=$((n + 1)) - done - [ "$n" -gt 0 ] || fail 'tests names no entry' - [ -x "$GATE_GO/go" ] || fail 'go_bin/go is not executable' - [ -f "$GATE_WEED" ] || fail 'weed_binary is not a file' - [ "$(sha256sum < "$GATE_WEED" | cut -d' ' -f1)" = "$GATE_WEED_SHA" ] || fail 'weed_binary does not match weed_sha256' - [ "$(git -C "$GATE_REPO" rev-parse --verify "$GATE_HEAD^{commit}")" = "$GATE_HEAD" ] || fail 'head is not that commit in product_repo' - d="$GATE_ROOT/$GATE_RUN" - mkdir -p "$GATE_ROOT" - # Created here, atomically, or refused: cleanup removes only a - # directory whose marker holds this run's token. - mkdir "$d" 2>/dev/null || fail 'run directory already exists' - token=$(od -An -tx1 -N16 /dev/urandom | tr -d ' \n') - printf '%s\n' "$token" > "$d/.layout-gate-owned" - printf '%s\n' "$token" - - action: exec - node: host - timeout: 2m - env.GATE_DIR: "{{ scratch_root }}/{{ run_id }}" - env.GATE_HEAD: "{{ head }}" - env.GATE_TESTS: "{{ tests }}" - env.GATE_REPO: "{{ product_repo }}" - env.GATE_WEED_SHA: "{{ weed_sha256 }}" - env.GATE_GO: "{{ go_bin }}" - cmd: | - set -euf - d="$GATE_DIR" - mkdir "$d/source" "$d/bin" "$d/tmp" "$d/evidence" - git -C "$GATE_REPO" archive "$GATE_HEAD" | tar -xf - -C "$d/source" - printf '%s\n' "$GATE_HEAD" > "$d/evidence/product.sha" - printf '%s weed\n' "$GATE_WEED_SHA" > "$d/evidence/weed.sha256" - "$GATE_GO/go" version > "$d/evidence/go.version" - printf '%s\n' $GATE_TESTS > "$d/evidence/selected.txt" - # Pins, recorded before any entry runs; gate_pass stays 0 unless run_tests passes. - - action: emit_provenance - product: seaweed-block - tested_sha: "{{ head }}" - gate_pass: "0" - gate_status: "pinned" - __weed_sha256: "{{ weed_sha256 }}" - __entries: "{{ tests }}" - - - name: build - actions: - - action: exec - node: host - timeout: 20m - env.GATE_DIR: "{{ scratch_root }}/{{ run_id }}" - env.GATE_GO: "{{ go_bin }}" - env.GATE_TESTS: "{{ tests }}" - cmd: | - set -eu - d="$GATE_DIR" - export PATH="$GATE_GO:$PATH" - cd "$d/source" - for b in blockmaster blockvolume sw-block; do go build -o "$d/bin/$b" "./cmd/$b"; done - # Only the test binaries the selected entries run: a package that - # no selected entry uses cannot fail the build of the others. - bv=0 sd=0 cs=0 - for t in $GATE_TESTS; do - case "$t" in - systemd) sd=1 ;; - catalog) cs=1 ;; - *) bv=1 ;; - esac - done - [ "$bv" = 0 ] || go test -c -tags 'subprocess chunkstore_integration' -o "$d/bin/blockvolume.test" ./cmd/blockvolume - [ "$sd" = 0 ] || go test -c -tags 'subprocess chunkstore_integration systemd_integration' -o "$d/bin/blockvolume-systemd.test" ./cmd/blockvolume - [ "$cs" = 0 ] || go test -c -tags 'chunkstore_integration' -o "$d/bin/chunkstore.test" ./core/frontend/chunkstore - sha256sum "$d/bin/"* > "$d/evidence/binaries.sha256" - - - name: run_tests - actions: - - action: exec - node: host - timeout: 95m - env.GATE_DIR: "{{ scratch_root }}/{{ run_id }}" - env.GATE_GO: "{{ go_bin }}" - env.GATE_WEED: "{{ weed_binary }}" - env.GATE_TESTS: "{{ tests }}" - receipt_path: "{{ bundle_dir }}/run_tests.receipt.json" - cmd: | - set -f - d="$GATE_DIR" - export PATH="$GATE_GO:$PATH" TMPDIR="$d/tmp" CHUNKSTORE_WEED="$GATE_WEED" SWBLOCK_TEST_BINS="$d/bin" - : > "$d/evidence/verdicts.txt" - failed=0 - n=0 - for t in $GATE_TESTS; do - n=$((n + 1)) - extra= - case "$t" in - move) pkg=cmd/blockvolume bin=blockvolume.test name=TestIntegrationWorkspaceLayoutMove to=14m ;; - lease) pkg=cmd/blockvolume bin=blockvolume.test name=TestBinaryWorkspaceLeaseOptInOwnsCLEANShutdown to=9m ;; - systemd) pkg=cmd/blockvolume bin=blockvolume-systemd.test name=TestSystemdExpiredStartupExits75ThenRegrantServes to=14m extra=GAP1_SYSTEMD_AUTHORIZED=1 ;; - catalog) pkg=core/frontend/chunkstore bin=chunkstore.test name=TestIntegration_CatalogRestoreAndDelete to=9m ;; - cutover-e2e) pkg=cmd/blockvolume bin=blockvolume.test name=TestCutoverWriteSnapshotKillRestartRestore to=40m ;; - cutover-create) pkg=cmd/blockvolume bin=blockvolume.test name=TestCutoverCreateFromSnapshot to=20m ;; - fence-heal) pkg=cmd/blockvolume bin=blockvolume.test name=TestFencingRoundHealContinuesThePrimary to=10m ;; - fence-rejoin) pkg=cmd/blockvolume bin=blockvolume.test name=TestFencingRoundSurvivorRejoins to=10m ;; - double-failover) pkg=cmd/blockvolume bin=blockvolume.test name=TestDoubleFailoverReadsBackEveryAckedWrite to=15m ;; - *) echo "unknown entry: $t" >&2; exit 2 ;; - esac - log="$d/evidence/$t.log" - # A failed test keeps its daemons' whole logs here (collected). - (cd "$d/source/$pkg" && env $extra SWBLOCK_TEST_LOG_DIR="$d/evidence/$t-daemons" "$d/bin/$bin" -test.run "^$name\$" -test.v -test.count 1 -test.timeout "$to") > "$log" 2>&1 - rc=$? - if [ "$rc" -eq 0 ] && grep -qE "^--- PASS: $name \(" "$log"; then - echo "PASS $t $name" >> "$d/evidence/verdicts.txt" - else - echo "FAIL $t $name rc=$rc" >> "$d/evidence/verdicts.txt" - tail -40 "$log" >&2 - failed=1 - fi - done - passes=$(grep -c '^PASS ' "$d/evidence/verdicts.txt" 2>/dev/null) || passes=0 - if [ "$n" -eq 0 ] || [ "$passes" -ne "$n" ]; then - echo "verdicts: $passes PASS of $n selected entries" >&2 - failed=1 - fi - cat "$d/evidence/verdicts.txt" >&2 - exit "$failed" - - - name: collect - always: true - actions: - - action: collect_path - node: host - path: "{{ scratch_root }}/{{ run_id }}/evidence" - name: "layout-gate" - - # Runs only when every earlier ordinary phase passed (the runner runs the - # always phases after them). The pass is read back from a collected copy of - # the evidence: a failed collection fails the gate, and the archive must - # hold one PASS verdict per selected entry and no other line. - - name: mark_pass - actions: - - action: collect_path - node: host - path: "{{ scratch_root }}/{{ run_id }}/evidence" - name: "layout-gate-pass" - - action: exec - node: host - timeout: 1m - env.GATE_ARCHIVE: "{{ artifacts_dir }}/layout-gate-pass.tgz" - env.GATE_TESTS: "{{ tests }}" - cmd: | - set -euf - v=$(tar -xzOf "$GATE_ARCHIVE" evidence/verdicts.txt) - n=0 - for t in $GATE_TESTS; do - n=$((n + 1)) - printf '%s\n' "$v" | grep -qE "^PASS $t Test[A-Za-z0-9_]+\$" || { echo "collected verdicts lack PASS for $t" >&2; exit 1; } - done - lines=$(printf '%s\n' "$v" | grep -c .) - [ "$n" -gt 0 ] && [ "$lines" -eq "$n" ] || { echo "collected verdicts: $lines lines for $n entries" >&2; exit 1; } - - action: emit_provenance - product: seaweed-block - tested_sha: "{{ head }}" - gate_pass: "1" - gate_status: "ok" - __weed_sha256: "{{ weed_sha256 }}" - __entries: "{{ tests }}" - - # Always runs and ends with the zero-residue assertion: no process whose cwd, - # executable or command line is inside this run's directory (the tests build - # and start every binary there, systemd units included), and no gap1-* unit. - # The run directory is removed only after that holds. - - name: cleanup - always: true - actions: - - action: exec - node: host - timeout: 3m - env.GATE_RUN: "{{ run_id }}" - env.GATE_ROOT: "{{ scratch_root }}" - env.GATE_TOKEN: "{{ gate_token }}" - receipt_path: "{{ bundle_dir }}/cleanup.receipt.json" - cmd: | - set -u - case "$GATE_RUN" in *[!0-9A-Za-z_-]*|'') echo 'run_id has unexpected characters' >&2; exit 2 ;; esac - case "$GATE_ROOT" in /*) ;; *) echo 'scratch_root must be absolute' >&2; exit 2 ;; esac - d="$GATE_ROOT/$GATE_RUN" - [ -e "$d" ] || exit 0 - # No token: prepare created nothing; whatever is there is not ours. - case "$GATE_TOKEN" in *[!0-9a-f]*|'') echo "this run created no directory; left untouched: $d" >&2; exit 0 ;; esac - [ ${#GATE_TOKEN} -eq 32 ] || { echo "this run created no directory; left untouched: $d" >&2; exit 0; } - [ "$(cat "$d/.layout-gate-owned" 2>/dev/null)" = "$GATE_TOKEN" ] || { echo "not created by this run; left untouched: $d" >&2; exit 2; } - residue() { - n=0 - for p in /proc/[0-9]*; do - [ "${p##*/}" = "$$" ] && continue - cwd=$(readlink "$p/cwd" 2>/dev/null || true) - exe=$(readlink "$p/exe" 2>/dev/null || true) - cmd=$(tr '\0' ' ' < "$p/cmdline" 2>/dev/null || true) - case "$cwd|$exe|$cmd" in *"$d"/*) echo "residue process ${p##*/}: $exe" >&2; n=$((n + 1)) ;; esac - done - if command -v systemctl >/dev/null 2>&1; then - units=$(systemctl list-units --all --plain --no-legend 'gap1-*' 2>/dev/null | awk '{print $1}') - [ -z "$units" ] || { echo "residue units: $units" >&2; n=$((n + 1)); } - fi - [ "$n" -eq 0 ] - } - i=0 - until residue; do - i=$((i + 1)) - [ "$i" -lt 30 ] || { echo "residue remains after 60s; run directory kept: $d" >&2; exit 1; } - sleep 2 - done - rm -rf -- "$d" - [ ! -e "$d" ] || { echo "run directory not removed: $d" >&2; exit 1; } - echo "zero residue: $d" diff --git a/seaweed-block/testops/scenarios/lifecycle-owner-admission-gate-chain.yaml b/seaweed-block/testops/scenarios/lifecycle-owner-admission-gate-chain.yaml deleted file mode 100644 index d0f0be1b73..0000000000 --- a/seaweed-block/testops/scenarios/lifecycle-owner-admission-gate-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Runner-native Phase 42 D1 gate: live lifecycle-owner API/admission boundary. - -name: lifecycle-owner-admission-gate-chain -description: > - Runs the live Kubernetes ValidatingAdmissionPolicy gate that proves the - lifecycle-owner identity can only issue finalizer-shaped SwBlockVolume main - object patches. This is the real API/admission successor to the Phase 41 - schema-aware boundary gate. - -vars: - product_root: "{{ env.PRODUCT_ROOT | default('/mnt/c/work/seaweed_block') }}" - -phases: - - name: admission_gate - actions: - - type: exec - name: run_phase42_admission_gate - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate bash scripts/run-phase42-lifecycle-owner-admission-gate.sh {{ product_root }}" - - - name: asserts - actions: - - type: grep_log - name: admission_gate_ok - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^phase42_lifecycle_owner_admission_status=ok$" - - type: grep_log - name: operator_status_no_main_patch - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^operator_status_main_patch_allowed=false$" - - type: grep_log - name: admission_policy_propagated - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^admission_policy_propagated=true$" - - type: grep_log - name: lifecycle_owner_finalizer_add_allowed - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_finalizer_add_allowed=true$" - - type: grep_log - name: lifecycle_owner_finalizer_add_idempotent - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_finalizer_add_idempotent=true$" - - type: grep_log - name: lifecycle_owner_finalizer_remove_allowed - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_finalizer_remove_allowed=true$" - - type: grep_log - name: lifecycle_owner_finalizer_remove_idempotent - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_finalizer_remove_idempotent=true$" - - type: grep_log - name: lifecycle_owner_spec_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_spec_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_label_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_label_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_annotation_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_annotation_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_ownerreferences_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_ownerreferences_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_deletiontimestamp_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_deletiontimestamp_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_foreign_finalizer_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_foreign_finalizer_allowed=false$" - - type: grep_log - name: lifecycle_owner_mixed_patch_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_mixed_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_mixed_metadata_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_mixed_metadata_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_main_status_not_mutated - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_main_status_mutated=false$" - - type: grep_log - name: lifecycle_owner_status_subresource_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^lifecycle_owner_status_subresource_patch_allowed=false$" - - type: grep_log - name: finalizers_endpoint_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^finalizers_endpoint_allowed=false$" - - type: grep_log - name: object_integrity_preserved - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-lifecycle-owner-admission-gate/phase42-lifecycle-owner-admission-gate-summary.txt" - pattern: "^object_integrity_preserved=true$" diff --git a/seaweed-block/testops/scenarios/lifecycle-owner-api-boundary-chain.yaml b/seaweed-block/testops/scenarios/lifecycle-owner-api-boundary-chain.yaml deleted file mode 100644 index cf2c227415..0000000000 --- a/seaweed-block/testops/scenarios/lifecycle-owner-api-boundary-chain.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Runner-native Phase 41 D2 gate: lifecycle-owner API/RBAC boundary. - -name: lifecycle-owner-api-boundary-chain -description: > - Proves that the released operator-status boundary remains status/events-only - while the future lifecycle-owner boundary permits only finalizer-shaped main - SwBlockVolume patches and rejects spec/unrelated metadata mutation. - -vars: - product_root: "{{ env.PRODUCT_ROOT | default('/mnt/c/work/seaweed_block') }}" - -phases: - - name: api_boundary - actions: - - type: exec - name: run_phase41_api_boundary - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary bash scripts/run-phase41-lifecycle-owner-api-boundary.sh {{ product_root }}" - - - name: asserts - actions: - - type: grep_log - name: api_boundary_ok - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary/phase41-lifecycle-owner-api-boundary-summary.txt" - pattern: "^phase41_lifecycle_owner_api_boundary_status=ok$" - - type: grep_log - name: operator_status_no_main_patch - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary/phase41-lifecycle-owner-api-boundary-summary.txt" - pattern: "^operator_status_main_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_finalizer_only_allowed - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary/phase41-lifecycle-owner-api-boundary-summary.txt" - pattern: "^lifecycle_owner_finalizer_patch_allowed=true$" - - type: grep_log - name: lifecycle_owner_spec_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary/phase41-lifecycle-owner-api-boundary-summary.txt" - pattern: "^lifecycle_owner_spec_patch_allowed=false$" - - type: grep_log - name: lifecycle_owner_unrelated_metadata_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary/phase41-lifecycle-owner-api-boundary-summary.txt" - pattern: "^lifecycle_owner_unrelated_metadata_patch_allowed=false$" - - type: grep_log - name: finalizers_endpoint_forbidden - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase41-lifecycle-owner-api-boundary/phase41-lifecycle-owner-api-boundary-summary.txt" - pattern: "^finalizers_endpoint_allowed=false$" diff --git a/seaweed-block/testops/scenarios/lifecycle-owner-delete-safety-decision-chain.yaml b/seaweed-block/testops/scenarios/lifecycle-owner-delete-safety-decision-chain.yaml deleted file mode 100644 index 14857e6cb1..0000000000 --- a/seaweed-block/testops/scenarios/lifecycle-owner-delete-safety-decision-chain.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Runner-native Phase 42 D5/D6 gate: delete-safety decisions stay external and -# isolated per volume. - -name: lifecycle-owner-delete-safety-decision-chain -description: > - Runs the Phase 42 delete-safety decision gate. This complements the live - admission gate: admission proves the lifecycle-owner can only patch the - approved finalizer shape; this gate proves finalizer-release decisions still - come from cleanup evidence and remain dry-run/status-only until Phase 43. - -vars: - product_root: "{{ env.PRODUCT_ROOT | default('/mnt/c/work/seaweed_block') }}" - -phases: - - name: delete_safety_decision - actions: - - type: exec - name: run_phase42_delete_safety_decision - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision bash scripts/run-phase42-delete-safety-decision-gate.sh {{ product_root }}" - - - name: asserts - actions: - - type: grep_log - name: gate_ok - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^phase42_delete_safety_decision_status=ok$" - - type: grep_log - name: clean_allowed - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^clean_delete_safety_decision=allowed$" - - type: grep_log - name: blocked_rejected - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^blocked_delete_safety_decision=rejected$" - - type: grep_log - name: missing_unknown - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^missing_delete_safety_decision=unknown$" - - type: grep_log - name: stale_unknown - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^stale_delete_safety_decision=unknown$" - - type: grep_log - name: dry_run_action - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^lifecycle_owner_action_mode=dry_run$" - - type: grep_log - name: no_action_mutation - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^lifecycle_owner_action_mutation_allowed=false$" - - type: grep_log - name: no_finalizer_patch - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^finalizer_patch_count=0$" - - type: grep_log - name: no_finalizer_events - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^no_finalizer_mutation_events=true$" - - type: grep_log - name: multi_volume_isolated - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase42-delete-safety-decision/phase42-delete-safety-decision-gate-summary.txt" - pattern: "^multi_volume_delete_safety_isolation=true$" diff --git a/seaweed-block/testops/scenarios/light-use-first-volume-breaks-chain.yaml b/seaweed-block/testops/scenarios/light-use-first-volume-breaks-chain.yaml deleted file mode 100644 index 0ce00cbedb..0000000000 --- a/seaweed-block/testops/scenarios/light-use-first-volume-breaks-chain.yaml +++ /dev/null @@ -1,190 +0,0 @@ -# Runner-native HG-10 adversarial break-class chain. -# -# Goal: -# Exercise the three close-gate break classes from -# internal/docs/qa-assignments/light-use-mvp-close-hard-gate.md and prove -# each failure leaves actionable evidence instead of a silent timeout. - -name: light-use-first-volume-breaks-chain -timeout: 25m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/preflight-missing-iscsiadm /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/pin_build" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/pre_clean_uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: break_preflight_missing_iscsiadm - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash -lc 'set +e; SW_BLOCK_PREFLIGHT_FORCE_MISSING=iscsiadm bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/preflight-missing-iscsiadm/preflight.txt 2>&1; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/preflight-missing-iscsiadm/exit_code.txt; test \"$rc\" -eq 2'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/preflight-missing-iscsiadm/preflight.txt" - pattern: "checked name=iscsiadm status=FAIL" - save_as: missing_iscsiadm_count - - action: assert_greater - actual: "{{ missing_iscsiadm_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/preflight-missing-iscsiadm/preflight.txt" - pattern: "Install open-iscsi/iscsiadm" - save_as: missing_iscsiadm_remediation_count - - action: assert_greater - actual: "{{ missing_iscsiadm_remediation_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - - name: break_mid_install_bad_image - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && bash -lc 'set +e; SW_BLOCK_IMAGE=ghcr.io/seaweedfs/does-not-exist:no-such-tag SW_BLOCK_CSI_IMAGE=ghcr.io/seaweedfs/does-not-exist:no-such-tag SW_BLOCK_DEMO_COLLECT_OPS_STATUS=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure/exit_code.txt; test \"$rc\" -ne 0'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure/controlled-stop.txt" - pattern: "ops-status-unavailable: no volume id reached" - save_as: image_ops_unavailable_count - - action: assert_greater - actual: "{{ image_ops_unavailable_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "grep -E 'ImagePullBackOff|ErrImagePull|does-not-exist|no-such-tag' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure/kube-system-pods-deploys.txt /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure/*.describe.txt > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure/image-pull-evidence.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure/image-pull-evidence.txt" - pattern: "no-such-tag" - save_as: image_failure_evidence_count - - action: assert_greater - actual: "{{ image_failure_evidence_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/image-failure-cleanup" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - - name: break_mid_app_attach - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_COLLECT_OPS_STATUS=1 SW_BLOCK_DEMO_WRITER_TIMEOUT=45 SW_BLOCK_DEMO_BREAK_AFTER_BLOCKVOLUME_READY=delete-generated-blockvolume bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure/exit_code.txt; test \"$rc\" -ne 0'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure/run.log" - pattern: "\\[app-demo\\] delete generated blockvolume after ready" - save_as: attach_hook_count - - action: assert_greater - actual: "{{ attach_hook_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure/run.log" - pattern: "\\[app-demo\\] collect ops status after failure" - save_as: attach_collect_count - - action: assert_greater - actual: "{{ attach_collect_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure/ops-status/ops-status-bundle.json" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/attach-failure-cleanup" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-breaks" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/light-use-first-volume-chain.yaml b/seaweed-block/testops/scenarios/light-use-first-volume-chain.yaml deleted file mode 100644 index 24d83232ce..0000000000 --- a/seaweed-block/testops/scenarios/light-use-first-volume-chain.yaml +++ /dev/null @@ -1,194 +0,0 @@ -# Runner-native light-use first-volume chain. -# -# Goal: -# Prove the documented Kubernetes quickstart path as a user-facing product -# loop, not just as an internal smoke: -# build/import -> launch alpha stack -> create PVC/app -> write/read -> -# delete -> verify cleanup attribution -> collect artifacts. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/light-use-first-volume-chain.yaml - -name: light-use-first-volume-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: first_volume_demo - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/pin_build/alpha-images.env; set +a; bash scripts/run-k8s-demo.sh {{ product_root }}'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo/run.log" - pattern: "\\[app-demo\\] PASS: app pod wrote data, replacement app pod read it back through the same PVC, cleanup complete" - save_as: first_volume_pass_count - - action: assert_greater - actual: "{{ first_volume_pass_count }}" - threshold: "0" - - - name: boundary_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo/writer.log" - pattern: "/data/demo.bin: OK" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo/generated-blockvolume.yaml" - pattern: "--volume-id=" - save_as: generated_volume_id_count - - action: assert_greater - actual: "{{ generated_volume_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo/generated-blockvolume.yaml" - pattern: "--iscsi-listen=" - save_as: generated_iscsi_count - - action: assert_greater - actual: "{{ generated_iscsi_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo/iscsi-sessions.after-delete.txt" - pattern: "No active sessions" - save_as: no_iscsi_session_count - - action: assert_greater - actual: "{{ no_iscsi_session_count }}" - threshold: "0" - - - name: cleanup_attribution - actions: - - action: exec - node: m02 - cmd: "sudo -n iscsiadm -m node > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/iscsi-nodes.after-demo.txt 2>&1 || true; cd {{ product_root }} && bash scripts/summarize-alpha-demo-cleanup.sh /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/demo /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/cleanup-attribution.txt /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/iscsi-nodes.after-demo.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/cleanup-attribution.txt" - pattern: "^pvc:sw-block-demo-pvc state=deleted" - save_as: product_cleanup_count - - action: assert_greater - actual: "{{ product_cleanup_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/cleanup-attribution.txt" - pattern: "cleaned_by=testops-guardrail" - save_as: testops_cleanup_count - - action: assert_greater - actual: "{{ testops_cleanup_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/light-use-first-volume-failure-bundle-chain.yaml b/seaweed-block/testops/scenarios/light-use-first-volume-failure-bundle-chain.yaml index ef2ffa6377..350d89ace1 100644 --- a/seaweed-block/testops/scenarios/light-use-first-volume-failure-bundle-chain.yaml +++ b/seaweed-block/testops/scenarios/light-use-first-volume-failure-bundle-chain.yaml @@ -7,8 +7,11 @@ # # Expected invocation: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/light-use-first-volume-failure-bundle-chain.yaml name: light-use-first-volume-failure-bundle-chain @@ -16,44 +19,48 @@ timeout: 16m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-first-volume-failure && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-first-volume-failure/demo" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: exec - node: m02 + node: node-a cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - name: preflight actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/preflight.txt 2>&1" + node: node-a + cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > {{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/preflight.txt 2>&1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/preflight.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/preflight.txt" pattern: "summary status=PASS" save_as: preflight_count - action: assert_greater @@ -63,22 +70,22 @@ phases: - name: pin_build_alpha_images actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: sw_block_image_id_count - action: assert_greater actual: "{{ sw_block_image_id_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build/alpha-images.env" pattern: "SW_BLOCK_CSI_IMAGE_ID=" save_as: sw_block_csi_image_id_count - action: assert_greater @@ -88,21 +95,21 @@ phases: - name: controlled_failure_bundle actions: - action: exec - node: m02 + node: node-a timeout: 10m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=blockvolume-ready SW_BLOCK_DEMO_COLLECT_OPS_STATUS=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/controlled-failure.exit_code; test \"$rc\" -eq 42'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo" + cmd: "cd {{ product_root }} && bash -lc 'set -a; source {{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=blockvolume-ready SW_BLOCK_DEMO_COLLECT_OPS_STATUS=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > {{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/controlled-failure.exit_code; test \"$rc\" -eq 42'" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/run.log" pattern: "\\[app-demo\\] controlled stop after blockvolume ready" save_as: controlled_stop_count - action: assert_greater actual: "{{ controlled_stop_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/controlled-failure.exit_code" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/controlled-failure.exit_code" pattern: "^42$" save_as: expected_exit_count - action: assert_greater @@ -112,48 +119,48 @@ phases: - name: failure_bundle_asserts actions: - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/controlled-stop.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/controlled-stop.txt" pattern: "^ops-status-collected:" save_as: ops_status_collected_count - action: assert_greater actual: "{{ ops_status_collected_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/generated-blockvolume.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/generated-blockvolume.yaml" pattern: "--status-addr=" save_as: generated_status_addr_count - action: assert_greater actual: "{{ generated_status_addr_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/ops-status-bundle.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/ops-status-bundle.json" pattern: "\"command\": \"sw-block ops status\"" save_as: bundle_command_count - action: assert_greater actual: "{{ bundle_command_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/ops-status-bundle.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/ops-status-bundle.json" pattern: "\"volume_id\":" save_as: bundle_volume_count - action: assert_greater actual: "{{ bundle_volume_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/volume-status-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/volume-status-summary.txt" pattern: "^status:" save_as: summary_status_count - action: assert_greater actual: "{{ summary_status_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/volume-status-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/demo/ops-status/volume-status-summary.txt" pattern: "^volume: id=" save_as: summary_volume_count - action: assert_greater @@ -166,34 +173,35 @@ phases: # ops-status can inspect a real target. Process hygiene is asserted after # collect_and_cleanup uninstalls the alpha stack. - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - name: collect_and_cleanup always: true actions: - action: exec - node: m02 + node: node-a timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure/uninstall" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure/uninstall" env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 + node: node-a cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-failure" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-first-volume-failure" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/light-use-first-volume-retry-chain.yaml b/seaweed-block/testops/scenarios/light-use-first-volume-retry-chain.yaml deleted file mode 100644 index 47cb6895ba..0000000000 --- a/seaweed-block/testops/scenarios/light-use-first-volume-retry-chain.yaml +++ /dev/null @@ -1,254 +0,0 @@ -# Runner-native light-use first-volume retry/idempotency chain. -# -# Goal: -# Prove a user can recover from a partial first-volume attempt by running the -# documented cleanup path, then re-run the same demo successfully. Also prove -# a successful run can be repeated immediately without a manual cleanup step. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/light-use-first-volume-retry-chain.yaml - -name: light-use-first-volume-retry-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_cleanup /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_demo /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/success_rerun" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pre_clean_uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: exec - node: m02 - cmd: "kubectl -n default get pvc sw-block-demo-pvc -o name > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pre-clean-residue.txt 2>&1 || true; kubectl -n default get deploy -l app=sw-blockvolume -o name >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pre-clean-residue.txt 2>&1 || true; ! grep -q '^persistentvolumeclaim/\\|^deployment.apps/' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pre-clean-residue.txt" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: partial_first_attempt - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=blockvolume-ready SW_BLOCK_DEMO_KEEP_ON_STOP=1 SW_BLOCK_DEMO_COLLECT_OPS_STATUS=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial/controlled-stop.exit_code; test \"$rc\" -eq 42'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial/run.log" - pattern: "\\[app-demo\\] keeping resources for retry validation" - save_as: keep_resources_count - - action: assert_greater - actual: "{{ keep_resources_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "kubectl -n default get pvc sw-block-demo-pvc -o name > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial/residue-before-retry.txt 2>&1 || true; kubectl -n default get deploy -l app=sw-blockvolume -o name >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial/residue-before-retry.txt 2>&1 || true" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial/residue-before-retry.txt" - pattern: "^persistentvolumeclaim/sw-block-demo-pvc$" - save_as: stale_pvc_count - - action: assert_greater - actual: "{{ stale_pvc_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/partial/residue-before-retry.txt" - pattern: "^deployment.apps/" - save_as: stale_blockvolume_deploy_count - - action: assert_greater - actual: "{{ stale_blockvolume_deploy_count }}" - threshold: "0" - - - name: cleanup_before_retry - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_cleanup" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_cleanup/uninstall.log" - pattern: "\\[alpha-uninstall\\] PASS: seaweed-block alpha stack uninstall requested" - save_as: uninstall_pass_count - - action: assert_greater - actual: "{{ uninstall_pass_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "kubectl -n default get pvc sw-block-demo-pvc -o name > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_cleanup/residue-after-cleanup.txt 2>&1 || true; kubectl -n default get deploy -l app=sw-blockvolume -o name >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_cleanup/residue-after-cleanup.txt 2>&1 || true; ! grep -q '^persistentvolumeclaim/\\|^deployment.apps/' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_cleanup/residue-after-cleanup.txt" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: retry_first_volume_demo - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build/alpha-images.env; set +a; bash scripts/run-k8s-demo.sh {{ product_root }}'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_demo" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_demo/run.log" - pattern: "\\[app-demo\\] PASS: app pod wrote data, replacement app pod read it back through the same PVC, cleanup complete" - save_as: retry_pass_count - - action: assert_greater - actual: "{{ retry_pass_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_demo/writer.log" - pattern: "/data/demo.bin: OK" - save_as: retry_writer_checksum_count - - action: assert_greater - actual: "{{ retry_writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/retry_demo/reader.log" - pattern: "/data/demo.bin: OK" - save_as: retry_reader_checksum_count - - action: assert_greater - actual: "{{ retry_reader_checksum_count }}" - threshold: "0" - - - name: rerun_after_success_no_cleanup - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash -lc 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/pin_build/alpha-images.env; set +a; bash scripts/run-k8s-demo.sh {{ product_root }}'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/success_rerun" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/success_rerun/run.log" - pattern: "\\[app-demo\\] PASS: app pod wrote data, replacement app pod read it back through the same PVC, cleanup complete" - save_as: success_rerun_pass_count - - action: assert_greater - actual: "{{ success_rerun_pass_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/success_rerun/writer.log" - pattern: "/data/demo.bin: OK" - save_as: success_rerun_writer_checksum_count - - action: assert_greater - actual: "{{ success_rerun_writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/success_rerun/reader.log" - pattern: "/data/demo.bin: OK" - save_as: success_rerun_reader_checksum_count - - action: assert_greater - actual: "{{ success_rerun_reader_checksum_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-first-volume-retry" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/master-failback-runtime-factory-chain.yaml b/seaweed-block/testops/scenarios/master-failback-runtime-factory-chain.yaml deleted file mode 100644 index 8fd32561f1..0000000000 --- a/seaweed-block/testops/scenarios/master-failback-runtime-factory-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Runner-native Phase 80 gate: blockmaster exposes a failback authority runtime -# factory backed by its live Publisher. This is not a public failback RPC and -# does not enable automatic failback. - -name: master-failback-runtime-factory-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: master_failback_runtime_factory_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory bash scripts/run-phase80-master-failback-runtime-factory-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^phase80_master_failback_runtime_factory_status=ok$" - save_as: phase80_ok - - action: assert_greater - actual: "{{ phase80_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^host_failback_runtime_uses_live_publisher=true$" - save_as: live_publisher - - action: assert_greater - actual: "{{ live_publisher }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^publisher_authority_line_advanced=true$" - save_as: publisher_advanced - - action: assert_greater - actual: "{{ publisher_advanced }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^automatic_failback_enabled=false$" - save_as: automatic_disabled - - action: assert_greater - actual: "{{ automatic_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^public_failback_rpc_added=false$" - save_as: no_public_rpc - - action: assert_greater - actual: "{{ no_public_rpc }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory/phase80-master-failback-runtime-factory-summary.txt" - pattern: "^storage_mutation_allowed=false$" - save_as: no_storage_mutation - - action: assert_greater - actual: "{{ no_storage_mutation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase80-master-failback-runtime-factory" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-app-baseline-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-app-baseline-chain.yaml deleted file mode 100644 index f8e14c7ed1..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-app-baseline-chain.yaml +++ /dev/null @@ -1,208 +0,0 @@ -# Runner-native mounted failover MVP RF=2 app-path baseline gate. -# -# Goal: -# Prove the documented app/PVC writer -> reader path works with an RF=2 -# product-owned blockvolume placement before injecting primary failure. This -# is a baseline for the mounted failover gate, not a recovery claim. - -name: mounted-failover-rf2-app-baseline-chain -timeout: 20m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: render_rf2_demo_manifest - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"2\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/demo-app-rf2.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/demo-app-rf2.yaml" - pattern: "replicationFactor: \"2\"" - save_as: rf2_manifest_count - - action: assert_greater - actual: "{{ rf2_manifest_count }}" - threshold: "0" - - - name: rf2_app_writer_reader - actions: - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/demo-app-rf2.yaml SW_BLOCK_ALPHA_LOGICAL_SERVERS=2 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=2 SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-rf2-app SW_BLOCK_DEMO_STOP_AFTER=reader-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/exit_code.txt; test \"$rc\" -eq 44'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/run.log" - pattern: "logical_servers=2" - save_as: logical_servers_count - - action: assert_greater - actual: "{{ logical_servers_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/run.log" - pattern: "expected_slots_per_volume=2" - save_as: expected_slots_count - - action: assert_greater - actual: "{{ expected_slots_count }}" - threshold: "0" - - - name: app_path_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/generated-blockvolume.yaml" - pattern: "--replica-id=r1" - save_as: r1_manifest_count - - action: assert_greater - actual: "{{ r1_manifest_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/generated-blockvolume.yaml" - pattern: "--replica-id=r2" - save_as: r2_manifest_count - - action: assert_greater - actual: "{{ r2_manifest_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/ops-inventory-reader-verified/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc" - save_as: inventory_pvc_count - - action: assert_greater - actual: "{{ inventory_pvc_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/ops-inventory-reader-verified/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=2" - save_as: inventory_rf2_count - - action: assert_greater - actual: "{{ inventory_rf2_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/demo/ops-inventory-reader-verified/nested-ops-status-bundles.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: nested_status_bundle_count - - action: assert_greater - actual: "{{ nested_status_bundle_count }}" - threshold: "1" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-rf2-app; find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec sudo rm -rf -- {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: exec - node: m02 - cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-rf2-app" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-app-baseline" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-degraded-replica-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-degraded-replica-chain.yaml deleted file mode 100644 index dc7007e24f..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-degraded-replica-chain.yaml +++ /dev/null @@ -1,234 +0,0 @@ -# Runner-native mounted failover MVP degraded-replica negative gate. -# -# Goal: -# Prove an RF=2 Kubernetes placement with one replica workload scaled to zero -# is reported as degraded and not as a recovered/healthy RF=2 state. This is -# a D5 negative fixture, not the final mounted recovery claim. - -name: mounted-failover-rf2-degraded-replica-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2 /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory" - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-rf2-degraded-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-rf2-degraded --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: install_rf2_alpha_stack - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/pin_build/alpha-images.env; set +a; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/install SW_BLOCK_ALPHA_LOGICAL_SERVERS=2 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=2 bash scripts/install-k8s-alpha.sh {{ product_root }}'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/install/install.log" - pattern: "logical_servers=2" - save_as: logical_servers_count - - action: assert_greater - actual: "{{ logical_servers_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/install/install.log" - pattern: "expected_slots_per_volume=2" - save_as: expected_slots_count - - action: assert_greater - actual: "{{ expected_slots_count }}" - threshold: "0" - - - name: rf2_placement_boundary - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cat > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/rf2-degraded.yaml <<'YAML'\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n name: sw-block-rf2-degraded\nprovisioner: block.csi.seaweedfs.com\nvolumeBindingMode: Immediate\nallowVolumeExpansion: false\nparameters:\n replicationFactor: \"2\"\n sw-block.seaweedfs.com/protocol: iscsi\n---\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n name: sw-block-rf2-degraded-pvc\n namespace: default\nspec:\n accessModes:\n - ReadWriteOnce\n storageClassName: sw-block-rf2-degraded\n resources:\n requests:\n storage: 1Mi\nYAML\nkubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/rf2-degraded.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/apply-rf2.log 2>&1\nkubectl -n default wait --for=jsonpath='{.status.phase}'=Bound pvc/sw-block-rf2-degraded-pvc --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/apply-rf2.log 2>&1\nfor i in $(seq 1 120); do count=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -ge 2 && break; sleep 1; done\ncount=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -eq 2\nkubectl -n default wait --for=condition=available deploy -l app=sw-blockvolume --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/apply-rf2.log 2>&1\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/blockvolumes.before-degrade.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/blockvolumes.before-degrade.txt" - pattern: "^sw-blockvolume-" - save_as: rf2_deploy_count - - action: assert_greater - actual: "{{ rf2_deploy_count }}" - threshold: "1" - - - name: degrade_one_replica - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "set -eu\nOUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2\nR2_DEPLOY=$(kubectl -n default get deploy -l app=sw-blockvolume,sw-block.seaweedfs.com/replica=r2 -o jsonpath='{.items[0].metadata.name}')\ntest -n \"$R2_DEPLOY\"\necho \"$R2_DEPLOY\" > \"$OUT/degraded-deployment.txt\"\nkubectl -n default scale deploy \"$R2_DEPLOY\" --replicas=0 > \"$OUT/scale-r2.log\" 2>&1\nfor i in $(seq 1 60); do ready=$(kubectl -n default get deploy \"$R2_DEPLOY\" -o jsonpath='{.status.readyReplicas}' 2>/dev/null || true); test -z \"$ready\" -o \"$ready\" = \"0\" && break; sleep 1; done\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > \"$OUT/blockvolumes.after-degrade.txt\"\nready=$(kubectl -n default get deploy \"$R2_DEPLOY\" -o jsonpath='{.status.readyReplicas}' 2>/dev/null || true); test -z \"$ready\" -o \"$ready\" = \"0\"" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/rf2/degraded-deployment.txt" - pattern: "sw-blockvolume-" - save_as: degraded_deploy_name_count - - action: assert_greater - actual: "{{ degraded_deploy_name_count }}" - threshold: "0" - - - name: inventory_after_degraded_replica - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; find \"$OUT/volumes\" -name ops-status-bundle.json -exec cat {} \\; > \"$OUT/nested-ops-status-bundles.json\" 2>/dev/null || true; exit \"$rc\"'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/exit_code.txt" - pattern: "^0$" - save_as: inventory_exit_zero_count - - action: assert_greater - actual: "{{ inventory_exit_zero_count }}" - threshold: "0" - - - name: inventory_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/volume-inventory-summary.txt" - pattern: "pvc=sw-block-rf2-degraded-pvc" - save_as: rf2_pvc_identity_count - - action: assert_greater - actual: "{{ rf2_pvc_identity_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=2" - save_as: rf2_observed_count - - action: assert_greater - actual: "{{ rf2_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/volume-inventory-summary.txt" - pattern: "replica: volume=.*replica=r2 .*status=unhealthy" - save_as: r2_unhealthy_count - - action: assert_greater - actual: "{{ r2_unhealthy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/volume-inventory-summary.txt" - pattern: "replica_degraded=r2 status=unhealthy" - save_as: r2_degraded_issue_count - - action: assert_greater - actual: "{{ r2_degraded_issue_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/volume-inventory-summary.txt" - pattern: "ops_status=unhealthy reason=replication_role_not_ready" - save_as: replication_not_ready_count - - action: assert_greater - actual: "{{ replication_not_ready_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q 'generated_deployment_missing\\|observed_replicas=0 desired_replicas=2\\|replica_slot_missing=unknown' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/inventory/nested-ops-status-bundles.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: nested_status_bundle_count - - action: assert_greater - actual: "{{ nested_status_bundle_count }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-rf2-degraded-pvc --ignore-not-found=true --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/delete-rf2-pvc.log 2>&1 || true; kubectl delete sc sw-block-rf2-degraded --ignore-not-found=true > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/delete-rf2-sc.log 2>&1 || true" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-degraded" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-placement-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-placement-chain.yaml deleted file mode 100644 index 69b0409fcd..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-placement-chain.yaml +++ /dev/null @@ -1,228 +0,0 @@ -# Runner-native mounted failover MVP RF=2 placement gate. -# -# Goal: -# Prove the alpha stack can be explicitly configured with two logical -# Seaweed Block servers on one Kubernetes node and render two RF=2 -# blockvolume workloads. This is a placement/readiness stepping stone, not -# the mounted failover recovery claim. - -name: mounted-failover-rf2-placement-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2 /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory" - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-rf2-placement-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-rf2-placement --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: install_rf2_alpha_stack - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/pin_build/alpha-images.env; set +a; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/install SW_BLOCK_ALPHA_LOGICAL_SERVERS=2 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=2 bash scripts/install-k8s-alpha.sh {{ product_root }}'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/install/install.log" - pattern: "logical_servers=2" - save_as: logical_servers_count - - action: assert_greater - actual: "{{ logical_servers_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/install/block-stack.rendered.yaml" - pattern: "server_id: m02-r2" - save_as: second_logical_server_count - - action: assert_greater - actual: "{{ second_logical_server_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/install/block-stack.rendered.yaml" - pattern: "--expected-slots-per-volume=2" - save_as: expected_slots_count - - action: assert_greater - actual: "{{ expected_slots_count }}" - threshold: "0" - - - name: rf2_placement_boundary - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cat > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/rf2-placement.yaml <<'YAML'\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n name: sw-block-rf2-placement\nprovisioner: block.csi.seaweedfs.com\nvolumeBindingMode: Immediate\nallowVolumeExpansion: false\nparameters:\n replicationFactor: \"2\"\n sw-block.seaweedfs.com/protocol: iscsi\n---\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n name: sw-block-rf2-placement-pvc\n namespace: default\nspec:\n accessModes:\n - ReadWriteOnce\n storageClassName: sw-block-rf2-placement\n resources:\n requests:\n storage: 1Mi\nYAML\nkubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/rf2-placement.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/apply-rf2.log 2>&1\nkubectl -n default wait --for=jsonpath='{.status.phase}'=Bound pvc/sw-block-rf2-placement-pvc --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/apply-rf2.log 2>&1\nfor i in $(seq 1 120); do count=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -ge 2 && break; sleep 1; done\ncount=$(kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | wc -l); test \"$count\" -eq 2\nkubectl -n default wait --for=condition=available deploy -l app=sw-blockvolume --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/apply-rf2.log 2>&1\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/blockvolumes.after-rf2.txt\nkubectl -n kube-system logs deploy/sw-blockmaster -c blockmaster > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/blockmaster.after-rf2.log 2>&1 || true" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/blockvolumes.after-rf2.txt" - pattern: "^sw-blockvolume-" - save_as: rf2_deploy_count - - action: assert_greater - actual: "{{ rf2_deploy_count }}" - threshold: "1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/rf2/blockmaster.after-rf2.log" - pattern: "replication_factor=2" - save_as: rf2_create_count - - action: assert_greater - actual: "{{ rf2_create_count }}" - threshold: "0" - - - name: inventory_rf2_placement - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; find \"$OUT/volumes\" -name ops-status-bundle.json -exec cat {} \\; > \"$OUT/nested-ops-status-bundles.json\" 2>/dev/null || true; exit \"$rc\"'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/exit_code.txt" - pattern: "^0$" - save_as: inventory_exit_zero_count - - action: assert_greater - actual: "{{ inventory_exit_zero_count }}" - threshold: "0" - - - name: inventory_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/volume-inventory-summary.txt" - pattern: "pvc=sw-block-rf2-placement-pvc" - save_as: rf2_pvc_identity_count - - action: assert_greater - actual: "{{ rf2_pvc_identity_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=2" - save_as: rf2_observed_count - - action: assert_greater - actual: "{{ rf2_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/volume-inventory-summary.txt" - pattern: "replica: volume=.*replica=r1 .*server=m02-r1 node=m02" - save_as: r1_logical_server_count - - action: assert_greater - actual: "{{ r1_logical_server_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/volume-inventory-summary.txt" - pattern: "replica: volume=.*replica=r2 .*server=m02-r2 node=m02" - save_as: r2_logical_server_count - - action: assert_greater - actual: "{{ r2_logical_server_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q 'generated_deployment_missing\\|observed_replicas=0 desired_replicas=2\\|replica_slot_missing=unknown' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/inventory/nested-ops-status-bundles.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: nested_status_bundle_count - - action: assert_greater - actual: "{{ nested_status_bundle_count }}" - threshold: "1" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-rf2-placement-pvc --ignore-not-found=true --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/delete-rf2-pvc.log 2>&1 || true; kubectl delete sc sw-block-rf2-placement --ignore-not-found=true > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/delete-rf2-sc.log 2>&1 || true" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-placement" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-primary-failure-safe-refusal-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-primary-failure-safe-refusal-chain.yaml deleted file mode 100644 index 8e6b5164fa..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-primary-failure-safe-refusal-chain.yaml +++ /dev/null @@ -1,296 +0,0 @@ -# Runner-native mounted failover MVP controlled-primary-failure safe-refusal gate. -# -# Goal: -# Write data through the RF=2 Kubernetes app/PVC path, identify the current -# primary, inject a scoped primary blockvolume stop before the replacement -# reader attaches, and require an explicit safe-refusal bundle. This does not -# claim recovery; it proves the product refuses to promote a not-ready -# candidate silently. - -name: mounted-failover-rf2-primary-failure-safe-refusal-chain -timeout: 22m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: render_rf2_demo_manifest - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"2\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/demo-app-rf2.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/demo-app-rf2.yaml" - pattern: "replicationFactor: \"2\"" - save_as: rf2_manifest_count - - action: assert_greater - actual: "{{ rf2_manifest_count }}" - threshold: "0" - - - name: rf2_primary_failure_safe_refusal - actions: - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/demo-app-rf2.yaml SW_BLOCK_ALPHA_LOGICAL_SERVERS=2 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=2 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-rf2-primary-safe-refusal SW_BLOCK_DEMO_FAIL_PRIMARY_BEFORE_READER=scale-primary-to-zero bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/exit_code.txt; test \"$rc\" -eq 46'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/run.log" - pattern: "fail_primary_before_reader=scale-primary-to-zero" - save_as: fail_primary_mode_count - - action: assert_greater - actual: "{{ fail_primary_mode_count }}" - threshold: "0" - - - name: safe_refusal_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "failover_status: refused" - save_as: failover_refused_count - - action: assert_greater - actual: "{{ failover_refused_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "ack_profile: sync-quorum" - save_as: safe_refusal_sync_quorum_count - - action: assert_greater - actual: "{{ safe_refusal_sync_quorum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/generated-blockvolume.yaml" - pattern: "--replication-ack=sync-quorum" - save_as: generated_sync_quorum_count - - action: assert_greater - actual: "{{ generated_sync_quorum_count }}" - threshold: "1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "failure_class=primary-blockvolume-controlled-stop" - save_as: failure_class_count - - action: assert_greater - actual: "{{ failure_class_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt; before=$(sed -n 's/^before_primary_replica=//p' \"$MARKER\"); failed=$(sed -n 's/^failed_replica=//p' \"$MARKER\"); test -n \"$before\" && test \"$before\" = \"$failed\"" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "candidate_ready=false" - save_as: candidate_not_ready_count - - action: assert_greater - actual: "{{ candidate_not_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/mounted-writer-required-frontier.txt" - pattern: "^pvc-.*=[0-9][0-9]*$" - save_as: mounted_writer_frontier_count - - action: assert_greater - actual: "{{ mounted_writer_frontier_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "required_frontier=pvc-" - save_as: safe_refusal_required_frontier_count - - action: assert_greater - actual: "{{ safe_refusal_required_frontier_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" - pattern: "required_frontier_known=true" - save_as: before_required_frontier_known_count - - action: assert_greater - actual: "{{ before_required_frontier_known_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q 'required_frontier_missing' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "candidate_promotion_evidence=promotion: .* candidate_ready=false" - save_as: candidate_promotion_evidence_count - - action: assert_greater - actual: "{{ candidate_promotion_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "reason=replication_role_not_ready" - save_as: safe_refusal_exact_reason_count - - action: assert_greater - actual: "{{ safe_refusal_exact_reason_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "candidate_evidence=.*replication=not_ready" - save_as: candidate_evidence_count - - action: assert_greater - actual: "{{ candidate_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "data_check_after_failover=not_claimed" - save_as: no_recovery_claim_count - - action: assert_greater - actual: "{{ no_recovery_claim_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "target_ready_replicas=0" - save_as: target_scaled_zero_count - - action: assert_greater - actual: "{{ target_scaled_zero_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=2" - save_as: before_rf2_count - - action: assert_greater - actual: "{{ before_rf2_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" - pattern: " role=primary " - save_as: before_primary_count - - action: assert_greater - actual: "{{ before_primary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" - pattern: "inventory_status: unhealthy" - save_as: after_unhealthy_count - - action: assert_greater - actual: "{{ after_unhealthy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/primary-failure-safe-refusal.txt" - pattern: "after_issue_evidence=" - save_as: after_issue_evidence_count - - action: assert_greater - actual: "{{ after_issue_evidence_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q '/data/demo.bin: OK' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/demo/reader.log 2>/dev/null" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec rm -rf {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-primary-safe-refusal" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-ready-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-ready-chain.yaml deleted file mode 100644 index 7e7e256a0e..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-ready-chain.yaml +++ /dev/null @@ -1,207 +0,0 @@ -# Runner-native RF=2 promotion-ready gate. -# -# Goal: -# Write data through the RF=2 Kubernetes app/PVC path, derive the mounted -# writer durable frontier from the primary support bundle, and require a -# non-primary replica to become promotion-ready under sync-quorum before any -# primary failure is injected. This does not claim recovery. - -name: mounted-failover-rf2-promotion-ready-chain -timeout: 24m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: render_rf2_demo_manifest - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"2\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/demo-app-rf2.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/demo-app-rf2.yaml" - pattern: "replicationFactor: \"2\"" - save_as: rf2_manifest_count - - action: assert_greater - actual: "{{ rf2_manifest_count }}" - threshold: "0" - - - name: rf2_promotion_ready - actions: - - action: exec - node: m02 - timeout: 14m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/demo-app-rf2.yaml SW_BLOCK_ALPHA_LOGICAL_SERVERS=2 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=2 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-rf2-promotion-ready SW_BLOCK_DEMO_STOP_AFTER=promotion-ready bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/exit_code.txt; test \"$rc\" -eq 47'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/run.log" - pattern: "controlled stop after promotion-ready" - save_as: promotion_ready_log_count - ignore_error: true - - - name: promotion_ready_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/promotion-ready.txt" - pattern: "promotion_ready_status: ready" - save_as: promotion_ready_count - - action: assert_greater - actual: "{{ promotion_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/promotion-ready.txt" - pattern: "ack_profile: sync-quorum" - save_as: sync_quorum_count - - action: assert_greater - actual: "{{ sync_quorum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/promotion-ready.txt" - pattern: "candidate_ready=true" - save_as: candidate_ready_count - - action: assert_greater - actual: "{{ candidate_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/promotion-ready.txt" - pattern: "candidate_promotion_evidence=promotion: .* candidate_ready=true" - save_as: candidate_promotion_evidence_count - - action: assert_greater - actual: "{{ candidate_promotion_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/mounted-writer-required-frontier.txt" - pattern: "^pvc-.*=[0-9][0-9]*$" - save_as: mounted_writer_frontier_count - - action: assert_greater - actual: "{{ mounted_writer_frontier_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/ops-inventory-promotion-ready/volume-inventory-summary.txt" - pattern: "required_frontier_known=true" - save_as: required_frontier_known_count - - action: assert_greater - actual: "{{ required_frontier_known_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/ops-inventory-promotion-ready/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=2" - save_as: rf2_count - - action: assert_greater - actual: "{{ rf2_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q '/data/demo.bin: OK' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/demo/reader.log 2>/dev/null" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec rm -rf {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-ready" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-recovery-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-recovery-chain.yaml deleted file mode 100644 index abd8a77725..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-promotion-recovery-chain.yaml +++ /dev/null @@ -1,338 +0,0 @@ -# Runner-native RF=2 promotion recovery gate. -# -# Goal: -# Write data through the RF=2 Kubernetes app/PVC path, prove the non-primary -# replica is promotion-ready under an explicit controlled-best-effort-demo -# claim profile, stop the current primary, wait for master/authority to -# publish the candidate as the new primary, then recreate/reattach the reader -# pod through CSI and verify the same data. This is not a quorum durability -# claim; RF=3 sync-quorum owns that product line. - -name: mounted-failover-rf2-promotion-recovery-chain -timeout: 28m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: render_rf2_demo_manifest - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"2\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/demo-app-rf2.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/demo-app-rf2.yaml" - pattern: "replicationFactor: \"2\"" - save_as: rf2_manifest_count - - action: assert_greater - actual: "{{ rf2_manifest_count }}" - threshold: "0" - - - name: rf2_promotion_recovery - actions: - - action: exec - node: m02 - timeout: 16m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/demo-app-rf2.yaml SW_BLOCK_ALPHA_LOGICAL_SERVERS=2 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=2 SW_BLOCK_ALPHA_REPLICATION_ACK=best-effort SW_BLOCK_OPS_INVENTORY_CLAIM_PROFILE=controlled-best-effort-demo SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-rf2-promotion-recovery SW_BLOCK_DEMO_REQUIRE_PROMOTION_READY_BEFORE_FAILURE=1 SW_BLOCK_DEMO_FAIL_PRIMARY_BEFORE_READER=scale-primary-to-zero SW_BLOCK_DEMO_STOP_AFTER=reader-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/exit_code.txt; test \"$rc\" -eq 44'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/run.log" - pattern: "fail_primary_before_reader=scale-primary-to-zero" - save_as: fail_primary_mode_count - - action: assert_greater - actual: "{{ fail_primary_mode_count }}" - threshold: "0" - - - name: recovery_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "ack_profile: best-effort" - save_as: best_effort_ack_count - - action: assert_greater - actual: "{{ best_effort_ack_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" - pattern: "claim_profile=controlled-best-effort-demo" - save_as: controlled_best_effort_claim_count - - action: assert_greater - actual: "{{ controlled_best_effort_claim_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "candidate_ready=true" - save_as: candidate_ready_count - - action: assert_greater - actual: "{{ candidate_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "failover_status: promoted" - save_as: failover_promoted_count - - action: assert_greater - actual: "{{ failover_promoted_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/iscsi-sessions.before-primary-failure.txt" - pattern: "No active sessions" - save_as: pre_failure_no_session_count - - action: assert_greater - actual: "{{ pre_failure_no_session_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "target_ready_replicas=0" - save_as: old_primary_stopped_count - - action: assert_greater - actual: "{{ old_primary_stopped_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt; promoted=$(sed -n 's/^promoted_replica=//p' \"$MARKER\"); after=$(sed -n 's/^after_primary_replica=//p' \"$MARKER\"); failed=$(sed -n 's/^failed_replica=//p' \"$MARKER\"); test -n \"$promoted\" && test \"$promoted\" = \"$after\" && test \"$promoted\" != \"$failed\"" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "post_failure_primary_count=1" - save_as: single_primary_count - - action: assert_greater - actual: "{{ single_primary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "frontend_primary_ready_issue_count=0" - save_as: no_frontend_ready_issue_count - - action: assert_greater - actual: "{{ no_frontend_ready_issue_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q 'frontend_primary_ready=true' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "failed_replica_after_evidence=replica:" - save_as: failed_replica_evidence_count - - action: assert_greater - actual: "{{ failed_replica_evidence_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt; failed_line=$(sed -n 's/^failed_replica_after_evidence=//p' \"$MARKER\"); test -n \"$failed_line\" && ! printf '%s\n' \"$failed_line\" | grep -q ' role=primary '" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "before_publish_target_evidence=replica:" - save_as: before_publish_evidence_count - - action: assert_greater - actual: "{{ before_publish_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "after_publish_target_evidence=replica:" - save_as: after_publish_evidence_count - - action: assert_greater - actual: "{{ after_publish_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/apply-reader.log" - pattern: "sw-block-demo-reader" - save_as: reader_apply_count - - action: assert_greater - actual: "{{ reader_apply_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt; portal=$(sed -n 's/^after_publish_target_evidence=.* frontend=\\([^ ]*\\).*/\\1/p' \"$MARKER\"); test -n \"$portal\" && grep -q \"NodeStageVolume: .* staged transport=iscsi portal=${portal}\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/blockcsi-node.log" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-recovery.txt" - pattern: "data_check_after_failover=reader_checksum_passed" - save_as: reader_after_failover_count - - action: assert_greater - actual: "{{ reader_after_failover_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/control-plane-timeline.txt" - pattern: "event=primary_observed" - save_as: timeline_primary_observed_count - - action: assert_greater - actual: "{{ timeline_primary_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/control-plane-timeline.txt" - pattern: "event=candidate_evaluated .*candidate_ready=true" - save_as: timeline_candidate_ready_count - - action: assert_greater - actual: "{{ timeline_candidate_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/control-plane-timeline.txt" - pattern: "event=primary_failure_injected" - save_as: timeline_failure_injected_count - - action: assert_greater - actual: "{{ timeline_failure_injected_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/control-plane-timeline.txt" - pattern: "event=authority_published .*to=" - save_as: timeline_authority_published_count - - action: assert_greater - actual: "{{ timeline_authority_published_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/control-plane-timeline.txt" - pattern: "event=csi_reattach_observed" - save_as: timeline_csi_reattach_count - - action: assert_greater - actual: "{{ timeline_csi_reattach_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/control-plane-timeline.txt" - pattern: "event=data_check .*result=reader_checksum_passed" - save_as: timeline_data_check_count - - action: assert_greater - actual: "{{ timeline_data_check_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=2" - save_as: rf2_observed_count - - action: assert_greater - actual: "{{ rf2_observed_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! test -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/demo/primary-failure-safe-refusal.txt" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-rf2-promotion-recovery; find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec sudo rm -rf -- {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: exec - node: m02 - cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-rf2-promotion-recovery" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf2-promotion-recovery" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf2-safe-refusal-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf2-safe-refusal-chain.yaml deleted file mode 100644 index 3caa10b18c..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf2-safe-refusal-chain.yaml +++ /dev/null @@ -1,218 +0,0 @@ -# Runner-native mounted failover MVP safe-refusal gate. -# -# Goal: -# Prove the current alpha Kubernetes topology refuses an RF=2 mounted -# failover setup safely when only one placement candidate exists. This is -# intentionally not the happy failover claim; it is the D4 safe-refusal path -# that must stay visible until live RF=2 Kubernetes placement is proven. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/mounted-failover-rf2-safe-refusal-chain.yaml - -name: mounted-failover-rf2-safe-refusal-chain -timeout: 16m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2 /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory" - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-rf2-safe-refusal-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-rf2-safe-refusal --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: install_alpha_stack - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/pin_build/alpha-images.env; set +a; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/install bash scripts/install-k8s-alpha.sh {{ product_root }}'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/install/install.log" - pattern: "PASS: seaweed-block alpha stack installed" - save_as: install_pass_count - - action: assert_greater - actual: "{{ install_pass_count }}" - threshold: "0" - - - name: rf2_safe_refusal_boundary - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "cat > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/rf2-safe-refusal.yaml <<'YAML'\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n name: sw-block-rf2-safe-refusal\nprovisioner: block.csi.seaweedfs.com\nvolumeBindingMode: Immediate\nallowVolumeExpansion: false\nparameters:\n replicationFactor: \"2\"\n sw-block.seaweedfs.com/protocol: iscsi\n---\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n name: sw-block-rf2-safe-refusal-pvc\n namespace: default\nspec:\n accessModes:\n - ReadWriteOnce\n storageClassName: sw-block-rf2-safe-refusal\n resources:\n requests:\n storage: 1Mi\nYAML\nkubectl apply -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/rf2-safe-refusal.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/apply-rf2.log 2>&1\nkubectl -n default wait --for=jsonpath='{.status.phase}'=Bound pvc/sw-block-rf2-safe-refusal-pvc --timeout=120s >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/apply-rf2.log 2>&1\nsleep 5\nkubectl -n default get pvc sw-block-rf2-safe-refusal-pvc -o yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/rf2-pvc.yaml\nkubectl get pv -o yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/pv.after-rf2.yaml\nkubectl -n default get deploy -l app=sw-blockvolume -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/blockvolumes.after-rf2.txt\nkubectl -n kube-system logs deploy/sw-blockmaster -c blockmaster > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/blockmaster.after-rf2.log 2>&1 || true\n! kubectl -n default get deploy -l app=sw-blockvolume --no-headers 2>/dev/null | grep -q ." - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/apply-rf2.log" - pattern: "persistentvolumeclaim/sw-block-rf2-safe-refusal-pvc created" - save_as: rf2_pvc_created_count - - action: assert_greater - actual: "{{ rf2_pvc_created_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q '^sw-blockvolume-' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/rf2/blockvolumes.after-rf2.txt" - - - name: inventory_safe_refusal - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && bash -c 'set -euo pipefail; OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory; mkdir -p \"$OUT\"; pf_port=$(python3 - <<\"PY\"\nimport socket\ns=socket.socket(); s.bind((\"127.0.0.1\",0)); print(s.getsockname()[1]); s.close()\nPY\n); kubectl -n kube-system port-forward svc/blockmaster ${pf_port}:9333 > \"$OUT/blockmaster-port-forward.log\" 2>&1 & pf_pid=$!; echo \"$pf_pid\" > \"$OUT/blockmaster-port-forward.pid\"; cleanup(){ kill \"$pf_pid\" >/dev/null 2>&1 || true; wait \"$pf_pid\" >/dev/null 2>&1 || true; }; trap cleanup EXIT; for i in $(seq 1 30); do (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1 && break; sleep 1; done; (echo >/dev/tcp/127.0.0.1/${pf_port}) >/dev/null 2>&1; go run ./cmd/sw-block ops inventory --namespace default --master 127.0.0.1:${pf_port} --out \"$OUT\" --timeout 30s > \"$OUT/stdout.txt\" 2> \"$OUT/stderr.txt\"; rc=$?; echo \"$rc\" > \"$OUT/exit_code.txt\"; exit \"$rc\"'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/exit_code.txt" - pattern: "^0$" - save_as: inventory_exit_zero_count - - action: assert_greater - actual: "{{ inventory_exit_zero_count }}" - threshold: "0" - - - name: inventory_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/volume-inventory-summary.txt" - pattern: "^inventory_status: unhealthy$" - save_as: inventory_unhealthy_count - - action: assert_greater - actual: "{{ inventory_unhealthy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/volume-inventory-summary.txt" - pattern: "pvc=sw-block-rf2-safe-refusal-pvc" - save_as: rf2_pvc_identity_count - - action: assert_greater - actual: "{{ rf2_pvc_identity_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/volume-inventory-summary.txt" - pattern: "rf=2 desired=2 observed=0" - save_as: rf2_desired_observed_count - - action: assert_greater - actual: "{{ rf2_desired_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/volume-inventory-summary.txt" - pattern: "generated_deployment_missing" - save_as: generated_missing_count - - action: assert_greater - actual: "{{ generated_missing_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/volume-inventory-summary.txt" - pattern: "observed_replicas=0 desired_replicas=2" - save_as: observed_deficit_count - - action: assert_greater - actual: "{{ observed_deficit_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/inventory/volume-inventory-summary.txt" - pattern: "replica_slot_missing=unknown" - save_as: missing_slot_count - - action: assert_greater - actual: "{{ missing_slot_count }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - cmd: "kubectl -n default delete pvc sw-block-rf2-safe-refusal-pvc --ignore-not-found=true --wait=true --timeout=120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/delete-rf2-pvc.log 2>&1 || true; kubectl delete sc sw-block-rf2-safe-refusal --ignore-not-found=true > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/delete-rf2-sc.log 2>&1 || true" - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-safe-refusal" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/mounted-failover-rf3-sync-quorum-recovery-chain.yaml b/seaweed-block/testops/scenarios/mounted-failover-rf3-sync-quorum-recovery-chain.yaml deleted file mode 100644 index 94282ddc0e..0000000000 --- a/seaweed-block/testops/scenarios/mounted-failover-rf3-sync-quorum-recovery-chain.yaml +++ /dev/null @@ -1,338 +0,0 @@ -# Runner-native RF=3 sync-quorum recovery gate. -# -# Goal: -# Write data through the RF=3 Kubernetes app/PVC path with sync-quorum, -# prove a non-primary replica is promotion-ready under the beta-recovery -# claim profile, stop the current primary, wait for master/authority to -# publish a candidate as the new primary, then recreate/reattach the reader -# pod through CSI and verify the same data. This is the durable writable HA -# Stage 1 product line. - -name: mounted-failover-rf3-sync-quorum-recovery-chain -timeout: 28m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: render_rf3_demo_manifest - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/demo-app-rf3.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/demo-app-rf3.yaml" - pattern: "replicationFactor: \"3\"" - save_as: rf3_manifest_count - - action: assert_greater - actual: "{{ rf3_manifest_count }}" - threshold: "0" - - - name: rf3_sync_quorum_recovery - actions: - - action: exec - node: m02 - timeout: 16m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/demo-app-rf3.yaml SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-rf3-sync-quorum-recovery SW_BLOCK_DEMO_REQUIRE_PROMOTION_READY_BEFORE_FAILURE=1 SW_BLOCK_DEMO_FAIL_PRIMARY_BEFORE_READER=scale-primary-to-zero SW_BLOCK_DEMO_STOP_AFTER=reader-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/exit_code.txt; test \"$rc\" -eq 44'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/run.log" - pattern: "fail_primary_before_reader=scale-primary-to-zero" - save_as: fail_primary_mode_count - - action: assert_greater - actual: "{{ fail_primary_mode_count }}" - threshold: "0" - - - name: recovery_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/reader.log" - pattern: "/data/demo.bin: OK" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "ack_profile: sync-quorum" - save_as: sync_quorum_ack_count - - action: assert_greater - actual: "{{ sync_quorum_ack_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" - pattern: "claim_profile=beta-recovery" - save_as: beta_recovery_claim_count - - action: assert_greater - actual: "{{ beta_recovery_claim_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "candidate_ready=true" - save_as: candidate_ready_count - - action: assert_greater - actual: "{{ candidate_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "failover_status: promoted" - save_as: failover_promoted_count - - action: assert_greater - actual: "{{ failover_promoted_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/iscsi-sessions.before-primary-failure.txt" - pattern: "No active sessions" - save_as: pre_failure_no_session_count - - action: assert_greater - actual: "{{ pre_failure_no_session_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "target_ready_replicas=0" - save_as: old_primary_stopped_count - - action: assert_greater - actual: "{{ old_primary_stopped_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt; promoted=$(sed -n 's/^promoted_replica=//p' \"$MARKER\"); after=$(sed -n 's/^after_primary_replica=//p' \"$MARKER\"); failed=$(sed -n 's/^failed_replica=//p' \"$MARKER\"); test -n \"$promoted\" && test \"$promoted\" = \"$after\" && test \"$promoted\" != \"$failed\"" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "post_failure_primary_count=1" - save_as: single_primary_count - - action: assert_greater - actual: "{{ single_primary_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "frontend_primary_ready_issue_count=0" - save_as: no_frontend_ready_issue_count - - action: assert_greater - actual: "{{ no_frontend_ready_issue_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! grep -q 'frontend_primary_ready=true' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "failed_replica_after_evidence=replica:" - save_as: failed_replica_evidence_count - - action: assert_greater - actual: "{{ failed_replica_evidence_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt; failed_line=$(sed -n 's/^failed_replica_after_evidence=//p' \"$MARKER\"); test -n \"$failed_line\" && ! printf '%s\n' \"$failed_line\" | grep -q ' role=primary '" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "before_publish_target_evidence=replica:" - save_as: before_publish_evidence_count - - action: assert_greater - actual: "{{ before_publish_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "after_publish_target_evidence=replica:" - save_as: after_publish_evidence_count - - action: assert_greater - actual: "{{ after_publish_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/apply-reader.log" - pattern: "sw-block-demo-reader" - save_as: reader_apply_count - - action: assert_greater - actual: "{{ reader_apply_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "MARKER=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt; portal=$(sed -n 's/^after_publish_target_evidence=.* frontend=\\([^ ]*\\).*/\\1/p' \"$MARKER\"); test -n \"$portal\" && grep -q \"NodeStageVolume: .* staged transport=iscsi portal=${portal}\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/blockcsi-node.log" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-recovery.txt" - pattern: "data_check_after_failover=reader_checksum_passed" - save_as: reader_after_failover_count - - action: assert_greater - actual: "{{ reader_after_failover_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/control-plane-timeline.txt" - pattern: "event=primary_observed" - save_as: timeline_primary_observed_count - - action: assert_greater - actual: "{{ timeline_primary_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/control-plane-timeline.txt" - pattern: "event=candidate_evaluated .*candidate_ready=true" - save_as: timeline_candidate_ready_count - - action: assert_greater - actual: "{{ timeline_candidate_ready_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/control-plane-timeline.txt" - pattern: "event=primary_failure_injected" - save_as: timeline_failure_injected_count - - action: assert_greater - actual: "{{ timeline_failure_injected_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/control-plane-timeline.txt" - pattern: "event=authority_published .*to=" - save_as: timeline_authority_published_count - - action: assert_greater - actual: "{{ timeline_authority_published_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/control-plane-timeline.txt" - pattern: "event=csi_reattach_observed" - save_as: timeline_csi_reattach_count - - action: assert_greater - actual: "{{ timeline_csi_reattach_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/control-plane-timeline.txt" - pattern: "event=data_check .*result=reader_checksum_passed" - save_as: timeline_data_check_count - - action: assert_greater - actual: "{{ timeline_data_check_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" - pattern: "rf=3 desired=3 observed=3" - save_as: rf3_observed_count - - action: assert_greater - actual: "{{ rf3_observed_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "! test -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/demo/primary-failure-safe-refusal.txt" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-rf3-sync-quorum-recovery; find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec sudo rm -rf -- {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: exec - node: m02 - cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-rf3-sync-quorum-recovery" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-mounted-failover-rf3-sync-quorum-recovery" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/node-loss-survival-rf3-reattach-chain.yaml b/seaweed-block/testops/scenarios/node-loss-survival-rf3-reattach-chain.yaml index be14ce5b4e..a581bb8797 100644 --- a/seaweed-block/testops/scenarios/node-loss-survival-rf3-reattach-chain.yaml +++ b/seaweed-block/testops/scenarios/node-loss-survival-rf3-reattach-chain.yaml @@ -13,44 +13,49 @@ timeout: 34m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= + node_ssh_key: "" # key path on the test node for the image import; set with -env node_ssh_key= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-node-loss-survival && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-node-loss-survival/demo" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: exec - node: m02 + node: node-a cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*blockmaste[r]' >/dev/null 2>&1 || true; sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-node-loss-survival >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - name: preflight actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/preflight.txt 2>&1" + node: node-a + cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/preflight.txt 2>&1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/preflight.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/preflight.txt" pattern: "summary status=PASS" save_as: preflight_count - action: assert_greater @@ -60,10 +65,10 @@ phases: - name: discover_multinode_topology actions: - action: exec - node: m02 + node: node-a cmd: | set -euo pipefail - B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival + B={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival cd {{ product_root }} bash scripts/preflight-node-loss-lab.sh \ --min-k8s-nodes 3 \ @@ -73,16 +78,16 @@ phases: --placement-out "$B/node-placement.before.txt" \ > "$B/node-loss-lab-preflight.txt" 2>&1 - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/node-placement.before.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/node-placement.before.txt" pattern: "node_loss_topology_eligible=true" save_as: topology_eligible_count - action: assert_greater actual: "{{ topology_eligible_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/node-placement.before.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/node-placement.before.txt" pattern: "physical_host_loss_claimed=false" save_as: no_physical_host_loss_claim_count - action: assert_greater @@ -92,40 +97,40 @@ phases: - name: pin_build_alpha_images actions: - action: exec - node: m02 + node: node-a timeout: 8m + env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ node_ssh_key }}" cmd: | set -euo pipefail - B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival + B={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival cd {{ product_root }} set -a source "$B/node-specs.env" set +a SW_BLOCK_IMPORT_K3S=1 \ SW_BLOCK_IMPORT_K3S_NODES="$K3S_IMPORT_NODES" \ - SW_BLOCK_IMPORT_K3S_SSH_USER=testdev \ - SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key \ + SW_BLOCK_IMPORT_K3S_SSH_USER={{ node_user }} \ SW_BLOCK_ARTIFACT_DIR="$B/pin_build" \ bash scripts/build-alpha-images.sh {{ product_root }} - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: sw_block_image_id_count - action: assert_greater actual: "{{ sw_block_image_id_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env" pattern: "SW_BLOCK_CSI_IMAGE_ID=" save_as: sw_block_csi_image_id_count - action: assert_greater actual: "{{ sw_block_csi_image_id_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMPORT_K3S_NODES=" save_as: k3s_import_nodes_count - action: assert_greater @@ -135,11 +140,11 @@ phases: - name: render_rf3_demo_manifest actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/demo-app-rf3.yaml" + node: node-a + cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/demo-app-rf3.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/demo-app-rf3.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/demo-app-rf3.yaml" pattern: "replicationFactor: \"3\"" save_as: rf3_manifest_count - action: assert_greater @@ -149,29 +154,29 @@ phases: - name: rf3_node_loss_recovery actions: - action: exec - node: m02 + node: node-a timeout: 20m cmd: | cd {{ product_root }} - bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/node-specs.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/demo-app-rf3.yaml SW_BLOCK_DEMO_APP_NODE_NAME="$APP_NODE" SW_BLOCK_DEMO_READER_NODE_NAME="$SURVIVOR_APP_NODE" SW_BLOCK_ALPHA_NODE_SPECS="$NODE_SPECS" SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_EXTERNAL_ISCSI=1 SW_BLOCK_DEMO_EXPECT_NO_AUTO_PROMOTION=1 SW_BLOCK_REJECT_LOOPBACK_PUBLISH_TARGETS=1 SW_BLOCK_ISCSI_CHAP_SECRET_NAME=sw-block-node-loss-chap SW_BLOCK_ISCSI_CHAP_USERNAME=testops-node-loss SW_BLOCK_ISCSI_CHAP_SECRET=testops-node-loss-{{ run_id }} SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-node-loss-survival SW_BLOCK_DEMO_REQUIRE_PROMOTION_READY_BEFORE_FAILURE=1 SW_BLOCK_DEMO_FAIL_PRIMARY_BEFORE_READER=cordon-node-scale-primary-to-zero SW_BLOCK_DEMO_STOP_AFTER=reader-verified SW_BLOCK_DEMO_KEEP_ON_STOP=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/exit_code.txt; test "$rc" -eq 44' + bash -c 'set -a; source {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/pin_build/alpha-images.env; source {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/node-specs.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo SW_BLOCK_DEMO_APP_MANIFEST={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/demo-app-rf3.yaml SW_BLOCK_DEMO_APP_NODE_NAME="$APP_NODE" SW_BLOCK_DEMO_READER_NODE_NAME="$SURVIVOR_APP_NODE" SW_BLOCK_ALPHA_NODE_SPECS="$NODE_SPECS" SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_EXTERNAL_ISCSI=1 SW_BLOCK_DEMO_EXPECT_NO_AUTO_PROMOTION=1 SW_BLOCK_REJECT_LOOPBACK_PUBLISH_TARGETS=1 SW_BLOCK_ISCSI_CHAP_SECRET_NAME=sw-block-node-loss-chap SW_BLOCK_ISCSI_CHAP_USERNAME=testops-node-loss SW_BLOCK_ISCSI_CHAP_SECRET=testops-node-loss-{{ run_id }} SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-node-loss-survival SW_BLOCK_DEMO_REQUIRE_PROMOTION_READY_BEFORE_FAILURE=1 SW_BLOCK_DEMO_FAIL_PRIMARY_BEFORE_READER=cordon-node-scale-primary-to-zero SW_BLOCK_DEMO_STOP_AFTER=reader-verified SW_BLOCK_DEMO_KEEP_ON_STOP=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/exit_code.txt; test "$rc" -eq 44' - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/run.log" pattern: "fail_primary_before_reader=cordon-node-scale-primary-to-zero" save_as: node_loss_failure_mode_count - action: assert_greater actual: "{{ node_loss_failure_mode_count }}" threshold: "0" - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo; { echo bounded_waits=pass; echo attach=bounded_by_demo_waits; echo failure_injection=bounded_by_scale_wait; echo authority_promotion=bounded_by_240s_inventory_poll; echo csi_reattach=bounded_by_reader_pod_wait; echo data_check=bounded_by_reader_pod_wait; echo cleanup=bounded_by_collect_and_cleanup_phase; } > \"$B/bounded-waits.txt\"" + node: node-a + cmd: "B={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo; { echo bounded_waits=pass; echo attach=bounded_by_demo_waits; echo failure_injection=bounded_by_scale_wait; echo authority_promotion=bounded_by_240s_inventory_poll; echo csi_reattach=bounded_by_reader_pod_wait; echo data_check=bounded_by_reader_pod_wait; echo cleanup=bounded_by_collect_and_cleanup_phase; } > \"$B/bounded-waits.txt\"" - action: exec - node: m02 + node: node-a timeout: 4m cmd: | cd {{ product_root }} bash -c 'set -euo pipefail - OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation + OUT={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation mkdir -p "$OUT" pf_port=$(python3 - <<"PY" import socket @@ -193,213 +198,215 @@ phases: - name: recovery_asserts actions: - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/writer.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/writer.log" pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" save_as: writer_checksum_count - action: assert_greater actual: "{{ writer_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/reader.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/reader.log" pattern: "/data/demo.bin: OK" save_as: reader_checksum_count - action: assert_greater actual: "{{ reader_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "ack_profile: sync-quorum" save_as: sync_quorum_ack_count - action: assert_greater actual: "{{ sync_quorum_ack_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "failure_class=primary-kubernetes-node-cordoned-blockvolume-stop" save_as: node_failure_class_count - action: assert_greater actual: "{{ node_failure_class_count }}" threshold: "0" - action: exec - node: m02 - cmd: "M=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt; before=$(sed -n 's/^before_primary_node=//p' \"$M\" | head -1); failed=$(sed -n 's/^failed_node=//p' \"$M\" | head -1); test -n \"$before\" && test \"$before\" = \"$failed\"" + node: node-a + cmd: "M={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt; before=$(sed -n 's/^before_primary_node=//p' \"$M\" | head -1); failed=$(sed -n 's/^failed_node=//p' \"$M\" | head -1); test -n \"$before\" && test \"$before\" = \"$failed\"" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "candidate_ready=true" save_as: candidate_ready_count - action: assert_greater actual: "{{ candidate_ready_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "failover_status: recovered_same_primary" save_as: failover_promoted_count - action: assert_greater actual: "{{ failover_promoted_count }}" threshold: "0" - action: exec - node: m02 - cmd: "M=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt; recovered=$(sed -n 's/^recovered_replica=//p' \"$M\" | tail -1); failed=$(sed -n 's/^failed_replica=//p' \"$M\" | head -1); test -n \"$recovered\" && test \"$recovered\" = \"$failed\" && grep -q '^auto_promotion_while_node_lost=none$' \"$M\"" + node: node-a + cmd: "M={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt; recovered=$(sed -n 's/^recovered_replica=//p' \"$M\" | tail -1); failed=$(sed -n 's/^failed_replica=//p' \"$M\" | head -1); test -n \"$recovered\" && test \"$recovered\" = \"$failed\" && grep -q '^auto_promotion_while_node_lost=none$' \"$M\"" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "post_failure_primary_count=1" save_as: single_primary_count - action: assert_greater actual: "{{ single_primary_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "node_loss_recovery_claimed=true" save_as: node_loss_recovery_claim_count - action: assert_greater actual: "{{ node_loss_recovery_claim_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "data_check_after_node_loss=reader_checksum_passed" save_as: node_loss_checksum_count - action: assert_greater actual: "{{ node_loss_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "pod_recreate_used=true" save_as: pod_recreate_count - action: assert_greater actual: "{{ pod_recreate_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "transparent_failover_claimed=false" save_as: no_transparent_claim_count - action: assert_greater actual: "{{ no_transparent_claim_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "physical_host_loss_claimed=false" save_as: no_physical_host_loss_claim_count - action: assert_greater actual: "{{ no_physical_host_loss_claim_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt" pattern: "old_primary_stale_io_success_count=0" save_as: stale_primary_fenced_count - action: assert_greater actual: "{{ stale_primary_fenced_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/bounded-waits.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/bounded-waits.txt" pattern: "bounded_waits=pass" save_as: bounded_waits_count - action: assert_greater actual: "{{ bounded_waits_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/ops-inventory-before-primary-failure/volume-inventory-summary.txt" pattern: "replicas_on_distinct_nodes=true frontends_non_loopback=true" save_as: topology_marker_count - action: assert_greater actual: "{{ topology_marker_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/ops-inventory-after-primary-failure/volume-inventory-summary.txt" pattern: "rf=3 desired=3 observed=3" save_as: rf3_after_count - action: assert_greater actual: "{{ rf3_after_count }}" threshold: "0" - action: exec - node: m02 - cmd: "M=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt; before=$(sed -n 's/^before_publish_target_frontend=//p' \"$M\" | head -1); portal=$(sed -n 's/^after_publish_target_frontend=//p' \"$M\" | tail -1); test -n \"$portal\" && test \"$portal\" = \"$before\" && ! printf '%s\n' \"$portal\" | grep -q '^127\\.0\\.0\\.1:' && grep -q \"NodeStageVolume: .* staged transport=iscsi portal=${portal}\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/blockcsi-node.log" + node: node-a + cmd: "M={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/primary-failure-recovery.txt; before=$(sed -n 's/^before_publish_target_frontend=//p' \"$M\" | head -1); portal=$(sed -n 's/^after_publish_target_frontend=//p' \"$M\" | tail -1); test -n \"$portal\" && test \"$portal\" = \"$before\" && ! printf '%s\n' \"$portal\" | grep -q '^127\\.0\\.0\\.1:' && grep -q \"NodeStageVolume: .* staged transport=iscsi portal=${portal}\" {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/blockcsi-node.log" - action: exec - node: m02 - cmd: "test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/node-loss-recovery-boundary.txt && grep -q 'node_loss_recovery_claimed=true' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/node-loss-recovery-boundary.txt" + node: node-a + cmd: "test -s {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/node-loss-recovery-boundary.txt && grep -q 'node_loss_recovery_claimed=true' {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/node-loss-recovery-boundary.txt" - action: exec - node: m02 - cmd: "S=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/node-loss-recovery-summary.txt; test -s \"$S\" && grep -q '^node_loss_recovery_summary_version=1$' \"$S\" && grep -q '^result=recovered_same_primary$' \"$S\" && grep -q '^data_check_after_node_loss=reader_checksum_passed$' \"$S\"" + node: node-a + cmd: "S={{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/node-loss-recovery-summary.txt; test -s \"$S\" && grep -q '^node_loss_recovery_summary_version=1$' \"$S\" && grep -q '^result=recovered_same_primary$' \"$S\" && grep -q '^data_check_after_node_loss=reader_checksum_passed$' \"$S\"" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/control-plane-timeline.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/control-plane-timeline.txt" pattern: "event=primary_failure_injected .*failure_class=primary-kubernetes-node-cordoned-blockvolume-stop" save_as: timeline_node_failure_count - action: assert_greater actual: "{{ timeline_node_failure_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation/cluster-evidence.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation/cluster-evidence.json" pattern: "\"event_type\": \"placement_verified\"" save_as: product_event_placement_count - action: assert_greater actual: "{{ product_event_placement_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation/cluster-evidence.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation/cluster-evidence.json" pattern: "\"event_type\": \"promotion_candidate_evaluated\"" save_as: product_event_candidate_count - action: assert_greater actual: "{{ product_event_candidate_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation/cluster-evidence.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/product-observation/cluster-evidence.json" pattern: "\"event_type\": \"csi_reattach_observed\"" save_as: product_event_csi_reattach_count - action: assert_greater actual: "{{ product_event_csi_reattach_count }}" threshold: "0" - action: exec - node: m02 - cmd: "test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/cordon-primary-node.log && grep -qi 'cordoned' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/cordon-primary-node.log" + node: node-a + cmd: "test -s {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/cordon-primary-node.log && grep -qi 'cordoned' {{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/demo/cordon-primary-node.log" - name: collect_and_cleanup always: true actions: - action: exec - node: m02 + node: node-a timeout: 4m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/uninstall" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival/uninstall" env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" env.SW_BLOCK_ISCSI_CHAP_SECRET_NAME: "sw-block-node-loss-chap" - action: exec - node: m02 - cmd: "N=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival/demo/cordoned-primary-node.txt; if test -s \"$N\"; then node=$(cat \"$N\"); kubectl uncordon \"$node\" >/dev/null 2>&1 || true; test \"$(kubectl get node \"$node\" -o jsonpath='{.spec.unschedulable}' 2>/dev/null || true)\" != \"true\"; fi" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; N=$SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-node-loss-survival/demo/cordoned-primary-node.txt; if test -s \"$N\"; then node=$(cat \"$N\"); kubectl uncordon \"$node\" >/dev/null 2>&1 || true; test \"$(kubectl get node \"$node\" -o jsonpath='{.spec.unschedulable}' 2>/dev/null || true)\" != \"true\"; fi" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 + node: node-a cmd: "sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-node-loss-survival; test ! -e /var/lib/sw-block/testops-{{ run_id }}-node-loss-survival; pkill -f 'kubectl.*port-forward.*blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-survival" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-node-loss-survival" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/node-loss-topology-eligibility-chain.yaml b/seaweed-block/testops/scenarios/node-loss-topology-eligibility-chain.yaml deleted file mode 100644 index fd28422a77..0000000000 --- a/seaweed-block/testops/scenarios/node-loss-topology-eligibility-chain.yaml +++ /dev/null @@ -1,289 +0,0 @@ -# Runner-native Node-Loss D3 topology eligibility gate. -# -# This is not the recovery gate. It proves the alpha Kubernetes path can render -# RF=3 across real Kubernetes nodes with non-loopback iSCSI/status endpoints, -# CHAP-protected external iSCSI, loopback publish-target rejection, and stable -# inventory eligibility markers. Three Kubernetes nodes may share two physical -# machines for this MVP gate, but the physical/fault-domain shape is recorded -# and the close report must not over-claim full physical-host loss unless the -# artifacts prove distinct physical hosts. D4 consumes this topology to inject -# primary node loss and prove CSI/pod-recreate recovery. - -name: node-loss-topology-eligibility-chain -timeout: 28m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true; sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-node-loss-topology >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: discover_multinode_topology - actions: - - action: exec - node: m02 - cmd: | - set -euo pipefail - B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology - cd {{ product_root }} - bash scripts/preflight-node-loss-lab.sh \ - --min-k8s-nodes 3 \ - --topology-out "$B/cluster-topology.txt" \ - --topology-json-out "$B/cluster-topology.json" \ - --env-out "$B/node-specs.env" \ - --placement-out "$B/node-placement.before.txt" \ - > "$B/node-loss-lab-preflight.txt" 2>&1 - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/node-placement.before.txt" - pattern: "node_loss_topology_eligible=true" - save_as: topology_eligible_count - - action: assert_greater - actual: "{{ topology_eligible_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/node-placement.before.txt" - pattern: "selected_node_count=3" - save_as: selected_node_count - - action: assert_greater - actual: "{{ selected_node_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/node-placement.before.txt" - pattern: "physical_host_loss_claimed=false" - save_as: no_physical_host_loss_claim_count - - action: assert_greater - actual: "{{ no_physical_host_loss_claim_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: | - set -euo pipefail - B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology - cd {{ product_root }} - set -a - source "$B/node-specs.env" - set +a - SW_BLOCK_IMPORT_K3S=1 \ - SW_BLOCK_IMPORT_K3S_NODES="$K3S_IMPORT_NODES" \ - SW_BLOCK_IMPORT_K3S_SSH_USER=testdev \ - SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key \ - SW_BLOCK_ARTIFACT_DIR="$B/pin_build" \ - bash scripts/build-alpha-images.sh {{ product_root }} - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMPORT_K3S_NODES=" - save_as: k3s_import_nodes_count - - action: assert_greater - actual: "{{ k3s_import_nodes_count }}" - threshold: "0" - - - name: render_rf3_demo_manifest - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/demo-app-rf3.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/demo-app-rf3.yaml" - pattern: "replicationFactor: \"3\"" - save_as: rf3_manifest_count - - action: assert_greater - actual: "{{ rf3_manifest_count }}" - threshold: "0" - - - name: rf3_external_topology - actions: - - action: exec - node: m02 - timeout: 16m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/pin_build/alpha-images.env; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/node-specs.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/demo-app-rf3.yaml SW_BLOCK_DEMO_APP_NODE_NAME=\"$APP_NODE\" SW_BLOCK_ALPHA_NODE_SPECS=\"$NODE_SPECS\" SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_EXTERNAL_ISCSI=1 SW_BLOCK_LAUNCHER_EXTERNAL_STATUS=1 SW_BLOCK_REJECT_LOOPBACK_PUBLISH_TARGETS=1 SW_BLOCK_ISCSI_CHAP_SECRET_NAME=sw-block-node-loss-chap SW_BLOCK_ISCSI_CHAP_USERNAME=testops-node-loss SW_BLOCK_ISCSI_CHAP_SECRET=testops-node-loss-{{ run_id }} SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-node-loss-topology SW_BLOCK_DEMO_STOP_AFTER=writer-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/exit_code.txt; test \"$rc\" -eq 44'" - - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology; { cat \"$B/node-placement.before.txt\"; echo kubernetes_node_loss_claimed=true; echo physical_host_loss_claimed=false; echo transparent_node_loss_claimed=false; echo recovery_gate=D4-not-this-scenario; } > \"$B/demo/node-loss-claim-boundary.txt\"" - - - name: topology_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/run.log" - pattern: "launcher_external_iscsi=1" - save_as: external_iscsi_count - - action: assert_greater - actual: "{{ external_iscsi_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/run.log" - pattern: "launcher_external_status=1" - save_as: external_status_count - - action: assert_greater - actual: "{{ external_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/run.log" - pattern: "reject_loopback_publish_targets=1" - save_as: reject_loopback_count - - action: assert_greater - actual: "{{ reject_loopback_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/run.log" - pattern: "chap_enabled=1" - save_as: chap_enabled_count - - action: assert_greater - actual: "{{ chap_enabled_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/writer.log" - pattern: "/data/demo.bin: OK" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/controlled-stop-writer-verified.txt" - pattern: "phase=writer-verified" - save_as: writer_verified_stop_count - - action: assert_greater - actual: "{{ writer_verified_stop_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/node-loss-claim-boundary.txt" - pattern: "physical_host_loss_claimed=false" - save_as: physical_host_nonclaim_count - - action: assert_greater - actual: "{{ physical_host_nonclaim_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo; test \"$(grep -c -- '--replica-id=r' \"$B/generated-blockvolume.yaml\")\" -ge 3; test \"$(grep -c -- '--allow-external-iscsi-bind' \"$B/generated-blockvolume.yaml\")\" -ge 3; test \"$(grep -c -- '--master-tls-cert=' \"$B/generated-blockvolume.yaml\")\" -ge 3" - - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo; ! grep -Eq -- '--(iscsi-listen|status-addr)=127\\.0\\.0\\.1|--(iscsi-listen|status-addr)=localhost' \"$B/generated-blockvolume.yaml\"" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/csi-controller.rendered.yaml" - pattern: "--reject-loopback-publish-targets" - save_as: csi_controller_reject_loopback_count - - action: assert_greater - actual: "{{ csi_controller_reject_loopback_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/csi-node.rendered.yaml" - pattern: "--reject-loopback-publish-targets" - save_as: csi_node_reject_loopback_count - - action: assert_greater - actual: "{{ csi_node_reject_loopback_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/ops-inventory-writer-verified/volume-inventory-summary.txt" - pattern: "rf=3 desired=3 observed=3" - save_as: rf3_observed_count - - action: assert_greater - actual: "{{ rf3_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/ops-inventory-writer-verified/volume-inventory-summary.txt" - pattern: "replicas_on_distinct_nodes=true frontends_non_loopback=true" - save_as: topology_marker_count - - action: assert_greater - actual: "{{ topology_marker_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo/ops-inventory-writer-verified; test \"$(grep -c '^replica: volume=.* node=' \"$B/volume-inventory-summary.txt\")\" -ge 3; ! grep -Eq 'frontend=127\\.0\\.0\\.1|status_addr=127\\.0\\.0\\.1|frontend=localhost|status_addr=localhost' \"$B/volume-inventory-summary.txt\"" - - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/demo; grep -q 'NodeStageVolume: .* staged transport=iscsi' \"$B/blockcsi-node.log\"; ! grep -q 'NodeStageVolume: .* portal=127.0.0.1' \"$B/blockcsi-node.log\"" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-node-loss-topology/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - env.SW_BLOCK_ISCSI_CHAP_SECRET_NAME: "sw-block-node-loss-chap" - - action: exec - node: m02 - cmd: "sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-node-loss-topology; test ! -e /var/lib/sw-block/testops-{{ run_id }}-node-loss-topology" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " diff --git a/seaweed-block/testops/scenarios/nvme-ana-baseline-chain.yaml b/seaweed-block/testops/scenarios/nvme-ana-baseline-chain.yaml deleted file mode 100644 index 8c3a8c07c4..0000000000 --- a/seaweed-block/testops/scenarios/nvme-ana-baseline-chain.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: nvme-ana-baseline-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: nvme_ana_baseline_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "cd {{ product_root }} && bash scripts/run-phase99-nvme-ana-baseline-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline/phase99-nvme-ana-baseline-summary.txt" - pattern: "^phase99_nvme_ana_baseline_status=ok$" - save_as: phase99_ok - - action: assert_greater - actual: "{{ phase99_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline/phase99-nvme-ana-baseline-summary.txt" - pattern: "^ana_identify_and_log_consistent=true$" - save_as: ana_consistent - - action: assert_greater - actual: "{{ ana_consistent }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline/phase99-nvme-ana-baseline-summary.txt" - pattern: "^projection_ana_state_mapping=true$" - save_as: projection_ana - - action: assert_greater - actual: "{{ projection_ana }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline/phase99-nvme-ana-baseline-summary.txt" - pattern: "^csi_nvme_node_stage=true$" - save_as: csi_nvme_stage - - action: assert_greater - actual: "{{ csi_nvme_stage }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline/phase99-nvme-ana-baseline-summary.txt" - pattern: "^nvme_scenarios_validate=pass$" - save_as: scenario_validate - - action: assert_greater - actual: "{{ scenario_validate }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase99-nvme-ana-baseline" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-ana-change-notice-chain.yaml b/seaweed-block/testops/scenarios/nvme-ana-change-notice-chain.yaml deleted file mode 100644 index bdcbfe5b18..0000000000 --- a/seaweed-block/testops/scenarios/nvme-ana-change-notice-chain.yaml +++ /dev/null @@ -1,93 +0,0 @@ -name: nvme-ana-change-notice-chain -timeout: 10m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: phase127_nvme_ana_change_notice - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer bash scripts/run-phase127-nvme-ana-change-notice-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^phase127_nvme_ana_change_notice_status=ok$" - save_as: phase127_ok - - action: assert_greater - actual: "{{ phase127_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^ana_provider_oaes_ana_change_notice=true$" - save_as: oaes_provider_count - - action: assert_greater - actual: "{{ oaes_provider_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^no_provider_oaes_zero=true$" - save_as: oaes_no_provider_count - - action: assert_greater - actual: "{{ oaes_no_provider_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^aer_completes_on_ana_change=true$" - save_as: aer_completion_count - - action: assert_greater - actual: "{{ aer_completion_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^aer_limit_still_enforced=true$" - save_as: aer_limit_count - - action: assert_greater - actual: "{{ aer_limit_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^host_live_aer_claim=false$" - save_as: host_live_claim_count - - action: assert_greater - actual: "{{ host_live_claim_count }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer/phase127-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase127-nvme-aer" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-ana-change-notice-host-chain.yaml b/seaweed-block/testops/scenarios/nvme-ana-change-notice-host-chain.yaml deleted file mode 100644 index b74ad5fbb1..0000000000 --- a/seaweed-block/testops/scenarios/nvme-ana-change-notice-host-chain.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# Live host NVMe ANA Change Notice gate. -# -# This is the Phase 128 runner entry point. It runs the standalone mounted -# NVMe/TCP failover gate under the Linux kernel nvme_async_event tracepoint and -# requires a real host-observed ANA Change Notice AER. -# -# Expected invocation from sw-test-runner-standalone: -# swblock run \ -# -env product_root=/tmp/seaweed_block \ -# -env ssh_key=/path/to/testdev_key \ -# testops/scenarios/nvme-ana-change-notice-host-chain.yaml - -name: nvme-ana-change-notice-host-chain -timeout: 20m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: host_aer_gate - actions: - - action: exec - node: m02 - timeout: 15m - cmd: "cd {{ product_root }} && bash scripts/run-phase128-nvme-ana-change-notice-host-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host/phase128-nvme-ana-change-notice-host-summary.txt" - pattern: "^phase128_nvme_ana_change_notice_host_gate_status=ok$" - save_as: phase128_ok_count - - action: assert_greater - actual: "{{ phase128_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host/phase128-nvme-ana-change-notice-host-summary.txt" - pattern: "^host_aer_observed=true$" - save_as: host_aer_observed_count - - action: assert_greater - actual: "{{ host_aer_observed_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host/phase128-nvme-ana-change-notice-host-summary.txt" - pattern: "^ana_log_change_count_advanced=true$" - save_as: ana_count_advanced_count - - action: assert_greater - actual: "{{ ana_count_advanced_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host/phase128-nvme-ana-change-notice-host-summary.txt" - pattern: "^mounted_io_after_notice=ok$" - save_as: mounted_io_ok_count - - action: assert_greater - actual: "{{ mounted_io_ok_count }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-ana-host" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-bounded-soak-chain.yaml b/seaweed-block/testops/scenarios/nvme-bounded-soak-chain.yaml deleted file mode 100644 index be50d31b36..0000000000 --- a/seaweed-block/testops/scenarios/nvme-bounded-soak-chain.yaml +++ /dev/null @@ -1,112 +0,0 @@ -name: nvme-bounded-soak-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak" - - - name: nvme_bounded_soak - actions: - - action: exec - node: m02 - timeout: 20m - cmd: "cd {{ product_root }} && bash scripts/run-nvme-mounted-failover-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate" - env.SW_BLOCK_NVME_SOAK_ITERATIONS: "5" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^phase101_nvme_soak_status=ok$" - save_as: soak_ok - - action: assert_greater - actual: "{{ soak_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^before_path_count=2$" - save_as: before_two_paths - - action: assert_greater - actual: "{{ before_two_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^soak_completed_iterations=5$" - save_as: completed_iterations - - action: assert_greater - actual: "{{ completed_iterations }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^soak_1_path_count=2$" - save_as: first_iter_two_paths - - action: assert_greater - actual: "{{ first_iter_two_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^soak_5_path_count=2$" - save_as: last_iter_two_paths - - action: assert_greater - actual: "{{ last_iter_two_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^soak_false_ready_count=0$" - save_as: no_false_ready - - action: assert_greater - actual: "{{ no_false_ready }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^soak_identity_drift_count=0$" - save_as: no_identity_drift - - action: assert_greater - actual: "{{ no_identity_drift }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak/gate/phase101-nvme-soak-summary.txt" - pattern: "^final_nvme_residue_count=0$" - save_as: nvme_clean - - action: assert_greater - actual: "{{ nvme_clean }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-soak" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-csi-multipath-component-chain.yaml b/seaweed-block/testops/scenarios/nvme-csi-multipath-component-chain.yaml deleted file mode 100644 index 5288e80545..0000000000 --- a/seaweed-block/testops/scenarios/nvme-csi-multipath-component-chain.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: nvme-csi-multipath-component-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: nvme_csi_multipath_component_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "cd {{ product_root }} && bash scripts/run-phase100-nvme-csi-multipath-component-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-component" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-component/phase100-nvme-csi-multipath-component-summary.txt" - pattern: "^phase100_nvme_csi_multipath_component_status=ok$" - save_as: phase100_ok - - action: assert_greater - actual: "{{ phase100_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-component/phase100-nvme-csi-multipath-component-summary.txt" - pattern: "^control_status_nvme_multipath_grouping=true$" - save_as: grouping_ok - - action: assert_greater - actual: "{{ grouping_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-component/phase100-nvme-csi-multipath-component-summary.txt" - pattern: "^node_stage_nvme_multipath_connects_all_targets=true$" - save_as: stage_ok - - action: assert_greater - actual: "{{ stage_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-component/phase100-nvme-csi-multipath-component-summary.txt" - pattern: "^live_k8s_nvme_multipath_required_for_release=true$" - save_as: live_required - - action: assert_greater - actual: "{{ live_required }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-component" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-csi-multipath-live-chain.yaml b/seaweed-block/testops/scenarios/nvme-csi-multipath-live-chain.yaml deleted file mode 100644 index 50eb64b8b8..0000000000 --- a/seaweed-block/testops/scenarios/nvme-csi-multipath-live-chain.yaml +++ /dev/null @@ -1,107 +0,0 @@ -name: nvme-csi-multipath-live-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-dynamic-smoke --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-dynamic-v1 --ignore-not-found=true --wait=true --timeout=120s; kubectl get pv --no-headers 2>/dev/null | awk '$6==\"sw-block-dynamic\" {print $1}' | xargs -r -I{} kubectl patch pv {} --type=merge -p '{\"metadata\":{\"finalizers\":null}}'; kubectl get pv --no-headers 2>/dev/null | awk '$6==\"sw-block-dynamic\" {print $1}' | xargs -r kubectl delete pv --ignore-not-found=true --wait=false; kubectl delete storageclass sw-block-dynamic --ignore-not-found=true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: pin_image_id_count - - action: assert_greater - actual: "{{ pin_image_id_count }}" - threshold: "0" - - - name: nvme_multipath_dynamic_pvc - actions: - - action: exec - node: m02 - timeout: 15m - cmd: "cd {{ product_root }} && bash scripts/run-phase100-nvme-csi-multipath-live-gate.sh {{ product_root }}" - env.SW_BLOCK_ALPHA_IMAGES_ENV: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/pin_build/alpha-images.env" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/live_gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/live_gate/phase100-nvme-csi-multipath-live-summary.txt" - pattern: "^phase100_nvme_csi_multipath_live_status=ok$" - save_as: live_ok - - action: assert_greater - actual: "{{ live_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/live_gate/phase100-nvme-csi-multipath-live-summary.txt" - pattern: "^generated_nvme_listen_count=2$" - save_as: two_nvme_paths - - action: assert_greater - actual: "{{ two_nvme_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/live_gate/phase100-nvme-csi-multipath-live-summary.txt" - pattern: "^node_stage_nvme_multipath_count=[1-9][0-9]*$" - save_as: node_stage_multipath - - action: assert_greater - actual: "{{ node_stage_multipath }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live/live_gate/phase100-nvme-csi-multipath-live-summary.txt" - pattern: "^nvme_residue_count=0$" - save_as: nvme_clean - - action: assert_greater - actual: "{{ nvme_clean }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-dynamic-smoke --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-dynamic-v1 --ignore-not-found=true --wait=true --timeout=120s; kubectl get pv --no-headers 2>/dev/null | awk '$6==\"sw-block-dynamic\" {print $1}' | xargs -r -I{} kubectl patch pv {} --type=merge -p '{\"metadata\":{\"finalizers\":null}}'; kubectl get pv --no-headers 2>/dev/null | awk '$6==\"sw-block-dynamic\" {print $1}' | xargs -r kubectl delete pv --ignore-not-found=true --wait=false; kubectl delete storageclass sw-block-dynamic --ignore-not-found=true" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase100-nvme-csi-multipath-live" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-k8s-mounted-restage-chain.yaml b/seaweed-block/testops/scenarios/nvme-k8s-mounted-restage-chain.yaml index 95f89a8d45..61545c98c2 100644 --- a/seaweed-block/testops/scenarios/nvme-k8s-mounted-restage-chain.yaml +++ b/seaweed-block/testops/scenarios/nvme-k8s-mounted-restage-chain.yaml @@ -10,42 +10,46 @@ timeout: 10m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: gate actions: - action: exec - node: m02 + node: node-a timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/run-phase129-nvme-k8s-mounted-restage-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-mounted-restage" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/run-phase129-nvme-k8s-mounted-restage-gate.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-mounted-restage" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-mounted-restage/phase129-nvme-k8s-mounted-restage-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-mounted-restage/phase129-nvme-k8s-mounted-restage-summary.txt" pattern: "^phase129_nvme_k8s_mounted_restage_status=ok$" save_as: phase129_ok_count - action: assert_greater actual: "{{ phase129_ok_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-mounted-restage/phase129-nvme-k8s-mounted-restage-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-mounted-restage/phase129-nvme-k8s-mounted-restage-summary.txt" pattern: "^mounted_nodestage_reconnects_missing_path=true$" save_as: reconnect_contract_count - action: assert_greater actual: "{{ reconnect_contract_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-mounted-restage/phase129-nvme-k8s-mounted-restage-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-mounted-restage/phase129-nvme-k8s-mounted-restage-summary.txt" pattern: "^automatic_k8s_reconnect_claim=false$" save_as: automatic_nonclaim_count - action: assert_greater @@ -56,7 +60,7 @@ phases: always: true actions: - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-mounted-restage" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-mounted-restage" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-k8s-reconnect-owner-chain.yaml b/seaweed-block/testops/scenarios/nvme-k8s-reconnect-owner-chain.yaml deleted file mode 100644 index 4b3aedee07..0000000000 --- a/seaweed-block/testops/scenarios/nvme-k8s-reconnect-owner-chain.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Phase 130 CSI-node NVMe reconnect owner/trigger gate. -# -# This is a source/component gate. It proves the product has an explicit -# CSI-node owner loop that invokes the mounted NVMe reconnect primitive from -# refreshed publish evidence. It deliberately does not claim the full live -# Kubernetes failover close gate; Phase 131 owns pod UID, mounted I/O, and CRD / -# report / dashboard agreement under a real path-set change. - -name: nvme-k8s-reconnect-owner-chain -timeout: 10m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: gate - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/run-phase130-nvme-reconnect-owner-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-reconnect-owner" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-reconnect-owner/phase130-nvme-reconnect-owner-summary.txt" - pattern: "^phase130_nvme_k8s_reconnect_owner_status=ok$" - save_as: phase130_ok_count - - action: assert_greater - actual: "{{ phase130_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-reconnect-owner/phase130-nvme-reconnect-owner-summary.txt" - pattern: "^reconnect_owner=csi-node$" - save_as: owner_count - - action: assert_greater - actual: "{{ owner_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-reconnect-owner/phase130-nvme-reconnect-owner-summary.txt" - pattern: "^owner_loop_invokes_reconnect=true$" - save_as: loop_count - - action: assert_greater - actual: "{{ loop_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-reconnect-owner/phase130-nvme-reconnect-owner-summary.txt" - pattern: "^live_k8s_failover_claim=false$" - save_as: live_nonclaim_count - - action: assert_greater - actual: "{{ live_nonclaim_count }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-reconnect-owner" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-multihost-roce-preflight-chain.yaml b/seaweed-block/testops/scenarios/nvme-multihost-roce-preflight-chain.yaml deleted file mode 100644 index 1ba09e22b2..0000000000 --- a/seaweed-block/testops/scenarios/nvme-multihost-roce-preflight-chain.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: nvme-multihost-roce-preflight-chain -timeout: 15m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: preflight - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight && cd {{ product_root }} && bash scripts/run-phase103-nvme-multihost-roce-preflight-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate/phase103-nvme-multihost-roce-preflight-summary.txt" - pattern: "^phase103_nvme_multihost_roce_preflight_status=ok$" - save_as: phase103_ok - - action: assert_greater - actual: "{{ phase103_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate/phase103-nvme-multihost-roce-preflight-summary.txt" - pattern: "^read_only=true$" - save_as: read_only - - action: assert_greater - actual: "{{ read_only }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate/phase103-nvme-multihost-roce-preflight-summary.txt" - pattern: "^nvme_tcp_preflight_ready=true$" - save_as: nvme_tcp_ready - - action: assert_greater - actual: "{{ nvme_tcp_ready }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate/phase103-nvme-multihost-roce-preflight-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate/phase103-nvme-multihost-roce-preflight-summary.txt" - pattern: "^roce_live_io_claim=false$" - save_as: no_roce_io_claim - - action: assert_greater - actual: "{{ no_roce_io_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight/gate/phase103-nvme-multihost-roce-preflight-summary.txt" - pattern: "^performance_claim_allowed=false$" - save_as: no_perf_claim - - action: assert_greater - actual: "{{ no_perf_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase103-nvme-roce-preflight" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-p4-multipath-failover-chain.yaml b/seaweed-block/testops/scenarios/nvme-p4-multipath-failover-chain.yaml index 0c6dc767d0..3681e72576 100644 --- a/seaweed-block/testops/scenarios/nvme-p4-multipath-failover-chain.yaml +++ b/seaweed-block/testops/scenarios/nvme-p4-multipath-failover-chain.yaml @@ -7,8 +7,11 @@ # # Expected invocation from sw-test-runner-standalone: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/nvme-p4-multipath-failover-chain.yaml name: nvme-p4-multipath-failover-chain @@ -16,45 +19,49 @@ timeout: 25m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p4-chain && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: pin_build actions: - action: exec - node: m02 + node: node-a timeout: 8m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockmaster ./cmd/blockmaster && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockvolume ./cmd/blockvolume" + cmd: "cd {{ product_root }} && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockmaster ./cmd/blockmaster && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockvolume ./cmd/blockvolume" - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/git.sha && git status --short > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/git.status && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockmaster --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/blockmaster.version.txt && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockvolume --version > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/blockvolume.version.txt" + node: node-a + cmd: "cd {{ product_root }} && git rev-parse HEAD > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/git.sha && git status --short > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/git.status && {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockmaster --version > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/blockmaster.version.txt && {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin/blockvolume --version > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/blockvolume.version.txt" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/blockvolume.version.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/pin_build/blockvolume.version.txt" pattern: "blockvolume revision=" save_as: blockvolume_version_count - action: assert_greater @@ -64,16 +71,16 @@ phases: - name: multipath_discovery actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/run-nvme-multipath-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery" + env.SW_BLOCK_BIN_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin" # Bash-level gate: smoke's own PASS line ran. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/run.log" pattern: "\\[nvme-mpath\\] PASS:" save_as: multipath_pass_count - action: assert_greater @@ -83,8 +90,8 @@ phases: # Field-level gate: cross-path identity ANAGRPID == 1 (was # the only field bash already gated; kept for parity). - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/identity-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/identity-summary.txt" pattern: "anagrpid=1" save_as: multipath_anagrpid_count - action: assert_greater @@ -97,8 +104,8 @@ phases: # multiple controllers." Bash never gated the value, only # observed it in id-ctrl text. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-id-ctrl.dev1.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-id-ctrl.dev1.txt" pattern: "^cmic\\s*:\\s*0xa$" save_as: cmic_match_count - action: assert_greater @@ -109,8 +116,8 @@ phases: # Revert of 035702f flips this to 0x0; kernel rejects with # "Duplicate unshared namespace 1." Bash never gated. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-id-ns.dev1.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-id-ns.dev1.txt" pattern: "^nmic\\s*:\\s*0x1$" save_as: nmic_match_count - action: assert_greater @@ -122,8 +129,8 @@ phases: # recognized value (any of 0x01/0x02/0x03/0x04/0x0F); # post-promotion drift to non_optimized would have slipped. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-ana-log.dev1.summary" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-ana-log.dev1.summary" pattern: "^ana_state=0x01 optimized$" save_as: ana_optimized_count - action: assert_greater @@ -132,8 +139,8 @@ phases: # Field-level gate: single ANA group reported. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-ana-log.dev1.summary" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/multipath_discovery/nvme-ana-log.dev1.summary" pattern: "^ana_group_count=1$" save_as: ana_group_count_match - action: assert_greater @@ -141,36 +148,36 @@ phases: threshold: "0" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: mounted_failover actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/run-nvme-mounted-failover-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover" - env.SW_BLOCK_BIN_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover" + env.SW_BLOCK_BIN_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/bin" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/run.log" pattern: "\\[nvme-failover\\] PASS:" save_as: failover_pass_count - action: assert_greater actual: "{{ failover_pass_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/pre-check-after-failover.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/pre-check-after-failover.log" pattern: "/pre.bin: OK" save_as: pre_checksum_count - action: assert_greater actual: "{{ pre_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/post-check.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/post-check.log" pattern: "/post.bin: OK" save_as: post_checksum_count - action: assert_greater @@ -183,8 +190,8 @@ phases: # at 1). A regression in assignment-epoch logic surfaces as # Epoch=0 or Epoch=1. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/status-r2-primary.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/status-r2-primary.json" pattern: "\"Epoch\":[2-9][0-9]*" save_as: r2_epoch_ge2_count - action: assert_greater @@ -193,8 +200,8 @@ phases: # Field-level gate: r2 promoted to AuthorityRole=primary. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/status-r2-primary.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/status-r2-primary.json" pattern: "\"AuthorityRole\":\"primary\"" save_as: r2_role_primary_count - action: assert_greater @@ -207,8 +214,8 @@ phases: # r2 could be authoritative-primary while still rejecting # I/O. - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/status-r2-primary.json" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/mounted_failover/status-r2-primary.json" pattern: "\"FrontendPrimaryReady\":true" save_as: r2_frontend_ready_count - action: assert_greater @@ -218,25 +225,25 @@ phases: - name: final_asserts actions: - action: exec - node: m02 - cmd: "sudo nvme list-subsys -o json > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain/nvme-list-subsys.final.json" + node: node-a + cmd: "sudo nvme list-subsys -o json > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain/nvme-list-subsys.final.json" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: collect_and_cleanup always: true actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p4-chain" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p4-chain" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-p5-csi-protocol-chain.yaml b/seaweed-block/testops/scenarios/nvme-p5-csi-protocol-chain.yaml index d9e2427a93..4205cc2e62 100644 --- a/seaweed-block/testops/scenarios/nvme-p5-csi-protocol-chain.yaml +++ b/seaweed-block/testops/scenarios/nvme-p5-csi-protocol-chain.yaml @@ -7,8 +7,11 @@ # # Expected invocation from sw-test-runner-standalone: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/nvme-p5-csi-protocol-chain.yaml name: nvme-p5-csi-protocol-chain @@ -16,44 +19,48 @@ timeout: 25m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p5-chain && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p5-chain" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: pin_build_alpha_images actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: pin_image_id_count - action: assert_greater @@ -63,22 +70,22 @@ phases: - name: nvme_dynamic_pvc actions: - action: exec - node: m02 + node: node-a timeout: 10m cmd: "cd {{ product_root }} && bash scripts/run-k8s-alpha-nvme.sh {{ product_root }}" - env.SW_BLOCK_ALPHA_IMAGES_ENV: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build/alpha-images.env" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/nvme_dynamic_pvc" + env.SW_BLOCK_ALPHA_IMAGES_ENV: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build/alpha-images.env" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/nvme_dynamic_pvc" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/nvme_dynamic_pvc/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/nvme_dynamic_pvc/run.log" pattern: "\\[alpha-nvme\\] PASS:" save_as: nvme_pass_count - action: assert_greater actual: "{{ nvme_pass_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/nvme_dynamic_pvc/generated-blockvolume.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/nvme_dynamic_pvc/generated-blockvolume.yaml" pattern: "--nvme-listen=" save_as: nvme_arg_count - action: assert_greater @@ -88,22 +95,22 @@ phases: - name: default_iscsi_regression actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/run-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ALPHA_IMAGES_ENV: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build/alpha-images.env" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/default_iscsi_regression" + env.SW_BLOCK_ALPHA_IMAGES_ENV: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/pin_build/alpha-images.env" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/default_iscsi_regression" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/default_iscsi_regression/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/default_iscsi_regression/run.log" pattern: "\\[alpha\\] PASS:" save_as: iscsi_pass_count - action: assert_greater actual: "{{ iscsi_pass_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain/default_iscsi_regression/generated-blockvolume.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain/default_iscsi_regression/generated-blockvolume.yaml" pattern: "--iscsi-listen=" save_as: iscsi_arg_count - action: assert_greater @@ -113,22 +120,22 @@ phases: - name: final_asserts actions: - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: collect_and_cleanup always: true actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-chain" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-chain" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-p5-protocol-component-gate.yaml b/seaweed-block/testops/scenarios/nvme-p5-protocol-component-gate.yaml index 5ad74ed19a..01d0ee8f4e 100644 --- a/seaweed-block/testops/scenarios/nvme-p5-protocol-component-gate.yaml +++ b/seaweed-block/testops/scenarios/nvme-p5-protocol-component-gate.yaml @@ -7,8 +7,11 @@ # # Expected invocation: # swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ +# -env product_root=/path/to/seaweed_block/on/node-a \ +# -env ssh_key=/path/to/ssh/key/on/controller \ +# -env node_host=192.0.2.10 \ +# -env node_user=tester \ +# -env artifact_root=/path/to/shared/artifacts \ # testops/scenarios/nvme-p5-protocol-component-gate.yaml name: nvme-p5-protocol-component-gate @@ -16,107 +19,111 @@ timeout: 5m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - name: pin_build actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build/git.status" + node: node-a + cmd: "cd {{ product_root }} && git rev-parse HEAD > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build/git.sha && git status --porcelain > {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build/git.status && test ! -s {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/pin_build/git.status" - name: protocol_component_tests actions: - action: exec - node: m02 + node: node-a timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -v ./core/csi ./core/host/master ./core/lifecycle ./core/launcher | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log'" + cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -v ./core/csi ./core/host/master ./core/lifecycle ./core/launcher | tee {{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log'" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15c_ControllerCreateVolume_RecordsProtocolSelection" save_as: csi_protocol_selection_count - action: assert_greater actual: "{{ csi_protocol_selection_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15c_ControllerCreateVolume_RejectsConflictingProtocolParameters" save_as: csi_protocol_conflict_count - action: assert_greater actual: "{{ csi_protocol_conflict_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15c_ControllerCreateVolume_RejectsInvalidProtocol" save_as: csi_protocol_invalid_count - action: assert_greater actual: "{{ csi_protocol_invalid_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15c_LifecycleService_CreateVolumePersistsDesiredIntent" save_as: master_lifecycle_protocol_count - action: assert_greater actual: "{{ master_lifecycle_protocol_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestFileStore_CreateVolumePersistsProtocolSelection" save_as: lifecycle_store_protocol_count - action: assert_greater actual: "{{ lifecycle_store_protocol_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15d_WorkloadPlan_NVMeProtocolCreatesNVMeTargets" save_as: lifecycle_nvme_plan_count - action: assert_greater actual: "{{ lifecycle_nvme_plan_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15d_WorkloadPlan_BlankPoolRF2CreatesReplicaWorkloads" save_as: lifecycle_default_iscsi_count - action: assert_greater actual: "{{ lifecycle_default_iscsi_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15d_K8sRenderer_RendersNVMeBlockVolumeArgs" save_as: launcher_nvme_render_count - action: assert_greater actual: "{{ launcher_nvme_render_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component/protocol-component-go-test.log" pattern: "PASS: TestG15d_K8sRenderer_RendersBlockVolumeDeploymentArgs" save_as: launcher_iscsi_render_count - action: assert_greater @@ -126,17 +133,17 @@ phases: - name: final_asserts actions: - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - name: collect_and_cleanup always: true actions: - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-nvme-p5-protocol-component" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-path-failure-status-chain.yaml b/seaweed-block/testops/scenarios/nvme-path-failure-status-chain.yaml deleted file mode 100644 index f67e9a5c8e..0000000000 --- a/seaweed-block/testops/scenarios/nvme-path-failure-status-chain.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: nvme-path-failure-status-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure" - - - name: nvme_path_failure_status - actions: - - action: exec - node: m02 - timeout: 20m - cmd: "cd {{ product_root }} && bash scripts/run-nvme-mounted-failover-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate/phase101-nvme-path-failure-summary.txt" - pattern: "^phase101_nvme_path_failure_status=ok$" - save_as: d2_ok - - action: assert_greater - actual: "{{ d2_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate/phase101-nvme-path-failure-summary.txt" - pattern: "^before_path_count=2$" - save_as: before_two_paths - - action: assert_greater - actual: "{{ before_two_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate/phase101-nvme-path-failure-summary.txt" - pattern: "^after_path_count=1$" - save_as: after_one_path - - action: assert_greater - actual: "{{ after_one_path }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate/phase101-nvme-path-failure-summary.txt" - pattern: "^after_nvme_reason=nvme_multipath_path_missing$" - save_as: missing_path_reason - - action: assert_greater - actual: "{{ missing_path_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate/phase101-nvme-path-failure-summary.txt" - pattern: "^after_ready_true=false$" - save_as: no_false_ready - - action: assert_greater - actual: "{{ no_false_ready }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure/gate/phase101-nvme-path-failure-summary.txt" - pattern: "^final_nvme_residue_count=0$" - save_as: nvme_clean - - action: assert_greater - actual: "{{ nvme_clean }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-path-failure" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-rdma-k8s-multipath-reconnect-chain.yaml b/seaweed-block/testops/scenarios/nvme-rdma-k8s-multipath-reconnect-chain.yaml deleted file mode 100644 index 1acbdc601b..0000000000 --- a/seaweed-block/testops/scenarios/nvme-rdma-k8s-multipath-reconnect-chain.yaml +++ /dev/null @@ -1,201 +0,0 @@ -name: nvme-rdma-k8s-multipath-reconnect-chain -timeout: 130m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - app_node: "" - app_ssh_addr: "" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: run_close_gate - actions: - - action: exec - node: m02 - timeout: 125m - cmd: "cd {{ product_root }} && bash scripts/run-phase166-nvme-rdma-k8s-multipath-reconnect-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath" - env.SW_BLOCK_PHASE166_RUN_ID: "{{ run_id }}" - env.SW_BLOCK_PHASE166_APP_NODE: "{{ app_node }}" - env.SW_BLOCK_PHASE166_APP_SSH_ADDR: "{{ app_ssh_addr }}" - env.SW_BLOCK_PHASE166_APP_SSH_KEY: "/opt/work/testdev_key" - - - name: assert_terminal_evidence - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^phase166_nvme_rdma_k8s_multipath_reconnect_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_initial_live_rdma_path_count=2$" - save_as: outage_baseline - - action: assert_greater - actual: "{{ outage_baseline }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_degraded_live_rdma_path_count=1$" - save_as: outage_degraded - - action: assert_greater - actual: "{{ outage_degraded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_mounted_io=ok$" - save_as: outage_io - - action: assert_greater - actual: "{{ outage_io }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_negative_surface_reason=nvme_multipath_path_missing$" - save_as: outage_negative - - action: assert_greater - actual: "{{ outage_negative }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_restored_live_rdma_path_count=2$" - save_as: outage_restored - - action: assert_greater - actual: "{{ outage_restored }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_restore_mounted_io=ok$" - save_as: restore_io - - action: assert_greater - actual: "{{ restore_io }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^desired_rdma_endpoint_changed=true$" - save_as: endpoint_changed - - action: assert_greater - actual: "{{ endpoint_changed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^new_rdma_endpoint_connected=true$" - save_as: endpoint_connected - - action: assert_greater - actual: "{{ endpoint_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^stale_rdma_endpoint_pruned=true$" - save_as: stale_pruned - - action: assert_greater - actual: "{{ stale_pruned }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^endpoint_live_rdma_path_count=2$" - save_as: endpoint_paths - - action: assert_greater - actual: "{{ endpoint_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^endpoint_pod_uid_preserved=true$" - save_as: endpoint_uid - - action: assert_greater - actual: "{{ endpoint_uid }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^endpoint_mounted_io=ok$" - save_as: endpoint_io - - action: assert_greater - actual: "{{ endpoint_io }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^endpoint_surfaces_agree=true$" - save_as: surfaces - - action: assert_greater - actual: "{{ surfaces }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_tcp_fallback_observed=false$" - save_as: outage_no_tcp - - action: assert_greater - actual: "{{ outage_no_tcp }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^endpoint_tcp_fallback_observed=false$" - save_as: endpoint_no_tcp - - action: assert_greater - actual: "{{ endpoint_no_tcp }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^outage_is_non_primary=true$" - save_as: non_primary_outage - - action: assert_greater - actual: "{{ non_primary_outage }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^endpoint_transition_io=ok$" - save_as: transition_io - - action: assert_greater - actual: "{{ transition_io }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^hostpath_cleanup_nodes=m01,m02$" - save_as: hostpath_cleanup - - action: assert_greater - actual: "{{ hostpath_cleanup }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath/phase166-nvme-rdma-k8s-multipath-reconnect-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase166-nvme-rdma-multipath" - name: remote-phases - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-rdma-k8s-publish-attach-chain.yaml b/seaweed-block/testops/scenarios/nvme-rdma-k8s-publish-attach-chain.yaml deleted file mode 100644 index 1f0d594c08..0000000000 --- a/seaweed-block/testops/scenarios/nvme-rdma-k8s-publish-attach-chain.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: nvme-rdma-k8s-publish-attach-chain -timeout: 60m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: run_close_gate - actions: - - action: exec - node: m02 - timeout: 55m - cmd: "cd {{ product_root }} && bash scripts/run-phase165-nvme-rdma-k8s-publish-attach-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s" - env.SW_BLOCK_PHASE165_RUN_ID: "{{ run_id }}" - env.SW_BLOCK_PHASE165_APP_SSH_KEY: "/opt/work/testdev_key" - - - name: assert_terminal_evidence - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s/phase165-nvme-rdma-k8s-publish-attach-summary.txt" - pattern: "^phase165_nvme_rdma_k8s_publish_attach_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s/phase165-nvme-rdma-k8s-publish-attach-summary.txt" - pattern: "^active_host_controller_transport=rdma$" - save_as: host_rdma - - action: assert_greater - actual: "{{ host_rdma }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s/phase165-nvme-rdma-k8s-publish-attach-summary.txt" - pattern: "^swblockvolume_status_transport=rdma$" - save_as: status_rdma - - action: assert_greater - actual: "{{ status_rdma }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s/phase165-nvme-rdma-k8s-publish-attach-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_ok - - action: assert_greater - actual: "{{ writer_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s/phase165-nvme-rdma-k8s-publish-attach-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_ok - - action: assert_greater - actual: "{{ reader_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s/phase165-nvme-rdma-k8s-publish-attach-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase165-nvme-rdma-k8s" - name: remote-phases - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-rdma-standalone-hardening-chain.yaml b/seaweed-block/testops/scenarios/nvme-rdma-standalone-hardening-chain.yaml deleted file mode 100644 index 6b2b951baf..0000000000 --- a/seaweed-block/testops/scenarios/nvme-rdma-standalone-hardening-chain.yaml +++ /dev/null @@ -1,121 +0,0 @@ -name: nvme-rdma-standalone-hardening-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 25m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma && cd {{ product_root }} && SW_BLOCK_PHASE164_RUN_ID={{ run_id }} SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma bash scripts/run-phase164-nvme-rdma-standalone-hardening-gate.sh {{ product_root }}" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^phase164_nvme_rdma_standalone_hardening_status=ok$" - save_as: phase164_ok - - action: assert_greater - actual: "{{ phase164_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^startup_rollback_verified=true$" - save_as: rollback - - action: assert_greater - actual: "{{ rollback }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^small_and_large_io_verified=true$" - save_as: io_shape - - action: assert_greater - actual: "{{ io_shape }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^flush_and_fua_verified=true$" - save_as: flush_fua - - action: assert_greater - actual: "{{ flush_fua }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^durable_restart_reconnect_verified=true$" - save_as: restart - - action: assert_greater - actual: "{{ restart }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^capability_restart_honesty_verified=true$" - save_as: capability_restart - - action: assert_greater - actual: "{{ capability_restart }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^multi_target_isolation_verified=true$" - save_as: isolation - - action: assert_greater - actual: "{{ isolation }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^bounded_connect_churn_verified=true$" - save_as: churn - - action: assert_greater - actual: "{{ churn }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^negative_preflight_refusal_verified=true$" - save_as: refusal - - action: assert_greater - actual: "{{ refusal }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^port_conflict_refusal_verified=true$" - save_as: port_conflict - - action: assert_greater - actual: "{{ port_conflict }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma/phase164-nvme-rdma-standalone-hardening-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup - - action: assert_greater - actual: "{{ cleanup }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase164-nvme-rdma" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-rdma-standalone-live-chain.yaml b/seaweed-block/testops/scenarios/nvme-rdma-standalone-live-chain.yaml deleted file mode 100644 index a18a88d692..0000000000 --- a/seaweed-block/testops/scenarios/nvme-rdma-standalone-live-chain.yaml +++ /dev/null @@ -1,89 +0,0 @@ -name: nvme-rdma-standalone-live-chain -timeout: 20m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 15m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma && cd {{ product_root }} && SW_BLOCK_PHASE163_RUN_ID={{ run_id }} SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma bash scripts/run-phase163-nvme-rdma-standalone-live-gate.sh {{ product_root }}" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^phase163_nvme_rdma_standalone_listener_impl_spike_status=ok$" - save_as: phase163_ok - - action: assert_greater - actual: "{{ phase163_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^linux_nvme_connect_rdma_succeeded=true$" - save_as: rdma_connect - - action: assert_greater - actual: "{{ rdma_connect }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^standalone_write_read_verified=true$" - save_as: rdma_io - - action: assert_greater - actual: "{{ rdma_io }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^seaweed_backend_write_observed=true$" - save_as: seaweed_backend - - action: assert_greater - actual: "{{ seaweed_backend }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^capability_endpoint_reports_rdma_supported=true$" - save_as: capability_supported - - action: assert_greater - actual: "{{ capability_supported }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^rdma_not_published_to_csi=true$" - save_as: no_csi_publish - - action: assert_greater - actual: "{{ no_csi_publish }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma/phase163-nvme-rdma-standalone-live-summary.txt" - pattern: "^disconnect_cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase163-nvme-rdma" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-rdma-transport-seam-chain.yaml b/seaweed-block/testops/scenarios/nvme-rdma-transport-seam-chain.yaml deleted file mode 100644 index dbefa818f3..0000000000 --- a/seaweed-block/testops/scenarios/nvme-rdma-transport-seam-chain.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: nvme-rdma-transport-seam-chain -timeout: 20m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: run_phase118_gate - actions: - - action: exec - node: m02 - timeout: 15m - cmd: "cd {{ product_root }} && bash scripts/run-phase118-nvme-rdma-transport-seam-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate/phase118-nvme-rdma-transport-seam-summary.txt" - pattern: "^phase118_nvme_rdma_transport_seam_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate/phase118-nvme-rdma-transport-seam-summary.txt" - pattern: "^target_transport_seam_present=true$" - save_as: seam_present - - action: assert_greater - actual: "{{ seam_present }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate/phase118-nvme-rdma-transport-seam-summary.txt" - pattern: "^rdma_target_error_typed=true$" - save_as: typed_error - - action: assert_greater - actual: "{{ typed_error }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate/phase118-nvme-rdma-transport-seam-summary.txt" - pattern: "^blockvolume_rdma_public_refusal=true$" - save_as: public_refusal - - action: assert_greater - actual: "{{ public_refusal }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate/phase118-nvme-rdma-transport-seam-summary.txt" - pattern: "^rdma_listener_implemented=false$" - save_as: rdma_listener_not_claimed - - action: assert_greater - actual: "{{ rdma_listener_not_claimed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam/gate/phase118-nvme-rdma-transport-seam-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase118-nvme-rdma-transport-seam" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-release-artifact-smoke-chain.yaml b/seaweed-block/testops/scenarios/nvme-release-artifact-smoke-chain.yaml deleted file mode 100644 index 78946d9d5d..0000000000 --- a/seaweed-block/testops/scenarios/nvme-release-artifact-smoke-chain.yaml +++ /dev/null @@ -1,111 +0,0 @@ -name: nvme-release-artifact-smoke-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - release_image: "" - release_csi_image: "" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-dynamic-smoke --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-dynamic-v1 --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-dynamic --ignore-not-found=true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact" - - - name: nvme_release_artifact_smoke - actions: - - action: exec - node: m02 - timeout: 80m - cmd: "cd {{ product_root }} && bash scripts/run-phase102-nvme-release-artifact-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate" - env.SW_BLOCK_RELEASE_IMAGE: "{{ release_image }}" - env.SW_BLOCK_CSI_RELEASE_IMAGE: "{{ release_csi_image }}" - env.SW_BLOCK_NVME_SOAK_ITERATIONS: "5" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase102_nvme_release_artifact_status=ok$" - save_as: phase102_ok - - action: assert_greater - actual: "{{ phase102_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase100_nvme_csi_multipath_live_status=ok$" - save_as: phase100_ok - - action: assert_greater - actual: "{{ phase100_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase101_nvme_path_failure_status=ok$" - save_as: path_failure_ok - - action: assert_greater - actual: "{{ path_failure_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase101_nvme_stage_unstage_status=ok$" - save_as: stage_unstage_ok - - action: assert_greater - actual: "{{ stage_unstage_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase101_nvme_soak_status=ok$" - save_as: soak_ok - - action: assert_greater - actual: "{{ soak_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase101_soak_false_ready_count=0$" - save_as: no_false_ready - - action: assert_greater - actual: "{{ no_false_ready }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact/gate/phase102-nvme-release-artifact-smoke-summary.txt" - pattern: "^phase101_soak_identity_drift_count=0$" - save_as: no_identity_drift - - action: assert_greater - actual: "{{ no_identity_drift }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "kubectl -n default delete pod sw-block-dynamic-smoke --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-dynamic-v1 --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-dynamic --ignore-not-found=true" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase102-nvme-release-artifact" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-stage-unstage-residue-chain.yaml b/seaweed-block/testops/scenarios/nvme-stage-unstage-residue-chain.yaml deleted file mode 100644 index 2ea5a779db..0000000000 --- a/seaweed-block/testops/scenarios/nvme-stage-unstage-residue-chain.yaml +++ /dev/null @@ -1,112 +0,0 @@ -name: nvme-stage-unstage-residue-chain -timeout: 30m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage" - - - name: nvme_stage_unstage - actions: - - action: exec - node: m02 - timeout: 20m - cmd: "cd {{ product_root }} && bash scripts/run-phase101-nvme-stage-unstage-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate" - env.SW_BLOCK_NVME_STAGE_CYCLES: "3" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^phase101_nvme_stage_unstage_status=ok$" - save_as: d3_ok - - action: assert_greater - actual: "{{ d3_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^cycle_1_connected_path_count=2$" - save_as: cycle1_connected - - action: assert_greater - actual: "{{ cycle1_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^cycle_2_connected_path_count=2$" - save_as: cycle2_connected - - action: assert_greater - actual: "{{ cycle2_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^cycle_3_connected_path_count=2$" - save_as: cycle3_connected - - action: assert_greater - actual: "{{ cycle3_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^cycle_1_disconnected_path_count=0$" - save_as: cycle1_clean - - action: assert_greater - actual: "{{ cycle1_clean }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^cycle_2_disconnected_path_count=0$" - save_as: cycle2_clean - - action: assert_greater - actual: "{{ cycle2_clean }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^cycle_3_disconnected_path_count=0$" - save_as: cycle3_clean - - action: assert_greater - actual: "{{ cycle3_clean }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage/gate/phase101-nvme-stage-unstage-summary.txt" - pattern: "^final_nvme_residue_count=0$" - save_as: final_clean - - action: assert_greater - actual: "{{ final_clean }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase101-nvme-stage-unstage" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-100gbe-baseline-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-100gbe-baseline-chain.yaml deleted file mode 100644 index d7e91c9052..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-100gbe-baseline-chain.yaml +++ /dev/null @@ -1,127 +0,0 @@ -name: nvme-tcp-100gbe-baseline-chain -timeout: 45m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase122-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase122-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase122 --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase122/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase122/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 38m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe SW_BLOCK_PHASE122_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE122_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase122-nvme-tcp-100gbe-baseline-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^phase122_nvme_tcp_100gbe_baseline_status=ok$" - save_as: phase122_status_ok - - action: assert_greater - actual: "{{ phase122_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^publish_target=10\\.0\\.0\\.[0-9]+:4420$" - save_as: target_is_100gbe - - action: assert_greater - actual: "{{ target_is_100gbe }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^publish_target_network_class=100gbe_tcp$" - save_as: network_class_ok - - action: assert_greater - actual: "{{ network_class_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^publish_target_route_dev=enp1s0np0$" - save_as: route_dev_ok - - action: assert_greater - actual: "{{ route_dev_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^frontend_transport=tcp$" - save_as: frontend_tcp - - action: assert_greater - actual: "{{ frontend_tcp }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^nvme_rdma_supported=false$" - save_as: rdma_false - - action: assert_greater - actual: "{{ rdma_false }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^seq_write_mibps=[0-9]" - save_as: seq_write_metric - - action: assert_greater - actual: "{{ seq_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^seq_read_mibps=[0-9]" - save_as: seq_read_metric - - action: assert_greater - actual: "{{ seq_read_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^small_write_iops=[0-9]" - save_as: small_write_metric - - action: assert_greater - actual: "{{ small_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe/phase122-nvme-tcp-100gbe-baseline-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase122-nvme-100gbe" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-backend-write-instrumentation-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-backend-write-instrumentation-chain.yaml deleted file mode 100644 index ef28cc62de..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-backend-write-instrumentation-chain.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: nvme-tcp-backend-write-instrumentation-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase126-block-nvme-tcp-backend-write-instrumentation-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^phase126_block_nvme_tcp_backend_write_instrumentation_status=ok$" - save_as: phase126_status_ok - - action: assert_greater - actual: "{{ phase126_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^target_write_bytes=[1-9][0-9]*$" - save_as: target_bytes - - action: assert_greater - actual: "{{ target_bytes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^backend_write_bytes=[1-9][0-9]*$" - save_as: backend_bytes - - action: assert_greater - actual: "{{ backend_bytes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^target_write_duration_ms=[1-9][0-9]*$" - save_as: target_duration - - action: assert_greater - actual: "{{ target_duration }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^backend_write_duration_ms=[1-9][0-9]*$" - save_as: backend_duration - - action: assert_greater - actual: "{{ backend_duration }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^write_path_observation=\\(backend_write\\|backend_sync\\|target_protocol\\|unknown\\)$" - save_as: observation_named - - action: assert_greater - actual: "{{ observation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^next_recommendation=phase127_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase126-write-instrumentation" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-bottleneck-triage-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-bottleneck-triage-chain.yaml deleted file mode 100644 index f96d97ff05..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-bottleneck-triage-chain.yaml +++ /dev/null @@ -1,111 +0,0 @@ -name: nvme-tcp-bottleneck-triage-chain -timeout: 50m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase123-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase123-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase123 --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase123/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase123/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 42m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage SW_BLOCK_PHASE123_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE123_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase123-nvme-tcp-bottleneck-triage-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^phase123_nvme_tcp_bottleneck_triage_status=ok$" - save_as: phase123_status_ok - - action: assert_greater - actual: "{{ phase123_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^publish_target=10[.]0[.]0[.][0-9][0-9]*:4420$" - save_as: target_is_data_plane - - action: assert_greater - actual: "{{ target_is_data_plane }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^network_baseline_status=ok$" - save_as: network_baseline_ok - - action: assert_greater - actual: "{{ network_baseline_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^network_baseline_mibps=[0-9]" - save_as: network_metric - - action: assert_greater - actual: "{{ network_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^k8s_mounted_nvme_tcp_mibps=[0-9]" - save_as: k8s_metric - - action: assert_greater - actual: "{{ k8s_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^top_bottleneck=" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^next_recommendation=phase" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage/phase123-nvme-tcp-bottleneck-triage-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase123-nvme-triage" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-live-attach-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-cross-node-live-attach-chain.yaml deleted file mode 100644 index 35622bae9e..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-live-attach-chain.yaml +++ /dev/null @@ -1,187 +0,0 @@ -name: nvme-tcp-cross-node-live-attach-chain -timeout: 45m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=120s; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/asserts /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && if docker image inspect sw-block:local sw-block-csi:local >/dev/null 2>&1; then mkdir -p \"$SW_BLOCK_ARTIFACT_DIR\"; echo \"SW_BLOCK_IMAGE_ID=$(docker image inspect sw-block:local --format '{{.Id}}')\" > \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; echo \"SW_BLOCK_CSI_IMAGE_ID=$(docker image inspect sw-block-csi:local --format '{{.Id}}')\" >> \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; echo cached_images=true >> \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; else bash scripts/build-alpha-images.sh {{ product_root }}; fi" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: generate_values - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/values.nvme.yaml --image sw-block:local --csi-image sw-block-csi:local --protocol nvme --node-limit 2 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live')\nnodes=[]\ncur=None\nfor raw in (base/'values/values.nvme.yaml').read_text().splitlines():\n line=raw.strip()\n if line.startswith('- name:'):\n if cur:\n nodes.append(cur)\n cur={}\n if cur is None:\n continue\n if line.startswith('kubernetesNode:'):\n cur['kubernetesNode']=line.split(':',1)[1].strip().strip('\"')\nif cur:\n nodes.append(cur)\nif len(nodes) < 2:\n raise SystemExit('need at least two generated nodes')\n(base/'values/blockvolume-node.txt').write_text(nodes[0]['kubernetesNode']+'\\n')\n(base/'values/app-node.txt').write_text(nodes[1]['kubernetesNode']+'\\n')\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/generate.stdout.txt" - pattern: "^network_mode=external-nvme$" - save_as: external_nvme_count - - action: assert_greater - actual: "{{ external_nvme_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/helm-template.yaml && grep -q -- '--launcher-external-nvme' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/helm-template.yaml && ! grep -q -- '--launcher-external-iscsi' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/values.nvme.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "set -e; APP_NODE=$(cat /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/app-node.txt); cd {{ product_root }} && SW_BLOCK_BASIC_APP_NODE_SELECTOR=\"$APP_NODE\" SW_BLOCK_BASIC_APP_PROTOCOL=nvme bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "1" - env.SW_BLOCK_INSTALL_MODE: "helm" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/values/values.nvme.yaml" - - - name: live_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok - - action: assert_greater - actual: "{{ first_volume_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/basic-app/first-volume-summary.txt" - pattern: "^app_protocol=nvme$" - save_as: app_protocol_nvme - - action: assert_greater - actual: "{{ app_protocol_nvme }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/basic-app/first-volume-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified - - action: assert_greater - actual: "{{ writer_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/basic-app/first-volume-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified - - action: assert_greater - actual: "{{ reader_verified }}" - threshold: "0" - - action: exec - node: m02 - timeout: 2m - cmd: "set -e; B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live; python3 - <<'PY'\nfrom pathlib import Path\nimport json\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live')\nblock_node=(base/'values/blockvolume-node.txt').read_text().strip()\napp_node=(base/'values/app-node.txt').read_text().strip()\nsummary=(base/'basic-app/first-volume-summary.txt').read_text()\nreport=(base/'basic-app/status/report/summary.txt').read_text()\ncluster=json.load(open(base/'basic-app/status/cluster-evidence.json'))\nvols=cluster.get('volumes') or []\nif not vols:\n raise SystemExit('no volumes in cluster evidence')\nvol=vols[0]\ntarget=vol.get('publish_target') or ''\nraw_status=vol.get('status') or ''\nif block_node == app_node:\n raise SystemExit(f'not cross-node: {block_node}')\nif target.startswith('127.') or target.startswith('localhost'):\n raise SystemExit(f'loopback target: {target}')\nif ':4420' not in target:\n raise SystemExit(f'unexpected nvme target: {target}')\nif 'managed_volume=' not in report or ' status=ready reason=first_volume_verified' not in report:\n raise SystemExit('managed-volume report did not surface ready/first_volume_verified')\nif 'managed_volume_nvme=' not in report or target not in report:\n raise SystemExit('managed-volume NVMe report missing publish target')\ntext='\\n'.join([\n 'phase106_nvme_tcp_cross_node_live_status=ok',\n f'blockvolume_node={block_node}',\n f'app_node={app_node}',\n f'publish_target={target}',\n 'publish_target_loopback=false',\n 'protocol=nvme',\n f'raw_cluster_status={raw_status}',\n 'managed_volume_status=ready',\n 'managed_volume_reason=first_volume_verified',\n 'writer_verified=true' if 'writer_verified=true' in summary else 'writer_verified=false',\n 'reader_verified=true' if 'reader_verified=true' in summary else 'reader_verified=false',\n])+'\\n'\n(base/'asserts/phase106-live-summary.txt').write_text(text)\nPY" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/asserts/phase106-live-summary.txt" - pattern: "^phase106_nvme_tcp_cross_node_live_status=ok$" - save_as: live_ok - - action: assert_greater - actual: "{{ live_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/asserts/phase106-live-summary.txt" - pattern: "^publish_target_loopback=false$" - save_as: non_loopback - - action: assert_greater - actual: "{{ non_loopback }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 45s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live/cleanup/helm-uninstall.txt || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 3m - cmd: "kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=45s || true; kubectl delete storageclass sw-block-example --ignore-not-found=true --wait=true --timeout=45s || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 1m - cmd: "kubectl get pv --no-headers | awk '/sw-block-example/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-example/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 1m - cmd: "sleep 5; kubectl get pv --no-headers | awk '/sw-block-example/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-example/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 1m - cmd: "sleep 10; kubectl get pv --no-headers | awk '/sw-block-example/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-example/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-live" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-isolation-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-isolation-chain.yaml deleted file mode 100644 index 5872dec366..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-isolation-chain.yaml +++ /dev/null @@ -1,182 +0,0 @@ -name: nvme-tcp-cross-node-multivolume-isolation-chain -timeout: 45m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - volume_count: "2" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/asserts /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && if docker image inspect sw-block:local sw-block-csi:local >/dev/null 2>&1; then mkdir -p \"$SW_BLOCK_ARTIFACT_DIR\"; echo \"SW_BLOCK_IMAGE_ID=$(docker image inspect sw-block:local --format '{{.Id}}')\" > \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; echo \"SW_BLOCK_CSI_IMAGE_ID=$(docker image inspect sw-block-csi:local --format '{{.Id}}')\" >> \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; echo cached_images=true >> \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; else bash scripts/build-alpha-images.sh {{ product_root }}; fi" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: generate_values - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/values.nvme.yaml --image sw-block:local --csi-image sw-block-csi:local --protocol nvme --node-limit 2 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume')\nnodes=[]\ncur=None\nfor raw in (base/'values/values.nvme.yaml').read_text().splitlines():\n line=raw.strip()\n if line.startswith('- name:'):\n if cur:\n nodes.append(cur)\n cur={}\n if cur is None:\n continue\n if line.startswith('kubernetesNode:'):\n cur['kubernetesNode']=line.split(':',1)[1].strip().strip('\"')\nif cur:\n nodes.append(cur)\nif len(nodes) < 2:\n raise SystemExit('need at least two generated nodes')\n(base/'values/blockvolume-node.txt').write_text(nodes[0]['kubernetesNode']+'\\n')\n(base/'values/app-node.txt').write_text(nodes[1]['kubernetesNode']+'\\n')\nPY" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/generate.stdout.txt" - pattern: "^network_mode=external-nvme$" - save_as: external_nvme_count - - action: assert_greater - actual: "{{ external_nvme_count }}" - threshold: "0" - - - name: helm_install_stack - actions: - - action: exec - node: m02 - timeout: 12m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/helm-template.yaml && grep -q -- '--launcher-external-nvme' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/helm-template.yaml && ! grep -q -- '--launcher-external-iscsi' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/values.nvme.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: multi_volume_user_loop - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "set -e; APP_NODE=$(cat /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/values/app-node.txt); cd {{ product_root }} && SW_BLOCK_MULTI_VOLUME_NODE_SELECTOR=\"$APP_NODE\" SW_BLOCK_MULTI_VOLUME_PROTOCOL=nvme bash scripts/run-multi-volume-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume" - env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" - env.SW_BLOCK_MULTI_VOLUME_CLEANUP: "0" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume/multi-volume-summary.txt" - pattern: "^multi_volume_status=ok$" - save_as: multi_volume_ok - - action: assert_greater - actual: "{{ multi_volume_ok }}" - threshold: "0" - - - name: isolation_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume/multi-volume-summary.txt" - pattern: "^protocol=nvme$" - save_as: protocol_nvme - - action: assert_greater - actual: "{{ protocol_nvme }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume/multi-volume-summary.txt" - pattern: "^writer_verified_count=2$" - save_as: writer_count_ok - - action: assert_greater - actual: "{{ writer_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume/multi-volume-summary.txt" - pattern: "^reader_verified_count=2$" - save_as: reader_count_ok - - action: assert_greater - actual: "{{ reader_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/multi-volume/multi-volume-summary.txt" - pattern: "^managed_volume_count=2$" - save_as: managed_volume_count_ok - - action: assert_greater - actual: "{{ managed_volume_count_ok }}" - threshold: "0" - - action: exec - node: m02 - timeout: 2m - cmd: "python3 - <<'PY'\nfrom pathlib import Path\nimport re\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume')\napp_node=(base/'values/app-node.txt').read_text().strip()\nsummary=(base/'multi-volume/status/report/summary.txt').read_text().splitlines()\nmanaged=[line for line in summary if line.startswith('managed_volume=')]\nnvme=[line for line in summary if line.startswith('managed_volume_nvme=')]\nif len(managed) != 2:\n raise SystemExit(f'managed_volume_count={len(managed)}')\nif len(nvme) != 2:\n raise SystemExit(f'nvme_line_count={len(nvme)}')\nready=[line for line in managed if ' status=ready ' in line and ' reason=first_volume_verified' in line]\nif len(ready) != 2:\n raise SystemExit('not all managed volumes are ready/first_volume_verified')\nids=[]\nnqns=[]\naddrs=[]\nfor line in managed:\n m=re.match(r'managed_volume=([^ ]+)', line)\n if m:\n ids.append(m.group(1))\nfor line in nvme:\n for key, sink in [('nqn', nqns), ('addr', addrs)]:\n m=re.search(rf' {key}=([^ ]+)', line)\n if m:\n sink.append(m.group(1))\nif len(set(ids)) != 2:\n raise SystemExit(f'volume identity collapsed: {ids}')\nif len(set(nqns)) != 2:\n raise SystemExit(f'nqn identity collapsed: {nqns}')\nif any(a.startswith('127.') or a.startswith('localhost') for a in addrs):\n raise SystemExit(f'loopback nvme addr observed: {addrs}')\nif not all(':4420' in a or ':442' in a for a in addrs):\n raise SystemExit(f'unexpected nvme addrs: {addrs}')\ntext='\\n'.join([\n 'phase107_nvme_tcp_multivolume_isolation_status=ok',\n f'app_node={app_node}',\n 'protocol=nvme',\n 'managed_volume_count=2',\n 'writer_verified_count=2',\n 'reader_verified_count=2',\n 'managed_volume_status=ready',\n 'managed_volume_reason=first_volume_verified',\n f'distinct_volume_ids={len(set(ids))}',\n f'distinct_nvme_nqns={len(set(nqns))}',\n 'publish_target_loopback=false',\n 'cross_volume_identity_mixup=false',\n])+'\\n'\n(base/'asserts/phase107-isolation-summary.txt').write_text(text)\nPY" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/asserts/phase107-isolation-summary.txt" - pattern: "^phase107_nvme_tcp_multivolume_isolation_status=ok$" - save_as: isolation_ok - - action: assert_greater - actual: "{{ isolation_ok }}" - threshold: "0" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 45s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume/cleanup/helm-uninstall.txt || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 3m - cmd: "for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 1m - cmd: "kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m02 - timeout: 1m - cmd: "sleep 5; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase107-nvme-multivolume" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-lifecycle-soak-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-lifecycle-soak-chain.yaml index 70173efb34..a320180bd3 100644 --- a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-lifecycle-soak-chain.yaml +++ b/seaweed-block/testops/scenarios/nvme-tcp-cross-node-multivolume-lifecycle-soak-chain.yaml @@ -3,7 +3,12 @@ timeout: 45m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= + import_nodes: "" # extra k3s nodes for the image import; set with -env import_nodes= + node_ssh_key: "" # key path on the test node for the image import; set with -env node_ssh_key= helm_release: "sw-block" helm_namespace: "kube-system" volume_count: "2" @@ -11,39 +16,40 @@ env: topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/asserts /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/bin $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/asserts $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - name: build_and_import_images actions: - action: exec - node: m02 + node: node-a timeout: 10m cmd: "cd {{ product_root }} && if docker image inspect sw-block:local sw-block-csi:local >/dev/null 2>&1; then mkdir -p \"$SW_BLOCK_ARTIFACT_DIR\"; echo \"SW_BLOCK_IMAGE_ID=$(docker image inspect sw-block:local --format '{{.Id}}')\" > \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; echo \"SW_BLOCK_CSI_IMAGE_ID=$(docker image inspect sw-block-csi:local --format '{{.Id}}')\" >> \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; echo cached_images=true >> \"$SW_BLOCK_ARTIFACT_DIR/alpha-images.env\"; else bash scripts/build-alpha-images.sh {{ product_root }}; fi" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/build" + env.SW_BLOCK_IMPORT_K3S_NODES: "{{ import_nodes }}" + env.SW_BLOCK_IMPORT_K3S_SSH_USER: "{{ node_user }}" + env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ node_ssh_key }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/build" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: image_id_count - action: assert_greater @@ -53,13 +59,13 @@ phases: - name: generate_values actions: - action: exec - node: m02 + node: node-a timeout: 4m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml --image sw-block:local --csi-image sw-block-csi:local --protocol nvme --node-limit 2 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle')\nnodes=[]\ncur=None\nfor raw in (base/'values/values.nvme.yaml').read_text().splitlines():\n line=raw.strip()\n if line.startswith('- name:'):\n if cur:\n nodes.append(cur)\n cur={}\n if cur is None:\n continue\n if line.startswith('kubernetesNode:'):\n cur['kubernetesNode']=line.split(':',1)[1].strip().strip('\"')\nif cur:\n nodes.append(cur)\nif len(nodes) < 2:\n raise SystemExit('need at least two generated nodes')\n(base/'values/blockvolume-node.txt').write_text(nodes[0]['kubernetesNode']+'\\n')\n(base/'values/app-node.txt').write_text(nodes[1]['kubernetesNode']+'\\n')\nPY" + cmd: "cd {{ product_root }} && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/bin/sw-block ./cmd/sw-block && {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml --image sw-block:local --csi-image sw-block-csi:local --protocol nvme --node-limit 2 > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/generate.stdout.txt && python3 - <<'PY'\nfrom pathlib import Path\nbase=Path('{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle')\nnodes=[]\ncur=None\nfor raw in (base/'values/values.nvme.yaml').read_text().splitlines():\n line=raw.strip()\n if line.startswith('- name:'):\n if cur:\n nodes.append(cur)\n cur={}\n if cur is None:\n continue\n if line.startswith('kubernetesNode:'):\n cur['kubernetesNode']=line.split(':',1)[1].strip().strip('\"')\nif cur:\n nodes.append(cur)\nif len(nodes) < 2:\n raise SystemExit('need at least two generated nodes')\n(base/'values/blockvolume-node.txt').write_text(nodes[0]['kubernetesNode']+'\\n')\n(base/'values/app-node.txt').write_text(nodes[1]['kubernetesNode']+'\\n')\nPY" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/generate.stdout.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/generate.stdout.txt" pattern: "^network_mode=external-nvme$" save_as: external_nvme_count - action: assert_greater @@ -69,13 +75,13 @@ phases: - name: helm_install_stack actions: - action: exec - node: m02 + node: node-a timeout: 12m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-template.yaml && grep -q -- '--launcher-external-nvme' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-template.yaml && ! grep -q -- '--launcher-external-iscsi' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/kube-system.after-install.txt" + cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-template.yaml && grep -q -- '--launcher-external-nvme' {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-template.yaml && ! grep -q -- '--launcher-external-iscsi' {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/values/values.nvme.yaml --wait --timeout 10m > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/kube-system.after-install.txt" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-install.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/install/helm-install.txt" pattern: "STATUS: deployed" save_as: helm_deployed_count - action: assert_greater @@ -85,17 +91,17 @@ phases: - name: lifecycle_soak actions: - action: exec - node: m02 + node: node-a timeout: 20m - cmd: "set -e; BASE=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle; APP_NODE=$(cat \"$BASE/values/app-node.txt\"); cd {{ product_root }}; for cycle in $(seq 1 {{ cycle_count }}); do mkdir -p \"$BASE/cycle-$cycle\"; SW_BLOCK_ARTIFACT_DIR=\"$BASE/cycle-$cycle\" SW_BLOCK_MULTI_VOLUME_NODE_SELECTOR=\"$APP_NODE\" SW_BLOCK_MULTI_VOLUME_PROTOCOL=nvme SW_BLOCK_MULTI_VOLUME_COUNT={{ volume_count }} SW_BLOCK_MULTI_VOLUME_CLEANUP=1 SW_BLOCK_CLI=\"$BASE/bin/sw-block\" bash scripts/run-multi-volume-example.sh {{ product_root }}; sudo -n nvme list-subsys > \"$BASE/cycle-$cycle/nvme-list-subsys.after-cleanup.txt\" 2>&1 || true; kubectl -n default get pods,pvc -o wide > \"$BASE/cycle-$cycle/default.after-cleanup.txt\" 2>&1 || true; kubectl get pv -o wide > \"$BASE/cycle-$cycle/pv.after-cleanup.txt\" 2>&1 || true; kubectl get storageclass sw-block-multi > \"$BASE/cycle-$cycle/storageclass.after-cleanup.txt\" 2>&1 || true; done" + cmd: "set -e; BASE={{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle; APP_NODE=$(cat \"$BASE/values/app-node.txt\"); cd {{ product_root }}; for cycle in $(seq 1 {{ cycle_count }}); do mkdir -p \"$BASE/cycle-$cycle\"; SW_BLOCK_ARTIFACT_DIR=\"$BASE/cycle-$cycle\" SW_BLOCK_MULTI_VOLUME_NODE_SELECTOR=\"$APP_NODE\" SW_BLOCK_MULTI_VOLUME_PROTOCOL=nvme SW_BLOCK_MULTI_VOLUME_COUNT={{ volume_count }} SW_BLOCK_MULTI_VOLUME_CLEANUP=1 SW_BLOCK_CLI=\"$BASE/bin/sw-block\" bash scripts/run-multi-volume-example.sh {{ product_root }}; sudo -n nvme list-subsys > \"$BASE/cycle-$cycle/nvme-list-subsys.after-cleanup.txt\" 2>&1 || true; kubectl -n default get pods,pvc -o wide > \"$BASE/cycle-$cycle/default.after-cleanup.txt\" 2>&1 || true; kubectl get pv -o wide > \"$BASE/cycle-$cycle/pv.after-cleanup.txt\" 2>&1 || true; kubectl get storageclass sw-block-multi > \"$BASE/cycle-$cycle/storageclass.after-cleanup.txt\" 2>&1 || true; done" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: exec - node: m02 + node: node-a timeout: 3m - cmd: "python3 - <<'PY'\nfrom pathlib import Path\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle')\ncycle_count={{ cycle_count }}\nvolume_count={{ volume_count }}\nlines=['phase108_nvme_tcp_multivolume_lifecycle_soak_status=ok', f'cycle_count={cycle_count}', f'volume_count_per_cycle={volume_count}']\nfor cycle in range(1, cycle_count+1):\n summary={}\n for raw in (base/f'cycle-{cycle}/multi-volume-summary.txt').read_text().splitlines():\n if '=' in raw:\n k,v=raw.split('=',1)\n summary[k]=v\n nvme_text=(base/f'cycle-{cycle}/nvme-list-subsys.after-cleanup.txt').read_text(errors='ignore')\n default_text=(base/f'cycle-{cycle}/default.after-cleanup.txt').read_text(errors='ignore')\n pv_text=(base/f'cycle-{cycle}/pv.after-cleanup.txt').read_text(errors='ignore')\n sc_text=(base/f'cycle-{cycle}/storageclass.after-cleanup.txt').read_text(errors='ignore')\n if summary.get('multi_volume_status') != 'ok':\n raise SystemExit(f'cycle {cycle} status={summary.get(\"multi_volume_status\")}')\n if summary.get('cleanup_status') != 'ok':\n raise SystemExit(f'cycle {cycle} cleanup={summary.get(\"cleanup_status\")}')\n if summary.get('writer_verified_count') != str(volume_count):\n raise SystemExit(f'cycle {cycle} writer_count={summary.get(\"writer_verified_count\")}')\n if summary.get('reader_verified_count') != str(volume_count):\n raise SystemExit(f'cycle {cycle} reader_count={summary.get(\"reader_verified_count\")}')\n nvme_residue=nvme_text.count('nqn.2026-05.io.seaweedfs')\n pvc_residue=default_text.count('sw-block-multi-pvc')\n pod_residue=default_text.count('sw-block-multi-reader') + default_text.count('sw-block-multi-writer')\n pv_residue=pv_text.count('sw-block-multi-pvc')\n sc_residue=0 if 'not found' in sc_text.lower() else sc_text.count('sw-block-multi')\n if any([nvme_residue, pvc_residue, pod_residue, pv_residue, sc_residue]):\n raise SystemExit(f'cycle {cycle} residue nvme={nvme_residue} pvc={pvc_residue} pod={pod_residue} pv={pv_residue} sc={sc_residue}')\n lines += [\n f'cycle_{cycle}_status=ok',\n f'cycle_{cycle}_writer_verified_count={summary.get(\"writer_verified_count\")}',\n f'cycle_{cycle}_reader_verified_count={summary.get(\"reader_verified_count\")}',\n f'cycle_{cycle}_cleanup_status=ok',\n f'cycle_{cycle}_nvme_residue_count=0',\n f'cycle_{cycle}_k8s_residue_count=0',\n ]\n(base/'asserts/phase108-lifecycle-soak-summary.txt').write_text('\\n'.join(lines)+'\\n')\nPY" + cmd: "python3 - <<'PY'\nfrom pathlib import Path\nbase=Path('{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle')\ncycle_count={{ cycle_count }}\nvolume_count={{ volume_count }}\nlines=['phase108_nvme_tcp_multivolume_lifecycle_soak_status=ok', f'cycle_count={cycle_count}', f'volume_count_per_cycle={volume_count}']\nfor cycle in range(1, cycle_count+1):\n summary={}\n for raw in (base/f'cycle-{cycle}/multi-volume-summary.txt').read_text().splitlines():\n if '=' in raw:\n k,v=raw.split('=',1)\n summary[k]=v\n nvme_text=(base/f'cycle-{cycle}/nvme-list-subsys.after-cleanup.txt').read_text(errors='ignore')\n default_text=(base/f'cycle-{cycle}/default.after-cleanup.txt').read_text(errors='ignore')\n pv_text=(base/f'cycle-{cycle}/pv.after-cleanup.txt').read_text(errors='ignore')\n sc_text=(base/f'cycle-{cycle}/storageclass.after-cleanup.txt').read_text(errors='ignore')\n if summary.get('multi_volume_status') != 'ok':\n raise SystemExit(f'cycle {cycle} status={summary.get(\"multi_volume_status\")}')\n if summary.get('cleanup_status') != 'ok':\n raise SystemExit(f'cycle {cycle} cleanup={summary.get(\"cleanup_status\")}')\n if summary.get('writer_verified_count') != str(volume_count):\n raise SystemExit(f'cycle {cycle} writer_count={summary.get(\"writer_verified_count\")}')\n if summary.get('reader_verified_count') != str(volume_count):\n raise SystemExit(f'cycle {cycle} reader_count={summary.get(\"reader_verified_count\")}')\n nvme_residue=nvme_text.count('nqn.2026-05.io.seaweedfs')\n pvc_residue=default_text.count('sw-block-multi-pvc')\n pod_residue=default_text.count('sw-block-multi-reader') + default_text.count('sw-block-multi-writer')\n pv_residue=pv_text.count('sw-block-multi-pvc')\n sc_residue=0 if 'not found' in sc_text.lower() else sc_text.count('sw-block-multi')\n if any([nvme_residue, pvc_residue, pod_residue, pv_residue, sc_residue]):\n raise SystemExit(f'cycle {cycle} residue nvme={nvme_residue} pvc={pvc_residue} pod={pod_residue} pv={pv_residue} sc={sc_residue}')\n lines += [\n f'cycle_{cycle}_status=ok',\n f'cycle_{cycle}_writer_verified_count={summary.get(\"writer_verified_count\")}',\n f'cycle_{cycle}_reader_verified_count={summary.get(\"reader_verified_count\")}',\n f'cycle_{cycle}_cleanup_status=ok',\n f'cycle_{cycle}_nvme_residue_count=0',\n f'cycle_{cycle}_k8s_residue_count=0',\n ]\n(base/'asserts/phase108-lifecycle-soak-summary.txt').write_text('\\n'.join(lines)+'\\n')\nPY" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/asserts/phase108-lifecycle-soak-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/asserts/phase108-lifecycle-soak-summary.txt" pattern: "^phase108_nvme_tcp_multivolume_lifecycle_soak_status=ok$" save_as: lifecycle_soak_ok - action: assert_greater @@ -106,13 +112,14 @@ phases: always: true actions: - action: exec - node: m02 + node: node-a timeout: 3m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 120s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup/verify bash scripts/verify-helm-cleanup.sh {{ product_root }}" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 120s > $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup/helm-uninstall.txt || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=$SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup/verify bash scripts/verify-helm-cleanup.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup/verify/cleanup-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle/cleanup/verify/cleanup-summary.txt" pattern: "^cleanup_status=ok$" save_as: cleanup_ok - action: assert_greater @@ -123,7 +130,7 @@ phases: always: true actions: - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase108-nvme-lifecycle" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-publish-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-cross-node-publish-chain.yaml deleted file mode 100644 index 8984d19b62..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-cross-node-publish-chain.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: nvme-tcp-cross-node-publish-chain -timeout: 20m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: publish_gate - actions: - - action: exec - node: m02 - timeout: 15m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish && cd {{ product_root }} && bash scripts/run-phase106-nvme-tcp-cross-node-publish-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^phase106_nvme_tcp_cross_node_publish_status=ok$" - save_as: phase106_ok - - action: assert_greater - actual: "{{ phase106_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^generated_external_nvme=true$" - save_as: external_nvme - - action: assert_greater - actual: "{{ external_nvme }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^generated_external_iscsi=false$" - save_as: no_external_iscsi_values - - action: assert_greater - actual: "{{ no_external_iscsi_values }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^helm_rendered_launcher_external_nvme=true$" - save_as: helm_external_nvme - - action: assert_greater - actual: "{{ helm_external_nvme }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^helm_rendered_launcher_external_iscsi=false$" - save_as: no_external_iscsi_helm - - action: assert_greater - actual: "{{ no_external_iscsi_helm }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^helm_rendered_chap=false$" - save_as: no_chap - - action: assert_greater - actual: "{{ no_chap }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^live_io_claim=false$" - save_as: no_live_io_claim - - action: assert_greater - actual: "{{ no_live_io_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish/gate/phase106-nvme-tcp-cross-node-publish-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase106-nvme-publish" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-durable-backend-write-batching-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-durable-backend-write-batching-chain.yaml deleted file mode 100644 index b0e32932ee..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-durable-backend-write-batching-chain.yaml +++ /dev/null @@ -1,111 +0,0 @@ -name: nvme-tcp-durable-backend-write-batching-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching SW_BLOCK_PHASE134_SEQ_MIB=64 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase134-durable-backend-write-batching-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^phase134_durable_backend_write_batching_status=ok$" - save_as: phase134_status_ok - - action: assert_greater - actual: "{{ phase134_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^unit_batch_regression_passed=true$" - save_as: unit_passed - - action: assert_greater - actual: "{{ unit_passed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^strict_ack_batch_disabled=true$" - save_as: strict_ack_guard - - action: assert_greater - actual: "{{ strict_ack_guard }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^backend_storage_batch_calls=[1-9][0-9]*$" - save_as: batch_calls - - action: assert_greater - actual: "{{ batch_calls }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^backend_storage_batch_blocks=[1-9][0-9]*$" - save_as: batch_blocks - - action: assert_greater - actual: "{{ batch_blocks }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batching_effective - - action: assert_greater - actual: "{{ batching_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching/phase134-durable-backend-write-batching-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase134-write-batching" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-frontend-request-size-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-frontend-request-size-profile-chain.yaml deleted file mode 100644 index cf14ee4726..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-frontend-request-size-profile-chain.yaml +++ /dev/null @@ -1,143 +0,0 @@ -name: nvme-tcp-frontend-request-size-profile-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size SW_BLOCK_PHASE140_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase140-frontend-request-size-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^phase140_frontend_request_size_profile_status=ok$" - save_as: phase140_status_ok - - action: assert_greater - actual: "{{ phase140_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^unit_target_request_profile_passed=true$" - save_as: unit_passed - - action: assert_greater - actual: "{{ unit_passed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batch_effective - - action: assert_greater - actual: "{{ batch_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^nvme_tcp_max_h2c_data_length_bytes=32768$" - save_as: max_h2c - - action: assert_greater - actual: "{{ max_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^target_write_request_max_bytes=[1-9][0-9]*$" - save_as: target_request_max - - action: assert_greater - actual: "{{ target_request_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^backend_write_request_max_bytes=32768$" - save_as: backend_request_max - - action: assert_greater - actual: "{{ backend_request_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^backend_full_block_batch_max=8$" - save_as: batch_max - - action: assert_greater - actual: "{{ batch_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^frontend_request_size_owner=\\(host_nvme\\|target_limit\\|backend_limit\\|unknown\\)$" - save_as: owner_named - - action: assert_greater - actual: "{{ owner_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^phase140_shape_result=\\(host_limited\\|target_limited\\|backend_limited\\|tunable\\|unknown\\)$" - save_as: shape_result - - action: assert_greater - actual: "{{ shape_result }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^next_recommendation=phase141_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size/phase140-frontend-request-size-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase140-request-size" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-desired-path-change-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-desired-path-change-chain.yaml deleted file mode 100644 index 8d0c24f891..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-desired-path-change-chain.yaml +++ /dev/null @@ -1,162 +0,0 @@ -name: nvme-tcp-k8s-desired-path-change-chain -timeout: 60m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase132-mounted --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase132_gate - actions: - - action: exec - node: m02 - timeout: 45m - cmd: "cd {{ product_root }} && bash scripts/run-phase132-nvme-k8s-desired-path-change-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^phase132_nvme_k8s_desired_path_change_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^initial_path_count=2$" - save_as: initial_two - - action: assert_greater - actual: "{{ initial_two }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^desired_path_set_changed=true$" - save_as: desired_changed - - action: assert_greater - actual: "{{ desired_changed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^path_loss_or_replacement_detected=true$" - save_as: replacement_detected - - action: assert_greater - actual: "{{ replacement_detected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^reconnect_owner=csi-node$" - save_as: owner - - action: assert_greater - actual: "{{ owner }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^reconnect_invoked=true$" - save_as: reconnect_invoked - - action: assert_greater - actual: "{{ reconnect_invoked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^new_desired_path_connected=true$" - save_as: new_path_connected - - action: assert_greater - actual: "{{ new_path_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^pod_uid_preserved=true$" - save_as: uid_preserved - - action: assert_greater - actual: "{{ uid_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^mounted_io_after_reconnect=ok$" - save_as: io_ok - - action: assert_greater - actual: "{{ io_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^crd_status_agrees=true$" - save_as: crd_agrees - - action: assert_greater - actual: "{{ crd_agrees }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^report_dashboard_agree=true$" - save_as: report_dashboard_agree - - action: assert_greater - actual: "{{ report_dashboard_agree }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change/gate/phase132-nvme-k8s-desired-path-change-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase132-nvme-desired-path-change" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-loss-io-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-loss-io-chain.yaml deleted file mode 100644 index ceee0937cc..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-loss-io-chain.yaml +++ /dev/null @@ -1,122 +0,0 @@ -name: nvme-tcp-k8s-mounted-path-loss-io-chain -timeout: 50m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase112-mounted --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase112_gate - actions: - - action: exec - node: m02 - timeout: 35m - cmd: "cd {{ product_root }} && bash scripts/run-phase112-nvme-k8s-mounted-path-loss-io-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^phase112_nvme_k8s_mounted_path_loss_io_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^mounted_pod_uid_preserved=true$" - save_as: uid_preserved - - action: assert_greater - actual: "{{ uid_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^mounted_io_after_path_loss=ok$" - save_as: mounted_io_ok - - action: assert_greater - actual: "{{ mounted_io_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^after_path_count=1$" - save_as: after_one_path - - action: assert_greater - actual: "{{ after_one_path }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^crd_reason=nvme_multipath_path_missing$" - save_as: crd_reason - - action: assert_greater - actual: "{{ crd_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^surface_ready_true_count=0$" - save_as: no_ready_true - - action: assert_greater - actual: "{{ no_ready_true }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io/gate/phase112-nvme-k8s-mounted-path-loss-io-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase112-nvme-mounted-path-loss-io" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-restore-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-restore-chain.yaml deleted file mode 100644 index 0db5acceb6..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-mounted-path-restore-chain.yaml +++ /dev/null @@ -1,154 +0,0 @@ -name: nvme-tcp-k8s-mounted-path-restore-chain -timeout: 60m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase112-mounted sw-block-phase113-mounted --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase113_gate - actions: - - action: exec - node: m02 - timeout: 45m - cmd: "cd {{ product_root }} && bash scripts/run-phase113-nvme-k8s-mounted-path-restore-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^phase113_nvme_k8s_mounted_path_restore_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^mounted_pod_uid_preserved=true$" - save_as: uid_preserved_after_loss - - action: assert_greater - actual: "{{ uid_preserved_after_loss }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^mounted_io_after_path_loss=ok$" - save_as: mounted_io_after_loss - - action: assert_greater - actual: "{{ mounted_io_after_loss }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^after_path_count=1$" - save_as: after_one_path - - action: assert_greater - actual: "{{ after_one_path }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^crd_reason=nvme_multipath_path_missing$" - save_as: degraded_reason - - action: assert_greater - actual: "{{ degraded_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^mounted_pod_uid_preserved_after_restore=true$" - save_as: uid_preserved_after_restore - - action: assert_greater - actual: "{{ uid_preserved_after_restore }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^mounted_io_after_restore=ok$" - save_as: mounted_io_after_restore - - action: assert_greater - actual: "{{ mounted_io_after_restore }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^restored_path_count=2$" - save_as: restored_two_paths - - action: assert_greater - actual: "{{ restored_two_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^restore_crd_reason=first_volume_verified$" - save_as: restore_crd_reason - - action: assert_greater - actual: "{{ restore_crd_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^surface_ready_true_count=0$" - save_as: no_ready_true_while_degraded - - action: assert_greater - actual: "{{ no_ready_true_while_degraded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore/gate/phase113-nvme-k8s-mounted-path-restore-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase113-nvme-mounted-path-restore" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-churn-soak-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-churn-soak-chain.yaml deleted file mode 100644 index 69591eb707..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-churn-soak-chain.yaml +++ /dev/null @@ -1,138 +0,0 @@ -name: nvme-tcp-k8s-multivolume-mounted-path-churn-soak-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase115-mounted-1 sw-block-phase115-mounted-2 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; for i in 1 2; do kubectl -n default delete pod sw-block-multi-reader-$i sw-block-multi-writer-$i --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase115_gate - actions: - - action: exec - node: m02 - timeout: 75m - cmd: "cd {{ product_root }} && bash scripts/run-phase115-nvme-k8s-multivolume-mounted-path-churn-soak-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^phase115_nvme_k8s_multivolume_mounted_path_churn_soak_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^cycle_count=3$" - save_as: cycle_count - - action: assert_greater - actual: "{{ cycle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^mounted_pods_preserved=true$" - save_as: pods_preserved - - action: assert_greater - actual: "{{ pods_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^mounted_io_after_loss_count=6$" - save_as: mounted_io_loss - - action: assert_greater - actual: "{{ mounted_io_loss }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^mounted_io_after_restore_count=6$" - save_as: mounted_io_restore - - action: assert_greater - actual: "{{ mounted_io_restore }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^cross_volume_reason_mixup=false$" - save_as: no_reason_mixup - - action: assert_greater - actual: "{{ no_reason_mixup }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^cross_volume_publish_target_mixup=false$" - save_as: no_target_mixup - - action: assert_greater - actual: "{{ no_target_mixup }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^all_restored_path_count=2$" - save_as: restored_paths - - action: assert_greater - actual: "{{ restored_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak/gate/phase115-nvme-k8s-multivolume-mounted-path-churn-soak-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase115-nvme-multivolume-mounted-path-churn-soak" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-isolation-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-isolation-chain.yaml deleted file mode 100644 index 1f20a97286..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-multivolume-mounted-path-isolation-chain.yaml +++ /dev/null @@ -1,154 +0,0 @@ -name: nvme-tcp-k8s-multivolume-mounted-path-isolation-chain -timeout: 70m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase114-mounted-1 sw-block-phase114-mounted-2 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; for i in 1 2; do kubectl -n default delete pod sw-block-multi-reader-$i sw-block-multi-writer-$i --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase114_gate - actions: - - action: exec - node: m02 - timeout: 55m - cmd: "cd {{ product_root }} && bash scripts/run-phase114-nvme-k8s-multivolume-mounted-path-isolation-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^phase114_nvme_k8s_multivolume_mounted_path_isolation_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^mounted_pods_preserved_after_loss=true$" - save_as: pods_preserved_after_loss - - action: assert_greater - actual: "{{ pods_preserved_after_loss }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^mounted_io_after_loss_count=2$" - save_as: mounted_io_after_loss - - action: assert_greater - actual: "{{ mounted_io_after_loss }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^degraded_volume_path_count=1$" - save_as: degraded_path_count - - action: assert_greater - actual: "{{ degraded_path_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^untouched_volume_path_count=2$" - save_as: untouched_path_count - - action: assert_greater - actual: "{{ untouched_path_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^cross_volume_reason_mixup=false$" - save_as: no_cross_reason - - action: assert_greater - actual: "{{ no_cross_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^mounted_pods_preserved_after_restore=true$" - save_as: pods_preserved_after_restore - - action: assert_greater - actual: "{{ pods_preserved_after_restore }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^mounted_io_after_restore_count=2$" - save_as: mounted_io_after_restore - - action: assert_greater - actual: "{{ mounted_io_after_restore }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^restored_volume_count=2$" - save_as: restored_volume_count - - action: assert_greater - actual: "{{ restored_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^restored_all_path_count=2$" - save_as: restored_path_count - - action: assert_greater - actual: "{{ restored_path_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation/gate/phase114-nvme-k8s-multivolume-mounted-path-isolation-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase114-nvme-multivolume-mounted-path-isolation" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-path-loss-crd-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-path-loss-crd-chain.yaml deleted file mode 100644 index e8a8e65a64..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-path-loss-crd-chain.yaml +++ /dev/null @@ -1,114 +0,0 @@ -name: nvme-tcp-k8s-path-loss-crd-chain -timeout: 50m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase111_gate - actions: - - action: exec - node: m02 - timeout: 35m - cmd: "cd {{ product_root }} && bash scripts/run-phase111-nvme-k8s-path-loss-crd-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate/phase111-nvme-k8s-path-loss-crd-summary.txt" - pattern: "^phase111_nvme_k8s_path_loss_crd_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate/phase111-nvme-k8s-path-loss-crd-summary.txt" - pattern: "^before_path_count=2$" - save_as: before_two_paths - - action: assert_greater - actual: "{{ before_two_paths }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate/phase111-nvme-k8s-path-loss-crd-summary.txt" - pattern: "^after_path_count=1$" - save_as: after_one_path - - action: assert_greater - actual: "{{ after_one_path }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate/phase111-nvme-k8s-path-loss-crd-summary.txt" - pattern: "^crd_reason=nvme_multipath_path_missing$" - save_as: crd_reason - - action: assert_greater - actual: "{{ crd_reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate/phase111-nvme-k8s-path-loss-crd-summary.txt" - pattern: "^surface_ready_true_count=0$" - save_as: no_ready_true - - action: assert_greater - actual: "{{ no_ready_true }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd/gate/phase111-nvme-k8s-path-loss-crd-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase111-nvme-k8s-path-loss-crd" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-reconnect-live-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-reconnect-live-chain.yaml deleted file mode 100644 index ab7d432138..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-reconnect-live-chain.yaml +++ /dev/null @@ -1,146 +0,0 @@ -name: nvme-tcp-k8s-reconnect-live-chain -timeout: 60m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase131-mounted --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase131_gate - actions: - - action: exec - node: m02 - timeout: 45m - cmd: "cd {{ product_root }} && bash scripts/run-phase131-nvme-k8s-reconnect-live-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^phase131_nvme_k8s_reconnect_live_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^initial_path_count=2$" - save_as: initial_two - - action: assert_greater - actual: "{{ initial_two }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^path_loss_detected=true$" - save_as: loss_detected - - action: assert_greater - actual: "{{ loss_detected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^reconnect_invoked=true$" - save_as: reconnect_invoked - - action: assert_greater - actual: "{{ reconnect_invoked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^replacement_path_connected=true$" - save_as: replacement_connected - - action: assert_greater - actual: "{{ replacement_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^pod_uid_preserved=true$" - save_as: uid_preserved - - action: assert_greater - actual: "{{ uid_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^mounted_io_after_reconnect=ok$" - save_as: io_ok - - action: assert_greater - actual: "{{ io_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^crd_status_agrees=true$" - save_as: crd_agrees - - action: assert_greater - actual: "{{ crd_agrees }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^report_dashboard_agree=true$" - save_as: report_dashboard_agree - - action: assert_greater - actual: "{{ report_dashboard_agree }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live/gate/phase131-nvme-k8s-reconnect-live-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase131-nvme-reconnect-live" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-k8s-stale-path-prune-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-k8s-stale-path-prune-chain.yaml deleted file mode 100644 index 1233fd8f90..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-k8s-stale-path-prune-chain.yaml +++ /dev/null @@ -1,178 +0,0 @@ -name: nvme-tcp-k8s-stale-path-prune-chain -timeout: 60m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase133-mounted --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: build_and_import_images - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_DOCKER_NO_CACHE: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: image_id_count - - action: assert_greater - actual: "{{ image_id_count }}" - threshold: "0" - - - name: run_phase133_gate - actions: - - action: exec - node: m02 - timeout: 45m - cmd: "cd {{ product_root }} && bash scripts/run-phase133-nvme-k8s-stale-path-prune-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^phase133_nvme_k8s_stale_path_prune_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^initial_path_count=2$" - save_as: initial_two - - action: assert_greater - actual: "{{ initial_two }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^desired_path_set_changed=true$" - save_as: desired_changed - - action: assert_greater - actual: "{{ desired_changed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^reconnect_owner=csi-node$" - save_as: owner - - action: assert_greater - actual: "{{ owner }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^reconnect_invoked=true$" - save_as: reconnect_invoked - - action: assert_greater - actual: "{{ reconnect_invoked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^new_desired_path_connected=true$" - save_as: new_path_connected - - action: assert_greater - actual: "{{ new_path_connected }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^stale_old_host_path_after_desired_change=false$" - save_as: stale_absent - - action: assert_greater - actual: "{{ stale_absent }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^stale_old_path_pruned=true$" - save_as: stale_pruned - - action: assert_greater - actual: "{{ stale_pruned }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^host_path_count_after_prune=2$" - save_as: prune_count_two - - action: assert_greater - actual: "{{ prune_count_two }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^pod_uid_preserved=true$" - save_as: uid_preserved - - action: assert_greater - actual: "{{ uid_preserved }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^mounted_io_after_reconnect=ok$" - save_as: io_ok - - action: assert_greater - actual: "{{ io_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^crd_status_agrees=true$" - save_as: crd_agrees - - action: assert_greater - actual: "{{ crd_agrees }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^report_dashboard_agree=true$" - save_as: report_dashboard_agree - - action: assert_greater - actual: "{{ report_dashboard_agree }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune/gate/phase133-nvme-k8s-stale-path-prune-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase133-nvme-stale-path-prune" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-large-h2c-retriage-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-large-h2c-retriage-chain.yaml deleted file mode 100644 index a81f6ef32c..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-large-h2c-retriage-chain.yaml +++ /dev/null @@ -1,231 +0,0 @@ -name: nvme-tcp-large-h2c-retriage-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c SW_BLOCK_PHASE142_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE142_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase142-nvme-tcp-large-h2c-retriage-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^phase142_nvme_tcp_large_h2c_retriage_status=ok$" - save_as: phase142_status_ok - - action: assert_greater - actual: "{{ phase142_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^phase142_contract_tests=pass$" - save_as: contract_tests - - action: assert_greater - actual: "{{ contract_tests }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^helm_candidate_max_h2c_data_length=65536$" - save_as: helm_candidate_64k - - action: assert_greater - actual: "{{ helm_candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^host_connects_candidate=true$" - save_as: host_connects - - action: assert_greater - actual: "{{ host_connects }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified - - action: assert_greater - actual: "{{ writer_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified - - action: assert_greater - actual: "{{ reader_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^backend_full_block_batch_max=[1-9][0-9]*$" - save_as: full_block_batch - - action: assert_greater - actual: "{{ full_block_batch }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^wal_append_writeat_max_bytes=[1-9][0-9]*$" - save_as: wal_writeat_max - - action: assert_greater - actual: "{{ wal_writeat_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^wal_copy_duration_ms=[0-9][0-9]*$" - save_as: wal_copy_counter - - action: assert_greater - actual: "{{ wal_copy_counter }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^wal_append_duration_ms=[0-9][0-9]*$" - save_as: wal_append_counter - - action: assert_greater - actual: "{{ wal_append_counter }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^wal_encode_duration_ms=[0-9][0-9]*$" - save_as: wal_encode_counter - - action: assert_greater - actual: "{{ wal_encode_counter }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^wal_checksum_duration_ms=[0-9][0-9]*$" - save_as: wal_checksum_counter - - action: assert_greater - actual: "{{ wal_checksum_counter }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^dirty_map_update_duration_ms=[0-9][0-9]*$" - save_as: dirty_map_counter - - action: assert_greater - actual: "{{ dirty_map_counter }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^phase142_bottleneck=\\(wal_copy\\|wal_append\\|wal_encode\\|wal_checksum\\|dirty_map\\|frontend_request_size\\|unknown\\)$" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^phase142_decision=\\(document_opt_in\\|broader_compat_gate\\|continue_backend_work\\|blocked\\)$" - save_as: decision_named - - action: assert_greater - actual: "{{ decision_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^next_recommendation=phase143_.*$" - save_as: next_named - - action: assert_greater - actual: "{{ next_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c/phase142-nvme-tcp-large-h2c-retriage-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase142-large-h2c" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-max-h2c-boundary-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-max-h2c-boundary-chain.yaml deleted file mode 100644 index e81d250297..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-max-h2c-boundary-chain.yaml +++ /dev/null @@ -1,143 +0,0 @@ -name: nvme-tcp-max-h2c-boundary-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c SW_BLOCK_PHASE141_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE141_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase141-nvme-tcp-max-h2c-boundary-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^phase141_nvme_tcp_max_h2c_boundary_status=ok$" - save_as: phase141_status_ok - - action: assert_greater - actual: "{{ phase141_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^h2c_contract_tests=pass$" - save_as: contract_tests - - action: assert_greater - actual: "{{ contract_tests }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^icresp_max_h2c_matches_candidate=true$" - save_as: icresp_match - - action: assert_greater - actual: "{{ icresp_match }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^identify_ioccsz_matches_candidate=true$" - save_as: identify_match - - action: assert_greater - actual: "{{ identify_match }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^host_connects_candidate=true$" - save_as: host_connects - - action: assert_greater - actual: "{{ host_connects }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified - - action: assert_greater - actual: "{{ writer_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified - - action: assert_greater - actual: "{{ reader_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^target_write_request_max_bytes=[1-9][0-9]*$" - save_as: target_request_max - - action: assert_greater - actual: "{{ target_request_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^request_size_increase_observed=\\(true\\|false\\)$" - save_as: request_increase_named - - action: assert_greater - actual: "{{ request_increase_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^phase141_decision=\\(keep_32k\\|add_opt_in\\|raise_default\\|blocked\\)$" - save_as: decision_named - - action: assert_greater - actual: "{{ decision_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c/phase141-nvme-tcp-max-h2c-boundary-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase141-h2c" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-multihost-topology-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-multihost-topology-chain.yaml deleted file mode 100644 index f26aed4122..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-multihost-topology-chain.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: nvme-tcp-multihost-topology-chain -timeout: 15m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: topology_gate - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology && cd {{ product_root }} && bash scripts/run-phase105-nvme-tcp-multihost-topology-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^phase105_nvme_tcp_multihost_topology_status=ok$" - save_as: phase105_ok - - action: assert_greater - actual: "{{ phase105_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^read_only=true$" - save_as: read_only - - action: assert_greater - actual: "{{ read_only }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^nvme_cross_node_loopback_status=blocked$" - save_as: blocked - - action: assert_greater - actual: "{{ blocked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^nvme_cross_node_loopback_reason=publish_target_loopback_cross_node$" - save_as: reason - - action: assert_greater - actual: "{{ reason }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^ready_true_count=0$" - save_as: no_ready_true - - action: assert_greater - actual: "{{ no_ready_true }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^safe_action=observe.inspect_publish_target_topology$" - save_as: action - - action: assert_greater - actual: "{{ action }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^iscsi_remediation_recommended=false$" - save_as: no_iscsi_action - - action: assert_greater - actual: "{{ no_iscsi_action }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology/gate/phase105-nvme-tcp-multihost-topology-summary.txt" - pattern: "^live_io_claim=false$" - save_as: no_live_io_claim - - action: assert_greater - actual: "{{ no_live_io_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase105-nvme-topology" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-path-loss-status-surface-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-path-loss-status-surface-chain.yaml index ec4d361b3d..50a490a36c 100644 --- a/seaweed-block/testops/scenarios/nvme-tcp-path-loss-status-surface-chain.yaml +++ b/seaweed-block/testops/scenarios/nvme-tcp-path-loss-status-surface-chain.yaml @@ -3,77 +3,81 @@ timeout: 35m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - name: live_path_loss_source actions: - action: exec - node: m02 + node: node-a timeout: 20m cmd: "cd {{ product_root }} && bash scripts/run-nvme-mounted-failover-smoke.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^phase101_nvme_path_failure_status=ok$" save_as: live_path_loss_ok - action: assert_greater actual: "{{ live_path_loss_ok }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^before_path_count=2$" save_as: before_two_paths - action: assert_greater actual: "{{ before_two_paths }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^after_path_count=1$" save_as: after_one_path - action: assert_greater actual: "{{ after_one_path }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^after_nvme_reason=nvme_multipath_path_missing$" save_as: live_missing_path_reason - action: assert_greater actual: "{{ live_missing_path_reason }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^after_ready_true=false$" save_as: live_no_false_ready - action: assert_greater actual: "{{ live_no_false_ready }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^final_nvme_residue_count=0$" save_as: live_nvme_clean - action: assert_greater @@ -83,11 +87,11 @@ phases: - name: support_surface_replay actions: - action: exec - node: m02 + node: node-a timeout: 5m cmd: | set -eu - ROOT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface + ROOT={{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface GATE="$ROOT/gate" BUNDLE="$ROOT/replay-bundle" SURFACES="$ROOT/surfaces" @@ -116,7 +120,7 @@ phases: python3 - <<'PY' import json from pathlib import Path - root = Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface') + root = Path('{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface') gate_summary = (root / 'gate/phase101-nvme-path-failure-summary.txt').read_text() report_summary = (root / 'surfaces/report/summary.txt').read_text() explain = (root / 'surfaces/explain/v1.txt').read_text() @@ -197,16 +201,16 @@ phases: ]) + '\n') PY - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/asserts/phase110-surface-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/asserts/phase110-surface-summary.txt" pattern: "^phase110_nvme_tcp_path_loss_status_surface_status=ok$" save_as: surface_ok - action: assert_greater actual: "{{ surface_ok }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/asserts/phase110-surface-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/asserts/phase110-surface-summary.txt" pattern: "^surface_ready_true_count=0$" save_as: no_false_ready_surface - action: assert_greater @@ -217,18 +221,18 @@ phases: always: true actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt" pattern: "^final_nvme_residue_count=0$" save_as: nvme_clean ignore_error: true - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-performance-baseline-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-performance-baseline-chain.yaml deleted file mode 100644 index f6368c9ce5..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-performance-baseline-chain.yaml +++ /dev/null @@ -1,128 +0,0 @@ -name: nvme-tcp-performance-baseline-chain -timeout: 40m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase120-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase120-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase120 --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase120/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase120/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 35m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf bash scripts/run-phase120-nvme-tcp-performance-baseline-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "/opt/work/testdev_key" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^phase120_nvme_tcp_performance_baseline_status=ok$" - save_as: phase120_status_ok - - action: assert_greater - actual: "{{ phase120_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^protocol=nvme$" - save_as: protocol_nvme - - action: assert_greater - actual: "{{ protocol_nvme }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^frontend_transport=tcp$" - save_as: frontend_transport_tcp - - action: assert_greater - actual: "{{ frontend_transport_tcp }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^performance_claim_allowed=false$" - save_as: performance_claim_denied - - action: assert_greater - actual: "{{ performance_claim_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: roce_claim_denied - - action: assert_greater - actual: "{{ roce_claim_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^seq_write_mibps=[0-9]" - save_as: seq_write_metric - - action: assert_greater - actual: "{{ seq_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^seq_read_mibps=[0-9]" - save_as: seq_read_metric - - action: assert_greater - actual: "{{ seq_read_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^small_write_iops=[0-9]" - save_as: small_write_metric - - action: assert_greater - actual: "{{ small_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^final_data_verified=true$" - save_as: final_data_verified - - action: assert_greater - actual: "{{ final_data_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf/phase120-nvme-tcp-performance-baseline-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase120-nvme-perf" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-post-batch-retriage-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-post-batch-retriage-chain.yaml deleted file mode 100644 index a91243a453..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-post-batch-retriage-chain.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: nvme-tcp-post-batch-retriage-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch SW_BLOCK_PHASE135_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase135-nvme-tcp-post-batch-retriage-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^phase135_nvme_tcp_post_batch_retriage_status=ok$" - save_as: phase135_status_ok - - action: assert_greater - actual: "{{ phase135_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^profile_comparable_with_phase126=true$" - save_as: comparable_profile - - action: assert_greater - actual: "{{ comparable_profile }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batching_effective - - action: assert_greater - actual: "{{ batching_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^post_batch_bottleneck=\\(backend_write\\|backend_sync\\|target_protocol\\|unknown\\)$" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^next_recommendation=phase136_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch/phase135-nvme-tcp-post-batch-retriage-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase135-post-batch" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-reduce-wal-record-encode-copy-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-reduce-wal-record-encode-copy-chain.yaml deleted file mode 100644 index d510ae1820..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-reduce-wal-record-encode-copy-chain.yaml +++ /dev/null @@ -1,127 +0,0 @@ -name: nvme-tcp-reduce-wal-record-encode-copy-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy SW_BLOCK_PHASE137_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase137-reduce-wal-record-encode-copy-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^phase137_reduce_wal_record_encode_copy_status=ok$" - save_as: phase137_status_ok - - action: assert_greater - actual: "{{ phase137_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^unit_wal_encode_copy_regression_passed=true$" - save_as: unit_passed - - action: assert_greater - actual: "{{ unit_passed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^preencode_data_copy_removed=true$" - save_as: preencode_copy_removed - - action: assert_greater - actual: "{{ preencode_copy_removed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^batch_append_encodes_direct_to_pending=true$" - save_as: direct_batch_encode - - action: assert_greater - actual: "{{ direct_batch_encode }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batch_effective - - action: assert_greater - actual: "{{ batch_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^wal_encode_copy_reduced_vs_phase136=true$" - save_as: encode_copy_reduced - - action: assert_greater - actual: "{{ encode_copy_reduced }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^post_phase137_bottleneck=\\(wal_copy\\|wal_encode\\|wal_checksum\\|wal_append\\|dirty_map\\|unknown\\)$" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^next_recommendation=phase138_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy/phase137-reduce-wal-record-encode-copy-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase137-wal-encode-copy" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-release-image-smoke-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-release-image-smoke-chain.yaml deleted file mode 100644 index 83ff72027c..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-release-image-smoke-chain.yaml +++ /dev/null @@ -1,139 +0,0 @@ -name: nvme-tcp-release-image-smoke-chain -timeout: 45m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - release_image: "" - release_csi_image: "" - release_commit: "" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-multi-reader-1 sw-block-multi-writer-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-1 --ignore-not-found=true --wait=true --timeout=120s || true; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete deploy -l app=sw-blockvolume --ignore-not-found=true --wait=false || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers 2>/dev/null | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_phase117_gate - actions: - - action: exec - node: m02 - timeout: 40m - cmd: "cd {{ product_root }} && bash scripts/run-phase117-nvme-release-image-smoke-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate" - env.SW_BLOCK_RELEASE_IMAGE: "{{ release_image }}" - env.SW_BLOCK_CSI_RELEASE_IMAGE: "{{ release_csi_image }}" - env.SW_BLOCK_RELEASE_COMMIT: "{{ release_commit }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^phase117_nvme_release_image_smoke_status=ok$" - save_as: gate_ok - - action: assert_greater - actual: "{{ gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^image_pair_commit_match=true$" - save_as: image_pair_match - - action: assert_greater - actual: "{{ image_pair_match }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^helm_values_protocol=nvme$" - save_as: protocol_ok - - action: assert_greater - actual: "{{ protocol_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^stage2_multipath_enabled=true$" - save_as: stage2_ok - - action: assert_greater - actual: "{{ stage2_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_ok - - action: assert_greater - actual: "{{ writer_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_ok - - action: assert_greater - actual: "{{ reader_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^volume_status=ready$" - save_as: status_ok - - action: assert_greater - actual: "{{ status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^volume_reason=first_volume_verified$" - save_as: reason_ok - - action: assert_greater - actual: "{{ reason_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^nvme_path_count=2$" - save_as: path_count_ok - - action: assert_greater - actual: "{{ path_count_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke/gate/phase117-nvme-release-image-smoke-summary.txt" - pattern: "^failure_count=0$" - save_as: failure_zero - - action: assert_greater - actual: "{{ failure_zero }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase117-nvme-release-image-smoke" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-status-surface-evidence-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-status-surface-evidence-chain.yaml index adefb23c10..41dc8e47f1 100644 --- a/seaweed-block/testops/scenarios/nvme-tcp-status-surface-evidence-chain.yaml +++ b/seaweed-block/testops/scenarios/nvme-tcp-status-surface-evidence-chain.yaml @@ -3,46 +3,52 @@ timeout: 45m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= + import_nodes: "" # extra k3s nodes for the image import; set with -env import_nodes= + node_ssh_key: "" # key path on the test node for the image import; set with -env node_ssh_key= helm_release: "sw-block" helm_namespace: "kube-system" volume_count: "2" topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n {{ helm_namespace }} get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n {{ helm_namespace }} patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n {{ helm_namespace }} delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n {{ helm_namespace }} delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance={{ helm_release }} --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/multi-volume /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/surfaces /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/asserts /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s || true; kubectl -n {{ helm_namespace }} get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n {{ helm_namespace }} patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n {{ helm_namespace }} delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n {{ helm_namespace }} delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance={{ helm_release }} --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=45s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=45s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=45s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=45s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/values $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/install $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/multi-volume $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/surfaces $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/asserts $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - name: build_and_import_images actions: - action: exec - node: m02 + node: node-a timeout: 10m cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_IMPORT_K3S_NODES: "192.168.1.181" - env.SW_BLOCK_IMPORT_K3S_SSH_USER: "testdev" - env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ ssh_key }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/build" + env.SW_BLOCK_IMPORT_K3S_NODES: "{{ import_nodes }}" + env.SW_BLOCK_IMPORT_K3S_SSH_USER: "{{ node_user }}" + env.SW_BLOCK_IMPORT_K3S_SSH_KEY: "{{ node_ssh_key }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/build" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: image_id_count - action: assert_greater @@ -52,13 +58,13 @@ phases: - name: generate_values actions: - action: exec - node: m02 + node: node-a timeout: 4m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml --image sw-block:local --csi-image sw-block-csi:local --protocol nvme --node-limit 2 > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/generate.stdout.txt && cat >> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml <<'YAML'\noperatorStatus:\n create: true\n dryRun: false\n interval: 5s\nlifecycleOwner:\n create: true\n dryRun: false\n interval: 5s\nYAML\npython3 - <<'PY'\nfrom pathlib import Path\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status')\nnodes=[]\ncur=None\nfor raw in (base/'values/values.nvme.yaml').read_text().splitlines():\n line=raw.strip()\n if line.startswith('- name:'):\n if cur:\n nodes.append(cur)\n cur={}\n if cur is None:\n continue\n if line.startswith('kubernetesNode:'):\n cur['kubernetesNode']=line.split(':',1)[1].strip().strip('\"')\nif cur:\n nodes.append(cur)\nif len(nodes) < 2:\n raise SystemExit('need at least two generated nodes')\n(base/'values/blockvolume-node.txt').write_text(nodes[0]['kubernetesNode']+'\\n')\n(base/'values/app-node.txt').write_text(nodes[1]['kubernetesNode']+'\\n')\nPY" + cmd: "cd {{ product_root }} && go build -o {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ./cmd/sw-block && {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml --image sw-block:local --csi-image sw-block-csi:local --protocol nvme --node-limit 2 > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/generate.stdout.txt && cat >> {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml <<'YAML'\noperatorStatus:\n create: true\n dryRun: false\n interval: 5s\nlifecycleOwner:\n create: true\n dryRun: false\n interval: 5s\nYAML\npython3 - <<'PY'\nfrom pathlib import Path\nbase=Path('{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status')\nnodes=[]\ncur=None\nfor raw in (base/'values/values.nvme.yaml').read_text().splitlines():\n line=raw.strip()\n if line.startswith('- name:'):\n if cur:\n nodes.append(cur)\n cur={}\n if cur is None:\n continue\n if line.startswith('kubernetesNode:'):\n cur['kubernetesNode']=line.split(':',1)[1].strip().strip('\"')\nif cur:\n nodes.append(cur)\nif len(nodes) < 2:\n raise SystemExit('need at least two generated nodes')\n(base/'values/blockvolume-node.txt').write_text(nodes[0]['kubernetesNode']+'\\n')\n(base/'values/app-node.txt').write_text(nodes[1]['kubernetesNode']+'\\n')\nPY" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/generate.stdout.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/generate.stdout.txt" pattern: "^network_mode=external-nvme$" save_as: external_nvme_count - action: assert_greater @@ -68,13 +74,13 @@ phases: - name: helm_install_stack actions: - action: exec - node: m02 + node: node-a timeout: 12m - cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && grep -q -- '--launcher-external-nvme' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && grep -q 'sw-block-operator-status' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && grep -q 'sw-block-lifecycle-owner' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/kube-system.after-install.txt" + cmd: "cd {{ product_root }} && helm lint charts/seaweed-block -f {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-lint.txt && helm template {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} -f {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && grep -q -- '--launcher-external-nvme' {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && grep -q 'sw-block-operator-status' {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && grep -q 'sw-block-lifecycle-owner' {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-template.yaml && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/values.nvme.yaml --wait --timeout 10m > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/kube-system.after-install.txt" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-install.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/install/helm-install.txt" pattern: "STATUS: deployed" save_as: helm_deployed_count - action: assert_greater @@ -84,17 +90,17 @@ phases: - name: multi_volume_user_loop actions: - action: exec - node: m02 + node: node-a timeout: 10m - cmd: "set -e; APP_NODE=$(cat /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/app-node.txt); cd {{ product_root }} && SW_BLOCK_MULTI_VOLUME_NODE_SELECTOR=\"$APP_NODE\" SW_BLOCK_MULTI_VOLUME_PROTOCOL=nvme bash scripts/run-multi-volume-example.sh {{ product_root }}" + cmd: "set -e; APP_NODE=$(cat {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/values/app-node.txt); cd {{ product_root }} && SW_BLOCK_MULTI_VOLUME_NODE_SELECTOR=\"$APP_NODE\" SW_BLOCK_MULTI_VOLUME_PROTOCOL=nvme bash scripts/run-multi-volume-example.sh {{ product_root }}" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/multi-volume" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/multi-volume" env.SW_BLOCK_MULTI_VOLUME_COUNT: "{{ volume_count }}" env.SW_BLOCK_MULTI_VOLUME_CLEANUP: "0" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block" + env.SW_BLOCK_CLI: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/multi-volume/multi-volume-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/multi-volume/multi-volume-summary.txt" pattern: "^multi_volume_status=ok$" save_as: multi_volume_ok - action: assert_greater @@ -104,18 +110,18 @@ phases: - name: surface_agreement actions: - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "set -e; BASE=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status; mkdir -p \"$BASE/surfaces/dashboard\" \"$BASE/surfaces/explain\"; for i in $(seq 1 60); do kubectl -n {{ helm_namespace }} get swblockvolumes -o json > \"$BASE/surfaces/swblockvolumes.json\" 2>/dev/null || true; python3 - <<'PY' \"$BASE/surfaces/swblockvolumes.json\" && exit 0 || true\nimport json, sys\ntry:\n doc=json.load(open(sys.argv[1]))\nexcept Exception:\n raise SystemExit(1)\nitems=doc.get('items') or []\nif len(items) != 2:\n raise SystemExit(1)\nfor item in items:\n st=item.get('status') or {}\n nv=st.get('nvme') or {}\n if st.get('status') != 'ready' or st.get('reasonCode') != 'first_volume_verified':\n raise SystemExit(1)\n if nv.get('protocol') != 'nvme' or not nv.get('nqn') or not nv.get('nvmeAddr') or nv.get('pathCount') != 1:\n raise SystemExit(1)\nPY\nsleep 2; done; echo 'SwBlockVolume NVMe status did not converge' >&2; kubectl -n {{ helm_namespace }} get swblockvolumes -o yaml >&2 || true; exit 1" + cmd: "set -e; BASE={{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status; mkdir -p \"$BASE/surfaces/dashboard\" \"$BASE/surfaces/explain\"; for i in $(seq 1 60); do kubectl -n {{ helm_namespace }} get swblockvolumes -o json > \"$BASE/surfaces/swblockvolumes.json\" 2>/dev/null || true; python3 - <<'PY' \"$BASE/surfaces/swblockvolumes.json\" && exit 0 || true\nimport json, sys\ntry:\n doc=json.load(open(sys.argv[1]))\nexcept Exception:\n raise SystemExit(1)\nitems=doc.get('items') or []\nif len(items) != 2:\n raise SystemExit(1)\nfor item in items:\n st=item.get('status') or {}\n nv=st.get('nvme') or {}\n if st.get('status') != 'ready' or st.get('reasonCode') != 'first_volume_verified':\n raise SystemExit(1)\n if nv.get('protocol') != 'nvme' or not nv.get('nqn') or not nv.get('nvmeAddr') or nv.get('pathCount') != 1:\n raise SystemExit(1)\nPY\nsleep 2; done; echo 'SwBlockVolume NVMe status did not converge' >&2; kubectl -n {{ helm_namespace }} get swblockvolumes -o yaml >&2 || true; exit 1" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "set -e; BASE=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status; /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ops report --from-bundle \"$BASE/multi-volume\" --out \"$BASE/surfaces/report\" > \"$BASE/surfaces/report.stdout.txt\" 2> \"$BASE/surfaces/report.stderr.txt\"; port=$(python3 - <<'PY'\nimport socket\ns=socket.socket(); s.bind(('127.0.0.1',0)); print(s.getsockname()[1]); s.close()\nPY\n); /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ops dashboard --from-bundle \"$BASE/multi-volume\" --listen 127.0.0.1:$port > \"$BASE/surfaces/dashboard/stdout.txt\" 2> \"$BASE/surfaces/dashboard/stderr.txt\" & pid=$!; trap 'kill $pid >/dev/null 2>&1 || true; wait $pid >/dev/null 2>&1 || true' EXIT; for i in $(seq 1 50); do code=$(curl -s -o \"$BASE/surfaces/dashboard/operator-snapshot.json\" -w '%{http_code}' \"http://127.0.0.1:$port/operator-snapshot.json\" || true); [ \"$code\" = 200 ] && break; sleep 0.2; done; python3 - <<'PY'\nfrom pathlib import Path\nimport json, re, subprocess\nbase=Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status')\nsummary=(base/'surfaces/report/summary.txt').read_text()\ncrd=json.loads((base/'surfaces/swblockvolumes.json').read_text())\nsnapshot=json.loads((base/'surfaces/report/operator-snapshot.json').read_text())\ndashboard=json.loads((base/'surfaces/dashboard/operator-snapshot.json').read_text())\ncrd_status=[]\nfor item in crd['items']:\n st=item['status']; nv=st['nvme']\n crd_status.append((st['volumeID'], st['pvcName'], st['status'], st['reasonCode'], st['publishTarget'], nv['protocol'], nv['nqn'], nv['nvmeAddr'], int(nv['pathCount'])))\nif len(crd_status) != 2:\n raise SystemExit('crd count mismatch')\nsummary_nvme=[]\nfor line in summary.splitlines():\n if line.startswith('managed_volume_nvme='):\n parts=dict(re.findall(r'([a-z_]+)=([^ ]+)', line))\n summary_nvme.append((line.split()[0].split('=',1)[1], parts.get('nqn'), parts.get('addr'), int(parts.get('path_count','0'))))\nif len(summary_nvme) != 2:\n raise SystemExit('summary nvme count mismatch')\nfor doc_name, doc in [('snapshot', snapshot), ('dashboard', dashboard)]:\n volumes=doc.get('volumes') or []\n if len(volumes) != 2:\n raise SystemExit(f'{doc_name} volume count={len(volumes)}')\n for volume in volumes:\n st=volume['status']; nv=st.get('nvme') or {}\n if st.get('status') != 'ready' or st.get('reason_code') != 'first_volume_verified':\n raise SystemExit(f'{doc_name} status mismatch {st}')\n if nv.get('protocol') != 'nvme' or not nv.get('nqn') or not nv.get('nvme_addr') or nv.get('path_count') != 1:\n raise SystemExit(f'{doc_name} nvme mismatch {nv}')\nfor volume_id, pvc, status, reason, publish, protocol, nqn, addr, path_count in crd_status:\n if protocol != 'nvme' or status != 'ready' or reason != 'first_volume_verified' or publish != addr or path_count != 1:\n raise SystemExit(f'crd mismatch {volume_id}')\n if f'managed_volume={volume_id} status=ready reason=first_volume_verified' not in summary:\n raise SystemExit(f'summary missing managed volume {volume_id}')\n if f'managed_volume_nvme={volume_id} nqn={nqn}' not in summary or f' addr={addr} ' not in summary:\n raise SystemExit(f'summary missing nvme {volume_id}')\n out=subprocess.check_output(['/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block','ops','explain','volume','--from-bundle',str(base/'multi-volume'),volume_id], text=True)\n (base/f'surfaces/explain/{volume_id}.txt').write_text(out)\n if f'managed_volume {volume_id} status=ready reason=first_volume_verified' not in out:\n raise SystemExit(f'explain missing status {volume_id}')\n if f'managed_volume_nvme protocol=nvme nqn={nqn}' not in out or f'addr={addr}' not in out:\n raise SystemExit(f'explain missing nvme {volume_id}')\ntext='\\n'.join([\n 'phase109_nvme_tcp_status_surface_status=ok',\n 'volume_count=2',\n 'crd_nvme_status_count=2',\n 'report_nvme_status_count=2',\n 'operator_snapshot_nvme_status_count=2',\n 'dashboard_nvme_status_count=2',\n 'explain_nvme_status_count=2',\n 'all_surfaces_status=ready',\n 'all_surfaces_reason=first_volume_verified',\n 'all_surfaces_protocol=nvme',\n 'publish_target_matches_nvme_addr=true',\n 'mutation_allowed=false',\n])+'\\n'\n(base/'asserts/phase109-surface-summary.txt').write_text(text)\nPY" + cmd: "set -e; BASE={{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status; {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ops report --from-bundle \"$BASE/multi-volume\" --out \"$BASE/surfaces/report\" > \"$BASE/surfaces/report.stdout.txt\" 2> \"$BASE/surfaces/report.stderr.txt\"; port=$(python3 - <<'PY'\nimport socket\ns=socket.socket(); s.bind(('127.0.0.1',0)); print(s.getsockname()[1]); s.close()\nPY\n); {{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block ops dashboard --from-bundle \"$BASE/multi-volume\" --listen 127.0.0.1:$port > \"$BASE/surfaces/dashboard/stdout.txt\" 2> \"$BASE/surfaces/dashboard/stderr.txt\" & pid=$!; trap 'kill $pid >/dev/null 2>&1 || true; wait $pid >/dev/null 2>&1 || true' EXIT; for i in $(seq 1 50); do code=$(curl -s -o \"$BASE/surfaces/dashboard/operator-snapshot.json\" -w '%{http_code}' \"http://127.0.0.1:$port/operator-snapshot.json\" || true); [ \"$code\" = 200 ] && break; sleep 0.2; done; python3 - <<'PY'\nfrom pathlib import Path\nimport json, re, subprocess\nbase=Path('{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status')\nsummary=(base/'surfaces/report/summary.txt').read_text()\ncrd=json.loads((base/'surfaces/swblockvolumes.json').read_text())\nsnapshot=json.loads((base/'surfaces/report/operator-snapshot.json').read_text())\ndashboard=json.loads((base/'surfaces/dashboard/operator-snapshot.json').read_text())\ncrd_status=[]\nfor item in crd['items']:\n st=item['status']; nv=st['nvme']\n crd_status.append((st['volumeID'], st['pvcName'], st['status'], st['reasonCode'], st['publishTarget'], nv['protocol'], nv['nqn'], nv['nvmeAddr'], int(nv['pathCount'])))\nif len(crd_status) != 2:\n raise SystemExit('crd count mismatch')\nsummary_nvme=[]\nfor line in summary.splitlines():\n if line.startswith('managed_volume_nvme='):\n parts=dict(re.findall(r'([a-z_]+)=([^ ]+)', line))\n summary_nvme.append((line.split()[0].split('=',1)[1], parts.get('nqn'), parts.get('addr'), int(parts.get('path_count','0'))))\nif len(summary_nvme) != 2:\n raise SystemExit('summary nvme count mismatch')\nfor doc_name, doc in [('snapshot', snapshot), ('dashboard', dashboard)]:\n volumes=doc.get('volumes') or []\n if len(volumes) != 2:\n raise SystemExit(f'{doc_name} volume count={len(volumes)}')\n for volume in volumes:\n st=volume['status']; nv=st.get('nvme') or {}\n if st.get('status') != 'ready' or st.get('reason_code') != 'first_volume_verified':\n raise SystemExit(f'{doc_name} status mismatch {st}')\n if nv.get('protocol') != 'nvme' or not nv.get('nqn') or not nv.get('nvme_addr') or nv.get('path_count') != 1:\n raise SystemExit(f'{doc_name} nvme mismatch {nv}')\nfor volume_id, pvc, status, reason, publish, protocol, nqn, addr, path_count in crd_status:\n if protocol != 'nvme' or status != 'ready' or reason != 'first_volume_verified' or publish != addr or path_count != 1:\n raise SystemExit(f'crd mismatch {volume_id}')\n if f'managed_volume={volume_id} status=ready reason=first_volume_verified' not in summary:\n raise SystemExit(f'summary missing managed volume {volume_id}')\n if f'managed_volume_nvme={volume_id} nqn={nqn}' not in summary or f' addr={addr} ' not in summary:\n raise SystemExit(f'summary missing nvme {volume_id}')\n out=subprocess.check_output(['{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/bin/sw-block','ops','explain','volume','--from-bundle',str(base/'multi-volume'),volume_id], text=True)\n (base/f'surfaces/explain/{volume_id}.txt').write_text(out)\n if f'managed_volume {volume_id} status=ready reason=first_volume_verified' not in out:\n raise SystemExit(f'explain missing status {volume_id}')\n if f'managed_volume_nvme protocol=nvme nqn={nqn}' not in out or f'addr={addr}' not in out:\n raise SystemExit(f'explain missing nvme {volume_id}')\ntext='\\n'.join([\n 'phase109_nvme_tcp_status_surface_status=ok',\n 'volume_count=2',\n 'crd_nvme_status_count=2',\n 'report_nvme_status_count=2',\n 'operator_snapshot_nvme_status_count=2',\n 'dashboard_nvme_status_count=2',\n 'explain_nvme_status_count=2',\n 'all_surfaces_status=ready',\n 'all_surfaces_reason=first_volume_verified',\n 'all_surfaces_protocol=nvme',\n 'publish_target_matches_nvme_addr=true',\n 'mutation_allowed=false',\n])+'\\n'\n(base/'asserts/phase109-surface-summary.txt').write_text(text)\nPY" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/asserts/phase109-surface-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/asserts/phase109-surface-summary.txt" pattern: "^phase109_nvme_tcp_status_surface_status=ok$" save_as: surface_ok - action: assert_greater @@ -126,13 +132,14 @@ phases: always: true actions: - action: exec - node: m02 + node: node-a timeout: 6m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup/helm-uninstall.txt || true; kubectl -n {{ helm_namespace }} get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n {{ helm_namespace }} patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n {{ helm_namespace }} delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n {{ helm_namespace }} delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance={{ helm_release }} --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup/verify bash scripts/verify-helm-cleanup.sh {{ product_root }}" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup/helm-uninstall.txt || true; kubectl -n {{ helm_namespace }} get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n {{ helm_namespace }} patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n {{ helm_namespace }} delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n {{ helm_namespace }} delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance={{ helm_release }} --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n default delete pod -l sw-block-test=multi-volume --ignore-not-found=true --wait=true --timeout=120s || true; for i in 1 2 3; do kubectl -n default delete pod sw-block-multi-writer-$i sw-block-multi-reader-$i --ignore-not-found=true --wait=true --timeout=120s || true; kubectl -n default delete pvc sw-block-multi-pvc-$i --ignore-not-found=true --wait=true --timeout=120s || true; done; kubectl delete storageclass sw-block-multi --ignore-not-found=true --wait=true --timeout=120s || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-multi/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=$SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup/verify bash scripts/verify-helm-cleanup.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup/verify/cleanup-summary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status/cleanup/verify/cleanup-summary.txt" pattern: "^cleanup_status=ok$" save_as: cleanup_ok - action: assert_greater @@ -143,7 +150,7 @@ phases: always: true actions: - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase109-nvme-status" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-phase109-nvme-status" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-target-backend-shape-split-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-target-backend-shape-split-chain.yaml deleted file mode 100644 index e2de1ec2f1..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-target-backend-shape-split-chain.yaml +++ /dev/null @@ -1,143 +0,0 @@ -name: nvme-tcp-target-backend-shape-split-chain -timeout: 70m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase124-block-perf sw-block-phase124-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase124-block-pvc sw-block-phase124-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase124-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase124/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase124/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 62m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split SW_BLOCK_PHASE124_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE124_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase124-nvme-tcp-target-backend-shape-split-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^phase124_nvme_tcp_target_backend_shape_split_status=ok$" - save_as: phase124_status_ok - - action: assert_greater - actual: "{{ phase124_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^network_baseline_mibps=[0-9]" - save_as: network_metric - - action: assert_greater - actual: "{{ network_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^local_path_seq_write_mibps=[0-9]" - save_as: local_write_metric - - action: assert_greater - actual: "{{ local_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^local_path_seq_read_mibps=[0-9]" - save_as: local_read_metric - - action: assert_greater - actual: "{{ local_read_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^block_nvme_seq_write_mibps=[0-9]" - save_as: block_write_metric - - action: assert_greater - actual: "{{ block_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^block_nvme_seq_read_mibps=[0-9]" - save_as: block_read_metric - - action: assert_greater - actual: "{{ block_read_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^block_vs_local_read_ratio=" - save_as: read_ratio_named - - action: assert_greater - actual: "{{ read_ratio_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^block_vs_local_write_ratio=" - save_as: write_ratio_named - - action: assert_greater - actual: "{{ write_ratio_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^shape_fsync_penalty=" - save_as: fsync_penalty_named - - action: assert_greater - actual: "{{ fsync_penalty_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^top_bottleneck=" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^next_recommendation=phase125_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split/phase124-nvme-tcp-target-backend-shape-split-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase124-nvme-split" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-append-batch-shape-coalescing-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-append-batch-shape-coalescing-chain.yaml deleted file mode 100644 index 4ce4003ee3..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-append-batch-shape-coalescing-chain.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: nvme-tcp-wal-append-batch-shape-coalescing-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape SW_BLOCK_PHASE139_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase139-wal-append-batch-shape-coalescing-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^phase139_wal_append_batch_shape_coalescing_status=ok$" - save_as: phase139_status_ok - - action: assert_greater - actual: "{{ phase139_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^unit_batch_shape_regression_passed=true$" - save_as: unit_passed - - action: assert_greater - actual: "{{ unit_passed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batch_effective - - action: assert_greater - actual: "{{ batch_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^backend_write_request_max_bytes=[1-9][0-9]*$" - save_as: request_max - - action: assert_greater - actual: "{{ request_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^backend_full_block_batch_max=[1-9][0-9]*$" - save_as: batch_max - - action: assert_greater - actual: "{{ batch_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^phase139_shape_result=\\(improved\\|frontend_request_limited\\|blocked\\)$" - save_as: shape_result - - action: assert_greater - actual: "{{ shape_result }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^next_recommendation=phase140_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape/phase139-wal-append-batch-shape-coalescing-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase139-batch-shape" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-append-copy-checksum-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-append-copy-checksum-profile-chain.yaml deleted file mode 100644 index 7a29918f37..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-append-copy-checksum-profile-chain.yaml +++ /dev/null @@ -1,127 +0,0 @@ -name: nvme-tcp-wal-append-copy-checksum-profile-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile SW_BLOCK_PHASE136_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase136-wal-append-copy-checksum-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^phase136_wal_append_copy_checksum_profile_status=ok$" - save_as: phase136_status_ok - - action: assert_greater - actual: "{{ phase136_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^unit_wal_profile_regression_passed=true$" - save_as: unit_passed - - action: assert_greater - actual: "{{ unit_passed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batch_effective - - action: assert_greater - actual: "{{ batch_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^wal_copy_duration_ms=[1-9][0-9]*$" - save_as: wal_copy_duration - - action: assert_greater - actual: "{{ wal_copy_duration }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^wal_encode_duration_ms=[1-9][0-9]*$" - save_as: wal_encode_duration - - action: assert_greater - actual: "{{ wal_encode_duration }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^wal_append_duration_ms=[1-9][0-9]*$" - save_as: wal_append_duration - - action: assert_greater - actual: "{{ wal_append_duration }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^post_phase136_bottleneck=\\(wal_copy\\|wal_encode\\|wal_checksum\\|wal_append\\|dirty_map\\|unknown\\)$" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^next_recommendation=phase137_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile/phase136-wal-append-copy-checksum-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase136-wal-profile" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-append-large-h2c-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-append-large-h2c-profile-chain.yaml deleted file mode 100644 index 6f064ef60e..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-append-large-h2c-profile-chain.yaml +++ /dev/null @@ -1,215 +0,0 @@ -name: nvme-tcp-wal-append-large-h2c-profile-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append SW_BLOCK_PHASE143_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE143_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase143-wal-append-large-h2c-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^phase143_wal_append_large_h2c_profile_status=ok$" - save_as: phase143_status_ok - - action: assert_greater - actual: "{{ phase143_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^phase143_contract_tests=pass$" - save_as: contract_tests - - action: assert_greater - actual: "{{ contract_tests }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^backend_full_block_batch_max=[1-9][0-9]*$" - save_as: full_block_batch - - action: assert_greater - actual: "{{ full_block_batch }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_duration_ms=[1-9][0-9]*$" - save_as: wal_append_ms - - action: assert_greater - actual: "{{ wal_append_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_writeat_calls=[1-9][0-9]*$" - save_as: writeat_calls - - action: assert_greater - actual: "{{ writeat_calls }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_writeat_bytes=[1-9][0-9]*$" - save_as: writeat_bytes - - action: assert_greater - actual: "{{ writeat_bytes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_writeat_max_bytes=[1-9][0-9]*$" - save_as: writeat_max - - action: assert_greater - actual: "{{ writeat_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_writeat_avg_bytes=[1-9][0-9]*$" - save_as: writeat_avg - - action: assert_greater - actual: "{{ writeat_avg }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_wrap_count=[0-9][0-9]*$" - save_as: wrap_count - - action: assert_greater - actual: "{{ wrap_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_append_padding_bytes=[0-9][0-9]*$" - save_as: padding_bytes - - action: assert_greater - actual: "{{ padding_bytes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^wal_encode_duration_ms=[1-9][0-9]*$" - save_as: wal_encode_ms - - action: assert_greater - actual: "{{ wal_encode_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^phase143_append_shape=\\(writeat_latency\\|writeat_count\\|encode_close_second\\|wrap_padding\\|unknown\\)$" - save_as: append_shape_named - - action: assert_greater - actual: "{{ append_shape_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^phase143_decision=\\(continue_backend_work\\|add_instrumentation\\|blocked\\)$" - save_as: decision_named - - action: assert_greater - actual: "{{ decision_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^next_recommendation=phase144_.*$" - save_as: next_named - - action: assert_greater - actual: "{{ next_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append/phase143-wal-append-large-h2c-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase143-wal-append" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-encode-append-pair-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-encode-append-pair-profile-chain.yaml deleted file mode 100644 index 4e86cf99c6..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-encode-append-pair-profile-chain.yaml +++ /dev/null @@ -1,207 +0,0 @@ -name: nvme-tcp-wal-encode-append-pair-profile-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair SW_BLOCK_PHASE144_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE144_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase144-wal-encode-append-pair-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^phase144_wal_encode_append_pair_profile_status=ok$" - save_as: phase144_status_ok - - action: assert_greater - actual: "{{ phase144_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^phase144_contract_tests=pass$" - save_as: contract_tests - - action: assert_greater - actual: "{{ contract_tests }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_encode_ops=[1-9][0-9]*$" - save_as: encode_ops - - action: assert_greater - actual: "{{ encode_ops }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_encode_bytes=[1-9][0-9]*$" - save_as: encode_bytes - - action: assert_greater - actual: "{{ encode_bytes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_encode_duration_ms=[1-9][0-9]*$" - save_as: encode_ms - - action: assert_greater - actual: "{{ encode_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_append_ops=[1-9][0-9]*$" - save_as: append_ops - - action: assert_greater - actual: "{{ append_ops }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_append_bytes=[1-9][0-9]*$" - save_as: append_bytes - - action: assert_greater - actual: "{{ append_bytes }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_append_duration_ms=[1-9][0-9]*$" - save_as: append_ms - - action: assert_greater - actual: "{{ append_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_append_writeat_calls=[1-9][0-9]*$" - save_as: writeat_calls - - action: assert_greater - actual: "{{ writeat_calls }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^wal_append_writeat_avg_bytes=[1-9][0-9]*$" - save_as: writeat_avg - - action: assert_greater - actual: "{{ writeat_avg }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^phase144_pair_shape=\\(encode_dominant\\|append_dominant\\|encode_append_tied\\|instrumentation_gap\\|unknown\\)$" - save_as: pair_shape_named - - action: assert_greater - actual: "{{ pair_shape_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^phase144_decision=\\(continue_backend_work\\|add_instrumentation\\|blocked\\)$" - save_as: decision_named - - action: assert_greater - actual: "{{ decision_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^next_recommendation=phase145_.*$" - save_as: next_named - - action: assert_greater - actual: "{{ next_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair/phase144-wal-encode-append-pair-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase144-wal-pair" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml deleted file mode 100644 index 6594f0607d..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml +++ /dev/null @@ -1,225 +0,0 @@ -name: nvme-tcp-wal-multiblock-head-lsn-confirmation-chain -timeout: 95m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m01: - host: 192.168.1.181 - user: testdev - key: "{{ ssh_key }}" - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; sudo -n rm -rf /tmp/sw-block-phase155-recovery-*; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m01 - timeout: 2m - cmd: "sudo -n rm -rf /tmp/sw-block-phase155-recovery-*" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 87m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn SW_BLOCK_PHASE155_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE155_SEQ_MIB=4 SW_BLOCK_PHASE155_RESTART_VERIFY_MIB=4 SW_BLOCK_PHASE155_STATE_HOSTPATH=/tmp/sw-block-phase155-recovery-{{ run_id }} SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase155-mounted-durable-status-head-lsn-confirmation-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^phase155_mounted_durable_status_head_lsn_confirmation_status=ok$" - save_as: phase155_status_ok - - action: assert_greater - actual: "{{ phase155_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^phase152_followup=head_lsn_diagnostic_cleanup$" - save_as: phase152_followup - - action: assert_greater - actual: "{{ phase152_followup }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^runtime_opt_in_enabled=true$" - save_as: runtime_enabled - - action: assert_greater - actual: "{{ runtime_enabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^recovery_test_disable_flusher_enabled=true$" - save_as: recovery_test_flusher_disabled - - action: assert_greater - actual: "{{ recovery_test_flusher_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^restart_persistence_mode=hostpath$" - save_as: restart_persistence - - action: assert_greater - actual: "{{ restart_persistence }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^blockvolume_restart_mode=force_delete_pod$" - save_as: restart_mode - - action: assert_greater - actual: "{{ restart_mode }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^recovery_completed=true$" - save_as: recovery_completed - - action: assert_greater - actual: "{{ recovery_completed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^recovered_lsn_after_restart=[1-9][0-9]*$" - save_as: recovered_lsn - - action: assert_greater - actual: "{{ recovered_lsn }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^recovered_lsn_remains_correct=true$" - save_as: recovered_lsn_correct - - action: assert_greater - actual: "{{ recovered_lsn_correct }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^durable_status_head_lsn_after_restart=[1-9][0-9]*$" - save_as: head_lsn_after - - action: assert_greater - actual: "{{ head_lsn_after }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^durable_status_head_lsn_equals_recovered_lsn=true$" - save_as: head_equals_recovered - - action: assert_greater - actual: "{{ head_equals_recovered }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^durable_status_evidence_matches_recovered_lsn=true$" - save_as: evidence_matches - - action: assert_greater - actual: "{{ evidence_matches }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^reader_verified_after_restart=true$" - save_as: reader_after - - action: assert_greater - actual: "{{ reader_after }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^ready_after_restart=true$" - save_as: ready_after - - action: assert_greater - actual: "{{ ready_after }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^default_wal_format_unchanged=true$" - save_as: default_unchanged - - action: assert_greater - actual: "{{ default_unchanged }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" - pattern: "^phase155_decision=mounted_confirmed$" - save_as: decision_confirmed - - action: assert_greater - actual: "{{ decision_confirmed }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: exec - node: m01 - timeout: 2m - cmd: "sudo -n rm -rf /tmp/sw-block-phase155-recovery-{{ run_id }}" - ignore_error: true - - action: exec - node: m02 - timeout: 2m - cmd: "sudo -n rm -rf /tmp/sw-block-phase155-recovery-{{ run_id }}" - ignore_error: true - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-mounted-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-mounted-profile-chain.yaml deleted file mode 100644 index 13dd515eba..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-mounted-profile-chain.yaml +++ /dev/null @@ -1,175 +0,0 @@ -name: nvme-tcp-wal-multiblock-mounted-profile-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted SW_BLOCK_PHASE151_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE151_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase151-wal-multiblock-mounted-nvme-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^phase151_wal_multiblock_mounted_nvme_profile_status=ok$" - save_as: phase151_status_ok - - action: assert_greater - actual: "{{ phase151_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^runtime_opt_in_enabled=true$" - save_as: runtime_enabled - - action: assert_greater - actual: "{{ runtime_enabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^mounted_helm_renders_opt_in=true$" - save_as: mounted_helm_opt_in - - action: assert_greater - actual: "{{ mounted_helm_opt_in }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^wal_encode_ops=[1-9][0-9]*$" - save_as: encode_ops - - action: assert_greater - actual: "{{ encode_ops }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^wal_append_ops=[1-9][0-9]*$" - save_as: append_ops - - action: assert_greater - actual: "{{ append_ops }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^multiblock_record_shape_observed=true$" - save_as: multiblock_shape - - action: assert_greater - actual: "{{ multiblock_shape }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified - - action: assert_greater - actual: "{{ writer_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified - - action: assert_greater - actual: "{{ reader_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^phase151_decision=keep_opt_in$" - save_as: decision - - action: assert_greater - actual: "{{ decision }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted/phase151-wal-multiblock-mounted-nvme-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase151-multiblock-mounted" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-recovery-compatibility-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-recovery-compatibility-chain.yaml deleted file mode 100644 index 289fa2a10d..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-recovery-compatibility-chain.yaml +++ /dev/null @@ -1,217 +0,0 @@ -name: nvme-tcp-wal-multiblock-recovery-compatibility-chain -timeout: 95m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m01: - host: 192.168.1.181 - user: testdev - key: "{{ ssh_key }}" - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; sudo -n rm -rf /tmp/sw-block-phase152-recovery-*; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: exec - node: m01 - timeout: 2m - cmd: "sudo -n rm -rf /tmp/sw-block-phase152-recovery-*" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 87m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery SW_BLOCK_PHASE152_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE152_SEQ_MIB=4 SW_BLOCK_PHASE152_RESTART_VERIFY_MIB=4 SW_BLOCK_PHASE152_STATE_HOSTPATH=/tmp/sw-block-phase152-recovery-{{ run_id }} SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase152-wal-multiblock-recovery-compatibility-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^phase152_wal_multiblock_recovery_compatibility_status=ok$" - save_as: phase152_status_ok - - action: assert_greater - actual: "{{ phase152_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^runtime_opt_in_enabled=true$" - save_as: runtime_enabled - - action: assert_greater - actual: "{{ runtime_enabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^recovery_test_disable_flusher_enabled=true$" - save_as: recovery_test_flusher_disabled - - action: assert_greater - actual: "{{ recovery_test_flusher_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^multiblock_record_shape_observed=true$" - save_as: multiblock_shape - - action: assert_greater - actual: "{{ multiblock_shape }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^mounted_helm_renders_recovery_test_disable_flusher=true$" - save_as: mounted_recovery_test_flusher_disabled - - action: assert_greater - actual: "{{ mounted_recovery_test_flusher_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^writer_verified_before_restart=true$" - save_as: writer_before - - action: assert_greater - actual: "{{ writer_before }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^blockvolume_restarted=true$" - save_as: restarted - - action: assert_greater - actual: "{{ restarted }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^blockvolume_restart_mode=force_delete_pod$" - save_as: restart_mode - - action: assert_greater - actual: "{{ restart_mode }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^recovery_completed=true$" - save_as: recovery_completed - - action: assert_greater - actual: "{{ recovery_completed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^recovered_lsn_after_restart=[1-9][0-9]*$" - save_as: recovered_lsn - - action: assert_greater - actual: "{{ recovered_lsn }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^wal_integrity_fault_observed=false$" - save_as: no_wal_fault - - action: assert_greater - actual: "{{ no_wal_fault }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^reader_verified_after_restart=true$" - save_as: reader_after - - action: assert_greater - actual: "{{ reader_after }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^ready_after_restart=true$" - save_as: ready_after - - action: assert_greater - actual: "{{ ready_after }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery/phase152-wal-multiblock-recovery-compatibility-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: exec - node: m01 - timeout: 2m - cmd: "sudo -n rm -rf /tmp/sw-block-phase152-recovery-{{ run_id }}" - ignore_error: true - - action: exec - node: m02 - timeout: 2m - cmd: "sudo -n rm -rf /tmp/sw-block-phase152-recovery-{{ run_id }}" - ignore_error: true - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase152-multiblock-recovery" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml deleted file mode 100644 index 273e4fcd42..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml +++ /dev/null @@ -1,167 +0,0 @@ -name: nvme-tcp-wal-record-materialization-effectiveness-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness SW_BLOCK_PHASE146_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE146_SEQ_MIB=512 SW_BLOCK_PHASE146_BASELINE_ENCODE_MS=297 SW_BLOCK_PHASE146_BASELINE_APPEND_MS=295 SW_BLOCK_PHASE146_VISIBLE_THRESHOLD_PCT=5 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^phase146_wal_record_materialization_effectiveness_status=ok$" - save_as: phase146_status_ok - - action: assert_greater - actual: "{{ phase146_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^wal_record_materialization_change=writebatch_value_entries$" - save_as: materialization_change - - action: assert_greater - actual: "{{ materialization_change }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^unit_record_compatibility=pass$" - save_as: unit_compat - - action: assert_greater - actual: "{{ unit_compat }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^wal_encode_duration_ms=[1-9][0-9]*$" - save_as: encode_ms - - action: assert_greater - actual: "{{ encode_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^wal_append_duration_ms=[1-9][0-9]*$" - save_as: append_ms - - action: assert_greater - actual: "{{ append_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^phase146_effectiveness=[a-z_][a-z_]*$" - save_as: effectiveness - - action: assert_greater - actual: "{{ effectiveness }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^phase146_decision=[a-z_][a-z_]*$" - save_as: decision - - action: assert_greater - actual: "{{ decision }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^next_recommendation=phase147_.*$" - save_as: next_named - - action: assert_greater - actual: "{{ next_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-reduction-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-reduction-chain.yaml deleted file mode 100644 index 93e006116c..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-reduction-chain.yaml +++ /dev/null @@ -1,175 +0,0 @@ -name: nvme-tcp-wal-record-materialization-reduction-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization SW_BLOCK_PHASE145_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE145_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase145-wal-record-materialization-reduction-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^phase145_wal_record_materialization_reduction_status=ok$" - save_as: phase145_status_ok - - action: assert_greater - actual: "{{ phase145_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^wal_record_materialization_change=writebatch_value_entries$" - save_as: materialization_change - - action: assert_greater - actual: "{{ materialization_change }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^unit_record_compatibility=pass$" - save_as: unit_compat - - action: assert_greater - actual: "{{ unit_compat }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^nvme_rdma_claim_allowed=false$" - save_as: no_rdma_claim - - action: assert_greater - actual: "{{ no_rdma_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^performance_slo_claim_allowed=false$" - save_as: no_slo_claim - - action: assert_greater - actual: "{{ no_slo_claim }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^candidate_max_h2c_bytes=65536$" - save_as: candidate_64k - - action: assert_greater - actual: "{{ candidate_64k }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^target_write_request_max_bytes=65536$" - save_as: target_h2c - - action: assert_greater - actual: "{{ target_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^backend_write_request_max_bytes=65536$" - save_as: backend_h2c - - action: assert_greater - actual: "{{ backend_h2c }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^wal_encode_duration_ms=[1-9][0-9]*$" - save_as: encode_ms - - action: assert_greater - actual: "{{ encode_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^wal_append_duration_ms=[1-9][0-9]*$" - save_as: append_ms - - action: assert_greater - actual: "{{ append_ms }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^writer_verified=true$" - save_as: writer_verified - - action: assert_greater - actual: "{{ writer_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^reader_verified=true$" - save_as: reader_verified - - action: assert_greater - actual: "{{ reader_verified }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^phase145_decision=keep_change$" - save_as: decision_keep - - action: assert_greater - actual: "{{ decision_keep }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^next_recommendation=phase146_.*$" - save_as: next_named - - action: assert_greater - actual: "{{ next_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization/phase145-wal-record-materialization-reduction-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase145-materialization" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-writeat-shape-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-writeat-shape-profile-chain.yaml deleted file mode 100644 index d395bc27c9..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-wal-writeat-shape-profile-chain.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: nvme-tcp-wal-writeat-shape-profile-chain -timeout: 90m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 82m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape SW_BLOCK_PHASE138_SEQ_MIB=512 SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase138-wal-writeat-shape-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^phase138_wal_writeat_shape_profile_status=ok$" - save_as: phase138_status_ok - - action: assert_greater - actual: "{{ phase138_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^unit_wal_writeat_shape_regression_passed=true$" - save_as: unit_passed - - action: assert_greater - actual: "{{ unit_passed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^target_write_observed=true$" - save_as: target_observed - - action: assert_greater - actual: "{{ target_observed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^backend_storage_batching_effective=true$" - save_as: batch_effective - - action: assert_greater - actual: "{{ batch_effective }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^wal_append_writeat_calls=[1-9][0-9]*$" - save_as: writeat_calls - - action: assert_greater - actual: "{{ writeat_calls }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^wal_append_writeat_max_bytes=[1-9][0-9]*$" - save_as: writeat_max - - action: assert_greater - actual: "{{ writeat_max }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^post_phase138_bottleneck=\\(wal_append_syscall\\|wal_append_small_writes\\|wal_wrap_padding\\|wal_encode\\|wal_checksum\\|dirty_map\\|unknown\\)$" - save_as: bottleneck_named - - action: assert_greater - actual: "{{ bottleneck_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^next_recommendation=phase139_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape/phase138-wal-writeat-shape-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase138-wal-writeat-shape" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/nvme-tcp-write-path-profile-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-write-path-profile-chain.yaml deleted file mode 100644 index 9d1d2114bd..0000000000 --- a/seaweed-block/testops/scenarios/nvme-tcp-write-path-profile-chain.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: nvme-tcp-write-path-profile-chain -timeout: 80m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase125-block-perf sw-block-phase125-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase125-block-pvc sw-block-phase125-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase125-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase125/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase125/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: run_gate - actions: - - action: exec - node: m02 - timeout: 72m - cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase125-block-nvme-tcp-write-path-profile-gate.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: assert_summary - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^phase125_block_nvme_tcp_write_path_profile_status=ok$" - save_as: phase125_status_ok - - action: assert_greater - actual: "{{ phase125_status_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^network_baseline_mibps=[0-9]" - save_as: network_metric - - action: assert_greater - actual: "{{ network_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^local_path_seq_write_mibps=[0-9]" - save_as: local_write_metric - - action: assert_greater - actual: "{{ local_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^block_nvme_seq_write_mibps=[0-9]" - save_as: block_write_metric - - action: assert_greater - actual: "{{ block_write_metric }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^blockvolume_cpu_sample_count=" - save_as: cpu_sample_count - - action: assert_greater - actual: "{{ cpu_sample_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^blockvolume_cpu_peak_percent=" - save_as: cpu_peak_named - - action: assert_greater - actual: "{{ cpu_peak_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^write_path_observation=" - save_as: observation_named - - action: assert_greater - actual: "{{ observation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^next_recommendation=phase126_" - save_as: recommendation_named - - action: assert_greater - actual: "{{ recommendation_named }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile/phase125-block-nvme-tcp-write-path-profile-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok - - action: assert_greater - actual: "{{ cleanup_ok }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase125-write-profile" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/operations-status-diagnostics-chain.yaml b/seaweed-block/testops/scenarios/operations-status-diagnostics-chain.yaml deleted file mode 100644 index 78b2c63438..0000000000 --- a/seaweed-block/testops/scenarios/operations-status-diagnostics-chain.yaml +++ /dev/null @@ -1,109 +0,0 @@ -# Runner-native operations/status diagnostics component gate. -# -# Goal: -# Prove the status-server diagnostic surfaces are present and explicitly -# guarded at component level before relying on them in beta-hardening suites. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/operations-status-diagnostics-chain.yaml - -name: operations-status-diagnostics-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/pin_build" - - - name: pin_build - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/pin_build/git.status" - - - name: status_diagnostics_component_tests - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -json -run \"TestStatusServer_(RejectsNonLoopbackBind|AcceptsLoopbackBindAndServesJSON|RecoveryEndpoint_Enabled_ReturnsEngineProjection|PeerStatusEndpoint_EnabledAfterStart_ReturnsPeerStates|DurableStatusEndpoint_EnabledAfterStart_ReturnsLineage)$\" ./core/host/volume | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/status-server-go-test.jsonl'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/status-server-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_RejectsNonLoopbackBind\"" - save_as: status_loopback_guard_count - - action: assert_greater - actual: "{{ status_loopback_guard_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/status-server-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_AcceptsLoopbackBindAndServesJSON\"" - save_as: status_base_json_count - - action: assert_greater - actual: "{{ status_base_json_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/status-server-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_RecoveryEndpoint_Enabled_ReturnsEngineProjection\"" - save_as: status_recovery_endpoint_count - - action: assert_greater - actual: "{{ status_recovery_endpoint_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/status-server-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_PeerStatusEndpoint_EnabledAfterStart_ReturnsPeerStates\"" - save_as: status_peers_endpoint_count - - action: assert_greater - actual: "{{ status_peers_endpoint_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status/status-server-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestStatusServer_DurableStatusEndpoint_EnabledAfterStart_ReturnsLineage\"" - save_as: status_durable_endpoint_count - - action: assert_greater - actual: "{{ status_durable_endpoint_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operations-status" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/operations-volume-status-cli-gate.yaml b/seaweed-block/testops/scenarios/operations-volume-status-cli-gate.yaml deleted file mode 100644 index 3c849587e0..0000000000 --- a/seaweed-block/testops/scenarios/operations-volume-status-cli-gate.yaml +++ /dev/null @@ -1,239 +0,0 @@ -# Runner-native operations volume-status CLI gate. -# -# Goal: -# Exercise the operator-facing `sw-block ops status` command boundary and -# prove it writes the support-bundle artifacts expected by the operations -# usability plan. This remains component-fast: the command talks to in-test -# fake master/status endpoints, not a live blockvolume deployment. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/operations-volume-status-cli-gate.yaml - -name: operations-volume-status-cli-gate -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts" - - - name: pin_build - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/pin_build/git.status" - - - name: ops_status_cli - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'SW_BLOCK_OPS_STATUS_CLI_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts go test -count=1 -json -run \"^TestOpsStatusWritesArtifactsAndReturnsClean$\" ./cmd/sw-block | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-status-cli-go-test.jsonl'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-status-cli-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestOpsStatusWritesArtifactsAndReturnsClean\"" - save_as: ops_status_cli_pass_count - - action: assert_greater - actual: "{{ ops_status_cli_pass_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-report.json" - pattern: "\"schema_version\": \"1.0\"" - save_as: ops_status_report_schema_count - - action: assert_greater - actual: "{{ ops_status_report_schema_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-report.json" - pattern: "\"volume_id\": \"v1\"" - save_as: ops_status_report_volume_count - - action: assert_greater - actual: "{{ ops_status_report_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-report.json" - pattern: "\"product_revision\": \"product-rev\"" - save_as: ops_status_report_product_revision_count - - action: assert_greater - actual: "{{ ops_status_report_product_revision_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"schema_version\": \"1.0\"" - save_as: ops_status_bundle_schema_count - - action: assert_greater - actual: "{{ ops_status_bundle_schema_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: ops_status_bundle_command_count - - action: assert_greater - actual: "{{ ops_status_bundle_command_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"volume_id\": \"v1\"" - save_as: ops_status_bundle_volume_count - - action: assert_greater - actual: "{{ ops_status_bundle_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"product_revision\": \"product-rev\"" - save_as: ops_status_bundle_product_revision_count - - action: assert_greater - actual: "{{ ops_status_bundle_product_revision_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"runner_revision\": \"runner-rev\"" - save_as: ops_status_bundle_runner_revision_count - - action: assert_greater - actual: "{{ ops_status_bundle_runner_revision_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"exit_code\": 0" - save_as: ops_status_bundle_exit_count - - action: assert_greater - actual: "{{ ops_status_bundle_exit_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"status\": \"ok\"" - save_as: ops_status_bundle_status_count - - action: assert_greater - actual: "{{ ops_status_bundle_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"name\": \"volume-status-report.json\"" - save_as: ops_status_bundle_report_artifact_count - - action: assert_greater - actual: "{{ ops_status_bundle_report_artifact_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"name\": \"volume-status-summary.txt\"" - save_as: ops_status_bundle_summary_artifact_count - - action: assert_greater - actual: "{{ ops_status_bundle_summary_artifact_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"name\": \"ops-status-bundle.json\"" - save_as: ops_status_bundle_self_artifact_count - - action: assert_greater - actual: "{{ ops_status_bundle_self_artifact_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"unchecked\":" - save_as: ops_status_bundle_unchecked_count - - action: assert_greater - actual: "{{ ops_status_bundle_unchecked_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"collection_errors\":" - save_as: ops_status_bundle_collection_errors_count - - action: assert_greater - actual: "{{ ops_status_bundle_collection_errors_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/ops-status-bundle.json" - pattern: "\"non_claims\":" - save_as: ops_status_bundle_non_claims_count - - action: assert_greater - actual: "{{ ops_status_bundle_non_claims_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-summary.txt" - pattern: "^status: ok$" - save_as: ops_status_summary_ok_count - - action: assert_greater - actual: "{{ ops_status_summary_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-summary.txt" - pattern: "^volume: id=v1 replica=r1 protocols=iscsi frontends=1$" - save_as: ops_status_summary_volume_count - - action: assert_greater - actual: "{{ ops_status_summary_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-summary.txt" - pattern: "^authority: role=primary healthy=true primary_ready=true assigned=true epoch=7 endpoint_version=2$" - save_as: ops_status_summary_authority_count - - action: assert_greater - actual: "{{ ops_status_summary_authority_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli/ops-artifacts/volume-status-summary.txt" - pattern: "^issues: none$" - save_as: ops_status_summary_issues_count - - action: assert_greater - actual: "{{ ops_status_summary_issues_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-cli" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/operations-volume-status-report-component-gate.yaml b/seaweed-block/testops/scenarios/operations-volume-status-report-component-gate.yaml deleted file mode 100644 index b2746168c1..0000000000 --- a/seaweed-block/testops/scenarios/operations-volume-status-report-component-gate.yaml +++ /dev/null @@ -1,257 +0,0 @@ -# Runner-native operations volume-status report component gate. -# -# Goal: -# Pin the first operations-layer read-only status report contract without -# starting blockmaster/blockvolume, k3s, iSCSI, or NVMe. This proves schema -# shape, frontend identity preservation, unavailable-field handling, and -# residue copy behavior before any operator surface is built around it. -# -# This is an observability/status report. It is not a block/data snapshot. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/operations-volume-status-report-component-gate.yaml - -name: operations-volume-status-report-component-gate -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/sample /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/ops-artifacts" - - - name: pin_build - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/pin_build/git.status" - - - name: report_component_tests - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'SW_BLOCK_OPS_STATUS_REPORT_OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/sample/volume-status-report.json SW_BLOCK_OPS_STATUS_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/ops-artifacts go test -count=1 -json -run \"^(TestBuildVolumeStatusReport_(ComposesExistingStatusSurfaces|JSONKeepsZeroValuedFrontendIdentity|JSONSchemaShapeIsStable|UsesMasterFrontendFacts|MarksUnavailableInputsExplicitly|CopiesInputSlices|WritesSampleReportArtifact)|TestVolumeStatusReportCollector_(CollectsInjectedReadOnlySources|ReturnsPartialReportWithSourceErrors|ReturnedReplicaDurableReadyButFrontendFenced|NilSourcesProduceUnavailableReport)|TestVolumeStatusSummary_(OKReport|UnhealthyReport|SupportingReplicaReadyIsClean|MissingReplicationRoleIsUnhealthy|InconsistentAuthorityReplicationPairIsUnhealthy|InvalidReport)|TestWriteVolumeStatusArtifacts_(WritesJSONAndSummary|PreservesPartialReportOnCollectionError|SplitsJoinedCollectionErrors|RequiresArtifactDir))$\" ./core/ops | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_ComposesExistingStatusSurfaces\"" - save_as: report_composition_count - - action: assert_greater - actual: "{{ report_composition_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_JSONKeepsZeroValuedFrontendIdentity\"" - save_as: report_zero_identity_count - - action: assert_greater - actual: "{{ report_zero_identity_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_JSONSchemaShapeIsStable\"" - save_as: report_schema_shape_count - - action: assert_greater - actual: "{{ report_schema_shape_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_UsesMasterFrontendFacts\"" - save_as: report_master_frontend_count - - action: assert_greater - actual: "{{ report_master_frontend_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_MarksUnavailableInputsExplicitly\"" - save_as: report_unavailable_count - - action: assert_greater - actual: "{{ report_unavailable_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_CopiesInputSlices\"" - save_as: report_copy_count - - action: assert_greater - actual: "{{ report_copy_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestBuildVolumeStatusReport_WritesSampleReportArtifact\"" - save_as: report_artifact_test_count - - action: assert_greater - actual: "{{ report_artifact_test_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestVolumeStatusReportCollector_CollectsInjectedReadOnlySources\"" - save_as: report_collector_success_count - - action: assert_greater - actual: "{{ report_collector_success_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestVolumeStatusReportCollector_ReturnsPartialReportWithSourceErrors\"" - save_as: report_collector_partial_count - - action: assert_greater - actual: "{{ report_collector_partial_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestVolumeStatusReportCollector_ReturnedReplicaDurableReadyButFrontendFenced\"" - save_as: report_collector_returned_count - - action: assert_greater - actual: "{{ report_collector_returned_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestVolumeStatusReportCollector_NilSourcesProduceUnavailableReport\"" - save_as: report_collector_nil_count - - action: assert_greater - actual: "{{ report_collector_nil_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestVolumeStatusSummary_SupportingReplicaReadyIsClean\"" - save_as: report_summary_supporting_count - - action: assert_greater - actual: "{{ report_summary_supporting_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestVolumeStatusSummary_InconsistentAuthorityReplicationPairIsUnhealthy\"" - save_as: report_summary_pairing_count - - action: assert_greater - actual: "{{ report_summary_pairing_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestWriteVolumeStatusArtifacts_WritesJSONAndSummary\"" - save_as: report_writer_success_count - - action: assert_greater - actual: "{{ report_writer_success_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestWriteVolumeStatusArtifacts_PreservesPartialReportOnCollectionError\"" - save_as: report_writer_partial_count - - action: assert_greater - actual: "{{ report_writer_partial_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/report-component-go-test.jsonl" - pattern: "\"Action\":\"pass\".*\"Test\":\"TestWriteVolumeStatusArtifacts_SplitsJoinedCollectionErrors\"" - save_as: report_writer_joined_errors_count - - action: assert_greater - actual: "{{ report_writer_joined_errors_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/sample/volume-status-report.json" - pattern: "\"schema_version\": \"1.0\"" - save_as: report_artifact_schema_count - - action: assert_greater - actual: "{{ report_artifact_schema_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/sample/volume-status-report.json" - pattern: "\"volume_id\": \"v1\"" - save_as: report_artifact_volume_count - - action: assert_greater - actual: "{{ report_artifact_volume_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/sample/volume-status-report.json" - pattern: "\"lun\": 0" - save_as: report_artifact_lun_count - - action: assert_greater - actual: "{{ report_artifact_lun_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/sample/volume-status-report.json" - pattern: "\"last_error\": \"unavailable\"" - save_as: report_artifact_unavailable_count - - action: assert_greater - actual: "{{ report_artifact_unavailable_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/ops-artifacts/volume-status-report.json" - pattern: "\"source\": {" - save_as: report_writer_json_count - - action: assert_greater - actual: "{{ report_writer_json_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/ops-artifacts/volume-status-summary.txt" - pattern: "^status: ok$" - save_as: report_summary_status_count - - action: assert_greater - actual: "{{ report_summary_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report/ops-artifacts/volume-status-summary.txt" - pattern: "^issues: none$" - save_as: report_summary_issues_count - - action: assert_greater - actual: "{{ report_summary_issues_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-ops-volume-status-report" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/operator-status-api-conformance-chain.yaml b/seaweed-block/testops/scenarios/operator-status-api-conformance-chain.yaml deleted file mode 100644 index d28d3f201e..0000000000 --- a/seaweed-block/testops/scenarios/operator-status-api-conformance-chain.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Runner-native Phase 40 D4 gate: operator-status API conformance. -# -# Goal: -# Catch the CRD/RBAC failures that previously escaped mock tests and failed -# only under live Kubernetes API validation: -# snake_case status payload drift -# unsupported condition/action enums -# wrong CRD endpoint usage -# RBAC boundary broadening -# delete-safety status regression - -name: operator-status-api-conformance-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: status_api_conformance - actions: - - action: exec - node: m02 - timeout: 5m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance bash scripts/run-phase40-status-api-conformance.sh {{ product_root }}" - - - name: status_api_conformance_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^phase40_status_api_conformance_status=ok$" - save_as: gate_ok_count - - action: assert_greater - actual: "{{ gate_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^casing_drift_gate=ok$" - save_as: casing_ok_count - - action: assert_greater - actual: "{{ casing_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^enum_drift_gate=ok$" - save_as: enum_ok_count - - action: assert_greater - actual: "{{ enum_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^wrong_endpoint_gate=ok$" - save_as: endpoint_ok_count - - action: assert_greater - actual: "{{ endpoint_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^rbac_boundary_gate=ok$" - save_as: rbac_ok_count - - action: assert_greater - actual: "{{ rbac_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^delete_safety_status_gate=ok$" - save_as: delete_safety_ok_count - - action: assert_greater - actual: "{{ delete_safety_ok_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-operator-status-api-conformance/phase40-status-api-conformance-summary.txt" - pattern: "^finalizer_mutation_allowed=false$" - save_as: finalizer_mutation_count - - action: assert_greater - actual: "{{ finalizer_mutation_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/rebuild-catchup-datapath-chain.yaml b/seaweed-block/testops/scenarios/rebuild-catchup-datapath-chain.yaml deleted file mode 100644 index 6c131edaa8..0000000000 --- a/seaweed-block/testops/scenarios/rebuild-catchup-datapath-chain.yaml +++ /dev/null @@ -1,160 +0,0 @@ -# Runner-native Phase 60 gate: real rebuild/catch-up data-path evidence. - -name: rebuild-catchup-datapath-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: rebuild_catchup_datapath_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath bash scripts/run-phase60-rebuild-catchup-datapath-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^phase60_rebuild_catchup_datapath_status=ok$" - save_as: phase60_ok - - action: assert_greater - actual: "{{ phase60_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^engine_catchup_roundtrip_test=true$" - save_as: engine_catchup - - action: assert_greater - actual: "{{ engine_catchup }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^catchup_barrier_confirms_test=true$" - save_as: catchup_barrier - - action: assert_greater - actual: "{{ catchup_barrier }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^dual_lane_rebuild_test=true$" - save_as: dual_lane_rebuild - - action: assert_greater - actual: "{{ dual_lane_rebuild }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^post_close_durable_ack_test=true$" - save_as: durable_ack_test - - action: assert_greater - actual: "{{ durable_ack_test }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^live_write_during_rebuild_test=true$" - save_as: live_write - - action: assert_greater - actual: "{{ live_write }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^same_lba_arbitration_test=true$" - save_as: same_lba - - action: assert_greater - actual: "{{ same_lba }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^start_catchup_observed=true$" - save_as: start_catchup - - action: assert_greater - actual: "{{ start_catchup }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^start_rebuild_observed=true$" - save_as: start_rebuild - - action: assert_greater - actual: "{{ start_rebuild }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^session_closed_completed_observed=true$" - save_as: session_closed - - action: assert_greater - actual: "{{ session_closed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^byte_equal_assertions_passed=true$" - save_as: byte_equal - - action: assert_greater - actual: "{{ byte_equal }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^rebuild_traffic_started=true$" - save_as: rebuild_traffic - - action: assert_greater - actual: "{{ rebuild_traffic }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^catchup_traffic_started=true$" - save_as: catchup_traffic - - action: assert_greater - actual: "{{ catchup_traffic }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^authority_executor_datapath_callsite=false$" - save_as: executor_not_wired - - action: assert_greater - actual: "{{ executor_not_wired }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath/phase60-rebuild-catchup-datapath-summary.txt" - pattern: "^failback_allowed=false$" - save_as: no_failback - - action: assert_greater - actual: "{{ no_failback }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase60-rebuild-catchup-datapath" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/rebuild-planning-close-chain.yaml b/seaweed-block/testops/scenarios/rebuild-planning-close-chain.yaml deleted file mode 100644 index a77198e52b..0000000000 --- a/seaweed-block/testops/scenarios/rebuild-planning-close-chain.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# Runner-native Phase 59 gate: returned-replica rebuild planning close path. - -name: rebuild-planning-close-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: rebuild_planning_close_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close bash scripts/run-phase59-rebuild-planning-close-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^phase59_rebuild_planning_close_status=ok$" - save_as: phase59_ok - - action: assert_greater - actual: "{{ phase59_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^rebuild_target_owner=target_mutation namespace=sw-block-phase59-rebuild-planning volumes=1 contracts=1 targets_planned=1 targets_existing=0 targets_created=1 invalid_contracts=0 mutation_allowed=true storage_mutation_allowed=false frontend_publication_allowed=false failback_allowed=false$" - save_as: target_owner_created - - action: assert_greater - actual: "{{ target_owner_created }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^rebuild_target_owner=target_mutation namespace=sw-block-phase59-rebuild-planning volumes=1 contracts=1 targets_planned=1 targets_existing=1 targets_created=0 invalid_contracts=0 mutation_allowed=false storage_mutation_allowed=false frontend_publication_allowed=false failback_allowed=false$" - save_as: target_owner_idempotent - - action: assert_greater - actual: "{{ target_owner_idempotent }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^rebuild_target_count_after_owner=1$" - save_as: target_count_one - - action: assert_greater - actual: "{{ target_count_one }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^rebuild_target_status_before_executor=$" - save_as: target_status_empty - - action: assert_greater - actual: "{{ target_status_empty }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^authority_executor=executed namespace=sw-block-phase59-rebuild-planning volumes=1 contracts=1 disabled_contracts=1 blocked_contracts=0 terminal_evidence_required=1 terminal_evidence_missing=0 ack_eligibility_target_missing=0 rebuild_target_missing=0 allowed_mutation_class=rebuild_traffic execution_requested=true execution_policy_enabled=true mutation_attempts=1 ack_eligibility_mutation_attempts=0 rebuild_progress_mutation_attempts=1 mutation_allowed=true storage_mutation_allowed=false$" - save_as: executor_executed - - action: assert_greater - actual: "{{ executor_executed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^rebuild_status_state_after_executor=planned$" - save_as: rebuild_planned - - action: assert_greater - actual: "{{ rebuild_planned }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^rebuild_traffic_started_after_executor=false$" - save_as: no_traffic - - action: assert_greater - actual: "{{ no_traffic }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^no_frontend_publication_after_executor=true$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close/phase59-rebuild-planning-close-summary.txt" - pattern: "^swblockvolume_reason_unchanged=candidate_frontier_behind$" - save_as: volume_unchanged - - action: assert_greater - actual: "{{ volume_unchanged }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase59-rebuild-planning-close" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/rebuild-runtime-target-contract-chain.yaml b/seaweed-block/testops/scenarios/rebuild-runtime-target-contract-chain.yaml deleted file mode 100644 index c57fa3b57c..0000000000 --- a/seaweed-block/testops/scenarios/rebuild-runtime-target-contract-chain.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# Runner-native Phase 63 gate: rebuild runtime target addressing contract. - -name: rebuild-runtime-target-contract-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: rebuild_runtime_target_contract_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract bash scripts/run-phase63-rebuild-runtime-target-contract-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^phase63_rebuild_runtime_target_contract_status=ok$" - save_as: phase63_ok - - action: assert_greater - actual: "{{ phase63_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^runtime_target_fields_schema_locked=true$" - save_as: schema_locked - - action: assert_greater - actual: "{{ schema_locked }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^target_owner_requires_runtime_facts=true$" - save_as: owner_requires_facts - - action: assert_greater - actual: "{{ owner_requires_facts }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^target_owner_missing_runtime_no_target=true$" - save_as: owner_missing_no_target - - action: assert_greater - actual: "{{ owner_missing_no_target }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^authority_executor_missing_runtime_target_blocks=true$" - save_as: executor_missing_blocks - - action: assert_greater - actual: "{{ executor_missing_blocks }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^authority_executor_runtime_request_carries_target_lineage=true$" - save_as: request_lineage - - action: assert_greater - actual: "{{ request_lineage }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^runtime_target_can_drive_http_runtime=true$" - save_as: target_drives_runtime - - action: assert_greater - actual: "{{ target_drives_runtime }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^session_id_inferred=false$" - save_as: no_session_inference - - action: assert_greater - actual: "{{ no_session_inference }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^blockvolume_runtime_endpoint_wired=false$" - save_as: endpoint_not_wired - - action: assert_greater - actual: "{{ endpoint_not_wired }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract/phase63-rebuild-runtime-target-contract-summary.txt" - pattern: "^start_rebuild_called=false$" - save_as: start_rebuild_not_called - - action: assert_greater - actual: "{{ start_rebuild_not_called }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase63-rebuild-runtime-target-contract" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/rebuild-target-owner-rbac-chain.yaml b/seaweed-block/testops/scenarios/rebuild-target-owner-rbac-chain.yaml deleted file mode 100644 index 97ae5d1a51..0000000000 --- a/seaweed-block/testops/scenarios/rebuild-target-owner-rbac-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 58 gate: rebuild-target-owner target-create RBAC boundary. - -name: rebuild-target-owner-rbac-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: rebuild_target_owner_rbac_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac bash scripts/run-phase58-rebuild-target-owner-rbac-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^phase58_rebuild_target_owner_rbac_status=ok$" - save_as: phase58_rbac_ok - - action: assert_greater - actual: "{{ phase58_rbac_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^owner_create_swblockreplicarebuilds_allowed=yes$" - save_as: owner_create_allowed - - action: assert_greater - actual: "{{ owner_create_allowed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^owner_create_rebuild_target_runtime_allowed=true$" - save_as: owner_runtime_create_allowed - - action: assert_greater - actual: "{{ owner_runtime_create_allowed }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^default_create_rebuild_target_runtime_denied=true$" - save_as: default_runtime_create_denied - - action: assert_greater - actual: "{{ default_runtime_create_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^owner_patch_rebuild_target_runtime_denied=true$" - save_as: owner_runtime_patch_denied - - action: assert_greater - actual: "{{ owner_runtime_patch_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^owner_patch_swblockreplicarebuilds_status_denied=no$" - save_as: owner_target_status_denied - - action: assert_greater - actual: "{{ owner_target_status_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^owner_create_events_denied=no$" - save_as: owner_events_denied - - action: assert_greater - actual: "{{ owner_events_denied }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac/phase58-rebuild-target-owner-rbac-summary.txt" - pattern: "^runtime_rebuild_target_status_state=$" - save_as: target_status_empty - - action: assert_greater - actual: "{{ target_status_empty }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase58-rebuild-target-owner-rbac" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/returned-replica-component-gate.yaml b/seaweed-block/testops/scenarios/returned-replica-component-gate.yaml deleted file mode 100644 index 596bd0116a..0000000000 --- a/seaweed-block/testops/scenarios/returned-replica-component-gate.yaml +++ /dev/null @@ -1,102 +0,0 @@ -# Runner-native returned-replica component gate. -# -# Goal: -# Run fast host/volume component tests that pin returned-replica frontend -# safety semantics before adding expensive RF=2/3 Kubernetes or initiator -# scenarios. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/returned-replica-component-gate.yaml - -name: returned-replica-component-gate -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/pin_build" - - - name: pin_build - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && git rev-parse HEAD > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/pin_build/git.sha && git status --porcelain > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/pin_build/git.status && test ! -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/pin_build/git.status" - - - name: returned_replica_component_tests - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash -o pipefail -c 'go test -count=1 -v ./core/host/volume | tee /mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/core-host-volume-go-test.log'" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/core-host-volume-go-test.log" - pattern: "--- PASS: TestG8A_ReturnedSupportingReplica_DoesNotServeFrontendBackend" - save_as: supporting_frontend_fence_count - - action: assert_greater - actual: "{{ supporting_frontend_fence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/core-host-volume-go-test.log" - pattern: "--- PASS: TestG9B_StatusProjection_ComponentAdapterLifecycle_NotReadyRecoveringReady" - save_as: returned_lifecycle_count - - action: assert_greater - actual: "{{ returned_lifecycle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/core-host-volume-go-test.log" - pattern: "--- PASS: TestG9B_StatusProjection_ReturnedReplicaCanBeDurableReadyButFrontendNotReady" - save_as: returned_durable_ready_frontend_fenced_count - - action: assert_greater - actual: "{{ returned_durable_ready_frontend_fenced_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component/core-host-volume-go-test.log" - pattern: "--- PASS: TestG9C_StatusProjection_DualLaneRecoveredReplicaReadyAfterPostCloseAck" - save_as: dual_lane_ready_count - - action: assert_greater - actual: "{{ dual_lane_ready_count }}" - threshold: "0" - - - name: final_asserts - actions: - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|^blockmaster |^blockvolume " - - - name: collect_and_cleanup - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-returned-replica-component" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/returned-replica-failback-contract-chain.yaml b/seaweed-block/testops/scenarios/returned-replica-failback-contract-chain.yaml deleted file mode 100644 index 82febeedec..0000000000 --- a/seaweed-block/testops/scenarios/returned-replica-failback-contract-chain.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Runner-native Phase 74 gate: returned-replica failback is explicit, -# evidence-gated, and still disabled until a real authority owner exists. - -name: returned-replica-failback-contract-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: returned_replica_failback_contract_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract bash scripts/run-phase74-returned-replica-failback-contract-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^phase74_returned_replica_failback_contract_status=ok$" - save_as: phase74_ok - - action: assert_greater - actual: "{{ phase74_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^failback_contract_disabled=true$" - save_as: failback_contract_disabled - - action: assert_greater - actual: "{{ failback_contract_disabled }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^failback_allowed_mutation_class=failback$" - save_as: failback_class - - action: assert_greater - actual: "{{ failback_class }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^failback_mutation_allowed=false$" - save_as: failback_no_mutation - - action: assert_greater - actual: "{{ failback_no_mutation }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^frontend_publication_attempts=0$" - save_as: no_frontend_publication - - action: assert_greater - actual: "{{ no_frontend_publication }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^ack_eligibility_contract_preserved=true$" - save_as: ack_contract_preserved - - action: assert_greater - actual: "{{ ack_contract_preserved }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract/phase74-returned-replica-failback-contract-summary.txt" - pattern: "^rebuild_contract_preserved=true$" - save_as: rebuild_contract_preserved - - action: assert_greater - actual: "{{ rebuild_contract_preserved }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase74-returned-replica-failback-contract" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/returned-replica-rebuild-contract-chain.yaml b/seaweed-block/testops/scenarios/returned-replica-rebuild-contract-chain.yaml deleted file mode 100644 index 00f3646938..0000000000 --- a/seaweed-block/testops/scenarios/returned-replica-rebuild-contract-chain.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Runner-native Phase 56 D2 gate: returned-replica rebuild/catch-up contract surfaces. - -name: returned-replica-rebuild-contract-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: rebuild_contract_surface_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract bash scripts/run-phase56-returned-replica-rebuild-contract-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract/phase56-returned-replica-rebuild-contract-summary.txt" - pattern: "^phase56_returned_replica_rebuild_contract_status=ok$" - save_as: phase56_rebuild_contract_ok - - action: assert_greater - actual: "{{ phase56_rebuild_contract_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract/phase56-returned-replica-rebuild-contract-summary.txt" - pattern: "^summary_rebuild_preflight_ready=1$" - save_as: rebuild_preflight_ready - - action: assert_greater - actual: "{{ rebuild_preflight_ready }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract/phase56-returned-replica-rebuild-contract-summary.txt" - pattern: "^summary_rebuild_contract_disabled=1$" - save_as: rebuild_contract_disabled - - action: assert_greater - actual: "{{ rebuild_contract_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract/phase56-returned-replica-rebuild-contract-summary.txt" - pattern: "^summary_rebuild_action_disabled=1$" - save_as: rebuild_action_disabled - - action: assert_greater - actual: "{{ rebuild_action_disabled }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract/phase56-returned-replica-rebuild-contract-summary.txt" - pattern: "^operator_snapshot_rebuild_contract=ok$" - save_as: snapshot_rebuild_contract - - action: assert_greater - actual: "{{ snapshot_rebuild_contract }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract/phase56-returned-replica-rebuild-contract-summary.txt" - pattern: "^dashboard_rebuild_contract=ok$" - save_as: dashboard_rebuild_contract - - action: assert_greater - actual: "{{ dashboard_rebuild_contract }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase56-returned-replica-rebuild-contract" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/returned-replica-status-schema-rbac-chain.yaml b/seaweed-block/testops/scenarios/returned-replica-status-schema-rbac-chain.yaml deleted file mode 100644 index 94ee5a3b74..0000000000 --- a/seaweed-block/testops/scenarios/returned-replica-status-schema-rbac-chain.yaml +++ /dev/null @@ -1,120 +0,0 @@ -# Runner-native Phase 47 D2 gate: live returned-replica status schema/RBAC. - -name: returned-replica-status-schema-rbac-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: status_schema_rbac_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac bash scripts/run-phase47-returned-replica-status-schema-rbac-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^phase47_returned_replica_status_schema_rbac_status=ok$" - save_as: phase47_status_gate_ok - - action: assert_greater - actual: "{{ phase47_status_gate_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^valid_returned_replica_status_server_dry_run=true$" - save_as: phase47_valid_status_count - - action: assert_greater - actual: "{{ phase47_valid_status_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^valid_executor_preflight_status_server_dry_run=true$" - save_as: phase50_valid_preflight_count - - action: assert_greater - actual: "{{ phase50_valid_preflight_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^executor_preflight_forbidden_mutation_class_projected=true$" - save_as: phase50_forbidden_mutation_class_count - - action: assert_greater - actual: "{{ phase50_forbidden_mutation_class_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^executor_preflight_ack_eligibility_known_projected=true$" - save_as: phase51_ack_known_projected_count - - action: assert_greater - actual: "{{ phase51_ack_known_projected_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^valid_executor_contract_status_server_dry_run=true$" - save_as: phase52_valid_contract_count - - action: assert_greater - actual: "{{ phase52_valid_contract_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^executor_contract_execution_disabled_projected=true$" - save_as: phase52_execution_disabled_count - - action: assert_greater - actual: "{{ phase52_execution_disabled_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^executor_contract_terminal_evidence_projected=true$" - save_as: phase52_terminal_evidence_count - - action: assert_greater - actual: "{{ phase52_terminal_evidence_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^snake_case_action_rejected=true$" - save_as: phase47_snake_rejected_count - - action: assert_greater - actual: "{{ phase47_snake_rejected_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^unsupported_action_mode_rejected=true$" - save_as: phase47_mode_rejected_count - - action: assert_greater - actual: "{{ phase47_mode_rejected_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac/phase47-returned-replica-status-schema-rbac-summary.txt" - pattern: "^operator_status_main_patch_allowed=no$" - save_as: phase47_main_patch_denied_count - - action: assert_greater - actual: "{{ phase47_main_patch_denied_count }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase47-status-schema-rbac" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/roce-live-io-feasibility-chain.yaml b/seaweed-block/testops/scenarios/roce-live-io-feasibility-chain.yaml deleted file mode 100644 index d456c9eb1c..0000000000 --- a/seaweed-block/testops/scenarios/roce-live-io-feasibility-chain.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: roce-live-io-feasibility-chain -timeout: 15m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: preflight - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility && cd {{ product_root }} && bash scripts/run-phase104-roce-live-io-feasibility-gate.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility/gate" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility/gate/phase104-roce-live-io-feasibility-summary.txt" - pattern: "^phase104_roce_live_io_status=ok$" - save_as: phase104_ok - - action: assert_greater - actual: "{{ phase104_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility/gate/phase104-roce-live-io-feasibility-summary.txt" - pattern: "^target_nvme_rdma_supported=false$" - save_as: rdma_unsupported - - action: assert_greater - actual: "{{ rdma_unsupported }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility/gate/phase104-roce-live-io-feasibility-summary.txt" - pattern: "^phase104_roce_live_io_result=blocked_target_transport_unsupported$" - save_as: blocked_unsupported - - action: assert_greater - actual: "{{ blocked_unsupported }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility/gate/phase104-roce-live-io-feasibility-summary.txt" - pattern: "^roce_claim_allowed=false$" - save_as: no_roce_claim - - action: assert_greater - actual: "{{ no_roce_claim }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase104-roce-feasibility" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/runtime-terminal-evidence-chain.yaml b/seaweed-block/testops/scenarios/runtime-terminal-evidence-chain.yaml deleted file mode 100644 index 3c523736bc..0000000000 --- a/seaweed-block/testops/scenarios/runtime-terminal-evidence-chain.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Runner-native Phase 65 gate: runtime terminal evidence. - -name: runtime-terminal-evidence-chain -timeout: 8m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: runtime_terminal_evidence_gate - actions: - - action: exec - node: m02 - timeout: 7m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence bash scripts/run-phase65-runtime-terminal-evidence-gate.sh {{ product_root }}" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence/phase65-runtime-terminal-evidence-summary.txt" - pattern: "^phase65_runtime_terminal_evidence_status=ok$" - save_as: phase65_ok - - action: assert_greater - actual: "{{ phase65_ok }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence/phase65-runtime-terminal-evidence-summary.txt" - pattern: "^runtime_terminal_status_recorded=true$" - save_as: terminal_recorded - - action: assert_greater - actual: "{{ terminal_recorded }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence/phase65-runtime-terminal-evidence-summary.txt" - pattern: "^runtime_endpoint_terminal_caught_up=true$" - save_as: endpoint_caught_up - - action: assert_greater - actual: "{{ endpoint_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence/phase65-runtime-terminal-evidence-summary.txt" - pattern: "^runtime_endpoint_terminal_does_not_restart=true$" - save_as: no_restart - - action: assert_greater - actual: "{{ no_restart }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence/phase65-runtime-terminal-evidence-summary.txt" - pattern: "^authority_executor_running_to_caught_up=true$" - save_as: executor_caught_up - - action: assert_greater - actual: "{{ executor_caught_up }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence/phase65-runtime-terminal-evidence-summary.txt" - pattern: "^frontend_publication_allowed=false$" - save_as: no_frontend - - action: assert_greater - actual: "{{ no_frontend }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase65-runtime-terminal-evidence" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/same-node-alpha-attach-chain.yaml b/seaweed-block/testops/scenarios/same-node-alpha-attach-chain.yaml deleted file mode 100644 index 70e9a70e2c..0000000000 --- a/seaweed-block/testops/scenarios/same-node-alpha-attach-chain.yaml +++ /dev/null @@ -1,234 +0,0 @@ -# Runner-native same-node alpha attach chain. -# -# Goal: -# Prove the documented alpha placement model: generated RF=1 iSCSI -# blockvolume and writer/reader app pods are pinned to the same selected -# Kubernetes node, attach through the normal CSI path, and inventory explains -# the PVC -> blockvolume node -> loopback frontend/support-bundle evidence. -# -# Expected invocation: -# swblock run \ -# -env product_root=/path/to/seaweed_block/on/m02 \ -# -env ssh_key=/path/to/testdev_key/on/controller \ -# testops/scenarios/same-node-alpha-attach-chain.yaml - -name: same-node-alpha-attach-chain -timeout: 18m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: reader_verified_with_live_inventory - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=reader-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/controlled-stop.exit_code; test \"$rc\" -eq 44'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log" - pattern: "\\[app-demo\\] controlled stop after reader verified" - save_as: reader_verified_stop_count - - action: assert_greater - actual: "{{ reader_verified_stop_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/writer.log" - pattern: "\\[app-writer\\] wrote and verified /data/demo.bin" - save_as: writer_checksum_count - - action: assert_greater - actual: "{{ writer_checksum_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/reader.log" - pattern: "\\[app-reader\\] verified persisted /data/demo.bin" - save_as: reader_checksum_count - - action: assert_greater - actual: "{{ reader_checksum_count }}" - threshold: "0" - - - name: same_node_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log" - pattern: "app_node=" - save_as: app_node_logged_count - - action: assert_greater - actual: "{{ app_node_logged_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log" - pattern: "pin_app_node=1" - save_as: app_node_pin_count - - action: assert_greater - actual: "{{ app_node_pin_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/demo-app.rendered.yaml" - pattern: "nodeSelector:" - save_as: writer_node_selector_count - - action: assert_greater - actual: "{{ writer_node_selector_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/demo-app-reader.rendered.yaml" - pattern: "nodeSelector:" - save_as: reader_node_selector_count - - action: assert_greater - actual: "{{ reader_node_selector_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/generated-blockvolume.yaml" - pattern: "kubernetes.io/hostname:" - save_as: blockvolume_node_selector_count - - action: assert_greater - actual: "{{ blockvolume_node_selector_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/generated-blockvolume.yaml" - pattern: "--iscsi-listen=127.0.0.1:" - save_as: loopback_frontend_count - - action: assert_greater - actual: "{{ loopback_frontend_count }}" - threshold: "0" - - action: exec - node: m02 - cmd: "APP_NODE=$(sed -n 's/^.*] app_node=//p' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log | tail -1); test -n \"$APP_NODE\"; grep -q \"node=${APP_NODE}\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc" - save_as: inventory_pvc_count - - action: assert_greater - actual: "{{ inventory_pvc_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt" - pattern: "frontend=127.0.0.1:" - save_as: inventory_frontend_count - - action: assert_greater - actual: "{{ inventory_frontend_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt" - pattern: "support_bundle=volumes/" - save_as: inventory_support_bundle_count - - action: assert_greater - actual: "{{ inventory_support_bundle_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/nested-ops-status-bundles.json" - pattern: "\"command\": \"sw-block ops status\"" - save_as: nested_status_bundle_count - - action: assert_greater - actual: "{{ nested_status_bundle_count }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/same-node-alpha-attach-negative-chain.yaml b/seaweed-block/testops/scenarios/same-node-alpha-attach-negative-chain.yaml deleted file mode 100644 index 86891180f5..0000000000 --- a/seaweed-block/testops/scenarios/same-node-alpha-attach-negative-chain.yaml +++ /dev/null @@ -1,173 +0,0 @@ -# Runner-native negative fixture for same-node alpha attach. -# -# Goal: -# Prove unsupported cross-node loopback placement fails with an actionable -# bundle instead of a writer/attach timeout. The fixture deliberately renders -# the app pod to a different node name than the generated blockvolume node. - -name: same-node-alpha-attach-negative-chain -timeout: 16m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: preflight - actions: - - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/preflight.txt 2>&1" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/preflight.txt" - pattern: "summary status=PASS" - save_as: preflight_count - - action: assert_greater - actual: "{{ preflight_count }}" - threshold: "0" - - - name: pin_build_alpha_images - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" - env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/pin_build" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/pin_build/alpha-images.env" - pattern: "SW_BLOCK_IMAGE_ID=" - save_as: sw_block_image_id_count - - action: assert_greater - actual: "{{ sw_block_image_id_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/pin_build/alpha-images.env" - pattern: "SW_BLOCK_CSI_IMAGE_ID=" - save_as: sw_block_csi_image_id_count - - action: assert_greater - actual: "{{ sw_block_csi_image_id_count }}" - threshold: "0" - - - name: unsupported_cross_node_loopback - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_APP_NODE_NAME=sw-block-not-the-blockvolume-node bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/exit_code.txt; test \"$rc\" -eq 45'" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/run.log" - pattern: "unsupported cross-node loopback attach" - save_as: unsupported_log_count - - action: assert_greater - actual: "{{ unsupported_log_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/unsupported-cross-node-loopback-attach.txt" - pattern: "^issue=unsupported_cross_node_loopback_attach$" - save_as: issue_class_count - - action: assert_greater - actual: "{{ issue_class_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/unsupported-cross-node-loopback-attach.txt" - pattern: "^app_node=sw-block-not-the-blockvolume-node$" - save_as: issue_app_node_count - - action: assert_greater - actual: "{{ issue_app_node_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/unsupported-cross-node-loopback-attach.txt" - pattern: "^blockvolume_node=" - save_as: issue_blockvolume_node_count - - action: assert_greater - actual: "{{ issue_blockvolume_node_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/unsupported-cross-node-loopback-attach.txt" - pattern: "^frontend=127.0.0.1:" - save_as: issue_frontend_count - - action: assert_greater - actual: "{{ issue_frontend_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/unsupported-cross-node-loopback-attach.txt" - pattern: "reason=loopback frontend requires app pod and blockvolume on the same node" - save_as: issue_reason_count - - action: assert_greater - actual: "{{ issue_reason_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/demo/ops-inventory-unsupported-placement/volume-inventory-summary.txt" - pattern: "pvc=sw-block-demo-pvc" - save_as: inventory_pvc_count - - action: assert_greater - actual: "{{ inventory_pvc_count }}" - threshold: "0" - - - name: collect_and_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative/uninstall" - env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-negative" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-baseline-chain.yaml b/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-baseline-chain.yaml index 331052ff46..7d73865b79 100644 --- a/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-baseline-chain.yaml +++ b/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-baseline-chain.yaml @@ -10,44 +10,48 @@ timeout: 28m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: exec - node: m02 + node: node-a cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - name: preflight actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/preflight.txt 2>&1" + node: node-a + cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/preflight.txt 2>&1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/preflight.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/preflight.txt" pattern: "summary status=PASS" save_as: preflight_count - action: assert_greater @@ -57,11 +61,11 @@ phases: - name: host_multipath_prereq actions: - action: exec - node: m02 - cmd: "set -e; B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath; { echo stage2_protocol=iscsi-alua; command -v iscsiadm >/dev/null && echo command_iscsiadm=present; command -v multipath >/dev/null && echo command_multipath=present; command -v sg_rtpg >/dev/null && echo command_sg_rtpg=present; command -v sg_inq >/dev/null && echo command_sg_inq=present; sudo modprobe iscsi_tcp; sudo modprobe dm_multipath; sudo modprobe scsi_dh_alua; test -d /sys/module/iscsi_tcp && echo module_iscsi_tcp=loaded; test -d /sys/module/dm_multipath && echo module_dm_multipath=loaded; test -d /sys/module/scsi_dh_alua && echo module_scsi_dh_alua=loaded; test -d /run/udev && echo udev_run=present; sudo multipath -t > \"$B/multipath-prereq.config.txt\" 2>&1; sudo multipath -ll > \"$B/multipath-prereq.multipath-ll.txt\" 2>&1 || true; echo multipath_prereq=pass; } > \"$B/multipath-prereq.txt\" 2>&1" + node: node-a + cmd: "set -e; B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath; { echo stage2_protocol=iscsi-alua; command -v iscsiadm >/dev/null && echo command_iscsiadm=present; command -v multipath >/dev/null && echo command_multipath=present; command -v sg_rtpg >/dev/null && echo command_sg_rtpg=present; command -v sg_inq >/dev/null && echo command_sg_inq=present; sudo modprobe iscsi_tcp; sudo modprobe dm_multipath; sudo modprobe scsi_dh_alua; test -d /sys/module/iscsi_tcp && echo module_iscsi_tcp=loaded; test -d /sys/module/dm_multipath && echo module_dm_multipath=loaded; test -d /sys/module/scsi_dh_alua && echo module_scsi_dh_alua=loaded; test -d /run/udev && echo udev_run=present; sudo multipath -t > \"$B/multipath-prereq.config.txt\" 2>&1; sudo multipath -ll > \"$B/multipath-prereq.multipath-ll.txt\" 2>&1 || true; echo multipath_prereq=pass; } > \"$B/multipath-prereq.txt\" 2>&1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/multipath-prereq.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/multipath-prereq.txt" pattern: "multipath_prereq=pass" save_as: multipath_prereq_count - action: assert_greater @@ -71,22 +75,22 @@ phases: - name: pin_build_alpha_images actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: sw_block_image_id_count - action: assert_greater actual: "{{ sw_block_image_id_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build/alpha-images.env" pattern: "SW_BLOCK_CSI_IMAGE_ID=" save_as: sw_block_csi_image_id_count - action: assert_greater @@ -96,11 +100,11 @@ phases: - name: render_rf3_demo_manifest actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc-writer-hold.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/demo-app-rf3.yaml" + node: node-a + cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc-writer-hold.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/demo-app-rf3.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/demo-app-rf3.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/demo-app-rf3.yaml" pattern: "replicationFactor: \"3\"" save_as: rf3_manifest_count - action: assert_greater @@ -110,139 +114,139 @@ phases: - name: stage2_multipath_baseline actions: - action: exec - node: m02 + node: node-a timeout: 16m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/demo-app-rf3.yaml SW_BLOCK_STAGE2_MULTIPATH=1 SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath SW_BLOCK_DEMO_STOP_AFTER=writer-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/exit_code.txt; test \"$rc\" -eq 44'" + cmd: "cd {{ product_root }} && bash -c 'set -a; source {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo SW_BLOCK_DEMO_APP_MANIFEST={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/demo-app-rf3.yaml SW_BLOCK_STAGE2_MULTIPATH=1 SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath SW_BLOCK_DEMO_STOP_AFTER=writer-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/exit_code.txt; test \"$rc\" -eq 44'" - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo; { echo transparent_failover_claimed=false; echo pod_recreate_path_used_for_baseline=true; echo next_required_gate=mounted_writer_primary_failure_without_pod_recreate; } > \"$B/stage2-claim-boundary.txt\"" + node: node-a + cmd: "B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo; { echo transparent_failover_claimed=false; echo pod_recreate_path_used_for_baseline=true; echo next_required_gate=mounted_writer_primary_failure_without_pod_recreate; } > \"$B/stage2-claim-boundary.txt\"" - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo; echo bounded_waits=writer_mounted_baseline > \"$B/bounded-waits.txt\"; echo close_gate_requires=post_failure_mounted_io_without_pod_recreate >> \"$B/bounded-waits.txt\"" + node: node-a + cmd: "B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo; echo bounded_waits=writer_mounted_baseline > \"$B/bounded-waits.txt\"; echo close_gate_requires=post_failure_mounted_io_without_pod_recreate >> \"$B/bounded-waits.txt\"" - name: stage2_wiring_asserts actions: - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/run.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/run.log" pattern: "stage2_multipath=1" save_as: stage2_log_count - action: assert_greater actual: "{{ stage2_log_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/csi-controller.rendered.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/csi-controller.rendered.yaml" pattern: "--stage2-multipath" save_as: csi_controller_stage2_count - action: assert_greater actual: "{{ csi_controller_stage2_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/csi-node.rendered.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/csi-node.rendered.yaml" pattern: "--stage2-multipath" save_as: csi_node_stage2_count - action: assert_greater actual: "{{ csi_node_stage2_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/generated-blockvolume.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/generated-blockvolume.yaml" pattern: "--replica-id=r1" save_as: r1_count - action: assert_greater actual: "{{ r1_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/generated-blockvolume.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/generated-blockvolume.yaml" pattern: "--replica-id=r2" save_as: r2_count - action: assert_greater actual: "{{ r2_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/generated-blockvolume.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/generated-blockvolume.yaml" pattern: "--replica-id=r3" save_as: r3_count - action: assert_greater actual: "{{ r3_count }}" threshold: "0" - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo; grep -o -- '--iscsi-iqn=[^\" ]*' \"$B/generated-blockvolume.yaml\" | sort -u > \"$B/unique-iscsi-iqns.txt\"; test \"$(wc -l < \"$B/unique-iscsi-iqns.txt\")\" -eq 1" + node: node-a + cmd: "B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo; grep -o -- '--iscsi-iqn=[^\" ]*' \"$B/generated-blockvolume.yaml\" | sort -u > \"$B/unique-iscsi-iqns.txt\"; test \"$(wc -l < \"$B/unique-iscsi-iqns.txt\")\" -eq 1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" pattern: "multipath=true" save_as: node_multipath_count - action: assert_greater actual: "{{ node_multipath_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" pattern: "staged transport=iscsi .* portals=.*127.0.0.1:3260" save_as: node_multipath_portal_3260_count - action: assert_greater actual: "{{ node_multipath_portal_3260_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" pattern: "staged transport=iscsi .* portals=.*127.0.0.1:3261" save_as: node_multipath_portal_3261_count - action: assert_greater actual: "{{ node_multipath_portal_3261_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/blockcsi-node.log" pattern: "staged transport=iscsi .* portals=.*127.0.0.1:3262" save_as: node_multipath_portal_3262_count - action: assert_greater actual: "{{ node_multipath_portal_3262_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/writer.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/writer.log" pattern: "/data/demo.bin: OK" save_as: writer_checksum_count - action: assert_greater actual: "{{ writer_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/controlled-stop-writer-verified.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/controlled-stop-writer-verified.txt" pattern: "phase=writer-verified" save_as: writer_verified_stop_count - action: assert_greater actual: "{{ writer_verified_stop_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/sg-rtpg.writer-mounted.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/sg-rtpg.writer-mounted.txt" pattern: "asymmetric access state" save_as: rtpg_state_count - action: assert_greater actual: "{{ rtpg_state_count }}" threshold: "0" - action: exec - node: m02 - cmd: "test -s /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/multipath.writer-mounted.txt" + node: node-a + cmd: "test -s {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/multipath.writer-mounted.txt" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/iscsi-sessions.writer-mounted.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/iscsi-sessions.writer-mounted.txt" pattern: "iqn.2026-05.io.seaweedfs" save_as: writer_mounted_session_count - action: assert_greater actual: "{{ writer_mounted_session_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/stage2-claim-boundary.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/demo/stage2-claim-boundary.txt" pattern: "transparent_failover_claimed=false" save_as: no_false_stage2_claim_count - action: assert_greater @@ -253,33 +257,34 @@ phases: always: true actions: - action: exec - node: m02 + node: node-a timeout: 3m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/uninstall" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath/uninstall" env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 + node: node-a cmd: "for map in $(sudo multipath -ll 2>/dev/null | awk '/^[^[:space:]][^ ]*[[:space:]]+\\(.*\\)/{print $1}'); do if sudo multipath -ll \"$map\" 2>/dev/null | grep -q 'io.seaweedfs'; then sudo multipath -f \"$map\" || true; fi; done; sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath; find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec sudo rm -rf -- {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - action: exec - node: m02 + node: node-a cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath" - action: exec - node: m02 + node: node-a cmd: "! sudo multipath -ll 2>/dev/null | grep -q 'io.seaweedfs'" - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-failover-chain.yaml b/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-failover-chain.yaml index ebac0cf65d..c6170022da 100644 --- a/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-failover-chain.yaml +++ b/seaweed-block/testops/scenarios/stage2-iscsi-alua-multipath-failover-chain.yaml @@ -9,44 +9,48 @@ timeout: 32m env: product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" + ssh_key: "" # private key for node_user; set with -env ssh_key= + node_host: "" # address of the test node; set with -env node_host=
+ node_user: "" # ssh user on the test node; set with -env node_user= + artifact_root: "" # shared artifact directory; set with -env artifact_root= topology: nodes: - m02: - host: 192.168.1.184 - user: testdev + node-a: + host: "{{ node_host }}" + user: "{{ node_user }}" key: "{{ ssh_key }}" phases: - name: pre_clean actions: - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover" + node: node-a + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; rm -rf $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover && mkdir -p $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo $SW_BLOCK_ARTIFACT_ROOT/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" - action: exec - node: m02 + node: node-a cmd: "kubectl -n default delete pod sw-block-demo-reader sw-block-demo-writer --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl -n default delete pvc sw-block-demo-pvc --ignore-not-found=true --wait=true --timeout=120s >/dev/null 2>&1 || true; kubectl delete sc sw-block-dynamic --ignore-not-found=true >/dev/null 2>&1 || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - name: preflight actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/preflight.txt 2>&1" + node: node-a + cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/preflight.txt 2>&1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/preflight.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/preflight.txt" pattern: "summary status=PASS" save_as: preflight_count - action: assert_greater @@ -56,11 +60,11 @@ phases: - name: host_multipath_prereq actions: - action: exec - node: m02 - cmd: "set -e; B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover; { echo stage2_protocol=iscsi-alua; command -v iscsiadm >/dev/null && echo command_iscsiadm=present; command -v multipath >/dev/null && echo command_multipath=present; command -v sg_rtpg >/dev/null && echo command_sg_rtpg=present; command -v sg_inq >/dev/null && echo command_sg_inq=present; sudo modprobe iscsi_tcp; sudo modprobe dm_multipath; sudo modprobe scsi_dh_alua; test -d /sys/module/iscsi_tcp && echo module_iscsi_tcp=loaded; test -d /sys/module/dm_multipath && echo module_dm_multipath=loaded; test -d /sys/module/scsi_dh_alua && echo module_scsi_dh_alua=loaded; test -d /run/udev && echo udev_run=present; sudo multipath -t > \"$B/multipath-prereq.config.txt\" 2>&1; sudo multipath -ll > \"$B/multipath-prereq.multipath-ll.txt\" 2>&1 || true; echo multipath_enabled=true; echo multipath_prereq=pass; } > \"$B/multipath-prereq.txt\" 2>&1" + node: node-a + cmd: "set -e; B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover; { echo stage2_protocol=iscsi-alua; command -v iscsiadm >/dev/null && echo command_iscsiadm=present; command -v multipath >/dev/null && echo command_multipath=present; command -v sg_rtpg >/dev/null && echo command_sg_rtpg=present; command -v sg_inq >/dev/null && echo command_sg_inq=present; sudo modprobe iscsi_tcp; sudo modprobe dm_multipath; sudo modprobe scsi_dh_alua; test -d /sys/module/iscsi_tcp && echo module_iscsi_tcp=loaded; test -d /sys/module/dm_multipath && echo module_dm_multipath=loaded; test -d /sys/module/scsi_dh_alua && echo module_scsi_dh_alua=loaded; test -d /run/udev && echo udev_run=present; sudo multipath -t > \"$B/multipath-prereq.config.txt\" 2>&1; sudo multipath -ll > \"$B/multipath-prereq.multipath-ll.txt\" 2>&1 || true; echo multipath_enabled=true; echo multipath_prereq=pass; } > \"$B/multipath-prereq.txt\" 2>&1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/multipath-prereq.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/multipath-prereq.txt" pattern: "multipath_prereq=pass" save_as: multipath_prereq_count - action: assert_greater @@ -70,22 +74,22 @@ phases: - name: pin_build_alpha_images actions: - action: exec - node: m02 + node: node-a timeout: 8m cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}" env.SW_BLOCK_IMPORT_K3S: "1" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build/alpha-images.env" pattern: "SW_BLOCK_IMAGE_ID=" save_as: sw_block_image_id_count - action: assert_greater actual: "{{ sw_block_image_id_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build/alpha-images.env" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build/alpha-images.env" pattern: "SW_BLOCK_CSI_IMAGE_ID=" save_as: sw_block_csi_image_id_count - action: assert_greater @@ -95,11 +99,11 @@ phases: - name: render_rf3_demo_manifest actions: - action: exec - node: m02 - cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc-writer-hold.yaml > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/demo-app-rf3.yaml" + node: node-a + cmd: "cd {{ product_root }} && sed 's/replicationFactor: \"1\"/replicationFactor: \"3\"/' deploy/k8s/alpha/demo-app-pvc-writer-hold.yaml > {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/demo-app-rf3.yaml" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/demo-app-rf3.yaml" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/demo-app-rf3.yaml" pattern: "replicationFactor: \"3\"" save_as: rf3_manifest_count - action: assert_greater @@ -109,21 +113,21 @@ phases: - name: mounted_writer_prepare actions: - action: exec - node: m02 + node: node-a timeout: 16m - cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo SW_BLOCK_DEMO_APP_MANIFEST=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/demo-app-rf3.yaml SW_BLOCK_STAGE2_MULTIPATH=1 SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_OPS_INVENTORY_CLAIM_PROFILE=stage2-iscsi-alua-multipath SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath-failover SW_BLOCK_DEMO_STOP_AFTER=writer-verified SW_BLOCK_DEMO_KEEP_ON_STOP=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/exit_code.txt; test \"$rc\" -eq 44'" + cmd: "cd {{ product_root }} && bash -c 'set -a; source {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_ARTIFACT_DIR={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo SW_BLOCK_DEMO_APP_MANIFEST={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/demo-app-rf3.yaml SW_BLOCK_STAGE2_MULTIPATH=1 SW_BLOCK_ALPHA_LOGICAL_SERVERS=3 SW_BLOCK_ALPHA_EXPECTED_SLOTS_PER_VOLUME=3 SW_BLOCK_ALPHA_REPLICATION_ACK=sync-quorum SW_BLOCK_OPS_INVENTORY_CLAIM_PROFILE=stage2-iscsi-alua-multipath SW_BLOCK_LAUNCHER_STATE_HOSTPATH=/var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath-failover SW_BLOCK_DEMO_STOP_AFTER=writer-verified SW_BLOCK_DEMO_KEEP_ON_STOP=1 bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > {{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/demo/exit_code.txt; test \"$rc\" -eq 44'" - action: exec - node: m02 - cmd: "B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover; cp \"$B/demo/multipath.writer-mounted.txt\" \"$B/failover/multipath-before.txt\"; cp \"$B/demo/sg-rtpg.writer-mounted.txt\" \"$B/failover/sg-rtpg.before.txt\"; cp \"$B/demo/iscsi-sessions.writer-mounted.txt\" \"$B/failover/iscsi-sessions.before.txt\"; { echo pod_recreate_used=false; echo transparent_failover_claimed=pending; echo claim_profile=stage2-iscsi-alua-multipath; } > \"$B/failover/stage2-failover-boundary.txt\"" + node: node-a + cmd: "B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover; cp \"$B/demo/multipath.writer-mounted.txt\" \"$B/failover/multipath-before.txt\"; cp \"$B/demo/sg-rtpg.writer-mounted.txt\" \"$B/failover/sg-rtpg.before.txt\"; cp \"$B/demo/iscsi-sessions.writer-mounted.txt\" \"$B/failover/iscsi-sessions.before.txt\"; { echo pod_recreate_used=false; echo transparent_failover_claimed=pending; echo claim_profile=stage2-iscsi-alua-multipath; } > \"$B/failover/stage2-failover-boundary.txt\"" - name: mounted_primary_failure actions: - action: exec - node: m02 + node: node-a timeout: 10m cmd: | cd {{ product_root }} && bash -c 'set -euo pipefail - B=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover + B={{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover D="$B/demo" O="$B/failover" SUMMARY="$D/ops-inventory-writer-verified/volume-inventory-summary.txt" @@ -210,72 +214,72 @@ phases: - name: stage2_failover_asserts actions: - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" pattern: "^pod_recreate_used=false$" save_as: no_pod_recreate_count - action: assert_greater actual: "{{ no_pod_recreate_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" pattern: "^data_check_after_failover=mounted_workload_checksum_passed$" save_as: mounted_checksum_count - action: assert_greater actual: "{{ mounted_checksum_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/workload-after-failover.log" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/workload-after-failover.log" pattern: "mounted_workload_checksum_passed" save_as: workload_pass_count - action: assert_greater actual: "{{ workload_pass_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/multipath-before.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/multipath-before.txt" pattern: "hwhandler='1 alua'" save_as: multipath_before_alua_count - action: assert_greater actual: "{{ multipath_before_alua_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/sg-rtpg.before.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/sg-rtpg.before.txt" pattern: "asymmetric access state" save_as: rtpg_before_count - action: assert_greater actual: "{{ rtpg_before_count }}" threshold: "1" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/sg-rtpg.after.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/sg-rtpg.after.txt" pattern: "asymmetric access state" save_as: rtpg_after_count - action: assert_greater actual: "{{ rtpg_after_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" pattern: "^old_primary_stale_io_success_count=0$" save_as: stale_primary_count - action: assert_greater actual: "{{ stale_primary_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/primary-failure.txt" pattern: "^post_failure_primary_count=1$" save_as: one_primary_count - action: assert_greater actual: "{{ one_primary_count }}" threshold: "0" - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/bounded-waits.txt" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/failover/bounded-waits.txt" pattern: "^bounded_waits=pass$" save_as: bounded_waits_count - action: assert_greater @@ -286,33 +290,34 @@ phases: always: true actions: - action: exec - node: m02 + node: node-a timeout: 5m - cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/uninstall" + cmd: "case \"$SW_BLOCK_ARTIFACT_ROOT\" in /?*) ;; *) echo 'artifact_root must be an absolute path other than /' >&2; exit 2;; esac; case \"$SW_BLOCK_ARTIFACT_ROOT\" in *[!A-Za-z0-9._/-]*) echo 'artifact_root may use only A-Za-z0-9._/-' >&2; exit 2;; esac; cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}" + env.SW_BLOCK_ARTIFACT_ROOT: "{{ artifact_root }}" + env.SW_BLOCK_ARTIFACT_DIR: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover/uninstall" env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1" - action: pre_run_cleanup - node: m02 + node: node-a kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" nvme_disconnect: "true" iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - action: exec - node: m02 + node: node-a cmd: "for map in $(sudo multipath -ll 2>/dev/null | awk '/^[^[:space:]][^ ]*[[:space:]]+\\(.*\\)/{print $1}'); do if sudo multipath -ll \"$map\" 2>/dev/null | grep -q 'io.seaweedfs'; then sudo multipath -f \"$map\" || true; fi; done; sudo rm -rf -- /var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath-failover; find /var/lib/sw-block -maxdepth 1 -type d -name 'testops-{{ run_id }}-*' -exec sudo rm -rf -- {} + 2>/dev/null || true; pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true" - action: assert_no_active_iscsi_sessions - node: m02 + node: node-a iqn_substr: "io.seaweedfs" - action: assert_no_processes - node: m02 + node: node-a pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - action: exec - node: m02 + node: node-a cmd: "test ! -e /var/lib/sw-block/testops-{{ run_id }}-stage2-iscsi-alua-multipath-failover" - action: exec - node: m02 + node: node-a cmd: "! sudo multipath -ll 2>/dev/null | grep -q 'io.seaweedfs'" - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover" + node: node-a + path: "{{ artifact_root }}/g15d-k8s/{{ run_id }}-stage2-iscsi-alua-multipath-failover" name: "remote-phases" ignore_error: true diff --git a/seaweed-block/testops/scenarios/status-endpoint-unreachable-live-chain.yaml b/seaweed-block/testops/scenarios/status-endpoint-unreachable-live-chain.yaml deleted file mode 100644 index f4fff2d9b1..0000000000 --- a/seaweed-block/testops/scenarios/status-endpoint-unreachable-live-chain.yaml +++ /dev/null @@ -1,356 +0,0 @@ -# Phase 34 D2 gate: live status endpoint unreachable. -# -# Goal: -# Upgrade the Phase 33 replay-only unreachable-status check into a live -# injection. The blockvolume process and iSCSI data path stay alive; only the -# replica status endpoint is rejected. Correct behavior is Unknown / -# status_endpoint_unreachable, not Blocked and not Ready=True. - -name: status-endpoint-unreachable-live-chain -timeout: 32m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - helm_release: "sw-block" - helm_namespace: "kube-system" - sw_block_image: "ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b" - sw_block_csi_image: "ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: pre_clean - actions: - - action: pre_run_cleanup - node: m02 - kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target" - nvme_disconnect: "true" - iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs" - - action: exec - node: m02 - timeout: 5m - cmd: "helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 180s || true; kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; kubectl delete clusterrole/sw-block-csi clusterrolebinding/sw-block-csi --ignore-not-found=true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/values /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/install /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/basic-app /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/fault /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/live-report /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/dashboard /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/cleanup" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - - name: build_and_install - actions: - - action: exec - node: m02 - timeout: 6m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin/sw-block ./cmd/sw-block && /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin/sw-block ops generate-helm-values --kubeconfig /etc/rancher/k3s/k3s.yaml --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/values/values.day1.yaml --image {{ sw_block_image }} --csi-image {{ sw_block_csi_image }} > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/values/generate.stdout.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/values/generate.stdout.txt" - pattern: "helm_values_status=ok" - save_as: generator_ok_count - - action: assert_greater - actual: "{{ generator_ok_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && helm install {{ helm_release }} charts/seaweed-block --namespace {{ helm_namespace }} --create-namespace -f /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/values/values.day1.yaml --wait --timeout 10m > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/install/helm-install.txt && kubectl -n {{ helm_namespace }} get deploy,ds,pods,svc -o wide > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/install/kube-system.after-install.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/install/helm-install.txt" - pattern: "STATUS: deployed" - save_as: helm_deployed_count - - action: assert_greater - actual: "{{ helm_deployed_count }}" - threshold: "0" - - - name: first_volume_ready_before_fault - actions: - - action: exec - node: m02 - timeout: 10m - cmd: "cd {{ product_root }} && bash scripts/run-basic-app-example.sh {{ product_root }}" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/basic-app" - env.SW_BLOCK_BASIC_APP_CLEANUP: "0" - env.SW_BLOCK_INSTALL_MODE: "helm" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - env.SW_BLOCK_HELM_VALUES_FILE: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/values/values.day1.yaml" - env.SW_BLOCK_CLI: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin/sw-block" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/basic-app/first-volume-summary.txt" - pattern: "^first_volume_status=ok$" - save_as: first_volume_ok_count - - action: assert_greater - actual: "{{ first_volume_ok_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 1m - cmd: | - python3 - <<'PY' - import json - from pathlib import Path - root = Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/basic-app") - snap = json.loads((root / "status/report/operator-snapshot.json").read_text()) - vols = snap.get("volumes") or [] - if len(vols) != 1: - raise SystemExit(f"expected one volume before fault, got {len(vols)}") - status = vols[0].get("status") or {} - if status.get("status") != "ready" or status.get("reason_code") != "first_volume_verified": - raise SystemExit(f"volume was not Ready before fault: {status}") - cluster = snap.get("cluster") or {} - if cluster.get("ready_volume_count") != 1: - raise SystemExit(f"expected ready_volume_count=1 before fault: {cluster}") - PY - - - name: block_status_endpoint - actions: - - action: exec - node: m02 - timeout: 2m - cmd: | - set -eu - OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/fault - mkdir -p "$OUT" - python3 - <<'PY' > "$OUT/status-target.env" - import json - from pathlib import Path - root = Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/basic-app/status") - doc = json.loads((root / "inventory/volume-inventory.json").read_text()) - vols = doc.get("volumes") or [] - if len(vols) != 1: - raise SystemExit(f"expected one volume, got {len(vols)}") - replicas = vols[0].get("replicas") or [] - if len(replicas) != 1: - raise SystemExit(f"expected one replica, got {len(replicas)}") - status_addr = replicas[0].get("status_address") or replicas[0].get("status_addr") or "" - if ":" not in status_addr: - raise SystemExit(f"bad status_addr={status_addr!r}") - host, port = status_addr.rsplit(":", 1) - frontend = replicas[0].get("frontend_address") or replicas[0].get("frontend_addr") or "" - if frontend.endswith(":3260") and frontend.rsplit(":", 1)[0] == host and port == "3260": - raise SystemExit("refusing to block iSCSI data port 3260") - print(f"status_addr={status_addr}") - print(f"status_host={host}") - print(f"status_port={port}") - print(f"volume_id={vols[0].get('volume_id','')}") - print(f"replica_id={replicas[0].get('replica_id','')}") - print(f"frontend_addr={frontend}") - PY - . "$OUT/status-target.env" - test "$status_port" != "3260" - echo "rule=iptables -I INPUT -p tcp --dport ${status_port} -j REJECT --reject-with tcp-reset" > "$OUT/iptables-rule.txt" - run_remote() { - if [ "$status_host" = "192.168.1.184" ] || [ "$status_host" = "127.0.0.1" ]; then - bash -s - else - ssh -i /opt/work/testdev_key -o StrictHostKeyChecking=no "testdev@${status_host}" bash -s - fi - } - run_remote > "$OUT/block-status-port.log" 2>&1 < "$OUT/unexpected-status-response.txt" 2>"$OUT/status-curl-after-block.stderr.txt"; then - echo "status endpoint still reachable after iptables block" >&2 - exit 1 - fi - echo "status_endpoint_blocked=true" > "$OUT/block-summary.txt" - cat "$OUT/status-target.env" >> "$OUT/block-summary.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: collect_live_unreachable_report - actions: - - action: exec - node: m02 - timeout: 4m - cmd: | - set -eu - ROOT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live - OUT="$ROOT/live-report" - mkdir -p "$OUT" - port=$(python3 - <<'PY' - import socket - s = socket.socket() - s.bind(("127.0.0.1", 0)) - print(s.getsockname()[1]) - s.close() - PY - ) - echo "$port" > "$OUT/blockmaster-port.txt" - kubectl -n kube-system port-forward deploy/sw-blockmaster "${port}:9333" > "$OUT/blockmaster-port-forward.log" 2>&1 & - pf=$! - trap 'kill $pf >/dev/null 2>&1 || true; wait $pf >/dev/null 2>&1 || true' EXIT - for i in $(seq 1 60); do - if (echo >"/dev/tcp/127.0.0.1/$port") >/dev/null 2>&1; then - break - fi - sleep 1 - done - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin/sw-block ops report --namespace default --master "127.0.0.1:${port}" --out "$OUT/report" --evidence-out "$OUT/evidence" --timeout 30s > "$OUT/report.stdout.txt" 2> "$OUT/report.stderr.txt" - volume_id=$(sed -n 's/^volume_id=//p' "$ROOT/fault/status-target.env" | head -1) - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin/sw-block ops explain volume --from-bundle "$OUT/report" "$volume_id" > "$OUT/explain.txt" 2> "$OUT/explain.stderr.txt" - test -s "$OUT/report/operator-snapshot.json" - test -s "$OUT/report/summary.txt" - test -s "$OUT/explain.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: unreachable_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/fault/block-summary.txt" - pattern: "^status_endpoint_blocked=true$" - save_as: status_blocked_count - - action: assert_greater - actual: "{{ status_blocked_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/live-report/report/summary.txt" - pattern: "status=unknown reason=status_endpoint_unreachable" - save_as: summary_unknown_count - - action: assert_greater - actual: "{{ summary_unknown_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/live-report/explain.txt" - pattern: "managed_volume_condition Ready status=Unknown reason=status_endpoint_unreachable" - save_as: explain_unknown_count - - action: assert_greater - actual: "{{ explain_unknown_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 2m - cmd: | - set -eu - ROOT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live - python3 - <<'PY' - import json - from pathlib import Path - snap = json.loads(Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/live-report/report/operator-snapshot.json").read_text()) - if snap.get("read_only") is not True: - raise SystemExit("operator snapshot is not read-only") - if (snap.get("mutation") or {}).get("mutation_allowed") is not False: - raise SystemExit("mutation_allowed is not false") - vols = snap.get("volumes") or [] - if len(vols) != 1: - raise SystemExit(f"expected one volume, got {len(vols)}") - status = vols[0].get("status") or {} - if status.get("status") != "unknown" or status.get("reason_code") != "status_endpoint_unreachable": - raise SystemExit(f"expected unknown/status_endpoint_unreachable, got {status}") - for condition in status.get("conditions") or []: - if condition.get("type") == "Ready" and condition.get("status") == "True": - raise SystemExit("false Ready=True while status endpoint is unreachable") - if condition.get("type") == "Blocked" and condition.get("status") == "True": - raise SystemExit("false Blocked=True for pure status endpoint unreachable") - cluster = snap.get("cluster") or {} - if cluster.get("ready_volume_count", 0) != 0: - raise SystemExit(f"ready_volume_count should be 0 during unreachable evidence: {cluster}") - PY - port=$(python3 - <<'PY' - import socket - s = socket.socket() - s.bind(("127.0.0.1", 0)) - print(s.getsockname()[1]) - s.close() - PY - ) - echo "$port" > "$ROOT/dashboard/port.txt" - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/bin/sw-block ops dashboard --from-bundle "$ROOT/live-report/report" --listen "127.0.0.1:${port}" > "$ROOT/dashboard/stdout.txt" 2> "$ROOT/dashboard/stderr.txt" & - pid=$! - trap 'kill $pid >/dev/null 2>&1 || true; wait $pid >/dev/null 2>&1 || true' EXIT - for i in $(seq 1 100); do - code=$(curl -s -o "$ROOT/dashboard/operator-snapshot.json" -w '%{http_code}' "http://127.0.0.1:${port}/operator-snapshot.json" || true) - test "$code" = "200" && break - sleep 0.2 - done - python3 - <<'PY' - import json - from pathlib import Path - snap = json.loads(Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/dashboard/operator-snapshot.json").read_text()) - vols = snap.get("volumes") or [] - if len(vols) != 1: - raise SystemExit("dashboard snapshot did not preserve one volume") - status = vols[0].get("status") or {} - if status.get("status") != "unknown" or status.get("reason_code") != "status_endpoint_unreachable": - raise SystemExit(f"dashboard did not preserve unreachable status: {status}") - for condition in status.get("conditions") or []: - if condition.get("type") == "Ready" and condition.get("status") == "True": - raise SystemExit("dashboard false Ready=True") - if condition.get("type") == "Blocked" and condition.get("status") == "True": - raise SystemExit("dashboard false Blocked=True") - PY - - - name: restore_status_endpoint - always: true - actions: - - action: exec - node: m02 - timeout: 2m - cmd: | - set -eu - OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/fault - if [ ! -f "$OUT/status-target.env" ]; then - exit 0 - fi - . "$OUT/status-target.env" - if [ -z "${status_host:-}" ] || [ -z "${status_port:-}" ]; then - echo "status endpoint was not blocked; no restore needed" > "$OUT/restore-summary.txt" - exit 0 - fi - run_remote() { - if [ "$status_host" = "192.168.1.184" ] || [ "$status_host" = "127.0.0.1" ]; then - bash -s - else - ssh -i /opt/work/testdev_key -o StrictHostKeyChecking=no "testdev@${status_host}" bash -s - fi - } - run_remote > "$OUT/restore-status-port.log" 2>&1 </dev/null; do :; done - ! sudo -n iptables -S INPUT | grep -- "--dport $status_port" - REMOTE - echo "status_endpoint_restored=true" > "$OUT/restore-summary.txt" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - - - name: helm_uninstall_cleanup - always: true - actions: - - action: exec - node: m02 - timeout: 8m - cmd: "kubectl -n default delete pod sw-block-example-reader sw-block-example-writer --ignore-not-found=true --wait=true --timeout=120s; kubectl -n default delete pvc sw-block-example-pvc --ignore-not-found=true --wait=true --timeout=120s; kubectl delete storageclass sw-block-example sw-block-dynamic --ignore-not-found=true --wait=true --timeout=120s; helm status {{ helm_release }} --namespace {{ helm_namespace }} >/dev/null 2>&1 && helm uninstall {{ helm_release }} --namespace {{ helm_namespace }} --wait --timeout 240s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/cleanup/helm-uninstall.txt || true; sudo -n iscsiadm -m node 2>/dev/null | awk '/io.seaweedfs/ {print $1, $2}' | while read portal target; do sudo -n iscsiadm -m node -T \"$target\" -p \"$portal\" -o delete || true; done; cd {{ product_root }} && bash scripts/verify-helm-cleanup.sh" - env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" - env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/cleanup/verify" - env.SW_BLOCK_HELM_RELEASE: "{{ helm_release }}" - env.SW_BLOCK_HELM_NAMESPACE: "{{ helm_namespace }}" - - action: assert_no_active_iscsi_sessions - node: m02 - iqn_substr: "io.seaweedfs" - - action: assert_no_processes - node: m02 - pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target " - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable-live/cleanup/verify/cleanup-summary.txt" - pattern: "^cleanup_status=ok$" - save_as: cleanup_ok_count - - action: assert_greater - actual: "{{ cleanup_ok_count }}" - threshold: "0" diff --git a/seaweed-block/testops/scenarios/status-endpoint-unreachable-replay-chain.yaml b/seaweed-block/testops/scenarios/status-endpoint-unreachable-replay-chain.yaml deleted file mode 100644 index 084e112471..0000000000 --- a/seaweed-block/testops/scenarios/status-endpoint-unreachable-replay-chain.yaml +++ /dev/null @@ -1,200 +0,0 @@ -# Phase 33 F2 gate: status endpoint unreachable replay. -# -# Goal: -# Prove a bundle that cannot reach replica status evidence is rendered as -# Unknown with reason=status_endpoint_unreachable across the user-facing -# read-only surfaces. This is intentionally replay-only: it validates the -# surface contract without introducing a second live failure mechanism. - -name: status-endpoint-unreachable-replay-chain -timeout: 10m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: prepare - actions: - - action: exec - node: m02 - timeout: 1m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bin /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bundle/demo/product-observation /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/dashboard" - - action: exec - node: m02 - timeout: 5m - cmd: "cd {{ product_root }} && go build -o /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bin/sw-block ./cmd/sw-block" - - - name: render_unreachable_bundle - actions: - - action: exec - node: m02 - timeout: 1m - cmd: | - python3 - <<'PY' - import json - from pathlib import Path - - root = Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bundle/demo/product-observation") - root.mkdir(parents=True, exist_ok=True) - doc = { - "schema_version": "1.0", - "captured_at": "2026-05-28T12:00:00Z", - "product_revision": "phase33-f2-replay", - "status": "unavailable", - "nodes": [], - "volumes": [{ - "volume_id": "pvc-unreachable", - "namespace": "default", - "pvc_name": "demo-pvc", - "pv_name": "pvc-unreachable", - "replication_factor": 1, - "desired_replicas": 1, - "observed_replicas": 1, - "status": "unavailable", - "reason": "status_endpoint_unreachable", - "primary_replica": "r1", - "primary_node": "m01", - "publish_target": "192.168.1.181:3260", - "replicas": [{ - "replica_id": "r1", - "server_id": "node-r1", - "kubernetes_node": "m01", - "observed": True, - "role": "primary", - "replication_role": "none", - "frontend_protocol": "iscsi", - "frontend_addr": "192.168.1.181:3260", - "status_addr": "192.168.1.181:23260" - }] - }], - "events": [{ - "event_id": "phase33-f2-1", - "event_time": "2026-05-28T12:00:01Z", - "volume_id": "pvc-unreachable", - "replica_id": "r1", - "event_type": "status_endpoint_unreachable", - "severity": "warning", - "message": "replica status endpoint unreachable; readiness is not claimed", - "reason_code": "status_endpoint_unreachable", - "evidence_ref": "product-observation/cluster-evidence.json" - }], - "non_claims": [ - "read-only-observation: does not mutate product, Kubernetes, iSCSI, or replica state", - "not-an-admin-action: no promote, repair, rebuild, backup, restore, or cleanup is authorized" - ] - } - (root / "cluster-evidence.json").write_text(json.dumps(doc, indent=2) + "\n") - PY - - - name: replay_surfaces - actions: - - action: exec - node: m02 - timeout: 1m - cmd: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bin/sw-block ops report --from-bundle /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bundle --out /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/stdout.txt 2> /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/stderr.txt" - - action: exec - node: m02 - timeout: 1m - cmd: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bin/sw-block ops explain volume --from-bundle /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bundle pvc-unreachable > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/explain.txt" - - action: exec - node: m02 - timeout: 1m - cmd: | - set -e - OUT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/dashboard - port=$(python3 - <<'PY' - import socket - s = socket.socket() - s.bind(("127.0.0.1", 0)) - print(s.getsockname()[1]) - s.close() - PY - ) - echo "$port" > "$OUT/port.txt" - /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bin/sw-block ops dashboard --from-bundle /mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/bundle --listen 127.0.0.1:${port} > "$OUT/stdout.txt" 2> "$OUT/stderr.txt" & - pid=$! - trap 'kill $pid >/dev/null 2>&1 || true; wait $pid >/dev/null 2>&1 || true' EXIT - for i in $(seq 1 100); do - code=$(curl -s -o "$OUT/operator-snapshot.json" -w '%{http_code}' "http://127.0.0.1:${port}/operator-snapshot.json" || true) - test "$code" = "200" && break - sleep 0.2 - done - test -s "$OUT/operator-snapshot.json" - - - name: surface_asserts - actions: - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/summary.txt" - pattern: "managed_volume=pvc-unreachable status=unknown reason=status_endpoint_unreachable" - save_as: summary_unreachable_count - - action: assert_greater - actual: "{{ summary_unreachable_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/operator-snapshot.json" - pattern: "\"reason_code\": \"status_endpoint_unreachable\"" - save_as: report_snapshot_reason_count - - action: assert_greater - actual: "{{ report_snapshot_reason_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/operator-snapshot.json" - pattern: "\"mutation_allowed\": false" - save_as: report_snapshot_readonly_count - - action: assert_greater - actual: "{{ report_snapshot_readonly_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/explain.txt" - pattern: "managed_volume_condition Ready status=Unknown reason=status_endpoint_unreachable" - save_as: explain_unknown_count - - action: assert_greater - actual: "{{ explain_unknown_count }}" - threshold: "0" - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/dashboard/operator-snapshot.json" - pattern: "\"reason_code\": \"status_endpoint_unreachable\"" - save_as: dashboard_reason_count - - action: assert_greater - actual: "{{ dashboard_reason_count }}" - threshold: "0" - - action: exec - node: m02 - timeout: 1m - cmd: | - python3 - <<'PY' - import json - from pathlib import Path - paths = [ - Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/report/operator-snapshot.json"), - Path("/mnt/smb/work/share/g15d-k8s/{{ run_id }}-status-endpoint-unreachable/dashboard/operator-snapshot.json"), - ] - for path in paths: - doc = json.loads(path.read_text()) - if doc.get("read_only") is not True: - raise SystemExit(f"{path}: read_only not true") - if (doc.get("mutation") or {}).get("mutation_allowed") is not False: - raise SystemExit(f"{path}: mutation_allowed not false") - vols = doc.get("volumes") or [] - if len(vols) != 1: - raise SystemExit(f"{path}: expected one volume") - status = vols[0].get("status") or {} - if status.get("status") != "unknown" or status.get("reason_code") != "status_endpoint_unreachable": - raise SystemExit(f"{path}: bad status {status}") - for condition in status.get("conditions") or []: - if condition.get("type") == "Ready" and condition.get("status") == "True": - raise SystemExit(f"{path}: false Ready=True") - PY diff --git a/seaweed-block/testops/scenarios/swblockvolume-authority-facts-chain.yaml b/seaweed-block/testops/scenarios/swblockvolume-authority-facts-chain.yaml deleted file mode 100644 index 3e6751d2b5..0000000000 --- a/seaweed-block/testops/scenarios/swblockvolume-authority-facts-chain.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Runner-native Phase 89 gate: SwBlockVolume.status exposes current authority -# facts for later failback target activation. This is status projection only, -# not a failback execution claim. - -name: swblockvolume-authority-facts-chain -timeout: 5m - -env: - product_root: "/tmp/seaweed_block" - ssh_key: "C:\\work\\dev_server\\testdev_key" - -topology: - nodes: - m02: - host: 192.168.1.184 - user: testdev - key: "{{ ssh_key }}" - -phases: - - name: swblockvolume_authority_facts_gate - actions: - - action: exec - node: m02 - timeout: 4m - cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts bash scripts/run-phase89-swblockvolume-authority-facts-gate.sh {{ product_root }}" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^phase89_swblockvolume_authority_facts_status=ok$" - save_as: phase89_ok - - action: assert_greater - actual: "{{ phase89_ok }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^crd_status_primary_replica_id=true$" - save_as: crd_primary - - action: assert_greater - actual: "{{ crd_primary }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^crd_status_authority_epoch=true$" - save_as: crd_epoch - - action: assert_greater - actual: "{{ crd_epoch }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^operator_snapshot_snake_authority=true$" - save_as: snapshot_authority - - action: assert_greater - actual: "{{ snapshot_authority }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^crd_status_camel_authority=true$" - save_as: crd_camel - - action: assert_greater - actual: "{{ crd_camel }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^report_summary_authority_line=true$" - save_as: report_authority - - action: assert_greater - actual: "{{ report_authority }}" - threshold: "0" - - - action: grep_log - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts/phase89-swblockvolume-authority-facts-summary.txt" - pattern: "^failback_activation_attempted=false$" - save_as: no_failback_activation - - action: assert_greater - actual: "{{ no_failback_activation }}" - threshold: "0" - - - name: collect - always: true - actions: - - action: collect_path - node: m02 - path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase89-swblockvolume-authority-facts" - name: "remote-phases" - ignore_error: true diff --git a/seaweed-block/testops/suites/beta-hardening-gate.yaml b/seaweed-block/testops/suites/beta-hardening-gate.yaml deleted file mode 100644 index c7f9904f1f..0000000000 --- a/seaweed-block/testops/suites/beta-hardening-gate.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: beta-hardening-gate -mode: chain - -# Seed runner-native beta-hardening suite. -# -# This composes the gates that are already executable today. It intentionally -# keeps each child scenario as the owner of its own cleanup and artifact -# collection. The suite layer only sequences them and emits top-level -# status/result metadata with child run pointers. -# -# Expected invocation from the controller: -# swblock suite --results-dir \ -# --env product_root=/tmp/seaweed-block-plan-roadmap-refresh-devrun \ -# --env ssh_key=C:/work/dev_server/testdev_key \ -# testops/suites/beta-hardening-gate.yaml -# -# Not yet final-close complete: -# - validate-bundle --profile beta-hardening is a runner-side follow-up. - -scenarios: - - id: iscsi-p6-alua-failover - path: ../scenarios/iscsi-p6-alua-failover-chain.yaml - - id: nvme-p4-multipath-failover - path: ../scenarios/nvme-p4-multipath-failover-chain.yaml - - id: nvme-p5-csi-protocol - path: ../scenarios/nvme-p5-csi-protocol-chain.yaml - - id: iscsi-p8-compat-soak - path: ../scenarios/iscsi-p8-compat-soak-chain.yaml - - id: csi-lifecycle-component - path: ../scenarios/csi-lifecycle-component-gate.yaml - - id: csi-rf1-durable-restart - path: ../scenarios/csi-rf1-durable-restart-chain.yaml - - id: operations-status-diagnostics - path: ../scenarios/operations-status-diagnostics-chain.yaml - - id: returned-replica-component - path: ../scenarios/returned-replica-component-gate.yaml - - id: iscsi-returned-replica - path: ../scenarios/iscsi-returned-replica-chain.yaml - - id: cleanup-residue - path: ../scenarios/cleanup-residue-chain.yaml diff --git a/seaweed-block/testops/suites/nvme-release-artifact-smoke.yaml b/seaweed-block/testops/suites/nvme-release-artifact-smoke.yaml deleted file mode 100644 index c7611b6fca..0000000000 --- a/seaweed-block/testops/suites/nvme-release-artifact-smoke.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: nvme-release-artifact-smoke-suite -mode: chain - -# Release-artifact gate for Phase 102. -# -# Required suite env: -# release_image=ghcr.io/seaweedfs/seaweed-block:sha- -# release_csi_image=ghcr.io/seaweedfs/seaweed-block-csi:sha- -# -# The scenario validates that the published images, not source-built local -# images, can run the Phase 100 NVMe CSI multipath attach path and the Phase 101 -# standalone NVMe hardening gates. - -scenarios: - - id: nvme-release-artifact-smoke - path: ../scenarios/nvme-release-artifact-smoke-chain.yaml diff --git a/seaweed-block/testops/suites/nvme-tcp-release-image-smoke.yaml b/seaweed-block/testops/suites/nvme-tcp-release-image-smoke.yaml deleted file mode 100644 index 6a8f1aa9e9..0000000000 --- a/seaweed-block/testops/suites/nvme-tcp-release-image-smoke.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: nvme-tcp-release-image-smoke-suite -mode: chain - -# Phase 117 release-image gate. -# -# Required suite env: -# release_image=ghcr.io/seaweedfs/seaweed-block:sha- -# release_csi_image=ghcr.io/seaweedfs/seaweed-block-csi:sha- -# Optional: -# release_commit= -# -# The scenario validates the published image pair, not source-built local -# images, against the representative NVMe/TCP supported-lab path. - -scenarios: - - id: nvme-tcp-release-image-smoke - path: ../scenarios/nvme-tcp-release-image-smoke-chain.yaml diff --git a/seaweed-block/testops/suites/protocol-release-gate.yaml b/seaweed-block/testops/suites/protocol-release-gate.yaml deleted file mode 100644 index 5174eb0817..0000000000 --- a/seaweed-block/testops/suites/protocol-release-gate.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: protocol-release-gate-suite -mode: chain - -# Runner-native equivalent of scripts/testops-run-protocol-release-gate.*. -# The suite CLI supplies the common env values, for example: -# swblock suite --results-dir \ -# --env product_root=/tmp/seaweed-block-nvme-p4l \ -# --env ssh_key=C:/work/dev_server/testdev_key \ -# testops/suites/protocol-release-gate.yaml -# -# Each child scenario owns its own product-level assertions and artifact -# collection. The suite layer only sequences them and emits top-level -# status/result metadata with child run pointers. - -scenarios: - - id: iscsi-p6-alua-failover - path: ../scenarios/iscsi-p6-alua-failover-chain.yaml - - id: nvme-p4-multipath-failover - path: ../scenarios/nvme-p4-multipath-failover-chain.yaml - - id: nvme-p5-csi-protocol - path: ../scenarios/nvme-p5-csi-protocol-chain.yaml - - id: iscsi-p8-compat-soak - path: ../scenarios/iscsi-p8-compat-soak-chain.yaml From acc22a4270b70090551bd5bd7e8f54631a52bee5 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 03:56:07 -0800 Subject: [PATCH 02/29] seaweed-block: docs: known issue: a queued rebalance can undo an operator failover (replicated preview) (#13444) Docs only. Includes the maintainer's #13446 (the commands to check and redo the primary after a failover). Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/releases/replicated-volumes-preview.md | 4 ++++ seaweed-block/docs/releases/v1.1.1.md | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/seaweed-block/docs/releases/replicated-volumes-preview.md b/seaweed-block/docs/releases/replicated-volumes-preview.md index e7c816bddb..a4cbbc117d 100644 --- a/seaweed-block/docs/releases/replicated-volumes-preview.md +++ b/seaweed-block/docs/releases/replicated-volumes-preview.md @@ -27,6 +27,10 @@ writing guest: 5. **Under `best-effort`, a replica can fall behind while it shows `healthy`.** A `best-effort` write waits for no replica, so a replica whose connection dropped can keep showing `healthy` while it misses writes. Use `sync-quorum` when the replicas must hold the data. +6. **An operator failover can be undone by an automatic rebalance.** With `sync-all`, or `sync-quorum` and two + replicas, a rebalance blockmaster decided just before `sw-block ops failover` can still be applied after it and move + the primary again. No acknowledged write is lost. After a failover, read the line with + `sw-block ops volumes --master-api -o json` and, if the primary moved, repeat the failover against it. **Planned for a later release.** Supported replicated volumes are planned for a later release; v1.1.x keeps every replicated configuration a preview. Replicated volumes are a preview: a primary cut off from the block master is not stopped diff --git a/seaweed-block/docs/releases/v1.1.1.md b/seaweed-block/docs/releases/v1.1.1.md index 303b8ca7cc..09067fa09b 100644 --- a/seaweed-block/docs/releases/v1.1.1.md +++ b/seaweed-block/docs/releases/v1.1.1.md @@ -46,6 +46,13 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo - At startup blockmaster checks volumes that are reserved for deletion and hold no workspace lease, one at a time, before it serves. Each check reads the filer, so a slow filer delays the start: in our test, 100 such volumes with a 100 ms filer delay added about 20 s. Volumes in normal use are skipped without a read. - No data is lost. A fix is planned for v1.1.2. +## Known issue: replicated volumes (preview): a queued rebalance can undo an operator failover + +- Affects replicated volumes (preview) whose acknowledgement profile allows a planned move: `sync-all`, or `sync-quorum` with two replicas. +- blockmaster may decide an automatic rebalance, which moves the primary to a less loaded server, just before an operator's `sw-block ops failover`. If that rebalance is applied after the failover, it moves the primary again, away from the replica the operator chose. +- No acknowledged write is lost: under these profiles every replica holds every acknowledged write. +- What to do: after `sw-block ops failover`, read the volume's line with `sw-block ops volumes --master-api -o json`; if `primary_replica` moved again, repeat the failover with `--expect-current @`. A fix is planned for a later v1.1.x release. + ## Upgrade notes - **Order: the CLI first, then blockmaster, then each holder**, as in From ab25506331e6a2a44f1f36ee210d1d8cc9a87613 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 07:08:10 -0800 Subject: [PATCH 03/29] seaweed-block: docs: known issue: resuming a snapshot delete that is still running (#13454) * seaweed-block: docs: known issue: resuming a snapshot delete that is still running Two overlapping runs of one snapshot delete, with a cleaning pass between, can record the delete with an intent page whose data was freed; every later snapshot delete on the volume is then refused (queue_full) and the volume's cleaning stops. The v1.1.1 notes give the trigger, the effect, what to do, and that v1.1.1 has no recovery for an affected volume. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: a stuck snapshot delete answers layout_busy, not queue_full Review: with the intent stuck, a later snapshot delete stops at the catalog's pre-check and answers layout_busy, a retryable answer that does not clear on retry. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- seaweed-block/docs/releases/v1.1.1.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/seaweed-block/docs/releases/v1.1.1.md b/seaweed-block/docs/releases/v1.1.1.md index 09067fa09b..256362f00a 100644 --- a/seaweed-block/docs/releases/v1.1.1.md +++ b/seaweed-block/docs/releases/v1.1.1.md @@ -53,6 +53,13 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo - No acknowledged write is lost: under these profiles every replica holds every acknowledged write. - What to do: after `sw-block ops failover`, read the volume's line with `sw-block ops volumes --master-api -o json`; if `primary_replica` moved again, repeat the failover with `--expect-current @`. A fix is planned for a later v1.1.x release. +## Known issue: resuming a snapshot delete that is still running can stop the volume's snapshot deletes and cleaning + +- **Trigger:** two runs of the same snapshot delete overlap. A run is resumed (`--request-id`, as a `no_progress` answer suggests, or by the volume host) while an earlier run of the same delete is still alive but stalled, for example a paused process or a slow filer call, and a cleaning pass runs in between. +- **Effect:** the snapshot delete is recorded with an intent page whose data was freed. From then on every snapshot delete on that volume fails with `layout_busy`, a retryable answer that does not clear on retry, and the volume's cleaning stops, so space is not reclaimed on that volume. The volume's data and its other snapshots stay readable. +- **What to do:** do not resume a snapshot delete while an earlier run of it may still be running. Wait for that run's answer, or make sure its process has exited, before you repeat the command with `--request-id`. +- **Recovery:** none in v1.1.1. A volume that already shows this needs a repair that is planned for a later release. A fix that prevents the record is planned for v1.1.2. + ## Upgrade notes - **Order: the CLI first, then blockmaster, then each holder**, as in From 20854b3a662bf5a99300d3be2e7fd3720ebb19d4 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 09:01:26 -0800 Subject: [PATCH 04/29] seaweed-block: docs: a no_progress answer or exiting does not stop a snapshot delete run (#13459) * seaweed-block: docs: exiting or a no_progress answer does not stop a snapshot delete run Review: a write the earlier run already sent to the filer can still land after a no_progress answer, a timeout or the command's exit, so the note asks for the earlier run's final answer before a resume, says waiting for the filer only lowers the risk, and says resumes the volume host starts on its own are outside the operator's control in v1.1.1. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: v1.1.1 has no reliable workaround for an overlapping snapshot delete Review: waiting for a final answer or for the filer is not a workaround an operator can rely on. The note now says there is none in v1.1.1, that not re-running or resuming an interrupted snapshot delete by hand reduces exposure, and that the fix is planned for v1.1.2. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the volume host retries only its own delete, for up to 30 seconds Review: the host never picks up a delete the command started; a delete sent to the host is retried by the host itself for up to 30 seconds. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the outstanding filer write, not a live run, is what makes a resume unsafe Review: the trigger described an earlier run that is still alive, so an operator could read a terminated process as ruling it out. The trigger and the advice now name the filer write the earlier run already sent, which can land after a no_progress answer, a timeout or the command's exit. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: a paused run has not sent its page update yet Review: the trigger now names both cases of an update that has not landed: the earlier run's process paused before sending it, or the update sent and not yet applied by the filer. Only in the second case need the earlier run not still be running. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: name the failures the volume host retries Review: the host retries its own delete for up to 30 seconds only while an attempt answers layout_busy or head_conflict; any other failure, including no_progress, is returned at once. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the host retry applies only on a version-1 HEAD Review: a version-0 HEAD takes v1.0's name-only delete, which the host does not retry. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the issue needs a version-1 HEAD Review: a version-0 or absent HEAD takes v1.0's name-only delete, which stages no intent pages, so it is not affected. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: 30 seconds is the host's retry threshold, not a bound Review: the host checks its deadline before each wait, so its last attempt can start and run past 30 seconds. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the host retries for about 30 seconds Review ruling: the plainer, strictly weaker wording. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- seaweed-block/docs/releases/v1.1.1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/releases/v1.1.1.md b/seaweed-block/docs/releases/v1.1.1.md index 256362f00a..64996ff4ac 100644 --- a/seaweed-block/docs/releases/v1.1.1.md +++ b/seaweed-block/docs/releases/v1.1.1.md @@ -55,9 +55,9 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo ## Known issue: resuming a snapshot delete that is still running can stop the volume's snapshot deletes and cleaning -- **Trigger:** two runs of the same snapshot delete overlap. A run is resumed (`--request-id`, as a `no_progress` answer suggests, or by the volume host) while an earlier run of the same delete is still alive but stalled, for example a paused process or a slow filer call, and a cleaning pass runs in between. +- **Trigger:** On a volume whose HEAD is version 1 (a version-0 HEAD takes v1.0's name-only delete and is not affected), two runs of the same snapshot delete overlap. A run is resumed (`--request-id`, as a `no_progress` answer suggests, or by the volume host) while an earlier run of the same delete still has a page update that has not landed: its process is paused before sending it, or it already sent it and the filer has not applied it, and a cleaning pass runs in between. In the second case the earlier run need not still be running: the write it already sent is what matters. - **Effect:** the snapshot delete is recorded with an intent page whose data was freed. From then on every snapshot delete on that volume fails with `layout_busy`, a retryable answer that does not clear on retry, and the volume's cleaning stops, so space is not reclaimed on that volume. The volume's data and its other snapshots stay readable. -- **What to do:** do not resume a snapshot delete while an earlier run of it may still be running. Wait for that run's answer, or make sure its process has exited, before you repeat the command with `--request-id`. +- **What to do:** v1.1.1 has no reliable workaround. To reduce exposure, do not re-run or resume an interrupted snapshot delete by hand (for example with `--request-id` after a `no_progress` answer). After a `no_progress` answer, a timeout, or the command's exit, a filer write the earlier run already sent can still land, so a later resume is not safe. On a volume whose HEAD is version 1, a delete sent to the volume host is retried by the host itself for about 30 seconds, but only while an attempt answers `layout_busy` or `head_conflict`; any other failure, including `no_progress`, is returned at once. On a version-0 HEAD the host runs v1.0's name-only delete, which it does not retry. The fix is planned for v1.1.2. - **Recovery:** none in v1.1.1. A volume that already shows this needs a repair that is planned for a later release. A fix that prevents the record is planned for v1.1.2. ## Upgrade notes From ba4370183ac5da3b4763f20c8334e5e6e828fc82 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:01:40 -0800 Subject: [PATCH 05/29] s3api: keep the derived aws:s3:arn in a CopyObject SSE-KMS context (#13451) * s3api: keep the derived aws:s3:arn in a CopyObject SSE-KMS context ParseSSEKMSCopyHeaders took the destination context header verbatim, so a copy could carry no aws:s3:arn or name another bucket's ARN, and a KMS key policy conditioned on aws:s3:arn could be met that way. Without the header, the default context was built from the filer path, which made the ARN arn:aws:s3:::b//buckets/b/key. Build the destination context the way PutObject does: the derived ARN of the destination object plus the client's extra keys. Co-Authored-By: Claude Opus 5.5 * s3api: reject a CopyObject SSE-KMS context the KMS would refuse The copy validation only checked that the context header was non-empty, so a malformed context failed later, after the copy had started, with InternalError. Apply the same checks PutObject applies and answer InvalidRequest up front. Co-Authored-By: Claude Opus 5.5 * s3api: answer InvalidRequest when the destination KMS context is refused The derived aws:s3:arn of a destination key with a control character fails the KMS context checks, and the copy answered InternalError. Return it as a CopyValidationError and let the copy error mapping honor that type, so the client gets InvalidRequest as PutObject does. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- weed/s3api/s3_sse_kms.go | 18 +-- weed/s3api/s3api_copy_validation.go | 9 +- ...i_object_handlers_copy_kms_context_test.go | 129 ++++++++++++++++++ .../s3api_object_handlers_copy_unified.go | 5 + 4 files changed, 144 insertions(+), 17 deletions(-) create mode 100644 weed/s3api/s3api_object_handlers_copy_kms_context_test.go diff --git a/weed/s3api/s3_sse_kms.go b/weed/s3api/s3_sse_kms.go index 1bd5526660..bf5f40e4b6 100644 --- a/weed/s3api/s3_sse_kms.go +++ b/weed/s3api/s3_sse_kms.go @@ -781,23 +781,17 @@ func ParseSSEKMSCopyHeaders(r *http.Request) (destKeyID string, encryptionContex return "", nil, false, fmt.Errorf("invalid KMS key ID: %s", destKeyID) } - // Parse encryption context if provided - if contextHeader := r.Header.Get(s3_constants.AmzServerSideEncryptionContext); contextHeader != "" { - contextBytes, decodeErr := base64.StdEncoding.DecodeString(contextHeader) - if decodeErr != nil { - return "", nil, false, fmt.Errorf("invalid encryption context encoding: %v", decodeErr) - } - - if unmarshalErr := json.Unmarshal(contextBytes, &encryptionContext); unmarshalErr != nil { - return "", nil, false, fmt.Errorf("invalid encryption context JSON: %v", unmarshalErr) - } - } - // Parse bucket key enabled flag if bucketKeyHeader := r.Header.Get(s3_constants.AmzServerSideEncryptionBucketKeyEnabled); bucketKeyHeader != "" { bucketKeyEnabled = strings.ToLower(bucketKeyHeader) == "true" } + dstBucket, dstObject := s3_constants.GetBucketAndObject(r) + encryptionContext, err = buildRequestEncryptionContext(dstBucket, dstObject, bucketKeyEnabled, r.Header.Get(s3_constants.AmzServerSideEncryptionContext)) + if err != nil { + return "", nil, false, &CopyValidationError{Code: s3err.ErrInvalidRequest, Message: err.Error()} + } + return destKeyID, encryptionContext, bucketKeyEnabled, nil } diff --git a/weed/s3api/s3api_copy_validation.go b/weed/s3api/s3api_copy_validation.go index 8c4cf47be3..430be30683 100644 --- a/weed/s3api/s3api_copy_validation.go +++ b/weed/s3api/s3api_copy_validation.go @@ -300,15 +300,14 @@ func hasSSECHeaders(headers http.Header) bool { s3_constants.AmzServerSideEncryptionCustomerKeyMD5) } -// validateEncryptionContext validates the encryption context header format +// validateEncryptionContext applies the checks the destination KMS call +// would apply to the context header. func validateEncryptionContext(contextHeader string) error { - // This would validate base64 encoding and JSON format - // Implementation would decode base64 and parse JSON - // For now, just check it's not empty if contextHeader == "" { return fmt.Errorf("encryption context cannot be empty") } - return nil + _, err := buildRequestEncryptionContext("", "", false, contextHeader) + return err } // ValidateCopySource validates the copy source path. diff --git a/weed/s3api/s3api_object_handlers_copy_kms_context_test.go b/weed/s3api/s3api_object_handlers_copy_kms_context_test.go new file mode 100644 index 0000000000..85899404ea --- /dev/null +++ b/weed/s3api/s3api_object_handlers_copy_kms_context_test.go @@ -0,0 +1,129 @@ +package s3api + +import ( + "encoding/base64" + "fmt" + "net/http" + "net/http/httptest" + "net/url" + "testing" + + "github.com/gorilla/mux" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/pb/s3_pb" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + util_http "github.com/seaweedfs/seaweedfs/weed/util/http" + "github.com/stretchr/testify/require" +) + +func newCopyKMSContextTestServer(t *testing.T, source *filer_pb.Entry, bucketEncryption *s3_pb.EncryptionConfiguration) (*S3ApiServer, *copyACLFiler) { + t.Helper() + util_http.InitGlobalHttpClient() + volume := startFakeVolumeServer(t) + for _, chunk := range source.GetChunks() { + volume.stored[chunk.GetFileIdString()] = []byte("data") + } + filer := ©ACLFiler{ambiguousPutFiler: &ambiguousPutFiler{volume: volume, apply: true, entries: map[string]*filer_pb.Entry{}}} + s3a := newPutTestServer(t, startFakeFiler(t, filer)) + s3a.iam = NewIdentityAccessManagementWithStore(s3a.option, nil, "memory") + t.Cleanup(s3a.iam.Shutdown) + s3a.bucketConfigCache.Set("b", &BucketConfig{Name: "b", Encryption: bucketEncryption}) + filer.entries["/buckets/b"] = &filer_pb.Entry{Name: "b", IsDirectory: true, Attributes: &filer_pb.FuseAttributes{}} + filer.entries["/buckets/b/source"] = source + return s3a, filer +} + +func copyToDestination(s3a *S3ApiServer, destination string, headers map[string]string) *httptest.ResponseRecorder { + req := httptest.NewRequest(http.MethodPut, "http://s3/b/"+url.PathEscape(destination), nil) + req = mux.SetURLVars(req, map[string]string{"bucket": "b", "object": destination}) + req.Header.Set("X-Amz-Copy-Source", "/b/source") + for k, v := range headers { + req.Header.Set(k, v) + } + rr := httptest.NewRecorder() + s3a.CopyObjectHandler(rr, req) + return rr +} + +func TestCopyObjectSSEKMSContextKeepsTheDestinationARN(t *testing.T) { + kmsKey := SetupTestKMS(t) + t.Cleanup(kmsKey.Cleanup) + attributes := func() *filer_pb.FuseAttributes { + return &filer_pb.FuseAttributes{FileMode: defaultFileMode, FileSize: 4, Mime: "text/plain"} + } + chunked := func() *filer_pb.Entry { + return &filer_pb.Entry{Name: "source", Attributes: attributes(), + Chunks: []*filer_pb.FileChunk{{FileId: fmt.Sprintf("3,%016x%08x", 100, 100), Size: 4}}} + } + explicit := map[string]string{ + s3_constants.AmzServerSideEncryption: "aws:kms", + s3_constants.AmzServerSideEncryptionAwsKmsKeyId: kmsKey.KeyID, + s3_constants.AmzServerSideEncryptionContext: base64.StdEncoding.EncodeToString([]byte(`{"aws:s3:arn":"arn:aws:s3:::other/o","team":"a"}`)), + } + for name, tc := range map[string]struct { + source *filer_pb.Entry + headers map[string]string + bucketEncryption *s3_pb.EncryptionConfiguration + want map[string]string + }{ + "chunked source": { + source: chunked(), + headers: explicit, + want: map[string]string{"aws:s3:arn": "arn:aws:s3:::b/destination", "team": "a"}, + }, + "inline source": { + source: &filer_pb.Entry{Name: "source", Attributes: attributes(), Content: []byte("data")}, + headers: explicit, + want: map[string]string{"aws:s3:arn": "arn:aws:s3:::b/destination", "team": "a"}, + }, + "bucket default": { + source: chunked(), + bucketEncryption: &s3_pb.EncryptionConfiguration{SseAlgorithm: "aws:kms", KmsKeyId: kmsKey.KeyID}, + want: map[string]string{"aws:s3:arn": "arn:aws:s3:::b/destination"}, + }, + } { + t.Run(name, func(t *testing.T) { + s3a, filer := newCopyKMSContextTestServer(t, tc.source, tc.bucketEncryption) + rr := copyToDestination(s3a, "destination", tc.headers) + require.Equal(t, http.StatusOK, rr.Code, rr.Body.String()) + + filer.mu.Lock() + stored := filer.entries["/buckets/b/destination"] + filer.mu.Unlock() + require.NotNil(t, stored) + sseKey, err := DeserializeSSEKMSMetadata(stored.Extended[s3_constants.SeaweedFSSSEKMSKey]) + require.NoError(t, err) + require.Equal(t, kmsKey.KeyID, sseKey.KeyID) + require.Equal(t, tc.want, sseKey.EncryptionContext) + }) + } +} + +func TestCopyObjectRejectsAContextTheKeyServiceRefuses(t *testing.T) { + kmsKey := SetupTestKMS(t) + t.Cleanup(kmsKey.Cleanup) + for name, tc := range map[string]struct { + destination string + contextHeader string + }{ + "not base64": {"destination", "not base64!"}, + "not JSON": {"destination", base64.StdEncoding.EncodeToString([]byte("team=a"))}, + "control character": {"destination", base64.StdEncoding.EncodeToString([]byte(`{"team":"a\tb"}`))}, + "control character in the destination key": {"dst\tkey", base64.StdEncoding.EncodeToString([]byte(`{"team":"a"}`))}, + } { + t.Run(name, func(t *testing.T) { + s3a, filer := newCopyKMSContextTestServer(t, &filer_pb.Entry{Name: "source", Content: []byte("data"), + Attributes: &filer_pb.FuseAttributes{FileMode: defaultFileMode, FileSize: 4, Mime: "text/plain"}}, nil) + rr := copyToDestination(s3a, tc.destination, map[string]string{ + s3_constants.AmzServerSideEncryption: "aws:kms", + s3_constants.AmzServerSideEncryptionAwsKmsKeyId: kmsKey.KeyID, + s3_constants.AmzServerSideEncryptionContext: tc.contextHeader, + }) + require.Equal(t, http.StatusBadRequest, rr.Code, rr.Body.String()) + require.Contains(t, rr.Body.String(), "InvalidRequest") + filer.mu.Lock() + defer filer.mu.Unlock() + require.NotContains(t, filer.entries, "/buckets/b/"+tc.destination) + }) + } +} diff --git a/weed/s3api/s3api_object_handlers_copy_unified.go b/weed/s3api/s3api_object_handlers_copy_unified.go index 3cfa54257f..6bf9d36460 100644 --- a/weed/s3api/s3api_object_handlers_copy_unified.go +++ b/weed/s3api/s3api_object_handlers_copy_unified.go @@ -99,6 +99,11 @@ func (s3a *S3ApiServer) mapCopyErrorToS3Error(err error) s3err.ErrorCode { return ssecErr } + var validationErr *CopyValidationError + if errors.As(err, &validationErr) { + return validationErr.Code + } + // Default to internal error for unknown errors return s3err.ErrInternalError } From 6c0859349baac097c48d80d3dd111391695e0433 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:02:14 -0800 Subject: [PATCH 06/29] s3api, iam: match policy variable values literally (#13413) * wildcard: match expanded variable text literally Co-Authored-By: Claude Opus 5.5 * s3api: match policy variable values literally in resource, action and principal patterns Co-Authored-By: Claude Opus 5.5 * s3api: match policy variable values literally in Like conditions Co-Authored-By: Claude Opus 5.5 * iam: match policy variable values literally in role policies Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- weed/iam/policy/policy_engine.go | 61 ++++----------- .../policy/policy_variable_matching_test.go | 68 +++++++++++++++++ weed/s3api/policy_engine/conditions.go | 63 ++++++++++----- weed/s3api/policy_engine/engine.go | 5 +- .../policy_engine/engine_variables_test.go | 76 +++++++++++++++++++ weed/s3api/policy_engine/types.go | 4 +- weed/util/wildcard/wildcard_matcher.go | 53 +++++++++++-- weed/util/wildcard/wildcard_matcher_test.go | 40 +++++++++- 8 files changed, 293 insertions(+), 77 deletions(-) diff --git a/weed/iam/policy/policy_engine.go b/weed/iam/policy/policy_engine.go index 80063bf453..696de3fe1f 100644 --- a/weed/iam/policy/policy_engine.go +++ b/weed/iam/policy/policy_engine.go @@ -1083,14 +1083,13 @@ func (e *PolicyEngine) EvaluateStringCondition(block map[string]interface{}, eva for _, contextValue := range contextStrings { contextValueMatchedSet := false for _, expected := range expectedStrings { - expandedExpected := expandPolicyVariables(expected, evalCtx) if useWildcard { - if wildcard.MatchesWildcard(expandedExpected, contextValue) { + if awsIAMResourceMatch(expected, contextValue, evalCtx) { contextValueMatchedSet = true break } } else { - if expandedExpected == contextValue { + if expandPolicyVariables(expected, evalCtx) == contextValue { contextValueMatchedSet = true break } @@ -1124,14 +1123,13 @@ func (e *PolicyEngine) EvaluateStringCondition(block map[string]interface{}, eva for _, contextValue := range contextStrings { contextValueMatchedSet := false for _, expected := range expectedStrings { - expandedExpected := expandPolicyVariables(expected, evalCtx) if useWildcard { - if wildcard.MatchesWildcard(expandedExpected, contextValue) { + if awsIAMResourceMatch(expected, contextValue, evalCtx) { contextValueMatchedSet = true break } } else { - if expandedExpected == contextValue { + if expandPolicyVariables(expected, evalCtx) == contextValue { contextValueMatchedSet = true break } @@ -1232,38 +1230,15 @@ func validateStatementWithType(statement *Statement, policyType string) error { // awsIAMMatch performs AWS IAM-compliant pattern matching with case-insensitivity and policy variable support func awsIAMMatch(pattern, value string, evalCtx *EvaluationContext) bool { - // Step 1: Substitute policy variables (e.g., ${aws:username}, ${saml:username}) - expandedPattern := expandPolicyVariables(pattern, evalCtx) - - // Step 2: Handle special patterns - if expandedPattern == "*" { - return true // Universal wildcard - } - - // Step 3: Case-insensitive exact match - if strings.EqualFold(expandedPattern, value) { - return true - } - - // Step 4: Handle AWS-style wildcards (case-insensitive) - if strings.Contains(expandedPattern, "*") || strings.Contains(expandedPattern, "?") { - return wildcard.MatchesWildcard(strings.ToLower(expandedPattern), strings.ToLower(value)) - } - - return false + expand := func(v string) string { return expandPolicyVariables(v, evalCtx) } + return wildcard.MatchesExpandedWildcard(pattern, policyVariablePattern, expand, value, true) } // awsIAMResourceMatch matches resource ARNs case-sensitively: object keys and // identity names that differ only in case name different resources. func awsIAMResourceMatch(pattern, value string, evalCtx *EvaluationContext) bool { - expandedPattern := expandPolicyVariables(pattern, evalCtx) - if expandedPattern == "*" || expandedPattern == value { - return true - } - if strings.Contains(expandedPattern, "*") || strings.Contains(expandedPattern, "?") { - return wildcard.MatchesWildcard(expandedPattern, value) - } - return false + expand := func(v string) string { return expandPolicyVariables(v, evalCtx) } + return wildcard.MatchesExpandedWildcard(pattern, policyVariablePattern, expand, value, false) } // expandPolicyVariables substitutes AWS policy variables in the pattern @@ -1390,13 +1365,12 @@ func (e *PolicyEngine) evaluateStringConditionIgnoreCase(block map[string]interf // Check against all expected values switch v := expectedValues.(type) { case string: - expandedPattern := expandPolicyVariables(v, evalCtx) if useWildcard { - if wildcard.MatchesWildcard(strings.ToLower(expandedPattern), strings.ToLower(ctxStr)) { + if awsIAMMatch(v, ctxStr, evalCtx) { itemMatchedSet = true } } else { - if strings.EqualFold(expandedPattern, ctxStr) { + if strings.EqualFold(expandPolicyVariables(v, evalCtx), ctxStr) { itemMatchedSet = true } } @@ -1412,14 +1386,13 @@ func (e *PolicyEngine) evaluateStringConditionIgnoreCase(block map[string]interf } } for _, valStr := range slice { - expandedPattern := expandPolicyVariables(valStr, evalCtx) if useWildcard { - if wildcard.MatchesWildcard(strings.ToLower(expandedPattern), strings.ToLower(ctxStr)) { + if awsIAMMatch(valStr, ctxStr, evalCtx) { itemMatchedSet = true break } } else { - if strings.EqualFold(expandedPattern, ctxStr) { + if strings.EqualFold(expandPolicyVariables(valStr, evalCtx), ctxStr) { itemMatchedSet = true break } @@ -1452,13 +1425,12 @@ func (e *PolicyEngine) evaluateStringConditionIgnoreCase(block map[string]interf // Handle different value types switch v := expectedValues.(type) { case string: - expandedPattern := expandPolicyVariables(v, evalCtx) if useWildcard { - if wildcard.MatchesWildcard(strings.ToLower(expandedPattern), strings.ToLower(ctxStr)) { + if awsIAMMatch(v, ctxStr, evalCtx) { itemMatchedSet = true } } else { - if strings.EqualFold(expandedPattern, ctxStr) { + if strings.EqualFold(expandPolicyVariables(v, evalCtx), ctxStr) { itemMatchedSet = true } } @@ -1474,14 +1446,13 @@ func (e *PolicyEngine) evaluateStringConditionIgnoreCase(block map[string]interf } } for _, valStr := range slice { - expandedPattern := expandPolicyVariables(valStr, evalCtx) if useWildcard { - if wildcard.MatchesWildcard(strings.ToLower(expandedPattern), strings.ToLower(ctxStr)) { + if awsIAMMatch(valStr, ctxStr, evalCtx) { itemMatchedSet = true break } } else { - if strings.EqualFold(expandedPattern, ctxStr) { + if strings.EqualFold(expandPolicyVariables(valStr, evalCtx), ctxStr) { itemMatchedSet = true break } diff --git a/weed/iam/policy/policy_variable_matching_test.go b/weed/iam/policy/policy_variable_matching_test.go index 49b5a5a848..252738b70e 100644 --- a/weed/iam/policy/policy_variable_matching_test.go +++ b/weed/iam/policy/policy_variable_matching_test.go @@ -188,3 +188,71 @@ func TestActionResourceConsistencyWithStringConditions(t *testing.T) { assert.Equal(t, "Allow", string(result.MatchingStatements[0].Effect), "Matching statement should have Allow effect") } + +func TestPolicyVariableValuesAreNotWildcards(t *testing.T) { + engine := NewPolicyEngine() + require.NoError(t, engine.Initialize(&PolicyEngineConfig{DefaultEffect: "Deny", StoreType: "memory"})) + require.NoError(t, engine.AddPolicy("", "home-policy", &PolicyDocument{ + Version: "2012-10-17", + Statement: []Statement{ + { + Effect: "Allow", + Action: []string{"s3:GetObject"}, + Resource: []string{"arn:aws:s3:::home/${jwt:email}/*"}, + }, + { + Effect: "Allow", + Action: []string{"s3:ListBucket"}, + Resource: []string{"arn:aws:s3:::home"}, + Condition: map[string]map[string]interface{}{ + "StringLike": {"s3:prefix": []string{"${jwt:email}/*"}}, + }, + }, + { + Effect: "Allow", + Action: []string{"s3:PutObject"}, + Resource: []string{"arn:aws:s3:::home/*"}, + Condition: map[string]map[string]interface{}{ + "StringLikeIgnoreCase": {"s3:prefix": "${jwt:email}/*"}, + }, + }, + }, + })) + + object := "arn:aws:s3:::home/alice@corp.com/secret.txt" + tests := []struct { + name string + email string + action string + resource string + prefix string + want Effect + }{ + {"owner get", "alice@corp.com", "s3:GetObject", object, "", EffectAllow}, + {"other user get", "bob@corp.com", "s3:GetObject", object, "", EffectDeny}, + {"star email get", "*@corp.com", "s3:GetObject", object, "", EffectDeny}, + {"bare star get", "*", "s3:GetObject", object, "", EffectDeny}, + {"question mark get", "?lice@corp.com", "s3:GetObject", object, "", EffectDeny}, + {"literal star owner get", "*@corp.com", "s3:GetObject", "arn:aws:s3:::home/*@corp.com/x", "", EffectAllow}, + {"owner list", "alice@corp.com", "s3:ListBucket", "arn:aws:s3:::home", "alice@corp.com/", EffectAllow}, + {"star list", "*", "s3:ListBucket", "arn:aws:s3:::home", "alice@corp.com/", EffectDeny}, + {"owner put ignore case", "Alice@corp.com", "s3:PutObject", object, "alice@corp.com/", EffectAllow}, + {"star put ignore case", "*", "s3:PutObject", object, "alice@corp.com/", EffectDeny}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + requestContext := map[string]interface{}{"jwt:email": tt.email} + if tt.prefix != "" { + requestContext["s3:prefix"] = tt.prefix + } + result, err := engine.Evaluate(context.Background(), "", &EvaluationContext{ + Principal: "user", + Action: tt.action, + Resource: tt.resource, + RequestContext: requestContext, + }, []string{"home-policy"}) + require.NoError(t, err) + assert.Equal(t, tt.want, result.Effect) + }) + } +} diff --git a/weed/s3api/policy_engine/conditions.go b/weed/s3api/policy_engine/conditions.go index b870123717..4d20e037b8 100644 --- a/weed/s3api/policy_engine/conditions.go +++ b/weed/s3api/policy_engine/conditions.go @@ -51,13 +51,34 @@ func (e *StringNotEqualsEvaluator) Evaluate(conditionValue interface{}, contextV type StringLikeEvaluator struct{} func (e *StringLikeEvaluator) Evaluate(conditionValue interface{}, contextValues []string) bool { - patterns := normalizeToStringSlice(conditionValue) - for _, pattern := range patterns { - for _, contextValue := range contextValues { - if wildcard.MatchesWildcard(pattern, contextValue) { + for _, contextValue := range contextValues { + if matchesLikePattern(conditionValue, contextValue) { + return true + } + } + return false +} + +// likePatterns holds *Like condition values with their policy variables still +// unexpanded, so the expanded text is matched literally. +type likePatterns struct { + patterns []string + expand func(string) string +} + +func matchesLikePattern(conditionValue interface{}, contextValue string) bool { + if lp, ok := conditionValue.(likePatterns); ok { + for _, pattern := range lp.patterns { + if wildcard.MatchesExpandedWildcard(pattern, PolicyVariableRegex, lp.expand, contextValue, false) { return true } } + return false + } + for _, pattern := range normalizeToStringSlice(conditionValue) { + if wildcard.MatchesWildcard(pattern, contextValue) { + return true + } } return false } @@ -66,12 +87,9 @@ func (e *StringLikeEvaluator) Evaluate(conditionValue interface{}, contextValues type StringNotLikeEvaluator struct{} func (e *StringNotLikeEvaluator) Evaluate(conditionValue interface{}, contextValues []string) bool { - patterns := normalizeToStringSlice(conditionValue) - for _, pattern := range patterns { - for _, contextValue := range contextValues { - if wildcard.MatchesWildcard(pattern, contextValue) { - return false - } + for _, contextValue := range contextValues { + if matchesLikePattern(conditionValue, contextValue) { + return false } } return true @@ -499,12 +517,9 @@ func (e *ArnEqualsEvaluator) Evaluate(conditionValue interface{}, contextValues type ArnLikeEvaluator struct{} func (e *ArnLikeEvaluator) Evaluate(conditionValue interface{}, contextValues []string) bool { - patterns := normalizeToStringSlice(conditionValue) - for _, pattern := range patterns { - for _, contextValue := range contextValues { - if wildcard.MatchesWildcard(pattern, contextValue) { - return true - } + for _, contextValue := range contextValues { + if matchesLikePattern(conditionValue, contextValue) { + return true } } return false @@ -702,12 +717,20 @@ func evaluateConditions(conditions PolicyConditions, contextValues map[string][] // Substitute variables in expected values expectedValues := value.Strings() - substitutedValues := make([]string, len(expectedValues)) - for i, v := range expectedValues { - substitutedValues[i] = SubstituteVariables(v, contextValues, claims) + var conditionValue interface{} + if strings.HasSuffix(operator, "Like") { + conditionValue = likePatterns{patterns: expectedValues, expand: func(v string) string { + return SubstituteVariables(v, contextValues, claims) + }} + } else { + substitutedValues := make([]string, len(expectedValues)) + for i, v := range expectedValues { + substitutedValues[i] = SubstituteVariables(v, contextValues, claims) + } + conditionValue = substitutedValues } - if !conditionEvaluator.Evaluate(substitutedValues, contextVals) { + if !conditionEvaluator.Evaluate(conditionValue, contextVals) { return false // If any condition fails, the whole condition block fails } } diff --git a/weed/s3api/policy_engine/engine.go b/weed/s3api/policy_engine/engine.go index e9c925c276..ee1e2fc05e 100644 --- a/weed/s3api/policy_engine/engine.go +++ b/weed/s3api/policy_engine/engine.go @@ -15,6 +15,7 @@ import ( "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + "github.com/seaweedfs/seaweedfs/weed/util/wildcard" ) // PolicyEvaluationResult represents the result of policy evaluation @@ -181,9 +182,9 @@ func (engine *PolicyEngine) evaluateCompiledPolicy(policy *CompiledPolicy, args // matchesDynamicPatterns checks if a value matches any of the dynamic patterns after variable substitution func (engine *PolicyEngine) matchesDynamicPatterns(patterns []string, value string, args *PolicyEvaluationArgs) bool { + expand := func(v string) string { return SubstituteVariables(v, args.Conditions, args.Claims) } for _, pattern := range patterns { - substituted := SubstituteVariables(pattern, args.Conditions, args.Claims) - if FastMatchesWildcard(substituted, value) { + if wildcard.MatchesExpandedWildcard(pattern, PolicyVariableRegex, expand, value, false) { return true } } diff --git a/weed/s3api/policy_engine/engine_variables_test.go b/weed/s3api/policy_engine/engine_variables_test.go index 1252449166..a856c0aab1 100644 --- a/weed/s3api/policy_engine/engine_variables_test.go +++ b/weed/s3api/policy_engine/engine_variables_test.go @@ -150,3 +150,79 @@ func TestEvaluatePolicyForRequestVariables(t *testing.T) { t.Errorf("Expected Indeterminate when resource doesn't match variable, got %v", result) } } + +func TestPolicyVariableValuesAreNotWildcards(t *testing.T) { + engine := NewPolicyEngine() + policyJSON := `{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": "*", + "Action": "s3:GetObject", + "Resource": "arn:aws:s3:::home/${jwt:email}/*" + }, + { + "Effect": "Allow", + "Principal": {"AWS": "arn:aws:iam::123456789012:user/${jwt:preferred_username}"}, + "Action": "s3:PutObject", + "Resource": "arn:aws:s3:::home/*" + } + ] + }` + if err := engine.SetBucketPolicy("home", policyJSON); err != nil { + t.Fatalf("Failed to set bucket policy: %v", err) + } + + tests := []struct { + name string + action string + key string + principal string + claims map[string]interface{} + want PolicyEvaluationResult + }{ + {"owner", "s3:GetObject", "alice@corp.com/secret.txt", "*", map[string]interface{}{"email": "alice@corp.com"}, PolicyResultAllow}, + {"other user", "s3:GetObject", "alice@corp.com/secret.txt", "*", map[string]interface{}{"email": "bob@corp.com"}, PolicyResultIndeterminate}, + {"star email", "s3:GetObject", "alice@corp.com/secret.txt", "*", map[string]interface{}{"email": "*@corp.com"}, PolicyResultIndeterminate}, + {"bare star email", "s3:GetObject", "alice@corp.com/secret.txt", "*", map[string]interface{}{"email": "*"}, PolicyResultIndeterminate}, + {"question mark email", "s3:GetObject", "alice@corp.com/secret.txt", "*", map[string]interface{}{"email": "?lice@corp.com"}, PolicyResultIndeterminate}, + {"literal star owner", "s3:GetObject", "*@corp.com/own.txt", "*", map[string]interface{}{"email": "*@corp.com"}, PolicyResultAllow}, + {"principal owner", "s3:PutObject", "x", "arn:aws:iam::123456789012:user/alice", map[string]interface{}{"preferred_username": "alice"}, PolicyResultAllow}, + {"principal star", "s3:PutObject", "x", "arn:aws:iam::123456789012:user/alice", map[string]interface{}{"preferred_username": "*"}, PolicyResultIndeterminate}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := engine.EvaluatePolicy("home", &PolicyEvaluationArgs{ + Action: tt.action, + Resource: "arn:aws:s3:::home/" + tt.key, + Principal: tt.principal, + Claims: tt.claims, + }) + if got != tt.want { + t.Errorf("got %v, want %v", got, tt.want) + } + }) + } +} + +func TestLikeConditionVariableValuesAreNotWildcards(t *testing.T) { + prefix := map[string][]string{"s3:prefix": {"alice@corp.com/"}} + for _, operator := range []string{"StringLike", "ForAnyValue:StringLike", "StringNotLike"} { + conditions := PolicyConditions{operator: {"s3:prefix": NewStringOrStringSlice("${jwt:email}/*")}} + for _, email := range []string{"alice@corp.com", "bob@corp.com", "*@corp.com", "*", "?lice@corp.com"} { + want := email == "alice@corp.com" + if operator == "StringNotLike" { + want = !want + } + if got := EvaluateConditions(conditions, prefix, nil, map[string]interface{}{"email": email}); got != want { + t.Errorf("%s email=%q: got %v, want %v", operator, email, got, want) + } + } + } + arnLike := PolicyConditions{"ArnLike": {"aws:SourceArn": NewStringOrStringSlice("arn:aws:iam::123456789012:user/${jwt:sub}")}} + source := map[string][]string{"aws:SourceArn": {"arn:aws:iam::123456789012:user/alice"}} + if EvaluateConditions(arnLike, source, nil, map[string]interface{}{"sub": "*"}) { + t.Errorf("ArnLike matched another user's ARN through a wildcard sub") + } +} diff --git a/weed/s3api/policy_engine/types.go b/weed/s3api/policy_engine/types.go index 2c4031d1fb..f494a6785c 100644 --- a/weed/s3api/policy_engine/types.go +++ b/weed/s3api/policy_engine/types.go @@ -761,9 +761,9 @@ func (cs *CompiledStatement) matchesPrincipalSet(args *PolicyEvaluationArgs, mat return true } } + expand := func(v string) string { return SubstituteVariables(v, args.Conditions, args.Claims) } for _, pattern := range dynamic { - substituted := SubstituteVariables(pattern, args.Conditions, args.Claims) - if FastMatchesWildcard(substituted, args.Principal) { + if wildcard.MatchesExpandedWildcard(pattern, PolicyVariableRegex, expand, args.Principal, false) { return true } } diff --git a/weed/util/wildcard/wildcard_matcher.go b/weed/util/wildcard/wildcard_matcher.go index 5b2b85f6da..2c07d1b4ce 100644 --- a/weed/util/wildcard/wildcard_matcher.go +++ b/weed/util/wildcard/wildcard_matcher.go @@ -117,12 +117,47 @@ func (m *WildcardMatcher) Match(str string) bool { if m.useRegex { return m.regex.MatchString(str) } - return matchWildcardString(m.pattern, str) + return matchWildcardString(m.pattern, nil, str) } // MatchesWildcard provides a simple function interface for wildcard matching. func MatchesWildcard(pattern, str string) bool { - return matchWildcardString(pattern, str) + return matchWildcardString(pattern, nil, str) +} + +// MatchesExpandedWildcard matches str against pattern after replacing each +// match of vars with expand(match). The replacement text is matched literally, +// so only '*' and '?' written in pattern itself act as wildcards. +func MatchesExpandedWildcard(pattern string, vars *regexp.Regexp, expand func(string) string, str string, ignoreCase bool) bool { + if ignoreCase { + str = strings.ToLower(str) + } + locs := vars.FindAllStringIndex(pattern, -1) + if len(locs) == 0 { + if ignoreCase { + pattern = strings.ToLower(pattern) + } + return matchWildcardString(pattern, nil, str) + } + var expanded strings.Builder + var literal []bool + add := func(s string, isLiteral bool) { + if ignoreCase { + s = strings.ToLower(s) + } + expanded.WriteString(s) + for range len(s) { + literal = append(literal, isLiteral) + } + } + prev := 0 + for _, loc := range locs { + add(pattern[prev:loc[0]], false) + add(expand(pattern[loc[0]:loc[1]]), true) + prev = loc[1] + } + add(pattern[prev:], false) + return matchWildcardString(expanded.String(), literal, str) } // FastMatchesWildcard uses a cached WildcardMatcher for repeated pattern matching. @@ -140,8 +175,12 @@ func CompileWildcardPattern(pattern string) (*regexp.Regexp, error) { return compileWildcardPattern(pattern) } -func matchWildcardString(pattern, str string) bool { - if pattern == "*" { +func isWildcardAt(pattern string, literal []bool, i int, c byte) bool { + return pattern[i] == c && (literal == nil || !literal[i]) +} + +func matchWildcardString(pattern string, literal []bool, str string) bool { + if len(pattern) == 1 && isWildcardAt(pattern, literal, 0, '*') { return true } if pattern == str { @@ -157,11 +196,11 @@ func matchWildcardString(pattern, str string) bool { switch { // '*' must be checked before literal equality so a '*' in the target // cannot consume the pattern wildcard without a backtrack point - case patternIndex < len(pattern) && pattern[patternIndex] == '*': + case patternIndex < len(pattern) && isWildcardAt(pattern, literal, patternIndex, '*'): lastStarIndex = patternIndex lastStarMatchIndex = targetIndex patternIndex++ - case patternIndex < len(pattern) && (pattern[patternIndex] == '?' || pattern[patternIndex] == str[targetIndex]): + case patternIndex < len(pattern) && (isWildcardAt(pattern, literal, patternIndex, '?') || pattern[patternIndex] == str[targetIndex]): targetIndex++ patternIndex++ case lastStarIndex != -1: @@ -173,7 +212,7 @@ func matchWildcardString(pattern, str string) bool { } } - for patternIndex < len(pattern) && pattern[patternIndex] == '*' { + for patternIndex < len(pattern) && isWildcardAt(pattern, literal, patternIndex, '*') { patternIndex++ } return patternIndex == len(pattern) diff --git a/weed/util/wildcard/wildcard_matcher_test.go b/weed/util/wildcard/wildcard_matcher_test.go index d318206a38..c4394e24f8 100644 --- a/weed/util/wildcard/wildcard_matcher_test.go +++ b/weed/util/wildcard/wildcard_matcher_test.go @@ -1,6 +1,9 @@ package wildcard -import "testing" +import ( + "regexp" + "testing" +) func TestMatchesWildcard(t *testing.T) { tests := []struct { @@ -215,3 +218,38 @@ func BenchmarkFastMatchesWildcard(b *testing.B) { FastMatchesWildcard("s3:Get*", "s3:GetObject") } } + +func TestMatchesExpandedWildcard(t *testing.T) { + vars := regexp.MustCompile(`\$\{([^}]+)\}`) + values := map[string]string{"${user}": "", "${star}": "*", "${q}": "?lice", "${mixed}": "Al*"} + expand := func(v string) string { + if s, ok := values[v]; ok { + return s + } + return v + } + tests := []struct { + pattern string + str string + ignoreCase bool + want bool + }{ + {"home/${star}/*", "home/alice/secret", false, false}, + {"home/${star}/*", "home/*/own", false, true}, + {"${star}", "anything", false, false}, + {"${star}", "*", false, true}, + {"home/${q}/*", "home/alice/x", false, false}, + {"home/${q}/*", "home/?lice/x", false, true}, + {"home/${user}*", "home/anyone", false, true}, + {"home/${unset}/*", "home/${unset}/x", false, true}, + {"home/${unset}/*", "home/alice/x", false, false}, + {"Home/${mixed}/?", "home/al*/x", true, true}, + {"Home/${mixed}/?", "home/alice/x", true, false}, + {"plain*", "plain-text", false, true}, + } + for _, tt := range tests { + if got := MatchesExpandedWildcard(tt.pattern, vars, expand, tt.str, tt.ignoreCase); got != tt.want { + t.Errorf("MatchesExpandedWildcard(%q, %q, ignoreCase=%v) = %v, want %v", tt.pattern, tt.str, tt.ignoreCase, got, tt.want) + } + } +} From 04a93bd7ddb1805a854737420229bab10584e0b1 Mon Sep 17 00:00:00 2001 From: Tiago Posse Date: Sat, 5 Dec 2026 20:07:31 +0100 Subject: [PATCH 07/29] s3api: support UploadPartCopy from SSE-KMS sources (#13431) * s3api: support UploadPartCopy from SSE-KMS sources UploadPartCopy from an SSE-KMS source returned 501, so `aws s3 cp`, `mv` and `sync` failed for SSE-KMS objects over the multipart threshold. The re-encrypting copy path now decrypts the source the way GET does: chunks with their own SSE-KMS metadata decrypt with it, and a source without any uses the entry-level key. A ranged copy starts at the chunk holding the range, so copying the tail of a large object doesn't fetch and decrypt everything before it. Co-Authored-By: Claude Opus 5.5 * s3api: start an SSE-S3 part copy at the chunk holding the range A ranged UploadPartCopy from a per-chunk SSE-S3 source fetched and decrypted every chunk before the range and discarded it, so copying a large SSE-S3 object part by part read the source quadratically. Start at the chunk holding the range start, as the SSE-KMS path does. Co-Authored-By: Claude Opus 5.5 * s3api: answer UploadPartCopy with the KMS error when the source won't decrypt A part copy from an SSE-KMS source whose key the KMS no longer holds, has disabled or refuses answered 500 InternalError, whether the refusal came while opening the source or mid-stream. Answer it with the KMS error, as PUT and CopyObject do. Co-Authored-By: Claude Opus 5.5 * s3api: refuse an SSE-KMS part copy over chunks of another SSE type A source mixing SSE-KMS chunks with SSE-S3 or SSE-C ones would stream the foreign chunks through as plaintext, copying their ciphertext into the destination part. Refuse the copy before fetching anything. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Chris Lu --- ...sse_kms_uploadpartcopy_integration_test.go | 98 ++++++ weed/s3api/s3api_object_handlers.go | 2 +- .../s3api_object_handlers_copy_part_sse.go | 90 ++++- ...i_object_handlers_copy_part_ssekms_test.go | 323 ++++++++++++++++++ weed/s3api/s3api_object_handlers_put.go | 3 +- 5 files changed, 502 insertions(+), 14 deletions(-) create mode 100644 test/s3/sse/s3_sse_kms_uploadpartcopy_integration_test.go create mode 100644 weed/s3api/s3api_object_handlers_copy_part_ssekms_test.go diff --git a/test/s3/sse/s3_sse_kms_uploadpartcopy_integration_test.go b/test/s3/sse/s3_sse_kms_uploadpartcopy_integration_test.go new file mode 100644 index 0000000000..16f3d0fbb1 --- /dev/null +++ b/test/s3/sse/s3_sse_kms_uploadpartcopy_integration_test.go @@ -0,0 +1,98 @@ +package sse_test + +import ( + "bytes" + "context" + "crypto/sha256" + "fmt" + "io" + "testing" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/stretchr/testify/require" +) + +// UploadPartCopy from an SSE-KMS source is what `aws s3 cp`, `mv` and `sync` +// send for objects over the multipart threshold. The name matches the +// `.*Multipart.*Integration` pattern CI runs. +func TestSSEKMSMultipartUploadPartCopyIntegration(t *testing.T) { + ctx := context.Background() + client, err := createS3Client(ctx, defaultConfig) + require.NoError(t, err) + + bucketName, err := createTestBucket(ctx, client, defaultConfig.BucketPrefix+"sse-kms-uploadpartcopy-") + require.NoError(t, err) + defer cleanupTestBucket(ctx, client, bucketName) + + const sourceKeyID = "test-key-uploadpartcopy-source" + const sourceSize = 20 * 1024 * 1024 + sourceData := generateTestData(sourceSize) + _, err = client.PutObject(ctx, &s3.PutObjectInput{ + Bucket: aws.String(bucketName), + Key: aws.String("source"), + Body: bytes.NewReader(sourceData), + ServerSideEncryption: types.ServerSideEncryptionAwsKms, + SSEKMSKeyId: aws.String(sourceKeyID), + }) + require.NoError(t, err) + + const mb = 1024 * 1024 + cases := []struct { + name string + keyID string + parts [][2]int64 + }{ + {"plain destination", "", [][2]int64{{0, 8*mb - 1}, {8 * mb, 16*mb - 1}, {16 * mb, sourceSize - 1}}}, + {"same key", sourceKeyID, [][2]int64{{0, sourceSize - 1}}}, + {"other key", "test-key-uploadpartcopy-destination", [][2]int64{{0, 5*mb - 1}, {5 * mb, 13*mb + 7}, {13*mb + 8, sourceSize - 1}}}, + } + for i, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + dstKey := fmt.Sprintf("dest-%d", i) + create := &s3.CreateMultipartUploadInput{Bucket: aws.String(bucketName), Key: aws.String(dstKey)} + if tc.keyID != "" { + create.ServerSideEncryption = types.ServerSideEncryptionAwsKms + create.SSEKMSKeyId = aws.String(tc.keyID) + } + createResp, err := client.CreateMultipartUpload(ctx, create) + require.NoError(t, err) + + var completed []types.CompletedPart + for p, rng := range tc.parts { + partNumber := aws.Int32(int32(p + 1)) + resp, err := client.UploadPartCopy(ctx, &s3.UploadPartCopyInput{ + Bucket: aws.String(bucketName), + Key: aws.String(dstKey), + PartNumber: partNumber, + UploadId: createResp.UploadId, + CopySource: aws.String(bucketName + "/source"), + CopySourceRange: aws.String(fmt.Sprintf("bytes=%d-%d", rng[0], rng[1])), + }) + require.NoErrorf(t, err, "UploadPartCopy range %d-%d", rng[0], rng[1]) + completed = append(completed, types.CompletedPart{ETag: resp.CopyPartResult.ETag, PartNumber: partNumber}) + } + _, err = client.CompleteMultipartUpload(ctx, &s3.CompleteMultipartUploadInput{ + Bucket: aws.String(bucketName), + Key: aws.String(dstKey), + UploadId: createResp.UploadId, + MultipartUpload: &types.CompletedMultipartUpload{Parts: completed}, + }) + require.NoError(t, err) + + resp, err := client.GetObject(ctx, &s3.GetObjectInput{Bucket: aws.String(bucketName), Key: aws.String(dstKey)}) + require.NoError(t, err) + got, err := io.ReadAll(resp.Body) + resp.Body.Close() + require.NoError(t, err) + require.Equal(t, sha256.Sum256(sourceData), sha256.Sum256(got)) + if tc.keyID == "" { + require.Empty(t, resp.ServerSideEncryption) + } else { + require.Equal(t, types.ServerSideEncryptionAwsKms, resp.ServerSideEncryption) + require.Equal(t, tc.keyID, aws.ToString(resp.SSEKMSKeyId)) + } + }) + } +} diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index c91705db55..8f13f72958 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -3265,7 +3265,7 @@ func buildMultipartSSEKMSReader(chunks []*filer_pb.FileChunk, fetchChunk func(*f glog.V(4).Infof("Decrypting SSE-KMS chunk %s with KeyID=%s", fileId, kmsKey.KeyID) dec, decErr := CreateSSEKMSDecryptedReader(raw, kmsKey) if decErr != nil { - return nil, fmt.Errorf("failed to decrypt chunk: %v", decErr) + return nil, fmt.Errorf("failed to decrypt chunk: %w", decErr) } return dec, nil }, diff --git a/weed/s3api/s3api_object_handlers_copy_part_sse.go b/weed/s3api/s3api_object_handlers_copy_part_sse.go index 0a0bc8605a..fcda6cd7e0 100644 --- a/weed/s3api/s3api_object_handlers_copy_part_sse.go +++ b/weed/s3api/s3api_object_handlers_copy_part_sse.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "net/http" + "slices" "sort" "strconv" @@ -129,7 +130,7 @@ func (r *readCloserAdapter) Close() error { // with the source's key — producing deterministic byte corruption on GET (#8908). // // Returns errCopySourceSSEUnsupported when the source's SSE type is not yet -// implemented in this slow path (SSE-KMS, SSE-C). Callers should map that +// implemented in this slow path (SSE-C). Callers should map that // sentinel to a 501 NotImplemented S3 response rather than collapsing it to // 500 InternalError, so clients can distinguish "we will not handle this // shape" from "the server failed". @@ -150,7 +151,7 @@ func (s3a *S3ApiServer) openSourcePlaintextReader( case s3_constants.SSETypeS3: return s3a.openSSES3SourcePlaintextReader(ctx, srcEntry, startOffset, sliceLen) case s3_constants.SSETypeKMS: - return nil, fmt.Errorf("%w: UploadPartCopy from SSE-KMS source", errCopySourceSSEUnsupported) + return s3a.openSSEKMSSourcePlaintextReader(ctx, srcEntry, startOffset, sliceLen) case s3_constants.SSETypeC: return nil, fmt.Errorf("%w: UploadPartCopy from SSE-C source", errCopySourceSSEUnsupported) default: @@ -188,11 +189,7 @@ func (s3a *S3ApiServer) openSSES3SourcePlaintextReader( } if hasPerChunkSSE { - sortedChunks := make([]*filer_pb.FileChunk, len(chunks)) - copy(sortedChunks, chunks) - sort.Slice(sortedChunks, func(i, j int) bool { - return sortedChunks[i].GetOffset() < sortedChunks[j].GetOffset() - }) + sortedChunks, skip := sourceChunksFrom(chunks, startOffset) decReader, err := buildMultipartSSES3Reader( sortedChunks, GetSSES3KeyManager(), @@ -209,7 +206,7 @@ func (s3a *S3ApiServer) openSSES3SourcePlaintextReader( if rc, ok := decReader.(io.Closer); ok { closer = rc } - return applyRange(&readCloserAdapter{Reader: decReader, closer: closer}, startOffset, sliceLen) + return applyRange(&readCloserAdapter{Reader: decReader, closer: closer}, skip, sliceLen) } // Legacy single-part fallback: entry-level SeaweedFSSSES3Key + entry IV. @@ -242,6 +239,75 @@ func (s3a *S3ApiServer) openSSES3SourcePlaintextReader( return applyRange(rc, startOffset, sliceLen) } +// openSSEKMSSourcePlaintextReader decrypts an SSE-KMS source the way GET does: +// chunks carrying their own SSE-KMS metadata (single-part puts, multipart +// parts, copies) each decrypt with it, and a source without any falls back to +// the entry-level key. +func (s3a *S3ApiServer) openSSEKMSSourcePlaintextReader( + ctx context.Context, + srcEntry *filer_pb.Entry, + startOffset, sliceLen int64, +) (io.ReadCloser, error) { + hasPerChunkSSE := slices.ContainsFunc(srcEntry.GetChunks(), func(c *filer_pb.FileChunk) bool { + return c.GetSseType() == filer_pb.SSEType_SSE_KMS && len(c.GetSseMetadata()) > 0 + }) + if hasPerChunkSSE { + chunks, skip := sourceChunksFrom(srcEntry.GetChunks(), startOffset) + if slices.ContainsFunc(chunks, func(c *filer_pb.FileChunk) bool { + return c.GetSseType() != filer_pb.SSEType_SSE_KMS && c.GetSseType() != filer_pb.SSEType_NONE + }) { + return nil, fmt.Errorf("SSE-KMS source holds chunks under another SSE type") + } + decReader, err := buildMultipartSSEKMSReader(chunks, func(c *filer_pb.FileChunk) (io.ReadCloser, error) { + return s3a.createEncryptedChunkReader(ctx, c) + }) + if err != nil { + return nil, fmt.Errorf("build SSE-KMS source reader: %w", err) + } + var closer io.Closer + if rc, ok := decReader.(io.Closer); ok { + closer = rc + } + return applyRange(&readCloserAdapter{Reader: decReader, closer: closer}, skip, sliceLen) + } + + keyData := srcEntry.Extended[s3_constants.SeaweedFSSSEKMSKey] + if len(keyData) == 0 { + return nil, fmt.Errorf("SSE-KMS source has no per-chunk metadata and no entry-level SSE-KMS key") + } + sseKMSKey, err := DeserializeSSEKMSMetadata(keyData) + if err != nil { + return nil, fmt.Errorf("deserialize entry-level SSE-KMS key: %w", err) + } + encStream, err := s3a.getEncryptedStreamFromVolumes(ctx, srcEntry, 0, int64(filer.FileSize(srcEntry))) + if err != nil { + return nil, fmt.Errorf("open ciphertext source: %w", err) + } + dec, err := CreateSSEKMSDecryptedReader(encStream, sseKMSKey) + if err != nil { + encStream.Close() + return nil, fmt.Errorf("create SSE-KMS decrypted reader: %w", err) + } + return applyRange(&readCloserAdapter{Reader: dec, closer: encStream}, startOffset, sliceLen) +} + +// sourceChunksFrom returns the chunks, by offset, from the one holding offset +// on, and how far into it offset falls. Every chunk decrypts on its own, so a +// part copied from deep in a large source doesn't have to fetch and decrypt +// all the chunks before it. +func sourceChunksFrom(chunks []*filer_pb.FileChunk, offset int64) ([]*filer_pb.FileChunk, int64) { + sorted := slices.Clone(chunks) + sort.Slice(sorted, func(i, j int) bool { + return sorted[i].GetOffset() < sorted[j].GetOffset() + }) + for i, c := range sorted { + if c.GetOffset()+int64(c.GetSize()) > offset { + return sorted[i:], max(offset-c.GetOffset(), 0) + } + } + return nil, 0 +} + // applyRange skips startOffset bytes from src and limits the result to // sliceLen bytes. The returned ReadCloser closes the underlying source. func applyRange(src io.ReadCloser, startOffset, sliceLen int64) (io.ReadCloser, error) { @@ -387,13 +453,13 @@ func (s3a *S3ApiServer) copyObjectPartViaReencryption( if err != nil { glog.Errorf("UploadPartCopy: open source plaintext reader: %v", err) // Distinguish "we will not handle this shape" (501) from "the server - // failed" (500). SSE-KMS / SSE-C source support in this slow path is - // staged work; the explicit error lets clients see it as a feature - // gap rather than a server fault. + // failed" (500). SSE-C source support in this slow path is staged + // work; the explicit error lets clients see it as a feature gap + // rather than a server fault. if errors.Is(err, errCopySourceSSEUnsupported) { return "", SSEResponseMetadata{}, s3err.ErrNotImplemented } - return "", SSEResponseMetadata{}, s3err.ErrInternalError + return "", SSEResponseMetadata{}, MapKMSErrorToS3Error(err) } defer srcReader.Close() diff --git a/weed/s3api/s3api_object_handlers_copy_part_ssekms_test.go b/weed/s3api/s3api_object_handlers_copy_part_ssekms_test.go new file mode 100644 index 0000000000..ebf2b264fe --- /dev/null +++ b/weed/s3api/s3api_object_handlers_copy_part_ssekms_test.go @@ -0,0 +1,323 @@ +package s3api + +import ( + "bytes" + "context" + "crypto/md5" + "crypto/rand" + "encoding/hex" + "fmt" + "io" + "net/http" + "net/http/httptest" + "slices" + "strings" + "sync" + "testing" + + "github.com/seaweedfs/seaweedfs/weed/kms" + "github.com/seaweedfs/seaweedfs/weed/kms/local" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3err" + util_http "github.com/seaweedfs/seaweedfs/weed/util/http" + "github.com/stretchr/testify/require" +) + +type sseKMSCopySource struct { + t *testing.T + s3a *S3ApiServer + filer *ambiguousPutFiler + volume *fakeVolumeServer + keyID string + nextFid int + readMu sync.Mutex + readFids []string +} + +func newSSEKMSCopySource(t *testing.T) *sseKMSCopySource { + provider, err := local.NewLocalKMSProvider(nil) + require.NoError(t, err) + kms.SetGlobalKMSProvider(provider) + t.Cleanup(func() { + kms.SetGlobalKMSProvider(nil) + require.NoError(t, provider.Close()) + }) + key, err := provider.(*local.LocalKMSProvider).CreateKey("copy source", nil) + require.NoError(t, err) + + util_http.InitGlobalHttpClient() + src := &sseKMSCopySource{t: t, keyID: key.KeyID, volume: startFakeVolumeServer(t)} + src.volume.beforeRead = func(fid string) { + src.readMu.Lock() + defer src.readMu.Unlock() + src.readFids = append(src.readFids, fid) + } + src.filer = &ambiguousPutFiler{volume: src.volume, apply: true, entries: map[string]*filer_pb.Entry{}} + src.s3a = newPutTestServer(t, startFakeFiler(t, src.filer)) + return src +} + +// encryptPart encrypts a part under one data key the way putToFiler does and +// cuts the ciphertext into chunkSize chunks placed at objectOffset, each +// carrying the part's key with its offset inside the part. +func (s *sseKMSCopySource) encryptPart(part []byte, objectOffset int64, chunkSize int) ([]*filer_pb.FileChunk, *SSEKMSKey) { + baseIV := make([]byte, s3_constants.AESBlockSize) + _, err := rand.Read(baseIV) + require.NoError(s.t, err) + encReader, key, err := CreateSSEKMSEncryptedReaderWithBaseIVAndOffset(bytes.NewReader(part), s.keyID, BuildEncryptionContext("b", "src", false), false, baseIV, 0) + require.NoError(s.t, err) + ciphertext, err := io.ReadAll(encReader) + require.NoError(s.t, err) + + var chunks []*filer_pb.FileChunk + for off := 0; off < len(part); off += chunkSize { + end := min(off+chunkSize, len(part)) + chunkKey := *key + chunkKey.ChunkOffset = int64(off) + metadata, err := SerializeSSEKMSMetadata(&chunkKey) + require.NoError(s.t, err) + s.nextFid++ + // volume 4: the fake filer assigns uploads on volume 3 + fid := fmt.Sprintf("4,%016x%08x", s.nextFid, 1) + s.volume.mu.Lock() + s.volume.stored[fid] = ciphertext[off:end] + s.volume.mu.Unlock() + chunks = append(chunks, &filer_pb.FileChunk{ + FileId: fid, + Offset: objectOffset + int64(off), + Size: uint64(end - off), + SseType: filer_pb.SSEType_SSE_KMS, + SseMetadata: metadata, + }) + } + return chunks, key +} + +func (s *sseKMSCopySource) reads() []string { + s.readMu.Lock() + defer s.readMu.Unlock() + return slices.Clone(s.readFids) +} + +func randomBytes(t *testing.T, n int) []byte { + b := make([]byte, n) + _, err := rand.Read(b) + require.NoError(t, err) + return b +} + +func sseKMSSourceEntry(size int, chunks []*filer_pb.FileChunk) *filer_pb.Entry { + return &filer_pb.Entry{ + Name: "src", + Attributes: &filer_pb.FuseAttributes{FileSize: uint64(size)}, + Chunks: chunks, + Extended: map[string][]byte{ + s3_constants.AmzServerSideEncryption: []byte(s3_constants.SSEAlgorithmKMS), + }, + } +} + +func TestOpenSourcePlaintextReaderSSEKMS(t *testing.T) { + src := newSSEKMSCopySource(t) + + // A two-part multipart object: each part has its own data key, and its + // chunks' offsets in the key metadata start over at the part. + part1 := randomBytes(t, 200) + part2 := randomBytes(t, 150) + plaintext := append(slices.Clone(part1), part2...) + chunks1, _ := src.encryptPart(part1, 0, 64) + chunks2, _ := src.encryptPart(part2, int64(len(part1)), 64) + // listed out of order: the reader must go by offset + entry := sseKMSSourceEntry(len(plaintext), append(chunks2, chunks1...)) + + ranges := [][2]int64{ + {0, 349}, + {0, 0}, + {10, 70}, + {64, 127}, + {130, 349}, + {190, 210}, + {200, 349}, + {349, 349}, + } + for _, rng := range ranges { + t.Run(fmt.Sprintf("%d-%d", rng[0], rng[1]), func(t *testing.T) { + reader, err := src.s3a.openSourcePlaintextReader(context.Background(), entry, rng[0], rng[1]) + require.NoError(t, err) + got, err := io.ReadAll(reader) + require.NoError(t, reader.Close()) + require.NoError(t, err) + require.Equal(t, plaintext[rng[0]:rng[1]+1], got) + }) + } + + // a range in the second part fetches none of the first part's chunks + before := len(src.reads()) + reader, err := src.s3a.openSourcePlaintextReader(context.Background(), entry, 210, 349) + require.NoError(t, err) + _, err = io.ReadAll(reader) + require.NoError(t, err) + require.NoError(t, reader.Close()) + for _, fid := range src.reads()[before:] { + for _, c := range chunks1 { + require.NotEqual(t, c.GetFileIdString(), fid, "range in part 2 fetched a part 1 chunk") + } + } +} + +func TestOpenSourcePlaintextReaderSSEKMSEntryLevelKey(t *testing.T) { + src := newSSEKMSCopySource(t) + + plaintext := randomBytes(t, 100) + chunks, key := src.encryptPart(plaintext, 0, 128) + src.volume.mu.Lock() + ciphertext := src.volume.stored[chunks[0].GetFileIdString()] + src.volume.mu.Unlock() + keyData, err := SerializeSSEKMSMetadata(key) + require.NoError(t, err) + + // inline content with only the entry-level key, as GET also reads it + entry := sseKMSSourceEntry(len(plaintext), nil) + entry.Content = ciphertext + entry.Extended[s3_constants.SeaweedFSSSEKMSKey] = keyData + + reader, err := src.s3a.openSourcePlaintextReader(context.Background(), entry, 5, 60) + require.NoError(t, err) + got, err := io.ReadAll(reader) + require.NoError(t, reader.Close()) + require.NoError(t, err) + require.Equal(t, plaintext[5:61], got) +} + +func TestCopyObjectPartFromSSEKMSSource(t *testing.T) { + src := newSSEKMSCopySource(t) + + plaintext := randomBytes(t, 300) + chunks, _ := src.encryptPart(plaintext, 0, 64) + entry := sseKMSSourceEntry(len(plaintext), chunks) + + r := httptest.NewRequest(http.MethodPut, "/b/dst?partNumber=1&uploadId=u1", nil) + etag, _, code := src.s3a.copyObjectPartViaReencryption(r, entry, 50, 249, "b", "dst", "u1", 1, &filer_pb.Entry{}) + require.Equal(t, s3err.ErrNone, code) + + var partEntry *filer_pb.Entry + src.filer.mu.Lock() + for key, e := range src.filer.entries { + if strings.Contains(key, "u1") { + partEntry = e + } + } + src.filer.mu.Unlock() + require.NotNil(t, partEntry) + + // the destination upload has no SSE, so the part holds the plaintext + require.Len(t, partEntry.GetChunks(), 1) + chunk := partEntry.GetChunks()[0] + require.Equal(t, filer_pb.SSEType_NONE, chunk.GetSseType()) + fid := chunk.GetFid() + src.volume.mu.Lock() + stored := src.volume.stored[fmt.Sprintf("%d,%016x%08x", fid.GetVolumeId(), fid.GetFileKey(), fid.GetCookie())] + src.volume.mu.Unlock() + // the fake volume keeps the whole multipart form body + require.True(t, bytes.Contains(stored, plaintext[50:250]), "part chunk doesn't hold the source range's plaintext") + wantMd5 := md5.Sum(plaintext[50:250]) + require.Equal(t, hex.EncodeToString(wantMd5[:]), strings.Trim(etag, `"`)) +} + +func TestOpenSourcePlaintextReaderSSES3StartsAtRangeChunk(t *testing.T) { + src := newSSEKMSCopySource(t) + initSSES3KeyManagerForTest(t) + key, err := GenerateSSES3Key() + require.NoError(t, err) + baseIV := randomBytes(t, s3_constants.AESBlockSize) + + plaintext := randomBytes(t, 256) + encReader, _, err := CreateSSES3EncryptedReaderWithBaseIV(bytes.NewReader(plaintext), key, baseIV, 0) + require.NoError(t, err) + ciphertext, err := io.ReadAll(encReader) + require.NoError(t, err) + + var chunks []*filer_pb.FileChunk + for off := 0; off < len(plaintext); off += 64 { + chunkIV, _ := calculateIVWithOffset(baseIV, int64(off)) + metadata, err := SerializeSSES3Metadata(&SSES3Key{Key: key.Key, KeyID: key.KeyID, Algorithm: key.Algorithm, IV: chunkIV}) + require.NoError(t, err) + src.nextFid++ + fid := fmt.Sprintf("4,%016x%08x", src.nextFid, 1) + src.volume.mu.Lock() + src.volume.stored[fid] = ciphertext[off : off+64] + src.volume.mu.Unlock() + chunks = append(chunks, &filer_pb.FileChunk{ + FileId: fid, + Offset: int64(off), + Size: 64, + SseType: filer_pb.SSEType_SSE_S3, + SseMetadata: metadata, + }) + } + entry := &filer_pb.Entry{ + Name: "src", + Attributes: &filer_pb.FuseAttributes{FileSize: uint64(len(plaintext))}, + Chunks: chunks, + Extended: map[string][]byte{ + s3_constants.AmzServerSideEncryption: []byte(s3_constants.SSEAlgorithmAES256), + }, + } + + reader, err := src.s3a.openSourcePlaintextReader(context.Background(), entry, 140, 220) + require.NoError(t, err) + got, err := io.ReadAll(reader) + require.NoError(t, reader.Close()) + require.NoError(t, err) + require.Equal(t, plaintext[140:221], got) + require.Equal(t, []string{chunks[2].GetFileIdString(), chunks[3].GetFileIdString()}, src.reads()) +} + +func TestCopyObjectPartFromSSEKMSSourceWithAMissingKeyIsKMSKeyNotFound(t *testing.T) { + src := newSSEKMSCopySource(t) + + plaintext := randomBytes(t, 300) + chunks, key := src.encryptPart(plaintext, 0, 64) + keyData, err := SerializeSSEKMSMetadata(key) + require.NoError(t, err) + inline := sseKMSSourceEntry(len(plaintext), nil) + src.volume.mu.Lock() + for _, c := range chunks { + inline.Content = append(inline.Content, src.volume.stored[c.GetFileIdString()]...) + } + src.volume.mu.Unlock() + inline.Extended[s3_constants.SeaweedFSSSEKMSKey] = keyData + + // the KMS reading the source no longer holds its key + setupKMSWithoutOnDemandKeys(t) + + cases := []struct { + name string + entry *filer_pb.Entry + start, end int64 + }{ + {"chunks from the start", sseKMSSourceEntry(len(plaintext), chunks), 0, 199}, + {"chunks from inside a chunk", sseKMSSourceEntry(len(plaintext), chunks), 70, 199}, + {"entry-level key", inline, 10, 199}, + } + for i, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + r := httptest.NewRequest(http.MethodPut, "/b/dst?partNumber=1&uploadId=u1", nil) + _, _, code := src.s3a.copyObjectPartViaReencryption(r, tc.entry, tc.start, tc.end, "b", "dst", "u1", i+1, &filer_pb.Entry{}) + require.Equal(t, s3err.ErrKMSKeyNotFound, code) + }) + } +} + +func TestOpenSourcePlaintextReaderSSEKMSRefusesOtherSSEChunks(t *testing.T) { + src := newSSEKMSCopySource(t) + + chunks, _ := src.encryptPart(randomBytes(t, 128), 0, 64) + chunks = append(chunks, &filer_pb.FileChunk{FileId: "4,ff00000001", Offset: 128, Size: 64, SseType: filer_pb.SSEType_SSE_S3, SseMetadata: []byte("{}")}) + entry := sseKMSSourceEntry(192, chunks) + + _, err := src.s3a.openSourcePlaintextReader(context.Background(), entry, 130, 191) + require.Error(t, err) + require.Empty(t, src.reads()) +} diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go index 75f8735c62..1adc2d6207 100644 --- a/weed/s3api/s3api_object_handlers_put.go +++ b/weed/s3api/s3api_object_handlers_put.go @@ -2065,7 +2065,8 @@ func mapChunkedUploadErrorToS3Error(reqCtx context.Context, err error) s3err.Err // its retries: load the client should back off from, not a fault. return s3err.ErrTooManyRequest default: - return s3err.ErrInternalError + // A part copy's source can fail to decrypt mid-stream. + return MapKMSErrorToS3Error(err) } } From adb07ee3cee43444c21029fc763e74798d1730a8 Mon Sep 17 00:00:00 2001 From: Tiago Posse Date: Sat, 5 Dec 2026 20:08:03 +0100 Subject: [PATCH 08/29] s3api: answer GET with the KMS error when the KMS won't decrypt (#13432) * s3api: answer GET with the KMS error when the KMS won't decrypt A GET of an SSE-KMS object whose key the KMS no longer holds, or refuses to use, returned 500 InternalError, which clients retry. PUT and CopyObject already answer the same KMS errors with their S3 codes, like KMS.NotFoundException. GET now does too, on the full, per-chunk key, range and directory content paths. The per-chunk key path wrapped the decrypt error with %v, which dropped the KMS error. Co-Authored-By: Claude Opus 5.5 * kms: report a provider outage as an internal failure GET now answers a KMS error with its S3 code, so a provider outage that the converters tagged as a key error turned a retryable read into a 400 that blames the key. OpenBao and Azure 5xx answers and GCP Unavailable or DeadlineExceeded matched the "not found" or "unavailable" substrings, and AWS KeyUnavailableException is retryable per the KMS API. All of these now map to KMSInternalException, which S3 answers as 500. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Chris Lu --- weed/kms/aws/aws_kms.go | 4 +- weed/kms/aws/aws_kms_test.go | 26 +++++ weed/kms/azure/azure_kms.go | 10 ++ weed/kms/azure/azure_kms_test.go | 30 ++++++ weed/kms/gcp/gcp_kms.go | 11 ++ weed/kms/gcp/gcp_kms_test.go | 27 +++++ weed/kms/openbao/openbao_kms.go | 11 ++ weed/kms/openbao/openbao_kms_test.go | 42 ++++++++ weed/s3api/s3api_object_handlers.go | 7 +- weed/s3api/s3api_sse_kms_read_errors_test.go | 106 +++++++++++++++++++ 10 files changed, 269 insertions(+), 5 deletions(-) create mode 100644 weed/kms/aws/aws_kms_test.go create mode 100644 weed/kms/gcp/gcp_kms_test.go create mode 100644 weed/s3api/s3api_sse_kms_read_errors_test.go diff --git a/weed/kms/aws/aws_kms.go b/weed/kms/aws/aws_kms.go index ea1a24ced6..7b34e23463 100644 --- a/weed/kms/aws/aws_kms.go +++ b/weed/kms/aws/aws_kms.go @@ -340,7 +340,7 @@ func (p *AWSKMSProvider) convertAWSError(err error, keyID string) error { Message: awsErr.Message(), KeyID: keyID, } - case "DisabledException", "KeyUnavailableException": + case "DisabledException": return &seaweedkms.KMSError{ Code: seaweedkms.ErrCodeKeyUnavailable, Message: awsErr.Message(), @@ -364,7 +364,7 @@ func (p *AWSKMSProvider) convertAWSError(err error, keyID string) error { Message: awsErr.Message(), KeyID: keyID, } - case "KMSInternalException", "KMSInvalidStateException": + case "KMSInternalException", "KMSInvalidStateException", "KeyUnavailableException": return &seaweedkms.KMSError{ Code: seaweedkms.ErrCodeKMSInternalFailure, Message: awsErr.Message(), diff --git a/weed/kms/aws/aws_kms_test.go b/weed/kms/aws/aws_kms_test.go new file mode 100644 index 0000000000..16e21f5f43 --- /dev/null +++ b/weed/kms/aws/aws_kms_test.go @@ -0,0 +1,26 @@ +package aws + +import ( + "testing" + + "github.com/aws/aws-sdk-go/aws/awserr" + + seaweedkms "github.com/seaweedfs/seaweedfs/weed/kms" +) + +func TestRetryableErrorIsAnInternalFailure(t *testing.T) { + p := &AWSKMSProvider{} + for _, tc := range []struct { + code string + want string + }{ + {"KeyUnavailableException", seaweedkms.ErrCodeKMSInternalFailure}, + {"DisabledException", seaweedkms.ErrCodeKeyUnavailable}, + {"NotFoundException", seaweedkms.ErrCodeNotFoundException}, + } { + got := p.convertAWSError(awserr.New(tc.code, "", nil), "k").(*seaweedkms.KMSError).Code + if got != tc.want { + t.Errorf("%s: got %s, want %s", tc.code, got, tc.want) + } + } +} diff --git a/weed/kms/azure/azure_kms.go b/weed/kms/azure/azure_kms.go index 667235f299..8b20a1915e 100644 --- a/weed/kms/azure/azure_kms.go +++ b/weed/kms/azure/azure_kms.go @@ -8,6 +8,7 @@ import ( "crypto/sha256" "encoding/base64" "encoding/json" + "errors" "fmt" "net/http" "net/url" @@ -446,6 +447,15 @@ func (p *AzureKMSProvider) convertAzureError(err error, keyID string) error { // Azure SDK uses different error types, need to check for specific conditions errMsg := err.Error() + var respErr *azcore.ResponseError + if errors.As(err, &respErr) && (respErr.StatusCode >= http.StatusInternalServerError || respErr.StatusCode == http.StatusTooManyRequests) { + return &seaweedkms.KMSError{ + Code: seaweedkms.ErrCodeKMSInternalFailure, + Message: fmt.Sprintf("Azure Key Vault error: %v", err), + KeyID: keyID, + } + } + if strings.Contains(errMsg, "not found") || strings.Contains(errMsg, "NotFound") { return &seaweedkms.KMSError{ Code: seaweedkms.ErrCodeNotFoundException, diff --git a/weed/kms/azure/azure_kms_test.go b/weed/kms/azure/azure_kms_test.go index 33b2fefeed..280f38a88f 100644 --- a/weed/kms/azure/azure_kms_test.go +++ b/weed/kms/azure/azure_kms_test.go @@ -16,6 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys" seaweedkms "github.com/seaweedfs/seaweedfs/weed/kms" @@ -361,3 +362,32 @@ func TestCheckContextEmpty(t *testing.T) { t.Fatal("context accepted for an unbound key") } } + +func TestServiceErrorIsAnInternalFailure(t *testing.T) { + p := &AzureKMSProvider{} + responseError := func(status int, code, message string) error { + body := `{"error":{"code":"` + code + `","message":"` + message + `"}}` + req, _ := http.NewRequest(http.MethodPost, "https://myvault.vault.azure.net/keys/k/unwrapkey", nil) + return runtime.NewResponseError(&http.Response{ + StatusCode: status, + Status: http.StatusText(status), + Header: http.Header{"Content-Type": {"application/json"}}, + Body: io.NopCloser(strings.NewReader(body)), + Request: req, + }) + } + for _, tc := range []struct { + err error + want string + }{ + {responseError(http.StatusServiceUnavailable, "ServiceUnavailable", "The service is currently unavailable."), seaweedkms.ErrCodeKMSInternalFailure}, + {responseError(http.StatusTooManyRequests, "Throttled", "Request was not processed because too many requests were received."), seaweedkms.ErrCodeKMSInternalFailure}, + {responseError(http.StatusNotFound, "KeyNotFound", "A key with (name/id) k was not found in this key vault."), seaweedkms.ErrCodeNotFoundException}, + {responseError(http.StatusForbidden, "Forbidden", "The user does not have keys unwrapKey permission."), seaweedkms.ErrCodeAccessDenied}, + } { + got := p.convertAzureError(tc.err, "k").(*seaweedkms.KMSError).Code + if got != tc.want { + t.Errorf("%v: got %s, want %s", tc.err, got, tc.want) + } + } +} diff --git a/weed/kms/gcp/gcp_kms.go b/weed/kms/gcp/gcp_kms.go index 5380a7aeb3..6fcad37bed 100644 --- a/weed/kms/gcp/gcp_kms.go +++ b/weed/kms/gcp/gcp_kms.go @@ -9,6 +9,8 @@ import ( "time" "google.golang.org/api/option" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" kms "cloud.google.com/go/kms/apiv1" "cloud.google.com/go/kms/apiv1/kmspb" @@ -316,6 +318,15 @@ func (p *GCPKMSProvider) convertGCPError(err error, keyID string) error { // Google Cloud SDK uses gRPC status codes errMsg := err.Error() + switch status.Code(err) { + case codes.Unavailable, codes.DeadlineExceeded, codes.Internal, codes.ResourceExhausted: + return &seaweedkms.KMSError{ + Code: seaweedkms.ErrCodeKMSInternalFailure, + Message: fmt.Sprintf("Google Cloud KMS error: %v", err), + KeyID: keyID, + } + } + if strings.Contains(errMsg, "not found") || strings.Contains(errMsg, "NotFound") { return &seaweedkms.KMSError{ Code: seaweedkms.ErrCodeNotFoundException, diff --git a/weed/kms/gcp/gcp_kms_test.go b/weed/kms/gcp/gcp_kms_test.go new file mode 100644 index 0000000000..fc1a829154 --- /dev/null +++ b/weed/kms/gcp/gcp_kms_test.go @@ -0,0 +1,27 @@ +package gcp + +import ( + "testing" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + seaweedkms "github.com/seaweedfs/seaweedfs/weed/kms" +) + +func TestServiceErrorIsAnInternalFailure(t *testing.T) { + p := &GCPKMSProvider{} + for _, tc := range []struct { + err error + want string + }{ + {status.Error(codes.Unavailable, "The service is currently unavailable."), seaweedkms.ErrCodeKMSInternalFailure}, + {status.Error(codes.DeadlineExceeded, "Deadline Exceeded"), seaweedkms.ErrCodeKMSInternalFailure}, + {status.Error(codes.NotFound, "CryptoKey projects/p/locations/l/keyRings/r/cryptoKeys/k not found."), seaweedkms.ErrCodeNotFoundException}, + } { + got := p.convertGCPError(tc.err, "k").(*seaweedkms.KMSError).Code + if got != tc.want { + t.Errorf("%v: got %s, want %s", tc.err, got, tc.want) + } + } +} diff --git a/weed/kms/openbao/openbao_kms.go b/weed/kms/openbao/openbao_kms.go index 4b3335223e..186cb45ccf 100644 --- a/weed/kms/openbao/openbao_kms.go +++ b/weed/kms/openbao/openbao_kms.go @@ -5,7 +5,9 @@ import ( "crypto/rand" "encoding/base64" "encoding/json" + "errors" "fmt" + "net/http" "strings" "time" @@ -428,6 +430,15 @@ func (p *OpenBaoKMSProvider) Close() error { func (p *OpenBaoKMSProvider) convertVaultError(err error, keyID string) error { errMsg := err.Error() + var respErr *vault.ResponseError + if errors.As(err, &respErr) && respErr.StatusCode >= http.StatusInternalServerError { + return &seaweedkms.KMSError{ + Code: seaweedkms.ErrCodeKMSInternalFailure, + Message: fmt.Sprintf("OpenBao/Vault error: %v", err), + KeyID: keyID, + } + } + if strings.Contains(errMsg, "not found") || strings.Contains(errMsg, "no handler") { return &seaweedkms.KMSError{ Code: seaweedkms.ErrCodeNotFoundException, diff --git a/weed/kms/openbao/openbao_kms_test.go b/weed/kms/openbao/openbao_kms_test.go index 860ebe8158..7e2676131e 100644 --- a/weed/kms/openbao/openbao_kms_test.go +++ b/weed/kms/openbao/openbao_kms_test.go @@ -253,3 +253,45 @@ func TestNoRefreshWithoutAnExpiringToken(t *testing.T) { }) } } + +func TestServerErrorIsAnInternalFailure(t *testing.T) { + t.Setenv("VAULT_MAX_RETRIES", "0") + for _, tc := range []struct { + status int + errors string + want string + }{ + {http.StatusInternalServerError, "local node not active but active cluster node not found", seaweedkms.ErrCodeKMSInternalFailure}, + {http.StatusServiceUnavailable, "service temporarily unavailable", seaweedkms.ErrCodeKMSInternalFailure}, + {http.StatusBadRequest, "encryption key not found", seaweedkms.ErrCodeNotFoundException}, + {http.StatusForbidden, "permission denied", seaweedkms.ErrCodeAccessDenied}, + } { + t.Run(tc.errors, func(t *testing.T) { + t.Setenv("VAULT_AGENT_ADDR", "") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + io.Copy(io.Discard, r.Body) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(tc.status) + json.NewEncoder(w).Encode(map[string][]string{"errors": {tc.errors}}) + })) + t.Cleanup(server.Close) + provider, err := NewOpenBaoKMSProvider(mapConfig{"address": server.URL, "token": "t"}) + if err != nil { + t.Fatalf("NewOpenBaoKMSProvider: %v", err) + } + t.Cleanup(func() { provider.Close() }) + + _, err = provider.GenerateDataKey(context.Background(), &seaweedkms.GenerateDataKeyRequest{ + KeyID: "test-key", + KeySpec: seaweedkms.KeySpecAES256, + }) + kmsErr, ok := err.(*seaweedkms.KMSError) + if !ok { + t.Fatalf("got %T %v, want a KMSError", err, err) + } + if kmsErr.Code != tc.want { + t.Errorf("got %s, want %s", kmsErr.Code, tc.want) + } + }) + } +} diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 8f13f72958..f79f8e8ef9 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -303,7 +303,8 @@ func streamCanceled(ctx context.Context, err error) bool { // shared lookup canceled by another request both cancel it while the client is // still connected, and returning silently would send that client an empty 200. // A client that has gone away never sees the write; it is answered -// ClientDisconnected so that an aborted download does not count as a 5xx. +// ClientDisconnected so that an aborted download does not count as a 5xx. A +// KMS refusal to decrypt gets its KMS error, as PUT and CopyObject answer it. func writeStreamErrorResponse(w http.ResponseWriter, r *http.Request, err error) { var streamErr *StreamError if errors.As(err, &streamErr) && streamErr.ResponseWritten { @@ -317,7 +318,7 @@ func writeStreamErrorResponse(w http.ResponseWriter, r *http.Request, err error) s3err.WriteErrorResponse(w, r, s3err.ErrClientDisconnected) return } - s3err.WriteErrorResponse(w, r, s3err.ErrInternalError) + s3err.WriteErrorResponse(w, r, MapKMSErrorToS3Error(err)) } // logCanceledStream logs a canceled stream at V(3) when the request context is @@ -694,7 +695,7 @@ func (s3a *S3ApiServer) decryptDirectoryContent(r *http.Request, entry *filer_pb } if err != nil { glog.Errorf("decryptDirectoryContent: %v", err) - return nil, s3err.ErrInternalError + return nil, MapKMSErrorToS3Error(err) } content, readErr := io.ReadAll(reader) if readErr != nil { diff --git a/weed/s3api/s3api_sse_kms_read_errors_test.go b/weed/s3api/s3api_sse_kms_read_errors_test.go new file mode 100644 index 0000000000..fe4a4619b8 --- /dev/null +++ b/weed/s3api/s3api_sse_kms_read_errors_test.go @@ -0,0 +1,106 @@ +package s3api + +import ( + "bytes" + "crypto/rand" + "fmt" + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/seaweedfs/seaweedfs/weed/kms" + "github.com/seaweedfs/seaweedfs/weed/kms/local" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3err" + util_http "github.com/seaweedfs/seaweedfs/weed/util/http" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestSSEKMSReadWithAMissingKeyIsKMSKeyNotFound(t *testing.T) { + writer, err := local.NewLocalKMSProvider(nil) + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, writer.Close()) }) + key, err := writer.(*local.LocalKMSProvider).CreateKey("deleted later", nil) + require.NoError(t, err) + kms.SetGlobalKMSProvider(writer) + + plaintext := make([]byte, 300) + _, err = rand.Read(plaintext) + require.NoError(t, err) + encReader, sseKey, err := CreateSSEKMSEncryptedReaderWithBucketKey(bytes.NewReader(plaintext), key.KeyID, BuildEncryptionContext("b", "o", false), false) + require.NoError(t, err) + ciphertext, err := io.ReadAll(encReader) + require.NoError(t, err) + keyData, err := SerializeSSEKMSMetadata(sseKey) + require.NoError(t, err) + + // the KMS reading the object no longer holds its key + setupKMSWithoutOnDemandKeys(t) + + util_http.InitGlobalHttpClient() + volume := startFakeVolumeServer(t) + s3a := newPutTestServer(t, startFakeFiler(t, &ambiguousPutFiler{volume: volume, entries: map[string]*filer_pb.Entry{}})) + + newEntry := func() *filer_pb.Entry { + return &filer_pb.Entry{ + Name: "o", + Attributes: &filer_pb.FuseAttributes{FileSize: uint64(len(plaintext))}, + Extended: map[string][]byte{ + s3_constants.AmzServerSideEncryption: []byte(s3_constants.SSEAlgorithmKMS), + s3_constants.SeaweedFSSSEKMSKey: keyData, + }, + } + } + inline := newEntry() + inline.Content = ciphertext + + chunked := newEntry() + for i, off := range []int{0, 150} { + chunkKey := *sseKey + chunkKey.ChunkOffset = int64(off) + metadata, err := SerializeSSEKMSMetadata(&chunkKey) + require.NoError(t, err) + fid := fmt.Sprintf("5,%016x%08x", i+1, 1) + volume.mu.Lock() + volume.stored[fid] = ciphertext[off : off+150] + volume.mu.Unlock() + chunked.Chunks = append(chunked.Chunks, &filer_pb.FileChunk{ + FileId: fid, + Offset: int64(off), + Size: 150, + SseType: filer_pb.SSEType_SSE_KMS, + SseMetadata: metadata, + }) + } + + for _, tc := range []struct { + name string + entry *filer_pb.Entry + rng string + }{ + {"single part", inline, ""}, + {"per-chunk keys", chunked, ""}, + {"range", chunked, "bytes=10-200"}, + } { + t.Run(tc.name, func(t *testing.T) { + r := httptest.NewRequest(http.MethodGet, "/b/o", nil) + if tc.rng != "" { + r.Header.Set("Range", tc.rng) + } + w := httptest.NewRecorder() + err := s3a.streamFromVolumeServersWithSSE(w, r, tc.entry, s3_constants.SSETypeKMS, "b", "o", "") + require.Error(t, err) + writeStreamErrorResponse(w, r, err) + assert.Equal(t, http.StatusBadRequest, w.Code) + assert.Contains(t, w.Body.String(), "KMS.NotFoundException") + }) + } + + t.Run("directory content", func(t *testing.T) { + _, code := s3a.decryptDirectoryContent(httptest.NewRequest(http.MethodGet, "/b/o/", nil), inline, s3_constants.SSETypeKMS) + assert.Equal(t, s3err.ErrKMSKeyNotFound, code) + }) +} From 90aae21e6b93f46e6a8c64ac5500ebfc7630a977 Mon Sep 17 00:00:00 2001 From: Tiago Posse Date: Sat, 5 Dec 2026 20:08:32 +0100 Subject: [PATCH 09/29] kms/local: read key_material from ${ENV} references (#13434) A local KMS key's key_material can now be written as ${NAME}, so the key can come from a Kubernetes Secret, or any secret store that hands it to the process as an environment variable, instead of sitting in the config file. This works in the S3 JSON config and in filer.toml. A reference to a variable that is unset or empty, or one that isn't written as ${NAME}, fails the load with an error that leaves the reference and the material out. The expansion is the one static S3 credentials already use, moved to weed/util so both share it. Co-authored-by: Claude Opus 5.5 --- weed/kms/local/local_kms.go | 4 ++++ weed/kms/local/local_kms_test.go | 21 ++++++++++++++++++++ weed/s3api/auth_credentials.go | 32 +++---------------------------- weed/util/env_refs.go | 33 ++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 weed/util/env_refs.go diff --git a/weed/kms/local/local_kms.go b/weed/kms/local/local_kms.go index 2910ab0cf0..0c4613f65f 100644 --- a/weed/kms/local/local_kms.go +++ b/weed/kms/local/local_kms.go @@ -236,6 +236,10 @@ func configuredKey(fields map[string]interface{}) (*LocalKey, error) { if err != nil { return nil, err } + material, resolved := util.ExpandEnvRefs(material) + if !resolved { + return nil, fmt.Errorf("key_material names an environment variable that is unset or empty, or isn't written as ${NAME}") + } keyMaterial, err := decodeKeyMaterial(material) if err != nil { return nil, err diff --git a/weed/kms/local/local_kms_test.go b/weed/kms/local/local_kms_test.go index 7317435493..86164d0a76 100644 --- a/weed/kms/local/local_kms_test.go +++ b/weed/kms/local/local_kms_test.go @@ -232,6 +232,18 @@ func TestHexAndBase64NameTheSameKey(t *testing.T) { } } +func TestKeyMaterialFromTheEnvironment(t *testing.T) { + // a Secret file's trailing newline comes through secretKeyRef too + t.Setenv("SEAWEEDFS_TEST_KMS_MATERIAL", keyA+"\n") + fromEnv := newProvider(t, jsonConfig(t, `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS_TEST_KMS_MATERIAL}"}]}`)) + literal := newProvider(t, jsonConfig(t, `{"keys": [{"key_id": "a", "key_material": "KEY_A"}]}`)) + + resp := wrap(t, literal, "a") + if got := unwrap(t, fromEnv, resp); !bytes.Equal(got, resp.Plaintext) { + t.Fatal("material read from the environment gave a different key") + } +} + func TestConfiguredKeysLeaveNoGeneratedFallback(t *testing.T) { p := newProvider(t, jsonConfig(t, `{"keys": [{"key_id": "a", "key_material": "KEY_A"}]}`)) @@ -314,6 +326,9 @@ func TestClosedKeyWrapsNothing(t *testing.T) { func TestInvalidKeyConfig(t *testing.T) { short := base64.StdEncoding.EncodeToString(make([]byte, 16)) + t.Setenv("SEAWEEDFS_TEST_KMS_EMPTY", "") + t.Setenv("SEAWEEDFS_TEST_KMS_SHORT", short) + t.Setenv("SEAWEEDFS_TEST_KMS_MATERIAL", keyA) cases := map[string]string{ "missing key_id": `{"keys": [{"key_material": "KEY_A"}]}`, "alias as key_id": `{"keys": [{"key_id": "alias/a", "key_material": "KEY_A"}]}`, @@ -342,6 +357,12 @@ func TestInvalidKeyConfig(t *testing.T) { "material as key_id, twice": `{"keys": [{"key_id": "KEY_A", "key_material": "KEY_B"}, {"key_id": "KEY_A", "key_material": "KEY_B"}]}`, "material as alias, twice": `{"keys": [{"key_id": "a", "key_material": "KEY_B", "aliases": ["KEY_A", "KEY_A"]}]}`, "material as alias key_id": `{"keys": [{"key_id": "alias/KEY_A", "key_material": "KEY_B"}]}`, + "unset variable": `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS_TEST_KMS_UNSET}"}]}`, + "empty variable": `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS_TEST_KMS_EMPTY}"}]}`, + "short variable": `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS_TEST_KMS_SHORT}"}]}`, + "malformed reference": `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS-TEST-KMS-MATERIAL}"}]}`, + "unclosed reference": `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS_TEST_KMS_MATERIAL"}]}`, + "variable and an unset one": `{"keys": [{"key_id": "a", "key_material": "${SEAWEEDFS_TEST_KMS_MATERIAL}${SEAWEEDFS_TEST_KMS_UNSET}"}]}`, } for name, cfg := range cases { t.Run(name, func(t *testing.T) { diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go index dd445850bd..f7f910f781 100644 --- a/weed/s3api/auth_credentials.go +++ b/weed/s3api/auth_credentials.go @@ -11,7 +11,6 @@ import ( "net/url" "os" "reflect" - "regexp" "slices" "strings" "sync" @@ -29,6 +28,7 @@ import ( "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" "github.com/seaweedfs/seaweedfs/weed/s3api/s3bucket" "github.com/seaweedfs/seaweedfs/weed/s3api/s3err" + "github.com/seaweedfs/seaweedfs/weed/util" "github.com/seaweedfs/seaweedfs/weed/util/wildcard" "github.com/seaweedfs/seaweedfs/weed/wdclient" "google.golang.org/protobuf/reflect/protoreflect" @@ -798,8 +798,6 @@ func parseS3ApiConfiguration(content []byte, fromStaticFile bool) (*iam_pb.S3Api return s3ApiConfiguration, nil } -var credentialEnvRef = regexp.MustCompile(`\$\{([A-Za-z_][A-Za-z0-9_]*)\}`) - // expandCredentialEnvRefs resolves ${VAR} references in the keys of a static // config file, so a deployment can keep the keys in its own secret store and // hand them to the process as environment variables. A credential still holding @@ -811,8 +809,8 @@ func expandCredentialEnvRefs(config *iam_pb.S3ApiConfiguration) { for _, ident := range config.Identities { kept := ident.Credentials[:0] for _, cred := range ident.Credentials { - accessKey, accessResolved := expandEnvRefs(cred.AccessKey) - secretKey, secretResolved := expandEnvRefs(cred.SecretKey) + accessKey, accessResolved := util.ExpandEnvRefs(cred.AccessKey) + secretKey, secretResolved := util.ExpandEnvRefs(cred.SecretKey) if !accessResolved || !secretResolved { glog.Warningf("identity %s: dropping credential %s, it references an unset environment variable", ident.Name, cred.AccessKey) continue @@ -824,30 +822,6 @@ func expandCredentialEnvRefs(config *iam_pb.S3ApiConfiguration) { } } -// expandEnvRefs reports false when any reference is malformed or names a -// variable that is unset or empty, leaving the reference in place for the -// caller to reject. -func expandEnvRefs(value string) (string, bool) { - if !strings.Contains(value, "${") { - return value, true - } - // Every ${ has to open a well-formed reference. A typo like ${MY-VAR} matches - // nothing, so it would otherwise survive substitution as a literal key. - if strings.Count(value, "${") != len(credentialEnvRef.FindAllString(value, -1)) { - return value, false - } - resolved := true - expanded := credentialEnvRef.ReplaceAllStringFunc(value, func(ref string) string { - env, found := os.LookupEnv(ref[2 : len(ref)-1]) - if !found || env == "" { - resolved = false - return ref - } - return env - }) - return expanded, resolved -} - func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3ApiConfiguration) error { return iam.loadS3ApiConfigurationWithSource(config, false) } diff --git a/weed/util/env_refs.go b/weed/util/env_refs.go new file mode 100644 index 0000000000..64bb225f38 --- /dev/null +++ b/weed/util/env_refs.go @@ -0,0 +1,33 @@ +package util + +import ( + "os" + "regexp" + "strings" +) + +var envRef = regexp.MustCompile(`\$\{([A-Za-z_][A-Za-z0-9_]*)\}`) + +// ExpandEnvRefs resolves ${VAR} references in a value from a config file. It +// reports false when any reference is malformed or names a variable that is +// unset or empty, leaving the reference in place for the caller to reject. +func ExpandEnvRefs(value string) (string, bool) { + if !strings.Contains(value, "${") { + return value, true + } + // Every ${ has to open a well-formed reference. A typo like ${MY-VAR} matches + // nothing, so it would otherwise survive substitution as a literal value. + if strings.Count(value, "${") != len(envRef.FindAllString(value, -1)) { + return value, false + } + resolved := true + expanded := envRef.ReplaceAllStringFunc(value, func(ref string) string { + env, found := os.LookupEnv(ref[2 : len(ref)-1]) + if !found || env == "" { + resolved = false + return ref + } + return env + }) + return expanded, resolved +} From ca5c659d9b48909a3c20ca41e1ab16b85dd6a1db Mon Sep 17 00:00:00 2001 From: Tiago Posse Date: Sat, 5 Dec 2026 20:09:21 +0100 Subject: [PATCH 10/29] s3api: answer a malformed SSE-KMS key ID with KMS.NotFoundException (#13433) * s3api: answer a malformed SSE-KMS key ID with KMS.NotFoundException PutObject and UploadPart with an SSE-KMS key ID that has spaces or control characters returned 500 InternalError, which clients retry. CopyObject already answers the same ID with KMS.NotFoundException, the error a KMS gives for a key ID it can't parse. PUT and UploadPart now do too. Co-Authored-By: Claude Opus 5.5 * s3api: refuse a malformed SSE-KMS key ID at CreateMultipartUpload AWS answers a key ID it can't use at CreateMultipartUpload. A malformed one was accepted there, so every UploadPart of the upload failed instead. ValidateRequestEncryption now answers it with KMS.NotFoundException, which also covers PutObject before a bucket auto-create. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Chris Lu --- weed/s3api/s3_sse_kms_error_codes_test.go | 41 +++++++++++++++++++++++ weed/s3api/s3_sse_kms_utils.go | 8 +++-- weed/s3api/s3api_copy_validation.go | 8 +++-- weed/s3api/s3api_copy_validation_test.go | 2 ++ 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/weed/s3api/s3_sse_kms_error_codes_test.go b/weed/s3api/s3_sse_kms_error_codes_test.go index 59b63e028e..d8782d98ed 100644 --- a/weed/s3api/s3_sse_kms_error_codes_test.go +++ b/weed/s3api/s3_sse_kms_error_codes_test.go @@ -1,6 +1,7 @@ package s3api import ( + "encoding/base64" "fmt" "net/http" "net/http/httptest" @@ -54,6 +55,46 @@ func TestSSEKMSPutWithAnUnknownKeyIsKMSKeyNotFound(t *testing.T) { } } +func TestSSEKMSPutWithAMalformedKeyIsKMSKeyNotFound(t *testing.T) { + setupKMSWithoutOnDemandKeys(t) + util_http.InitGlobalHttpClient() + filer := &ambiguousPutFiler{volume: startFakeVolumeServer(t), apply: true, entries: map[string]*filer_pb.Entry{}} + s3a := newPutTestServer(t, startFakeFiler(t, filer)) + + for name, baseIV := range map[string]string{ + "single put": "", + "multipart part": base64.StdEncoding.EncodeToString(make([]byte, s3_constants.AESBlockSize)), + } { + for _, keyID := range []string{"bad key", " k", "k\t"} { + r := httptest.NewRequest(http.MethodPut, "/b/o", nil) + r.Header.Set(s3_constants.AmzServerSideEncryption, "aws:kms") + r.Header.Set(s3_constants.AmzServerSideEncryptionAwsKmsKeyId, keyID) + if baseIV != "" { + r.Header.Set(s3_constants.SeaweedFSSSEKMSBaseIVHeader, baseIV) + } + r = mux.SetURLVars(r, map[string]string{"bucket": "b", "object": "o"}) + _, code, _ := s3a.putToFiler(r, "/buckets/b/o", strings.NewReader("data"), "b", "o", 1, 0, nil, false, "") + require.Equal(t, s3err.ErrKMSKeyNotFound, code, "%s with key ID %q", name, keyID) + } + } +} + +func TestSSEKMSCreateMultipartUploadWithAMalformedKeyIsKMSKeyNotFound(t *testing.T) { + s3a, filer := newMultipartInitiateSSETestServer(t, nil) + rr := initiateMultipartWithHeaders(s3a, map[string]string{ + s3_constants.AmzServerSideEncryption: "aws:kms", + s3_constants.AmzServerSideEncryptionAwsKmsKeyId: "bad key", + }) + require.Equal(t, http.StatusBadRequest, rr.Code, rr.Body.String()) + require.Contains(t, rr.Body.String(), "KMS.NotFoundException") + + filer.mu.Lock() + defer filer.mu.Unlock() + for path := range filer.entries { + require.NotContains(t, path, s3_constants.MultipartUploadsFolder, "upload %s was created", path) + } +} + func TestSSEKMSCopyWithAnUnknownKeyIsKMSKeyNotFound(t *testing.T) { setupKMSWithoutOnDemandKeys(t) util_http.InitGlobalHttpClient() diff --git a/weed/s3api/s3_sse_kms_utils.go b/weed/s3api/s3_sse_kms_utils.go index 2bd7396f9f..9f43aee262 100644 --- a/weed/s3api/s3_sse_kms_utils.go +++ b/weed/s3api/s3_sse_kms_utils.go @@ -40,9 +40,13 @@ func validateKMSEncryptionContext(encryptionContext map[string]string) error { // generateKMSDataKey generates a new data encryption key using KMS // This function encapsulates the common pattern used across all SSE-KMS functions func generateKMSDataKey(keyID string, encryptionContext map[string]string) (*KMSDataKeyResult, error) { - // Validate keyID to prevent injection attacks and malformed requests to KMS service + // Validate keyID to prevent injection attacks and malformed requests to KMS service. + // A KMS answers an ID it can't parse as not found, and so does CopyObject. if !isValidKMSKeyID(keyID) { - return nil, fmt.Errorf("invalid KMS key ID format: key ID must be non-empty, without spaces or control characters") + return nil, &kms.KMSError{ + Code: kms.ErrCodeNotFoundException, + Message: "invalid KMS key ID format: key ID must be non-empty, without spaces or control characters", + } } if err := validateKMSEncryptionContext(encryptionContext); err != nil { diff --git a/weed/s3api/s3api_copy_validation.go b/weed/s3api/s3api_copy_validation.go index 430be30683..32f7399024 100644 --- a/weed/s3api/s3api_copy_validation.go +++ b/weed/s3api/s3api_copy_validation.go @@ -181,14 +181,18 @@ func validateEncryptionCompatibility(headers http.Header) error { // ValidateRequestEncryption rejects PutObject or CreateMultipartUpload // encryption headers that no single method can honor, with the InvalidArgument -// codes S3 returns for them. Under fips140=only it also refuses SSE-C, -// including the CopyObject copy-source headers. +// codes S3 returns for them, and a malformed SSE-KMS key ID with +// KMS.NotFoundException. Under fips140=only it also refuses SSE-C, including +// the CopyObject copy-source headers. func ValidateRequestEncryption(headers http.Header) s3err.ErrorCode { if fips140Enforced() && (hasSSECHeaders(headers) || hasSSECCopyHeaders(headers)) { return s3err.ErrNotImplemented } err := validateEncryptionCompatibility(headers) if err == nil { + if keyID := headers.Get(s3_constants.AmzServerSideEncryptionAwsKmsKeyId); keyID != "" && !isValidKMSKeyID(keyID) { + return s3err.ErrKMSKeyNotFound + } return s3err.ErrNone } var validationErr *CopyValidationError diff --git a/weed/s3api/s3api_copy_validation_test.go b/weed/s3api/s3api_copy_validation_test.go index 00edd60101..d6fc3cb5c6 100644 --- a/weed/s3api/s3api_copy_validation_test.go +++ b/weed/s3api/s3api_copy_validation_test.go @@ -47,6 +47,8 @@ func TestValidateRequestEncryption(t *testing.T) { {name: "SSE-S3 with KMS key id", sse: s3_constants.SSEAlgorithmAES256, headers: map[string]string{s3_constants.AmzServerSideEncryptionAwsKmsKeyId: "key-id"}, want: s3err.ErrIncompatibleEncryptionMethod}, {name: "KMS key id without method", headers: map[string]string{s3_constants.AmzServerSideEncryptionAwsKmsKeyId: "key-id"}, want: s3err.ErrIncompatibleEncryptionMethod}, {name: "KMS key id with aws:kms", sse: s3_constants.SSEAlgorithmKMS, headers: map[string]string{s3_constants.AmzServerSideEncryptionAwsKmsKeyId: "key-id"}, want: s3err.ErrNone}, + {name: "malformed KMS key id", sse: s3_constants.SSEAlgorithmKMS, headers: map[string]string{s3_constants.AmzServerSideEncryptionAwsKmsKeyId: "bad key"}, want: s3err.ErrKMSKeyNotFound}, + {name: "KMS key id with a control character", sse: s3_constants.SSEAlgorithmKMS, headers: map[string]string{s3_constants.AmzServerSideEncryptionAwsKmsKeyId: "k\t"}, want: s3err.ErrKMSKeyNotFound}, } for _, tc := range testCases { From 373eb29e594e572c3e1e435d360addc441defbb0 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:10:42 -0800 Subject: [PATCH 11/29] s3tables: table policy, maintenance and tag operations refuse a view (#13439) * s3tables: table policy and maintenance reads refuse views and unfinished records readTableMetadataAttr only checked that the table-metadata attribute was present, so the table policy and maintenance operations accepted a view or a record a create or rename had not finished writing. Route it through tableMetadata, the check GetTable and the other table operations use. Co-Authored-By: Claude Opus 5.5 * s3tables: tagging a table ARN refuses a view or unfinished record TagResource, ListTagsForResource and UntagResource read the table-metadata attribute directly for a table ARN, so a view or a record still being created or renamed under that name took and answered tags as a table. Read a table target through readTableMetadataAttr. Co-Authored-By: Claude Opus 5.5 * s3tables: table record writes refuse a view requireTableCreatedAt compared only the creation time, so a view holding the name at write time was not rejected on its own. Refuse it, so table policy, tag and maintenance writes never land on a view. Co-Authored-By: Claude Opus 5.5 * s3tables: test table operations against a view and an unfinished record Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- weed/s3api/s3tables/filer_ops.go | 15 +-- weed/s3api/s3tables/handler_policy.go | 16 ++- .../s3tables/handler_view_not_table_test.go | 97 +++++++++++++++++++ 3 files changed, 118 insertions(+), 10 deletions(-) create mode 100644 weed/s3api/s3tables/handler_view_not_table_test.go diff --git a/weed/s3api/s3tables/filer_ops.go b/weed/s3api/s3tables/filer_ops.go index 150bf9171d..eea629e45e 100644 --- a/weed/s3api/s3tables/filer_ops.go +++ b/weed/s3api/s3tables/filer_ops.go @@ -479,14 +479,15 @@ func (h *S3TablesHandler) loadNamespaceMetadata(ctx context.Context, filerClient return &metadata, nil } -// readTableMetadataAttr returns the table-metadata xattr at tablePath. A -// directory without it is not a table, so its absence reads as a missing entry. +// readTableMetadataAttr returns the table-metadata xattr at tablePath. A view, +// an unfinished record, or a directory without it is not a table, so each reads +// as a missing entry. func (h *S3TablesHandler) readTableMetadataAttr(ctx context.Context, client filer_pb.SeaweedFilerClient, tablePath string) ([]byte, error) { - data, err := h.getExtendedAttribute(ctx, client, tablePath, ExtendedKeyMetadata) - if errors.Is(err, ErrAttributeNotFound) { - return nil, fmt.Errorf("%w: %s", filer_pb.ErrNotFound, tablePath) + entry, err := h.lookupEntry(ctx, client, tablePath) + if err != nil { + return nil, err } - return data, err + return tableMetadata(entry) } // lookupEntry returns the filer entry at the given path. @@ -777,7 +778,7 @@ func (h *S3TablesHandler) mutateCatalogRecord( // settings into a conflict. func requireTableCreatedAt(extended map[string][]byte, path string, createdAt time.Time) error { var current tableMetadataInternal - if json.Unmarshal(extended[ExtendedKeyMetadata], ¤t) != nil || !current.CreatedAt.Equal(createdAt) { + if EntryType(extended) == EntryTypeView || json.Unmarshal(extended[ExtendedKeyMetadata], ¤t) != nil || !current.CreatedAt.Equal(createdAt) { return fmt.Errorf("%w: %s holds another table", ErrConcurrentUpdate, path) } return nil diff --git a/weed/s3api/s3tables/handler_policy.go b/weed/s3api/s3tables/handler_policy.go index 8575298dd1..03d699969a 100644 --- a/weed/s3api/s3tables/handler_policy.go +++ b/weed/s3api/s3tables/handler_policy.go @@ -799,7 +799,7 @@ func (h *S3TablesHandler) handleTagResource(w http.ResponseWriter, r *http.Reque requestTagKeys := mapKeys(req.Tags) err = filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { // Read metadata for ownership check - data, err := h.getExtendedAttribute(r.Context(), client, resourcePath, ExtendedKeyMetadata) + data, err := h.readResourceMetadata(r.Context(), client, resourcePath, rType) if err != nil { if errors.Is(err, filer_pb.ErrNotFound) || errors.Is(err, ErrAttributeNotFound) { return h.absentTagTargetError(r, client, "TagResource", "not authorized to tag resource", req.ResourceARN, rType) @@ -965,7 +965,7 @@ func (h *S3TablesHandler) handleListTagsForResource(w http.ResponseWriter, r *ht var tableNamespace, tableName string err = filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { // Read metadata for ownership check - data, err := h.getExtendedAttribute(r.Context(), client, resourcePath, ExtendedKeyMetadata) + data, err := h.readResourceMetadata(r.Context(), client, resourcePath, rType) if err != nil { if errors.Is(err, filer_pb.ErrNotFound) || errors.Is(err, ErrAttributeNotFound) { return h.absentTagTargetError(r, client, "ListTagsForResource", "not authorized to list tags for resource", req.ResourceARN, rType) @@ -1094,7 +1094,7 @@ func (h *S3TablesHandler) handleUntagResource(w http.ResponseWriter, r *http.Req var createdAt time.Time err = filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { // Read metadata for ownership check - data, err := h.getExtendedAttribute(r.Context(), client, resourcePath, ExtendedKeyMetadata) + data, err := h.readResourceMetadata(r.Context(), client, resourcePath, rType) if err != nil { if errors.Is(err, filer_pb.ErrNotFound) || errors.Is(err, ErrAttributeNotFound) { return h.absentTagTargetError(r, client, "UntagResource", "not authorized to untag resource", req.ResourceARN, rType) @@ -1239,6 +1239,16 @@ func (h *S3TablesHandler) absentTagTargetError(r *http.Request, client filer_pb. return filer_pb.ErrNotFound } +// readResourceMetadata returns the metadata xattr of a tagging target. A table +// ARN reads it the way the table operations do, so a view or an unfinished +// record at that name is absent. +func (h *S3TablesHandler) readResourceMetadata(ctx context.Context, client filer_pb.SeaweedFilerClient, resourcePath string, rType ResourceType) ([]byte, error) { + if rType == ResourceTypeTable { + return h.readTableMetadataAttr(ctx, client, resourcePath) + } + return h.getExtendedAttribute(ctx, client, resourcePath, ExtendedKeyMetadata) +} + // resolveResourcePath determines the resource path and extended attribute key from a resource ARN func (h *S3TablesHandler) resolveResourcePath(resourceARN string) (path string, key string, rType ResourceType, err error) { // Try parsing as table ARN first diff --git a/weed/s3api/s3tables/handler_view_not_table_test.go b/weed/s3api/s3tables/handler_view_not_table_test.go new file mode 100644 index 0000000000..2546d298f5 --- /dev/null +++ b/weed/s3api/s3tables/handler_view_not_table_test.go @@ -0,0 +1,97 @@ +package s3tables + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// A view, or a table its create has not finished writing, is not a table: the +// table policy, maintenance and tag operations answer NoSuchTable for its name +// and write nothing to it. +func TestTableOperationsRefuseViewAndUnfinishedRecord(t *testing.T) { + fs, m := startRenameManager(t) + seedView(t, fs, "v") + nsPath := GetNamespacePath(renameTestBucket, "ns") + fs.Put(nsPath, "c", map[string][]byte{ + ExtendedKeyMetadata: []byte(`{"name":"c","namespace":"ns","ownerAccountId":"` + DefaultAccountID + `"}`), + ExtendedKeyDeleting: []byte(createClaim), + }) + bucketARN := mustBucketARN(t) + + for _, name := range []string{"v", "c"} { + before := extendedOf(t, fs, nsPath, name) + tableARN, err := BuildTableARN(DefaultRegion, DefaultAccountID, renameTestBucket, "ns", name) + require.NoError(t, err) + ops := []struct { + operation string + input interface{} + }{ + {"PutTablePolicy", &PutTablePolicyRequest{ + TableBucketARN: bucketARN, + Namespace: []string{"ns"}, + Name: name, + ResourcePolicy: `{"Statement":[{"Effect":"Allow","Principal":"*","Action":"s3tables:*","Resource":"*"}]}`, + }}, + {"GetTablePolicy", &GetTablePolicyRequest{TableBucketARN: bucketARN, Namespace: []string{"ns"}, Name: name}}, + {"DeleteTablePolicy", &DeleteTablePolicyRequest{TableBucketARN: bucketARN, Namespace: []string{"ns"}, Name: name}}, + {"PutTableMaintenanceConfiguration", &PutTableMaintenanceConfigurationRequest{ + TableBucketARN: bucketARN, + Namespace: []string{"ns"}, + Name: name, + Type: MaintenanceTypeIcebergCompaction, + Value: &MaintenanceConfigurationValue{Status: MaintenanceStatusEnabled}, + }}, + {"GetTableMaintenanceConfiguration", &GetTableMaintenanceConfigurationRequest{TableBucketARN: bucketARN, Namespace: []string{"ns"}, Name: name}}, + {"GetTableMaintenanceJobStatus", &GetTableMaintenanceJobStatusRequest{TableBucketARN: bucketARN, Namespace: []string{"ns"}, Name: name}}, + {"TagResource", &TagResourceRequest{ResourceARN: tableARN, Tags: map[string]string{"k": "v"}}}, + {"ListTagsForResource", &ListTagsForResourceRequest{ResourceARN: tableARN}}, + {"UntagResource", &UntagResourceRequest{ResourceARN: tableARN, TagKeys: []string{"k"}}}, + } + for _, op := range ops { + t.Run(name+"/"+op.operation, func(t *testing.T) { + status, resp := runHandler(t, m, fs.Client, op.operation, op.input) + assert.Equal(t, http.StatusNotFound, status, "%+v", resp) + assert.Equal(t, ErrCodeNoSuchTable, resp.Type, "%+v", resp) + }) + } + assert.Equal(t, before, extendedOf(t, fs, nsPath, name), "%s must not be written to", name) + } +} + +// An identity granted only s3tables:PutTablePolicy cannot plant a policy on +// another account's view through the table API and so open the view to itself. +func TestPutTablePolicyCannotOpenAView(t *testing.T) { + fs, m := startRenameManager(t) + m.SetTrusted(false) + m.SetDefaultAllow(false) + seedView(t, fs, "v") + bucketARN := mustBucketARN(t) + + call := func(operation string, input interface{}) int { + body, err := json.Marshal(input) + require.NoError(t, err) + identity := &testIdentity{Name: "other", Account: &testIdentityAccount{Id: "other"}, + Actions: []string{"s3tables:PutTablePolicy"}} + req, err := newManagerRequest(s3_constants.SetIdentityInContext(assignedCtx(), identity), operation, body, "other") + require.NoError(t, err) + rec := httptest.NewRecorder() + m.handler.HandleRequest(rec, req, NewManagerClient(fs.Client)) + return rec.Code + } + + assert.Equal(t, http.StatusNotFound, call("PutTablePolicy", &PutTablePolicyRequest{ + TableBucketARN: bucketARN, + Namespace: []string{"ns"}, + Name: "v", + ResourcePolicy: `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":"*","Action":"s3tables:*","Resource":"*"}]}`, + })) + assert.NotEqual(t, http.StatusOK, call("GetView", &GetViewRequest{TableBucketARN: bucketARN, Namespace: []string{"ns"}, Name: "v"})) + assert.NotEqual(t, http.StatusOK, call("DeleteView", &DeleteViewRequest{TableBucketARN: bucketARN, Namespace: []string{"ns"}, Name: "v"})) + assert.NotNil(t, fs.Get(GetNamespacePath(renameTestBucket, "ns"), "v"), "the view must still be stored") +} From 120d78681869648263868f387fb43cc1234e3e5e Mon Sep 17 00:00:00 2001 From: Yip Leo Date: Sun, 6 Dec 2026 03:11:43 +0800 Subject: [PATCH 12/29] mount: update a directory's times once, without retries (#13443) * mount: update a directory's times once, without retries touchDirMtimeCtime sent its UpdateEntry through saveEntry's retries, 1, 2 and 4 s apart. Every create, link, rename and removal in the directory waits for that update and ignores how it went. In a directory many writers share, the update of its entry conflicts in the filer store with theirs (TiKV reports "write conflict"), and the call waited out the backoffs: in one directory about 200 jobs shared, three mounts logged 3646 such retries in two hours, each holding a create or a rename for up to about 7 s. saveEntry takes a bestEffort flag: such an update is tried once and its failure logged at V(1). touchDirMtimeCtime sets it; setattr and the xattr calls keep their retries. Co-Authored-By: Claude Opus 5.5 * mount: shorten the directory times comments Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Chris Lu --- weed/mount/weedfs_attr.go | 6 ++- weed/mount/weedfs_attr_mount_root_test.go | 53 ++++++++++++++++++- .../weedfs_invalidate_open_handle_test.go | 10 ++-- weed/mount/weedfs_xattr.go | 4 +- weed/mount/wfs_save.go | 25 ++++++--- 5 files changed, 81 insertions(+), 17 deletions(-) diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go index 33e826b03e..2cfc2edf26 100644 --- a/weed/mount/weedfs_attr.go +++ b/weed/mount/weedfs_attr.go @@ -259,7 +259,7 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse return fuse.OK } - return wfs.saveEntry(path, entry) + return wfs.saveEntry(path, entry, false) } @@ -463,6 +463,8 @@ func (wfs *WFS) touchDirMtimeCtimeBest(dirPath util.FullPath) { // touchDirMtimeCtime updates a directory's mtime and ctime on the filer. // POSIX requires this when entries are created or removed in the directory. +// It is tried once: callers ignore the outcome, and retrying a write conflict +// on a directory many writers share only stalls them. func (wfs *WFS) touchDirMtimeCtime(dirPath util.FullPath) { // The mount root reports its own times (setRootAttr), and maybeLoadEntry // synthesizes its entry from the mount options instead of reading the @@ -481,7 +483,7 @@ func (wfs *WFS) touchDirMtimeCtime(dirPath util.FullPath) { dirEntry.Attributes.MtimeNs = int32(now.Nanosecond()) dirEntry.Attributes.Ctime = now.Unix() dirEntry.Attributes.CtimeNs = int32(now.Nanosecond()) - wfs.saveEntry(dirPath, dirEntry) + wfs.saveEntry(dirPath, dirEntry, true) } // touchDirMtimeCtimeLocal updates a directory's mtime and ctime in an in-memory diff --git a/weed/mount/weedfs_attr_mount_root_test.go b/weed/mount/weedfs_attr_mount_root_test.go index e86a5613b8..741cc0d9ef 100644 --- a/weed/mount/weedfs_attr_mount_root_test.go +++ b/weed/mount/weedfs_attr_mount_root_test.go @@ -5,27 +5,42 @@ import ( "os" "sync" "testing" + "time" + "github.com/seaweedfs/go-fuse/v2/fuse" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) -// savedEntriesFiler records the entries a mount saves. +// savedEntriesFiler records the entries a mount saves, refusing each with +// refuse when it is set. type savedEntriesFiler struct { filer_pb.UnimplementedSeaweedFilerServer mu sync.Mutex updates []*filer_pb.UpdateEntryRequest + refuse error } func (s *savedEntriesFiler) UpdateEntry(_ context.Context, req *filer_pb.UpdateEntryRequest) (*filer_pb.UpdateEntryResponse, error) { s.mu.Lock() defer s.mu.Unlock() s.updates = append(s.updates, proto.Clone(req).(*filer_pb.UpdateEntryRequest)) + if s.refuse != nil { + return nil, s.refuse + } return &filer_pb.UpdateEntryResponse{}, nil } +func (s *savedEntriesFiler) updateCount() int { + s.mu.Lock() + defer s.mu.Unlock() + return len(s.updates) +} + // Creating or removing an entry directly in the mount root must not save the // root: its entry is synthesized from the mount options, so saving it would // replace the real directory on the filer, wiping a bucket's quota and the @@ -64,3 +79,39 @@ func TestTouchDirMtimeCtimeLeavesTheMountRootOnTheFiler(t *testing.T) { t.Errorf("sub mtime = %d, want it touched", fake.updates[0].Entry.Attributes.Mtime) } } + +// The directory times update is tried once; other saves still retry. +func TestTouchDirMtimeCtimeIsTriedOnce(t *testing.T) { + wfs := newInvalidateTestWFS(t) + root := util.FullPath("/buckets/b1") + wfs.option.FilerMountRootPath = string(root) + fake := &savedEntriesFiler{refuse: status.Error(codes.Unknown, "write conflict")} + startFakeFiler(t, wfs, fake) + + wfs.inodeToPath.Lookup(root, 1, true, false, 0, false) + wfs.inodeToPath.MarkChildrenCached(root) + sub := &filer_pb.Entry{ + Name: "sub", + IsDirectory: true, + Attributes: &filer_pb.FuseAttributes{FileMode: uint32(os.ModeDir | 0755), Mtime: 1}, + } + if err := wfs.metaCache.InsertEntry(context.Background(), filer.FromPbEntry(string(root), sub), 1); err != nil { + t.Fatal(err) + } + var backoffs []time.Duration + oldSleep := metadataFlushSleep + metadataFlushSleep = func(_ context.Context, d time.Duration) { backoffs = append(backoffs, d) } + defer func() { metadataFlushSleep = oldSleep }() + + wfs.touchDirMtimeCtime(root.Child("sub")) + if n := fake.updateCount(); n != 1 || len(backoffs) != 0 { + t.Fatalf("touch sent %d updates and waited out backoffs %v, want 1 update and none", n, backoffs) + } + + if code := wfs.saveEntry(root.Child("sub"), proto.Clone(sub).(*filer_pb.Entry), false); code == fuse.OK { + t.Fatal("refused save reported OK") + } + if n := fake.updateCount(); n < 3 { + t.Fatalf("save sent %d updates in all, want it to retry", n) + } +} diff --git a/weed/mount/weedfs_invalidate_open_handle_test.go b/weed/mount/weedfs_invalidate_open_handle_test.go index 7a93cf4b8f..70264988ba 100644 --- a/weed/mount/weedfs_invalidate_open_handle_test.go +++ b/weed/mount/weedfs_invalidate_open_handle_test.go @@ -446,7 +446,7 @@ func TestSaveEntryKeepsOpenHandleAheadOfOlderEvents(t *testing.T) { Name: "file", Attributes: &filer_pb.FuseAttributes{FileSize: 200}, } - if code := wfs.saveEntry(util.FullPath("/dir/file"), saved); code != fuse.OK { + if code := wfs.saveEntry(util.FullPath("/dir/file"), saved, false); code != fuse.OK { t.Fatalf("saveEntry status = %v, want OK", code) } @@ -720,7 +720,7 @@ func TestEventlessSaveAckStillFencesOlderEvents(t *testing.T) { Name: "file", Attributes: &filer_pb.FuseAttributes{FileSize: 200}, } - if code := wfs.saveEntry(util.FullPath("/dir/file"), saved); code != fuse.OK { + if code := wfs.saveEntry(util.FullPath("/dir/file"), saved, false); code != fuse.OK { t.Fatalf("saveEntry status = %v, want OK", code) } @@ -1374,7 +1374,7 @@ func TestAckedSaveInstallsIntoRacingOpenHandle(t *testing.T) { Name: "file", Attributes: &filer_pb.FuseAttributes{FileSize: 200}, } - if code := wfs.saveEntry(util.FullPath("/dir/file"), saved); code != fuse.OK { + if code := wfs.saveEntry(util.FullPath("/dir/file"), saved, false); code != fuse.OK { t.Fatalf("saveEntry status = %v, want OK", code) } @@ -1395,7 +1395,7 @@ func TestAckedSaveInstallsIntoRacingOpenHandle(t *testing.T) { if code := wfs.saveEntry(util.FullPath("/dir/dirty"), &filer_pb.Entry{ Name: "dirty", Attributes: &filer_pb.FuseAttributes{FileSize: 200}, - }); code != fuse.OK { + }, false); code != fuse.OK { t.Fatalf("saveEntry status = %v, want OK", code) } if size := dirtyFh.GetEntry().GetEntry().Attributes.FileSize; size != 88 { @@ -1588,7 +1588,7 @@ func TestEventlessSaveVersionsCacheEntry(t *testing.T) { if code := wfs.saveEntry(util.FullPath("/dir/file"), &filer_pb.Entry{ Name: "file", Attributes: &filer_pb.FuseAttributes{FileSize: 200, FileMode: 0100644}, - }); code != fuse.OK { + }, false); code != fuse.OK { t.Fatalf("saveEntry status = %v, want OK", code) } diff --git a/weed/mount/weedfs_xattr.go b/weed/mount/weedfs_xattr.go index 7ff1667a2b..267a901dfc 100644 --- a/weed/mount/weedfs_xattr.go +++ b/weed/mount/weedfs_xattr.go @@ -186,7 +186,7 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr st return fuse.OK } - return wfs.saveEntry(path, entry) + return wfs.saveEntry(path, entry, false) } @@ -294,7 +294,7 @@ func (wfs *WFS) RemoveXAttr(cancel <-chan struct{}, header *fuse.InHeader, attr return fuse.OK } - return wfs.saveEntry(path, entry) + return wfs.saveEntry(path, entry, false) } func removeXAttr(entry *filer_pb.Entry, attr string) fuse.Status { diff --git a/weed/mount/wfs_save.go b/weed/mount/wfs_save.go index 95744a4c39..6da48fb26e 100644 --- a/weed/mount/wfs_save.go +++ b/weed/mount/wfs_save.go @@ -15,7 +15,10 @@ import ( "github.com/seaweedfs/seaweedfs/weed/util" ) -func (wfs *WFS) saveEntry(path util.FullPath, entry *filer_pb.Entry) (code fuse.Status) { +// saveEntry stores entry at path on the filer, retrying a failed update. A +// bestEffort update, whose outcome changes nothing for its caller, is tried +// once and its failure logged at V(1). +func (wfs *WFS) saveEntry(path util.FullPath, entry *filer_pb.Entry, bestEffort bool) (code fuse.Status) { parentDir, _ := path.DirAndName() @@ -31,14 +34,20 @@ func (wfs *WFS) saveEntry(path util.FullPath, entry *filer_pb.Entry) (code fuse. glog.V(1).Infof("save entry %s", path) var resp *filer_pb.UpdateEntryResponse - err := retryMetadataFlushIf(context.Background(), func() error { + update := func() error { var callErr error resp, callErr = wfs.streamUpdateEntry(context.Background(), request) return callErr - }, isRetryableFilerError, func(nextAttempt, totalAttempts int, backoff time.Duration, err error) { - glog.Warningf("saveEntry %s: retrying UpdateEntry (attempt %d/%d) after %v: %v", - path, nextAttempt, totalAttempts, backoff, err) - }) + } + var err error + if bestEffort { + err = update() + } else { + err = retryMetadataFlushIf(context.Background(), update, isRetryableFilerError, func(nextAttempt, totalAttempts int, backoff time.Duration, err error) { + glog.Warningf("saveEntry %s: retrying UpdateEntry (attempt %d/%d) after %v: %v", + path, nextAttempt, totalAttempts, backoff, err) + }) + } if err != nil { // Wrap with %w so grpcErrorToFuseStatus can still unwrap the gRPC status @@ -46,7 +55,9 @@ func (wfs *WFS) saveEntry(path util.FullPath, entry *filer_pb.Entry) (code fuse. // status.FromError would fall through to the default EIO. err = fmt.Errorf("UpdateEntry dir %s: %w", path, err) fuseStatus := grpcErrorToFuseStatus(err) - if fuseStatus == fuse.EIO { + if bestEffort { + glog.V(1).Infof("saveEntry %s: %v (best effort, not retried)", path, err) + } else if fuseStatus == fuse.EIO { glog.Errorf("saveEntry failed for %s: %v (returning EIO)", path, err) } else { glog.V(1).Infof("saveEntry failed for %s: %v (returning %v)", path, err, fuseStatus) From 16a6a70a08ea6168cce609b39acbd3f6e7545715 Mon Sep 17 00:00:00 2001 From: Yip Leo Date: Sun, 6 Dec 2026 03:12:29 +0800 Subject: [PATCH 13/29] mount: keep delayed events about an earlier file off the next file at its name (#13445) * mount: keep delayed events about an earlier file off the next file at its name A writer that publishes a status file by writing NNNN.json.tmp-PID, fsyncing it and renaming it over NNNN.json recreates the tmp name every few seconds. Without -writebackCache a mount applies its own events from the metadata subscription after the local apply (the events of a rename stream carry the response time, not the log position, so the dedup ring does not match them), and their invalidations reach whatever file sits at the path by then. With about 200 such writers in one directory, two of these events failed a round of the next file: - the rename of round k moved round k+1's tmp file to NNNN.json. Its handle published under that name and was refused (EIO); the retry wrote into NNNN.json, and the rename of the tmp name failed with ENOENT. - the create of round k became the entry and base of round k+1's file, and every flush of the round was refused (EIO). Both hit the new file in the window in which Create had put its handle in the map but not yet marked it an unpublished create: it did that afterwards, holding no lock, so the event found a clean handle with a base and took it for a published file. On master the second event, which carries the inode number the creating mount stored, makes the handle give the name up instead (replacedByAnotherFile) and marks it deleted: its writes are never published, and close returns success. - AcquireCreatedFileHandle puts a new handle in the state the create leaves it in before the handle is in the map. An existing handle, whose inode number outlived an earlier file, is installed under its lock. - An invalidation carries which file its event is about: the inode number the file's creator stored and its creation time (hard links excluded). An open handle ignores a rename of another file, and any other event about an earlier one (another number, created before the file held). A later file at the name still reaches the handle. - MovePath takes the inode number a rename event reports. A source that maps to another inode, while the table knows the renamed file by that number, holds another file and stays. Co-Authored-By: Claude Opus 5.5 * mount: judge another file by its creation time only for this mount's own events A peer's file can take the name with an older creation time: renamed in from another name, or created on a host whose clock runs behind. Dropping its event left the name on the replaced file's inode. A peer's rename can also name a file by a stored inode number another file here holds, when two mounts made the same path within one second, and was refused. Co-Authored-By: Claude Opus 5.5 * mount: a delete of another file at the name leaves the open handle alone Like a rename, a delete names the file it removed. A peer's delayed delete of an earlier file at the name, logged by a filer other than the one behind the handle's version, marked the held file deleted and dropped its writes. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Chris Lu --- weed/mount/filehandle.go | 52 +++ weed/mount/filehandle_map.go | 28 +- weed/mount/filehandle_test.go | 2 +- weed/mount/inode_to_path.go | 14 +- weed/mount/inode_to_path_dirstate_test.go | 2 +- weed/mount/inode_to_path_test.go | 4 +- weed/mount/meta_cache/meta_cache.go | 44 ++- weed/mount/weedfs.go | 38 +- weed/mount/weedfs_create_handle_state_test.go | 131 +++++++ weed/mount/weedfs_dir_lookup_dot_test.go | 8 +- weed/mount/weedfs_file_mkrm.go | 25 +- .../weedfs_invalidate_open_handle_test.go | 6 +- weed/mount/weedfs_peer_unlink_test.go | 2 +- weed/mount/weedfs_rename.go | 2 +- weed/mount/weedfs_rename_publish_test.go | 2 +- .../mount/weedfs_stale_event_identity_test.go | 328 ++++++++++++++++++ 16 files changed, 653 insertions(+), 35 deletions(-) create mode 100644 weed/mount/weedfs_create_handle_state_test.go create mode 100644 weed/mount/weedfs_stale_event_identity_test.go diff --git a/weed/mount/filehandle.go b/weed/mount/filehandle.go index 281c5016bb..4fed3eaa45 100644 --- a/weed/mount/filehandle.go +++ b/weed/mount/filehandle.go @@ -12,6 +12,7 @@ import ( "github.com/seaweedfs/seaweedfs/weed/cluster" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/mount/meta_cache" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/util" ) @@ -484,6 +485,57 @@ func (fh *FileHandle) setAuthoritativeBase(base *filer_pb.Entry) { fh.baseEntry.Store(base) } +// installCreated puts the handle in the state Create leaves it in: a deferred +// create dirty with no filer base, an eager one clean on the entry the filer +// acknowledged. The caller holds the handle's lock, or has not exposed the +// handle yet. +func (fh *FileHandle) installCreated(entry *filer_pb.Entry, deferred bool) { + fh.dirtyMetadata = deferred + if deferred { + // A local placeholder, not an acknowledged filer base. + fh.baseEntry.Store(nil) + return + } + fh.setAuthoritativeBase(proto.Clone(entry).(*filer_pb.Entry)) +} + +// fileIdentity is the inode number, creation time and hard link mark of the +// file the handle holds, as its entry records them. +func (fh *FileHandle) fileIdentity() (inode uint64, crtime int64, hardLink bool) { + fh.entry.RLock() + defer fh.entry.RUnlock() + if e := fh.entry.Entry; e != nil { + if a := e.Attributes; a != nil { + inode, crtime = a.Inode, a.Crtime + } + hardLink = len(e.HardLinkId) > 0 + } + return +} + +// holdsAnotherFileThan reports whether the handle holds a file other than the +// one the event is about. +func (fh *FileHandle) holdsAnotherFileThan(inv meta_cache.EntryInvalidation) bool { + heldInode, _, heldHardLink := fh.fileIdentity() + return anotherFile(inv, heldInode, heldHardLink) +} + +// holdsLaterFileThan reports whether the event is about an earlier file of +// the name than the one the handle holds: another file, created before it. +func (fh *FileHandle) holdsLaterFileThan(inv meta_cache.EntryInvalidation) bool { + heldInode, heldCrtime, heldHardLink := fh.fileIdentity() + return inv.Crtime != 0 && anotherFile(inv, heldInode, heldHardLink) && inv.Crtime < heldCrtime +} + +// anotherFile reports whether the event is about another file than the one +// numbered heldInode: both carry an inode number from their creators and the +// numbers differ. Zero says nothing, and a hard link is known by its link +// record instead. +func anotherFile(inv meta_cache.EntryInvalidation, heldInode uint64, heldHardLink bool) bool { + eventInode := inv.FileInode() + return eventInode != 0 && !heldHardLink && heldInode != 0 && heldInode != eventInode +} + // unpublishedCreate reports a file this mount created whose deferred create // has not reached the filer yet: Create leaves such a handle dirty with no // base, and the first successful flush installs one. The filer holds nothing diff --git a/weed/mount/filehandle_map.go b/weed/mount/filehandle_map.go index 84831f94c1..c1dd40e49c 100644 --- a/weed/mount/filehandle_map.go +++ b/weed/mount/filehandle_map.go @@ -67,6 +67,27 @@ func (i *FileHandleToInode) MarkInodeRenamed(inode uint64) { // Callers must treat a draining report as "wait for the pending flush, then // retry the whole acquire", not as success. func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *filer_pb.Entry, versionTsNs int64, signature int32, appendMode ...bool) (*FileHandle, FileHandleId, bool, bool) { + return i.acquireFileHandle(wfs, inode, entry, versionTsNs, signature, len(appendMode) > 0 && appendMode[0], nil) +} + +// AcquireCreatedFileHandle is AcquireFileHandle for the file Create just made. +// A new handle is in the state the create leaves it in before any other thread +// can find it: a deferred create dirty with no filer base (an unpublished +// create), an eager one clean on the entry the filer acknowledged. Setting that +// state after the handle was in the map left a window in which an event +// applied to the inode found a clean handle with a base and took it for a +// published file. An existing handle, whose inode number outlived an earlier +// file, comes back as from AcquireFileHandle; the caller installs the create +// under its lock. +func (i *FileHandleToInode) AcquireCreatedFileHandle(wfs *WFS, inode uint64, entry *filer_pb.Entry, deferred, appendMode bool) (*FileHandle, FileHandleId, bool, bool) { + return i.acquireFileHandle(wfs, inode, entry, 0, 0, appendMode, func(fh *FileHandle) { + fh.installCreated(entry, deferred) + }) +} + +// acquireFileHandle runs prepare, if given, on a new handle before the handle +// is in the map. +func (i *FileHandleToInode) acquireFileHandle(wfs *WFS, inode uint64, entry *filer_pb.Entry, versionTsNs int64, signature int32, appendMode bool, prepare func(fh *FileHandle)) (*FileHandle, FileHandleId, bool, bool) { // Bind before publishing the handle or queuing any async close. Capture // under the inode-table lock, but release it before taking the fhMap lock. var writebackError *atomic.Bool @@ -85,9 +106,12 @@ func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *fil if !found { fh = newFileHandle(wfs, FileHandleId(util.RandomUint64()), inode, entry) fh.writebackContentError = writebackError - fh.fhs[fh.fh] = len(appendMode) > 0 && appendMode[0] + fh.fhs[fh.fh] = appendMode fh.entryVersionTsNs.Store(versionTsNs) fh.entryVersionSignature.Store(signature) + if prepare != nil { + prepare(fh) + } i.inode2fh[inode] = fh i.fh2inode[fh.fh] = inode return fh, fh.fh, false, false @@ -97,7 +121,7 @@ func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *fil } fh.counter++ openFh := FileHandleId(util.RandomUint64()) - fh.fhs[openFh] = len(appendMode) > 0 && appendMode[0] + fh.fhs[openFh] = appendMode i.fh2inode[openFh] = inode return fh, openFh, true, false } diff --git a/weed/mount/filehandle_test.go b/weed/mount/filehandle_test.go index ebf3cd51ff..5c7eef6295 100644 --- a/weed/mount/filehandle_test.go +++ b/weed/mount/filehandle_test.go @@ -42,7 +42,7 @@ func TestFileHandleFullPathUsesSavedRenamePathAfterForget(t *testing.T) { } fh.RememberPath(oldPath) - wfs.inodeToPath.MovePath(oldPath, newPath) + wfs.inodeToPath.MovePath(oldPath, newPath, 0) fh.RememberPath(newPath) wfs.inodeToPath.Forget(inode, 1, nil, nil) diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go index 0d004cfbd9..6499d2d221 100644 --- a/weed/mount/inode_to_path.go +++ b/weed/mount/inode_to_path.go @@ -799,10 +799,22 @@ func (i *InodeToPath) removePathFromInode2Path(inode uint64, path util.FullPath) } } -func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (sourceInode, targetInode uint64) { +// MovePath moves the inode at sourcePath to targetPath, reporting it and the +// inode it displaced there. fileInode, when not zero, is the inode number the +// moved file's creator stored, as a rename event reports it. A source that +// maps to another inode while the table knows fileInode holds another file, +// one the rename did not move, and stays: a delayed event about an earlier +// file of the name finds a later one there when a writer recreates the name, +// as one renaming tmp files into place does every few seconds. +func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath, fileInode uint64) (sourceInode, targetInode uint64) { i.Lock() defer i.Unlock() sourceInode, sourceFound := i.path2inode[sourcePath] + if sourceFound && fileInode != 0 && sourceInode != fileInode { + if _, known := i.inode2path[fileInode]; known { + return 0, 0 + } + } if !sourceFound && !i.moveForgotten(sourcePath, targetPath) { // Nothing of ours to move: the source was never visited here, or a // redelivery already moved it. Whatever sits at the target is not ours diff --git a/weed/mount/inode_to_path_dirstate_test.go b/weed/mount/inode_to_path_dirstate_test.go index 66c63016a2..7db98d9051 100644 --- a/weed/mount/inode_to_path_dirstate_test.go +++ b/weed/mount/inode_to_path_dirstate_test.go @@ -47,7 +47,7 @@ func TestDirStateIndexesStayInStep(t *testing.T) { t.Error("a file landed in the directory index") } - itp.MovePath("/a/sub", "/a/moved") + itp.MovePath("/a/sub", "/a/moved", 0) checkDirIndexes(t, itp) if itp.dirStateOf("/a/sub") != nil { t.Error("pre-rename directory still indexed") diff --git a/weed/mount/inode_to_path_test.go b/weed/mount/inode_to_path_test.go index ac680f0a69..c518f7655d 100644 --- a/weed/mount/inode_to_path_test.go +++ b/weed/mount/inode_to_path_test.go @@ -196,8 +196,8 @@ func TestMovePathWithNoSourceLeavesTheTarget(t *testing.T) { itp := NewInodeToPath(util.FullPath("/"), 0) inode := itp.Lookup("/a/f.txt", time.Now().Unix(), false, false, 0, true) - itp.MovePath("/a/f.txt", "/a/g.txt") - if sourceInode, targetInode := itp.MovePath("/a/f.txt", "/a/g.txt"); sourceInode != 0 || targetInode != 0 { + itp.MovePath("/a/f.txt", "/a/g.txt", 0) + if sourceInode, targetInode := itp.MovePath("/a/f.txt", "/a/g.txt", 0); sourceInode != 0 || targetInode != 0 { t.Errorf("repeat move reported %d -> %d, want nothing moved", sourceInode, targetInode) } diff --git a/weed/mount/meta_cache/meta_cache.go b/weed/mount/meta_cache/meta_cache.go index 583fffc80f..a40b964979 100644 --- a/weed/mount/meta_cache/meta_cache.go +++ b/weed/mount/meta_cache/meta_cache.go @@ -1157,6 +1157,33 @@ type EntryInvalidation struct { // LiveHardLinkId is set on a delete that left other names holding the // hard-linked file, by the count the filer kept its chunks on. LiveHardLinkId []byte + // Inode and Crtime say which file the event is about, from the entry it + // carries (for a vacated path, the entry that left it): the inode number + // the file's creator stored and its creation time in seconds, zero where + // unknown. HardLink marks an entry known by its link record instead. A + // writer that renames tmp files into place recreates the same name every + // few seconds, so a delayed event can find a later file at its path. + Inode uint64 + Crtime int64 + HardLink bool +} + +// identifiedBy fills in which file the invalidation is about from entry. +func (inv EntryInvalidation) identifiedBy(entry *filer_pb.Entry) EntryInvalidation { + if attributes := entry.GetAttributes(); attributes != nil { + inv.Inode, inv.Crtime = attributes.Inode, attributes.Crtime + } + inv.HardLink = len(entry.GetHardLinkId()) > 0 + return inv +} + +// FileInode is the inode number of the file the event is about, or zero when +// the event cannot tell it: no number recorded, or a hard link. +func (inv EntryInvalidation) FileInode() uint64 { + if inv.HardLink { + return 0 + } + return inv.Inode } type metadataResponseSideEffects struct { @@ -1786,10 +1813,17 @@ func collectEntryInvalidations(resp *filer_pb.SubscribeMetadataResponse) []Entry } if message.OldEntry.Name != message.NewEntry.Name || resp.Directory != newDir { newKey := util.NewFullPath(newDir, message.NewEntry.Name) - invalidations = append(invalidations, EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Signatures: signatures, RenamedTo: newKey, WasDirectory: message.OldEntry.IsDirectory}) - invalidations = append(invalidations, EntryInvalidation{Path: newKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures}) + // The file that left the old name is the one the rename moved; + // an event that names only the old entry is identified by the + // moved one, which keeps its attributes. + left := message.OldEntry + if left.GetAttributes() == nil { + left = message.NewEntry + } + invalidations = append(invalidations, EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Signatures: signatures, RenamedTo: newKey, WasDirectory: message.OldEntry.IsDirectory}.identifiedBy(left)) + invalidations = append(invalidations, EntryInvalidation{Path: newKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures}.identifiedBy(message.NewEntry)) } else { - invalidations = append(invalidations, EntryInvalidation{Path: oldKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures}) + invalidations = append(invalidations, EntryInvalidation{Path: oldKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures}.identifiedBy(message.NewEntry)) } return invalidations } @@ -1800,12 +1834,12 @@ func collectEntryInvalidations(resp *filer_pb.SubscribeMetadataResponse) []Entry newDir = message.NewParentPath } newKey := util.NewFullPath(newDir, message.NewEntry.Name) - invalidations = append(invalidations, EntryInvalidation{Path: newKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures}) + invalidations = append(invalidations, EntryInvalidation{Path: newKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures}.identifiedBy(message.NewEntry)) } if filer_pb.IsDelete(resp) && message.OldEntry != nil { oldKey := util.NewFullPath(resp.Directory, message.OldEntry.Name) - invalidation := EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Deleted: true, Signatures: signatures, WasDirectory: message.OldEntry.IsDirectory} + invalidation := EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Deleted: true, Signatures: signatures, WasDirectory: message.OldEntry.IsDirectory}.identifiedBy(message.OldEntry) if len(message.OldEntry.HardLinkId) > 0 && message.OldEntry.HardLinkCounter > 1 { invalidation.LiveHardLinkId = message.OldEntry.HardLinkId } diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index b47283387a..1910239e58 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -10,6 +10,7 @@ import ( "path" "path/filepath" "runtime" + "slices" "sync" "sync/atomic" "syscall" @@ -1228,7 +1229,14 @@ func (wfs *WFS) onEntryInvalidation(invalidation meta_cache.EntryInvalidation) { // open. handled, replacedInode, detached := wfs.invalidateOpenFileHandle(invalidation) if !handled && invalidation.RenamedTo != "" { - _, replacedInode = wfs.inodeToPath.MovePath(invalidation.Path, invalidation.RenamedTo) + // Only the file this mount's own rename moved: a later file at the old + // name stays. A peer's rename names a file by a number another file + // here may hold, so it moves the source as before. + fileInode := uint64(0) + if wfs.ownEvent(invalidation) { + fileInode = invalidation.FileInode() + } + _, replacedInode = wfs.inodeToPath.MovePath(invalidation.Path, invalidation.RenamedTo, fileInode) } else if !handled && invalidation.Deleted && len(invalidation.LiveHardLinkId) > 0 { // Otherwise the next open by nodeid resolves to the deleted name. A // newer stored entry means something has taken the name since. @@ -1323,6 +1331,14 @@ func (wfs *WFS) MountRoot() util.FullPath { return util.FullPath(wfs.option.FilerMountRootPath) } +// ownEvent reports an event this mount caused, which reaches it after the +// local apply. Creation times compare only within this mount's clock: a +// peer's file, or one moved in from another name, may be older and still +// take the name. +func (wfs *WFS) ownEvent(invalidation meta_cache.EntryInvalidation) bool { + return slices.Contains(invalidation.Signatures, wfs.signature) +} + // invalidateOpenFileHandle applies one event to the handle that has the entry // open, reporting whether it found one: a handle owns its inode's rename // bookkeeping, and the caller moves the table only for inodes without one. Any @@ -1356,6 +1372,24 @@ func (wfs *WFS) invalidateOpenFileHandle(invalidation meta_cache.EntryInvalidati return } + // An event about another file that had this name is not about the one the + // handle holds. A writer that renames tmp files into place recreates the + // name every few seconds, and a delayed event about the earlier file, this + // mount's own included, finds the next one here: moving it to the earlier + // file's new name, or giving the name up to the earlier file, left its + // flush publishing under the wrong name or not at all. A rename or a + // delete names the file it moved or removed; any other event is skipped + // only when it is this mount's own and about an earlier file (another + // inode number, created before the one held), so a file a peer put at the + // name still reaches the handle. + if invalidation.RenamedTo != "" || invalidation.Deleted { + if fh.holdsAnotherFileThan(invalidation) { + return + } + } else if wfs.ownEvent(invalidation) && fh.holdsLaterFileThan(invalidation) { + return + } + // A rename changes which name the inode answers to, not which version of // its content the handle holds, so it is applied ahead of the version fence // below - a fence that skipped it would strand the inode and the handle on @@ -1363,7 +1397,7 @@ func (wfs *WFS) invalidateOpenFileHandle(invalidation meta_cache.EntryInvalidati // still ours to move, which is what makes a replayed rename a no-op here. moved := false if invalidation.RenamedTo != "" { - if sourceInode, replaced := wfs.inodeToPath.MovePath(filePath, invalidation.RenamedTo); sourceInode != 0 { + if sourceInode, replaced := wfs.inodeToPath.MovePath(filePath, invalidation.RenamedTo, inode); sourceInode != 0 { moved = true if replaced != inode { replacedInode = replaced diff --git a/weed/mount/weedfs_create_handle_state_test.go b/weed/mount/weedfs_create_handle_state_test.go new file mode 100644 index 0000000000..47488cc73b --- /dev/null +++ b/weed/mount/weedfs_create_handle_state_test.go @@ -0,0 +1,131 @@ +package mount + +import ( + "context" + "fmt" + "sync" + "sync/atomic" + "syscall" + "testing" + + "github.com/seaweedfs/go-fuse/v2/fuse" + "google.golang.org/protobuf/proto" + + "github.com/seaweedfs/seaweedfs/weed/mount/meta_cache" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/util" +) + +// A create's handle is an unpublished create from the moment anything can +// find it. Create used to set that state after the handle was in the map, and +// an event about the earlier file of the same name applied in between found a +// clean handle with a base. These tests apply such an event exactly when the +// handle becomes visible. + +func createForWrite(t *testing.T, wfs *WFS, name string) *FileHandle { + t.Helper() + out := &fuse.CreateOut{} + if code := wfs.Create(make(chan struct{}), &fuse.CreateIn{ + InHeader: fuse.InHeader{NodeId: 1, Caller: fuse.Caller{Owner: fuse.Owner{Uid: 1, Gid: 1}}}, + Flags: syscall.O_WRONLY | syscall.O_CREAT | syscall.O_TRUNC, + Mode: 0o644, + }, name, out); code != fuse.OK { + t.Fatalf("create %s: %v", name, code) + } + return wfs.GetHandle(FileHandleId(out.Fh)) +} + +func applyWhenCreateHandleIsVisible(t *testing.T, apply func(fh *FileHandle)) { + t.Helper() + previous := createHandleVisible + createHandleVisible = apply + t.Cleanup(func() { createHandleVisible = previous }) +} + +// An event about an earlier file that records no inode number: its entry, +// chunks included, became the new file's entry, and the new file was then +// published with the earlier file's chunks. +func TestEventAtCreateLeavesTheNewFileEmpty(t *testing.T) { + wfs, _ := newCreateTestWFS(t) + const name = "0115.json.tmp-7" + earlier := &filer_pb.Entry{ + Name: name, + Attributes: &filer_pb.FuseAttributes{FileSize: 218686, FileMode: 0100644}, + Chunks: []*filer_pb.FileChunk{{FileId: "3,earlier", Size: 218686}}, + } + applyWhenCreateHandleIsVisible(t, func(fh *FileHandle) { + wfs.onEntryInvalidation(meta_cache.EntryInvalidation{Path: util.FullPath("/").Child(name), Entry: earlier, TsNs: 1}) + }) + fh := createForWrite(t, wfs, name) + defer wfs.ReleaseHandle(fh.fh) + if entry, base := fh.GetEntry().GetEntry(), fh.baseEntry.Load(); !fh.unpublishedCreate() || base != nil || len(entry.GetChunks()) != 0 || entry.GetAttributes().GetFileSize() != 0 { + t.Fatalf("new file's handle unpublished=%v base=%v entry=%v, want an empty unpublished create", fh.unpublishedCreate(), base, entry) + } +} + +// The same event with the inode number and creation time a mount stores on +// the files it creates: the new file's handle gave the name up to the earlier +// file and was marked deleted, so its flush stored nothing and returned OK. +func TestEventAtCreateDoesNotDropTheNewFile(t *testing.T) { + wfs, srv := newCreateTestWFS(t) + const name = "0115.json.tmp-7" + earlier := &filer_pb.Entry{ + Name: name, + Attributes: &filer_pb.FuseAttributes{Inode: 8854146469129211641, Crtime: 1796392775, FileSize: 218686, FileMode: 0100644}, + Chunks: []*filer_pb.FileChunk{{FileId: "3,earlier", Size: 218686}}, + } + applyWhenCreateHandleIsVisible(t, func(fh *FileHandle) { + wfs.onEntryInvalidation(meta_cache.EntryInvalidation{Path: util.FullPath("/").Child(name), Entry: earlier, TsNs: 1, Inode: earlier.Attributes.Inode, Crtime: earlier.Attributes.Crtime}) + }) + fh := createForWrite(t, wfs, name) + defer wfs.ReleaseHandle(fh.fh) + if fh.isDeleted { + t.Fatal("new file's handle marked deleted by an event about the earlier file") + } + if code := wfs.doFlush(context.Background(), fh, 1, 1, false, 0); code != fuse.OK { + t.Fatalf("flush: %v", code) + } + srv.mu.Lock() + stored := srv.lastEntry + srv.mu.Unlock() + if stored.GetName() != name || len(stored.GetChunks()) != 0 { + t.Fatalf("filer got %v, want the new, empty file created", stored) + } +} + +// The same against an event applied concurrently, many times over, for the +// race detector. +func TestCreateExposesItsHandleUnpublished(t *testing.T) { + wfs, _ := newCreateTestWFS(t) + earlier := &filer_pb.Entry{ + Name: "x", + Attributes: &filer_pb.FuseAttributes{FileSize: 36, FileMode: 0100644}, + Chunks: []*filer_pb.FileChunk{{FileId: "3,earlier", Size: 36}}, + } + const rounds = 500 + for i := 0; i < rounds; i++ { + name := fmt.Sprintf("f-%d.tmp", i) + path := util.FullPath("/").Child(name) + event := proto.Clone(earlier).(*filer_pb.Entry) + event.Name = name + var stop atomic.Bool + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + for !stop.Load() { + wfs.onEntryInvalidation(meta_cache.EntryInvalidation{Path: path, Entry: event, TsNs: 1}) + } + }() + fh := createForWrite(t, wfs, name) + stop.Store(true) + wg.Wait() + lock := wfs.fhLockTable.AcquireLock("test", fh.fh, util.ExclusiveLock) + entry, base, unpublished := fh.GetEntry().GetEntry(), fh.baseEntry.Load(), fh.unpublishedCreate() + wfs.fhLockTable.ReleaseLock(fh.fh, lock) + if !unpublished || base != nil || len(entry.GetChunks()) != 0 || entry.GetAttributes().GetFileSize() != 0 { + t.Fatalf("round %d: new file's handle unpublished=%v base=%v entry=%v, want an empty unpublished create", i, unpublished, base, entry) + } + wfs.ReleaseHandle(fh.fh) + } +} diff --git a/weed/mount/weedfs_dir_lookup_dot_test.go b/weed/mount/weedfs_dir_lookup_dot_test.go index d5e625246b..cccf266c28 100644 --- a/weed/mount/weedfs_dir_lookup_dot_test.go +++ b/weed/mount/weedfs_dir_lookup_dot_test.go @@ -160,7 +160,7 @@ func TestMovePathMovesAForgottenInode(t *testing.T) { inode := table.Lookup("/a.txt", 1, false, false, 0, true) table.Forget(inode, 1, nil, nil) - table.MovePath("/a.txt", "/b.txt") + table.MovePath("/a.txt", "/b.txt", 0) if path, _ := table.GetForgottenPath(inode); path != "/b.txt" { t.Fatalf("retained path %q, want /b.txt", path) } @@ -181,7 +181,7 @@ func TestLookupHandleRefusesAPathRenamedAway(t *testing.T) { table.RetainForgotten(nfsExportForgottenInodes) inode := table.Lookup("/a.txt", 1, false, false, 0, true) table.Forget(inode, 1, nil, nil) - table.MovePath("/a.txt", "/b.txt") + table.MovePath("/a.txt", "/b.txt", 0) if table.LookupHandle("/a.txt", inode, false) { t.Fatal("LookupHandle registered the path the inode was renamed away from") @@ -201,7 +201,7 @@ func TestMovePathOfAForgottenInodeDropsTheReplacedTarget(t *testing.T) { table.Forget(inode, 1, nil, nil) replaced := table.Lookup("/b.txt", 1, false, false, 0, true) - if source, target := table.MovePath("/a.txt", "/b.txt"); source != 0 || target != replaced { + if source, target := table.MovePath("/a.txt", "/b.txt", 0); source != 0 || target != replaced { t.Fatalf("MovePath = %d, %d; want 0, %d", source, target, replaced) } if _, found := table.GetInode("/b.txt"); found { @@ -211,7 +211,7 @@ func TestMovePathOfAForgottenInodeDropsTheReplacedTarget(t *testing.T) { t.Fatal("LookupHandle refused the moved inode at the target") } - if source, target := table.MovePath("/a.txt", "/b.txt"); source != 0 || target != 0 { + if source, target := table.MovePath("/a.txt", "/b.txt", 0); source != 0 || target != 0 { t.Fatalf("redelivered MovePath = %d, %d; want 0, 0", source, target) } if got, _ := table.GetInode("/b.txt"); got != inode { diff --git a/weed/mount/weedfs_file_mkrm.go b/weed/mount/weedfs_file_mkrm.go index bf81a86f69..aac1b81f2a 100644 --- a/weed/mount/weedfs_file_mkrm.go +++ b/weed/mount/weedfs_file_mkrm.go @@ -104,11 +104,15 @@ func (wfs *WFS) Create(cancel <-chan struct{}, in *fuse.CreateIn, name string, o // For deferred creates, bypass AcquireHandle (which calls maybeReadEntry // and would fail since the entry is not yet on the filer or in the meta cache). // We already have the entry from createRegularFile, so create the handle directly. + // A deferred create is dirty, so its filer create happens on Flush even if + // the file is closed without any writes; an eager create has already + // persisted the entry, so its handle starts clean. A new handle is in that + // state before anything can find it. var fileHandle *FileHandle var openFh FileHandleId var existed, draining bool for { - fileHandle, openFh, existed, draining = wfs.fhMap.AcquireFileHandle(wfs, inode, newEntry, 0, 0, in.Flags&syscall.O_APPEND != 0) + fileHandle, openFh, existed, draining = wfs.fhMap.AcquireCreatedFileHandle(wfs, inode, newEntry, deferCreate, in.Flags&syscall.O_APPEND != 0) if !draining { break } @@ -118,25 +122,20 @@ func (wfs *WFS) Create(cancel <-chan struct{}, in *fuse.CreateIn, name string, o return fuse.EINTR } } + createHandleVisible(fileHandle) if existed { // A create is authoritative for the entry it just made, so it takes // effect even on a handle that outlived a previous incarnation. + // Installed under the handle's lock, as events install theirs. + fhActiveLock := wfs.fhLockTable.AcquireLock("Create", fileHandle.fh, util.ExclusiveLock) fileHandle.SetEntry(newEntry) + fileHandle.installCreated(newEntry, deferCreate) + wfs.fhLockTable.ReleaseLock(fileHandle.fh, fhActiveLock) } fileHandle.RememberPath(entryFullPath) if !existed { wfs.exportedHandles.AcquireHandle(inode, entryFullPath) } - // Mark dirty so the deferred filer create happens on Flush, even if the - // file is closed without any writes. An eager create has already - // persisted the entry, so its handle starts clean. - fileHandle.dirtyMetadata = deferCreate - if deferCreate { - // This is a local placeholder, not an acknowledged filer base. - fileHandle.baseEntry.Store(nil) - } else { - fileHandle.setAuthoritativeBase(proto.Clone(newEntry).(*filer_pb.Entry)) - } // Create bypasses AcquireHandle, so attach the lock acquired above. // A surviving handle may already hold one; ours is redundant then. @@ -155,6 +154,10 @@ func (wfs *WFS) Create(cancel <-chan struct{}, in *fuse.CreateIn, name string, o return fuse.OK } +// createHandleVisible runs as soon as Create's handle can be found by other +// threads. A hook for tests. +var createHandleVisible = func(fh *FileHandle) {} + // openExistingForCreate answers a create whose name already exists: an // exclusive create fails, any other opens the entry, truncating it if asked. func (wfs *WFS) openExistingForCreate(ctx context.Context, in *fuse.CreateIn, entryFullPath util.FullPath, entry *filer_pb.Entry, out *fuse.CreateOut) fuse.Status { diff --git a/weed/mount/weedfs_invalidate_open_handle_test.go b/weed/mount/weedfs_invalidate_open_handle_test.go index 70264988ba..d5b4e5d5ea 100644 --- a/weed/mount/weedfs_invalidate_open_handle_test.go +++ b/weed/mount/weedfs_invalidate_open_handle_test.go @@ -2342,7 +2342,7 @@ func TestPeerReplacementAfterALocalRenameKeepsTheHandle(t *testing.T) { t.Fatalf("apply: %v", err) } waitForHandleLockWaiter(t, "invalidateOpenFileHandle") - wfs.inodeToPath.MovePath(path, renamed) + wfs.inodeToPath.MovePath(path, renamed, 0) release() wfs.metaCache.WaitForEntryInvalidations() @@ -2386,8 +2386,8 @@ func TestPeerInvalidationLeavesAnotherInodesHardLinks(t *testing.T) { t.Fatalf("apply: %v", err) } waitForHandleLockWaiter(t, "invalidateOpenFileHandle") - wfs.inodeToPath.MovePath(path, renamed) - wfs.inodeToPath.MovePath(incoming, path) + wfs.inodeToPath.MovePath(path, renamed, 0) + wfs.inodeToPath.MovePath(incoming, path, 0) fh.RememberPath(renamed) release() wfs.metaCache.WaitForEntryInvalidations() diff --git a/weed/mount/weedfs_peer_unlink_test.go b/weed/mount/weedfs_peer_unlink_test.go index 62d18b51e8..7fa7254df4 100644 --- a/weed/mount/weedfs_peer_unlink_test.go +++ b/weed/mount/weedfs_peer_unlink_test.go @@ -158,7 +158,7 @@ func TestDelayedPeerUnlinkKeepsRenamedOntoName(t *testing.T) { if err := wfs.applyLocalMetadataEvent(ctx, rename); err != nil { t.Fatalf("apply local rename: %v", err) } - wfs.inodeToPath.MovePath("/final", "/tmp") + wfs.inodeToPath.MovePath("/final", "/tmp", 0) del := &filer_pb.SubscribeMetadataResponse{Directory: "/", TsNs: 10, EventNotification: &filer_pb.EventNotification{OldEntry: link("tmp")}} if err := wfs.metaCache.ApplyMetadataResponse(ctx, del, meta_cache.SubscriberMetadataResponseApplyOptions); err != nil { t.Fatalf("apply peer delete: %v", err) diff --git a/weed/mount/weedfs_rename.go b/weed/mount/weedfs_rename.go index bfef8f9e44..c063749c67 100644 --- a/weed/mount/weedfs_rename.go +++ b/weed/mount/weedfs_rename.go @@ -525,7 +525,7 @@ func (wfs *WFS) handleRenameResponse(ctx context.Context, resp *filer_pb.StreamR oldPath := oldParent.Child(oldName) newPath := newParent.Child(newName) - sourceInode, targetInode := wfs.inodeToPath.MovePath(oldPath, newPath) + sourceInode, targetInode := wfs.inodeToPath.MovePath(oldPath, newPath, 0) if sourceInode != 0 { fh, foundFh := wfs.fhMap.FindFileHandle(sourceInode) if foundFh { diff --git a/weed/mount/weedfs_rename_publish_test.go b/weed/mount/weedfs_rename_publish_test.go index b8e6955556..49b050ca46 100644 --- a/weed/mount/weedfs_rename_publish_test.go +++ b/weed/mount/weedfs_rename_publish_test.go @@ -738,7 +738,7 @@ func TestChmodOfAFileThatKeepsMovingGivesUp(t *testing.T) { for i := 1; i <= 4; i++ { waitQueued(path) next := util.FullPath(fmt.Sprintf("/checkpoints/f%d", i)) - wfs.inodeToPath.MovePath(path, next) + wfs.inodeToPath.MovePath(path, next, 0) nextHeld := table.AcquireLock("test", next, util.SharedLock) table.ReleaseLock(path, held) path, held = next, nextHeld diff --git a/weed/mount/weedfs_stale_event_identity_test.go b/weed/mount/weedfs_stale_event_identity_test.go new file mode 100644 index 0000000000..c9aead497f --- /dev/null +++ b/weed/mount/weedfs_stale_event_identity_test.go @@ -0,0 +1,328 @@ +package mount + +import ( + "context" + "testing" + + "google.golang.org/protobuf/proto" + + "github.com/seaweedfs/seaweedfs/weed/mount/meta_cache" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/util" +) + +// A writer that publishes a JSON status by writing NNNN.json.tmp-PID and +// renaming it over NNNN.json does so every few seconds, so the tmp name comes +// back again and again. The mount's own events about the previous round reach +// it through the subscription, later than its local apply, and can arrive +// while the next round's file sits at the tmp name. These tests feed such +// delayed events to a mount whose next tmp file is already there. + +const ( + staleEarlierInode = uint64(8854146469129211641) + staleLaterInode = uint64(8854146469129211752) + staleEarlierCrt = int64(1796392775) + staleLaterCrt = int64(1796392778) + // staleLaterTsNs is where the later file's create was logged, by a filer + // (signature staleOtherFiler) other than the one whose events follow: + // its clock does not fence them. + staleLaterTsNs = int64(1796392778500000000) + staleOtherFiler = int32(7) +) + +func staleEntry(name string, inode uint64, crtime int64, size uint64, fileId string) *filer_pb.Entry { + return &filer_pb.Entry{ + Name: name, + Attributes: &filer_pb.FuseAttributes{ + Inode: inode, Crtime: crtime, Mtime: crtime, FileSize: size, FileMode: 0100644, + }, + Chunks: []*filer_pb.FileChunk{{FileId: fileId, Size: size}}, + } +} + +func applySubscribed(t *testing.T, wfs *WFS, resp *filer_pb.SubscribeMetadataResponse) { + t.Helper() + if err := wfs.metaCache.ApplyMetadataResponse(context.Background(), resp, meta_cache.SubscriberMetadataResponseApplyOptions); err != nil { + t.Fatalf("apply event: %v", err) + } + wfs.metaCache.WaitForEntryInvalidations() +} + +// staleRenameRound sets up the state after round k renamed its tmp file over +// the status file and round k+1 created the next tmp file: the earlier tmp +// inode now answers to the status name, the later one to the tmp name. With +// open, round k+1's file has a published, clean handle, as between its fsync +// and its rename, versioned by the filer that took its create. +func staleRenameRound(t *testing.T, open bool) (*WFS, *FileHandle) { + t.Helper() + wfs := newInvalidateTestWFS(t) + tmp, final := util.FullPath("/dir/0100.json.tmp-7"), util.FullPath("/dir/0100.json") + wfs.inodeToPath.Lookup(tmp, staleEarlierCrt, false, false, staleEarlierInode, true) + if src, _ := wfs.inodeToPath.MovePath(tmp, final, 0); src != staleEarlierInode { + t.Fatalf("local rename moved %d, want %d", src, staleEarlierInode) + } + if got := wfs.inodeToPath.Lookup(tmp, staleLaterCrt, false, false, staleLaterInode, true); got != staleLaterInode { + t.Fatalf("later tmp inode = %d, want %d", got, staleLaterInode) + } + if !open { + return wfs, nil + } + entry := staleEntry("0100.json.tmp-7", staleLaterInode, staleLaterCrt, 218846, "3,later") + fh, _, _, _ := wfs.fhMap.AcquireFileHandle(wfs, staleLaterInode, entry, staleLaterTsNs, staleOtherFiler) + fh.RememberPath(tmp) + return wfs, fh +} + +func staleRenameEvent(inode uint64, crtime int64) *filer_pb.SubscribeMetadataResponse { + moved := staleEntry("0100.json", inode, crtime, 218686, "3,earlier") + left := proto.Clone(moved).(*filer_pb.Entry) + left.Name = "0100.json.tmp-7" + return &filer_pb.SubscribeMetadataResponse{ + Directory: "/dir", + TsNs: 1796392775195309000, + EventNotification: &filer_pb.EventNotification{ + OldEntry: left, + NewEntry: moved, + NewParentPath: "/dir", + Signatures: []int32{1, -1390797052}, + }, + } +} + +// 12-04 mri-ss-dual-pvc-0100: the delayed rename of round k moved round k+1's +// tmp file to the status name. Its handle then published under that name and +// was refused, and the retry's data went straight into the status file while +// the rename of the tmp name failed with ENOENT. +func TestDelayedRenameOfEarlierFileDoesNotMoveTheNextOne(t *testing.T) { + for _, open := range []bool{true, false} { + name := "no handle" + if open { + name = "open handle" + } + t.Run(name, func(t *testing.T) { + wfs, fh := staleRenameRound(t, open) + applySubscribed(t, wfs, staleRenameEvent(staleEarlierInode, staleEarlierCrt)) + + if got, _ := wfs.inodeToPath.GetPath(staleLaterInode); got != "/dir/0100.json.tmp-7" { + t.Fatalf("round k+1's tmp file now answers to %q, want the tmp name it was created at", got) + } + if got, _ := wfs.inodeToPath.GetPath(staleEarlierInode); got != "/dir/0100.json" { + t.Fatalf("round k's file answers to %q, want the status name", got) + } + if fh != nil { + if got := fh.FullPath(); got != "/dir/0100.json.tmp-7" { + t.Fatalf("handle path = %q, want the tmp name", got) + } + if fh.isDeleted { + t.Fatal("handle marked deleted by an event about another file") + } + } + }) + } +} + +// The file an event renamed still follows it: a rename of the file the mount +// holds at the name, by another client, moves it as before. +func TestRenameOfTheFileHeldStillMovesIt(t *testing.T) { + for _, open := range []bool{true, false} { + name := "no handle" + if open { + name = "open handle" + } + t.Run(name, func(t *testing.T) { + wfs, fh := staleRenameRound(t, open) + event := staleRenameEvent(staleLaterInode, staleLaterCrt) + event.EventNotification.NewEntry.Name = "elsewhere.json" + applySubscribed(t, wfs, event) + + if got, _ := wfs.inodeToPath.GetPath(staleLaterInode); got != "/dir/elsewhere.json" { + t.Fatalf("renamed file answers to %q, want /dir/elsewhere.json", got) + } + if fh != nil && fh.FullPath() != "/dir/elsewhere.json" { + t.Fatalf("handle path = %q, want /dir/elsewhere.json", fh.FullPath()) + } + }) + } +} + +// An event that records no inode number says nothing about which file it +// moved, and is applied as before. +func TestRenameEventWithoutInodeStillMoves(t *testing.T) { + wfs, _ := staleRenameRound(t, false) + event := staleRenameEvent(0, 0) + applySubscribed(t, wfs, event) + if got, _ := wfs.inodeToPath.GetPath(staleLaterInode); got != "/dir/0100.json" { + t.Fatalf("file at the old name answers to %q, want it moved to /dir/0100.json", got) + } +} + +// 12-04 mri-ss-dual-pvc-0115: the delayed create of round k's tmp file became +// the entry and base of round k+1's file at the same name. The flush then +// published against that base, the filer no longer had it, and every flush of +// the round failed with EIO. +func TestDelayedCreateOfEarlierFileDoesNotBecomeTheNextOnesBase(t *testing.T) { + wfs, fh := staleRenameRound(t, true) + want := proto.Clone(fh.GetEntry().GetEntry()).(*filer_pb.Entry) + + create := &filer_pb.SubscribeMetadataResponse{ + Directory: "/dir", + TsNs: 1796392775117988000, + EventNotification: &filer_pb.EventNotification{ + NewEntry: staleEntry("0100.json.tmp-7", staleEarlierInode, staleEarlierCrt, 218686, "3,earlier"), + NewParentPath: "/dir", + Signatures: []int32{1, -1390797052}, + }, + } + applySubscribed(t, wfs, create) + + if got := fh.GetEntry().GetEntry(); got.GetAttributes().GetInode() != staleLaterInode || len(got.Chunks) != 1 || got.Chunks[0].FileId != "3,later" { + t.Fatalf("handle entry = %v, want the later file's own %v", got, want) + } + if base := fh.baseEntry.Load(); base.GetAttributes().GetInode() != staleLaterInode { + t.Fatalf("handle base = %v, want the later file's", base) + } + if fh.isDeleted { + t.Fatal("handle marked deleted by the earlier file's create; its flushes would be dropped") + } + if got, _ := wfs.inodeToPath.GetPath(staleLaterInode); got != "/dir/0100.json.tmp-7" { + t.Fatalf("later file answers to %q, want the tmp name", got) + } + + // A delayed delete of the earlier file leaves the later one's handle be. + del := &filer_pb.SubscribeMetadataResponse{ + Directory: "/dir", + TsNs: 1796392775195277000, + EventNotification: &filer_pb.EventNotification{ + OldEntry: staleEntry("0100.json.tmp-7", staleEarlierInode, staleEarlierCrt, 218686, "3,earlier"), + Signatures: []int32{1, -1390797052}, + }, + } + applySubscribed(t, wfs, del) + if fh.isDeleted { + t.Fatal("handle marked deleted by a delayed delete of the earlier file; its flushes would be dropped") + } +} + +// A later file another client put at the name is not filtered out as an +// earlier one: it reaches the handle, which gives the name up to it, as for a +// peer's rename over the file it has open (replacedByAnotherFile). +func TestLaterFileAtTheNameStillReachesTheHandle(t *testing.T) { + wfs, fh := staleRenameRound(t, true) + const laterStill = uint64(77) + update := &filer_pb.SubscribeMetadataResponse{ + Directory: "/dir", + TsNs: 1796392790000000000, + EventNotification: &filer_pb.EventNotification{ + OldEntry: &filer_pb.Entry{Name: "0100.json.tmp-7"}, + NewEntry: staleEntry("0100.json.tmp-7", laterStill, staleLaterCrt+10, 99, "4,peer"), + NewParentPath: "/dir", + }, + } + applySubscribed(t, wfs, update) + if !fh.isDeleted { + t.Fatal("a later file at the name did not reach the handle: it still publishes over the newcomer") + } + if got, found := wfs.inodeToPath.GetInode("/dir/0100.json.tmp-7"); found && got == staleLaterInode { + t.Fatal("the handle's inode kept the name the later file has now") + } +} + +// A delete of the file the handle holds still marks it, as before. +func TestDeleteOfTheFileHeldStillMarksIt(t *testing.T) { + wfs, fh := staleRenameRound(t, true) + del := &filer_pb.SubscribeMetadataResponse{ + Directory: "/dir", + TsNs: 1796392791000000000, + EventNotification: &filer_pb.EventNotification{ + OldEntry: staleEntry("0100.json.tmp-7", staleLaterInode, staleLaterCrt, 218846, "3,later"), + }, + } + applySubscribed(t, wfs, del) + if !fh.isDeleted { + t.Fatal("a delete of the file the handle holds did not mark it") + } +} + +// A file this mount knows by another number than its creator stored, as when +// the table kept the number of a name it still mapped, is still moved by a +// rename of it: the table knows no file by the event's number. +func TestRenameOfAFileTheTableKnowsByAnotherNumberStillMoves(t *testing.T) { + wfs := newInvalidateTestWFS(t) + const kept = uint64(4242) + wfs.inodeToPath.Lookup("/dir/0100.json.tmp-7", staleLaterCrt, false, false, kept, true) + applySubscribed(t, wfs, staleRenameEvent(staleLaterInode, staleLaterCrt)) + if got, _ := wfs.inodeToPath.GetPath(kept); got != "/dir/0100.json" { + t.Fatalf("renamed file answers to %q, want /dir/0100.json", got) + } +} + +// A peer's file can take the name with an older creation time than the open +// file's: renamed in from another name, or created on a host whose clock runs +// behind. The name must stop resolving to the replaced file's inode. +func TestPeerOlderFileTakesTheOpenName(t *testing.T) { + const heldInode, peerInode = uint64(9000000000000000100), uint64(9000000000000000007) + const heldCrt, peerCrt = int64(1796392778), int64(1796390000) + peerSigs := []int32{5} + moveIn := &filer_pb.SubscribeMetadataResponse{Directory: "/dir", TsNs: 1796392790000000001, EventNotification: &filer_pb.EventNotification{ + OldEntry: staleEntry("backup", peerInode, peerCrt, 10, "3,old"), NewEntry: staleEntry("current", peerInode, peerCrt, 10, "3,old"), NewParentPath: "/dir", Signatures: peerSigs}} + create := &filer_pb.SubscribeMetadataResponse{Directory: "/dir", TsNs: 1796392790000000001, EventNotification: &filer_pb.EventNotification{ + NewEntry: staleEntry("current", peerInode, peerCrt, 10, "3,old"), Signatures: peerSigs}} + targetDelete := &filer_pb.SubscribeMetadataResponse{Directory: "/dir", TsNs: 1796392790000000000, EventNotification: &filer_pb.EventNotification{ + OldEntry: staleEntry("current", heldInode, heldCrt, 10, "3,new"), Signatures: peerSigs}} + for _, tc := range []struct { + name string + events []*filer_pb.SubscribeMetadataResponse + }{ + {"rename over after a delete", []*filer_pb.SubscribeMetadataResponse{targetDelete, moveIn}}, + {"rename over in place", []*filer_pb.SubscribeMetadataResponse{moveIn}}, + {"create after a delete", []*filer_pb.SubscribeMetadataResponse{targetDelete, create}}, + } { + t.Run(tc.name, func(t *testing.T) { + wfs := newInvalidateTestWFS(t) + cur := util.FullPath("/dir/current") + wfs.inodeToPath.Lookup(cur, heldCrt, false, false, heldInode, true) + fh, _, _, _ := wfs.fhMap.AcquireFileHandle(wfs, heldInode, staleEntry("current", heldInode, heldCrt, 10, "3,new"), staleLaterTsNs, staleOtherFiler) + fh.RememberPath(cur) + for _, event := range tc.events { + applySubscribed(t, wfs, event) + } + if got, found := wfs.inodeToPath.GetInode(cur); found && got == heldInode { + t.Fatalf("%s still resolves to the replaced file's inode (handle deleted=%v)", cur, fh.isDeleted) + } + }) + } +} + +// Two mounts that create one path within the same second store the same inode +// number, and the later file gets the next number here. A peer's rename of it +// still moves it. +func TestPeerRenameOfFileWithCollidingInodeMoves(t *testing.T) { + wfs := newInvalidateTestWFS(t) + wfs.inodeToPath.Lookup("/dir/a", staleEarlierCrt, false, false, staleEarlierInode, true) + local := wfs.inodeToPath.Lookup("/dir/tmp", staleEarlierCrt, false, false, staleEarlierInode, true) + if local == staleEarlierInode { + t.Fatalf("colliding file got the stored number %d", local) + } + moved := staleEntry("b", staleEarlierInode, staleEarlierCrt, 10, "3,peer") + left := proto.Clone(moved).(*filer_pb.Entry) + left.Name = "tmp" + applySubscribed(t, wfs, &filer_pb.SubscribeMetadataResponse{Directory: "/dir", TsNs: 1796392790000000001, EventNotification: &filer_pb.EventNotification{ + OldEntry: left, NewEntry: moved, NewParentPath: "/dir", Signatures: []int32{5}}}) + if got, _ := wfs.inodeToPath.GetPath(local); got != "/dir/b" { + t.Fatalf("renamed file answers to %q, want /dir/b", got) + } +} + +// A peer's delete of an earlier file at the name, logged by another filer +// than the one behind the handle's version, is not about the held file. +func TestPeerDeleteOfEarlierFileKeepsTheHandle(t *testing.T) { + wfs, fh := staleRenameRound(t, true) + applySubscribed(t, wfs, &filer_pb.SubscribeMetadataResponse{Directory: "/dir", TsNs: 1796392775195309000, EventNotification: &filer_pb.EventNotification{ + OldEntry: staleEntry("0100.json.tmp-7", staleEarlierInode, staleEarlierCrt, 218686, "3,earlier"), Signatures: []int32{5}}}) + if fh.isDeleted { + t.Fatal("handle marked deleted by a peer's delete of another file") + } + if got, _ := wfs.inodeToPath.GetPath(staleLaterInode); got != "/dir/0100.json.tmp-7" { + t.Fatalf("held file answers to %q, want the tmp name", got) + } +} From 68f99dc11468c409a5207be28e503bd516caf2c3 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:13:09 -0800 Subject: [PATCH 14/29] seaweed-block: docs: no read of the line confirms a failover stays (#13449) * seaweed-block: docs: read the line again before relying on a failover Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: a read of the line is a snapshot, not a confirmation The queued rebalance applies when blockmaster's assignment queue reaches it, so a second read can come before it as well. Say that no read confirms the primary stays, and that the guest is started again on the new primary if it moves later. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- seaweed-block/docs/releases/replicated-volumes-preview.md | 5 ++++- seaweed-block/docs/releases/v1.1.1.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/releases/replicated-volumes-preview.md b/seaweed-block/docs/releases/replicated-volumes-preview.md index a4cbbc117d..7ef1ba5e10 100644 --- a/seaweed-block/docs/releases/replicated-volumes-preview.md +++ b/seaweed-block/docs/releases/replicated-volumes-preview.md @@ -30,7 +30,10 @@ writing guest: 6. **An operator failover can be undone by an automatic rebalance.** With `sync-all`, or `sync-quorum` and two replicas, a rebalance blockmaster decided just before `sw-block ops failover` can still be applied after it and move the primary again. No acknowledged write is lost. After a failover, read the line with - `sw-block ops volumes --master-api -o json` and, if the primary moved, repeat the failover against it. + `sw-block ops volumes --master-api -o json`, and if the primary moved, repeat the failover against it. A + read shows the line at that moment only: blockmaster applies the queued rebalance when its assignment queue reaches + it, not at a fixed time, so the primary can still move after any read, and the guest is then started again on the + new primary (item 4). **Planned for a later release.** Supported replicated volumes are planned for a later release; v1.1.x keeps every replicated configuration a preview. Replicated volumes are a preview: a primary cut off from the block master is not stopped diff --git a/seaweed-block/docs/releases/v1.1.1.md b/seaweed-block/docs/releases/v1.1.1.md index 64996ff4ac..d4d3bef40f 100644 --- a/seaweed-block/docs/releases/v1.1.1.md +++ b/seaweed-block/docs/releases/v1.1.1.md @@ -51,7 +51,7 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo - Affects replicated volumes (preview) whose acknowledgement profile allows a planned move: `sync-all`, or `sync-quorum` with two replicas. - blockmaster may decide an automatic rebalance, which moves the primary to a less loaded server, just before an operator's `sw-block ops failover`. If that rebalance is applied after the failover, it moves the primary again, away from the replica the operator chose. - No acknowledged write is lost: under these profiles every replica holds every acknowledged write. -- What to do: after `sw-block ops failover`, read the volume's line with `sw-block ops volumes --master-api -o json`; if `primary_replica` moved again, repeat the failover with `--expect-current @`. A fix is planned for a later v1.1.x release. +- What to do: after `sw-block ops failover`, read the volume's line with `sw-block ops volumes --master-api -o json`; if `primary_replica` moved again, repeat the failover with `--expect-current @`. No read confirms that the primary stays: blockmaster applies the queued rebalance when its assignment queue reaches it, not at a fixed time, so it can still move the primary after any read, and the guest is then started again on the new primary. A fix is planned for a later v1.1.x release. ## Known issue: resuming a snapshot delete that is still running can stop the volume's snapshot deletes and cleaning From 2637ff09c5d4e03c84ae6af83b29787611cf3dfe Mon Sep 17 00:00:00 2001 From: Yip Leo Date: Sun, 6 Dec 2026 03:13:51 +0800 Subject: [PATCH 15/29] mount: answer ESTALE for an inode whose name the filer no longer has (#13447) * mount: answer ESTALE for an inode whose name the filer no longer has A job that writes a status file through a tmp name retried a failed round by opening the tmp name again. The kernel still resolved the name to the failed round's inode, and the mount still mapped it, but the filer had no such file: the open failed with ENOENT although it asked for O_CREAT, and the job exited. lookupEntry already logged such a tracked name ("filer ErrNotFound for tracked path"). It now drops the name from the inode table when no open handle and no pending flush owns the inode, and requests for the inode by node id answer ESTALE (maybeReadEntry, AcquireHandle), as pathlessInodeStatus already does for an inode without a name. The kernel looks the name up again and, for an open with O_CREAT, creates the file, which gets an inode of its own. Co-Authored-By: Claude Opus 5.5 * mount: drop a vanished name only while it maps to the inode looked up lookupEntry read the name's inode after the filer answered. A rename that gave the name to another inode while the request was in flight, a directory say, had that inode's name dropped on the strength of an answer about the name as it was. The inode is now taken before the request, and the name is dropped only while it still maps to that one. Co-Authored-By: Claude Opus 5.5 * mount: keep the vanished name mapped; ESTALE alone has the kernel look again Dropping the name raced with an open of the same inode: a handle published between the check for one and the removal, or just after it, had no name left, so a peer's rename of that name no longer reached it and its flush went to the old name. pathlessInodeStatus answers ESTALE for any inode the kernel still holds, so maybeReadEntry and AcquireHandle get the kernel to look the name up again without the table losing it. A file created at the name meanwhile reuses the inode number, as before. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- weed/mount/weedfs.go | 5 ++ weed/mount/weedfs_filehandle.go | 6 ++ weed/mount/weedfs_vanished_name_test.go | 91 +++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 weed/mount/weedfs_vanished_name_test.go diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index 1910239e58..2349976154 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -801,6 +801,11 @@ func (wfs *WFS) maybeReadEntry(ctx context.Context, inode uint64) (path util.Ful return "", nil, nil, wfs.pathlessInodeStatus(inode, status) } entry, _, status = wfs.maybeLoadEntry(ctx, path) + if status == fuse.ENOENT { + // The filer no longer has the inode's name: the kernel looks the name + // up again on ESTALE. + status = wfs.pathlessInodeStatus(inode, status) + } return } diff --git a/weed/mount/weedfs_filehandle.go b/weed/mount/weedfs_filehandle.go index 26795c9b3d..7e47f9f1ae 100644 --- a/weed/mount/weedfs_filehandle.go +++ b/weed/mount/weedfs_filehandle.go @@ -48,6 +48,12 @@ func (wfs *WFS) AcquireHandle(ctx context.Context, inode uint64, flags, uid, gid entryVersionTsNs = entryVersion{tsNs: existingFh.entryVersionTsNs.Load(), signature: existingFh.entryVersionSignature.Load()} } else { entry, entryVersionTsNs, status = wfs.maybeLoadEntry(ctx, path) + if status == fuse.ENOENT { + // The name the kernel resolved is gone from the filer: ESTALE + // has the open look it up again (with O_CREAT, create it), + // where ENOENT failed it. + return nil, 0, wfs.pathlessInodeStatus(inode, status) + } if status != fuse.OK { return nil, 0, status } diff --git a/weed/mount/weedfs_vanished_name_test.go b/weed/mount/weedfs_vanished_name_test.go new file mode 100644 index 0000000000..7f05d53bb4 --- /dev/null +++ b/weed/mount/weedfs_vanished_name_test.go @@ -0,0 +1,91 @@ +package mount + +import ( + "context" + "runtime" + "syscall" + "testing" + + "github.com/seaweedfs/go-fuse/v2/fuse" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" +) + +// staleStatus is the answer for an inode whose name is gone: ESTALE, which has +// Linux walk the path again; elsewhere ENOENT (see pathlessInodeStatus). +func staleStatus() fuse.Status { + if runtime.GOOS != "linux" { + return fuse.ENOENT + } + return fuse.Status(syscall.ESTALE) +} + +// vanishedNameFiler has the directory /dir and nothing in it. +type vanishedNameFiler struct { + filer_pb.UnimplementedSeaweedFilerServer +} + +func (s *vanishedNameFiler) LookupDirectoryEntry(ctx context.Context, r *filer_pb.LookupDirectoryEntryRequest) (*filer_pb.LookupDirectoryEntryResponse, error) { + if r.Directory == "/" && r.Name == "dir" { + return &filer_pb.LookupDirectoryEntryResponse{Entry: &filer_pb.Entry{Name: "dir", IsDirectory: true, Attributes: &filer_pb.FuseAttributes{FileMode: uint32(0o777) | 1<<31}}}, nil + } + return nil, status.Error(codes.NotFound, filer_pb.ErrNotFound.Error()) +} + +func (s *vanishedNameFiler) CreateEntry(ctx context.Context, r *filer_pb.CreateEntryRequest) (*filer_pb.CreateEntryResponse, error) { + return &filer_pb.CreateEntryResponse{}, nil +} + +func (s *vanishedNameFiler) UpdateEntry(ctx context.Context, r *filer_pb.UpdateEntryRequest) (*filer_pb.UpdateEntryResponse, error) { + return &filer_pb.UpdateEntryResponse{}, nil +} + +// A job retried a failed round by opening its tmp name again, which the +// kernel still resolved to the failed round's inode. The filer had no such +// file, and the open failed with ENOENT, O_CREAT notwithstanding. ESTALE has +// the kernel look the name up again and create the file. +func TestOpenOfVanishedNameAnswersEstale(t *testing.T) { + wfs := newInvalidateTestWFS(t) + wfs.option.FilerMountRootPath = "/" + startFakeFiler(t, wfs, &vanishedNameFiler{}) + dirInode := wfs.inodeToPath.Lookup("/dir", 1, true, false, 0, true) + const stale = uint64(197923552737547634) + wfs.inodeToPath.Lookup("/dir/0115.json.tmp-7", 1796393673, false, false, stale, true) + + caller := fuse.Caller{Owner: fuse.Owner{Uid: 1000, Gid: 20}} + var opened fuse.OpenOut + code := wfs.Open(make(chan struct{}), &fuse.OpenIn{InHeader: fuse.InHeader{NodeId: stale, Caller: caller}, Flags: syscall.O_WRONLY}, &opened) + if code != staleStatus() { + t.Fatalf("open of the vanished name's inode: %v, want %v", code, staleStatus()) + } + // The name stays mapped, so a handle another opener publishes meanwhile + // still follows a rename event about it. + if got, found := wfs.inodeToPath.GetInode("/dir/0115.json.tmp-7"); !found || got != stale { + t.Fatalf("name mapped to %d (%v), want it kept on %d", got, found, stale) + } + + // The kernel looks the name up again, finds nothing and creates it. + var out fuse.CreateOut + if code := wfs.Create(make(chan struct{}), &fuse.CreateIn{InHeader: fuse.InHeader{NodeId: dirInode, Caller: caller}, Flags: syscall.O_WRONLY | syscall.O_CREAT | syscall.O_TRUNC, Mode: 0o644}, "0115.json.tmp-7", &out); code != fuse.OK { + t.Fatalf("create after ESTALE: %v", code) + } + wfs.ReleaseHandle(FileHandleId(out.Fh)) +} + +// A stat of the inode, as the first request after the file went away, gets +// ESTALE too. +func TestGetAttrOfVanishedNameAnswersEstale(t *testing.T) { + wfs := newInvalidateTestWFS(t) + wfs.option.FilerMountRootPath = "/" + startFakeFiler(t, wfs, &vanishedNameFiler{}) + wfs.inodeToPath.Lookup("/dir", 1, true, false, 0, true) + const stale = uint64(197923552737547634) + wfs.inodeToPath.Lookup("/dir/0115.json.tmp-7", 1796393673, false, false, stale, true) + + var attr fuse.AttrOut + if code := wfs.GetAttr(make(chan struct{}), &fuse.GetAttrIn{InHeader: fuse.InHeader{NodeId: stale}}, &attr); code != staleStatus() { + t.Fatalf("getattr of the vanished name's inode: %v, want %v", code, staleStatus()) + } +} From 6e91dc97b8fe37f99eaf1cfbbe1685e107e2cee5 Mon Sep 17 00:00:00 2001 From: hayne <18980319139@163.com> Date: Sun, 6 Dec 2026 03:15:01 +0800 Subject: [PATCH 16/29] worker: reject a task at capacity without blocking the manager loop (#13453) * worker: reject a task at capacity without blocking the manager loop * worker: gofmt the capacity test and trim its comment Co-Authored-By: Claude Opus 5.5 * worker: report a task rejected at capacity back to the admin The admin marks a task assigned before sending it, has no assignment timeout, and only reclaims tasks from workers whose heartbeats stop. A worker that rejects a task at capacity keeps heartbeating, so the task stayed assigned to it and blocked further work on its volume. Report the rejection as a failure so the admin reschedules it. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Chris Lu Co-authored-by: Claude Opus 5.5 --- weed/worker/worker.go | 3 + weed/worker/worker_capacity_test.go | 103 ++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 weed/worker/worker_capacity_test.go diff --git a/weed/worker/worker.go b/weed/worker/worker.go index 536cd9b86c..d612ec644f 100644 --- a/weed/worker/worker.go +++ b/weed/worker/worker.go @@ -248,6 +248,7 @@ out: currentLoad := len(w.state.currentTasks) if currentLoad >= w.config.MaxConcurrent { cmd.resp <- fmt.Errorf("worker is at capacity") + continue } task := cmd.data.(*types.TaskInput) w.state.currentTasks[task.ID] = task @@ -545,6 +546,8 @@ func (w *Worker) HandleTask(task *types.TaskInput) error { w.id, task.ID, task.Type, task.VolumeID) if err := w.setTask(task); err != nil { + // The admin already marked the task assigned to this worker. + w.completeTask(task.ID, false, err.Error()) return err } diff --git a/weed/worker/worker_capacity_test.go b/weed/worker/worker_capacity_test.go new file mode 100644 index 0000000000..03f9a1ae35 --- /dev/null +++ b/weed/worker/worker_capacity_test.go @@ -0,0 +1,103 @@ +package worker + +import ( + "testing" + "time" + + "github.com/seaweedfs/seaweedfs/weed/worker/types" +) + +// HandleTask does not pre-check load the way requestTasks does, so a task can +// arrive at capacity. The manager loop must reject it and keep serving. +func TestSetTaskAtCapacityDoesNotBlockManagerLoop(t *testing.T) { + w, err := NewWorker(&types.WorkerConfig{ + BaseWorkingDir: t.TempDir(), + MaxConcurrent: 2, + }) + if err != nil { + t.Fatalf("NewWorker: %v", err) + } + + for _, id := range []string{"t1", "t2"} { + if err := w.setTask(&types.TaskInput{ID: id}); err != nil { + t.Fatalf("setTask(%s): %v", id, err) + } + } + + rejected := make(chan error, 1) + go func() { + rejected <- w.setTask(&types.TaskInput{ID: "t3"}) + }() + select { + case err := <-rejected: + if err == nil { + t.Fatalf("setTask at capacity = nil error, want capacity error") + } + case <-time.After(5 * time.Second): + t.Fatalf("setTask at capacity blocked: manager loop deadlocked on the rejected task") + } + + load := make(chan int, 1) + go func() { load <- w.getTaskLoad() }() + select { + case got := <-load: + if got != 2 { + t.Errorf("load after rejection = %d, want 2", got) + } + case <-time.After(5 * time.Second): + t.Fatalf("getTaskLoad blocked after rejection") + } + + // Drain so Stop does not wait for tasks that never execute. + w.removeTask(&types.TaskInput{ID: "t1"}) + w.removeTask(&types.TaskInput{ID: "t2"}) + if err := w.Stop(); err != nil { + t.Fatalf("Stop: %v", err) + } +} + +type completionRecorder struct { + AdminClient + completed chan string +} + +func (c *completionRecorder) CompleteTask(taskID string, success bool, errorMsg string) error { + if !success { + c.completed <- taskID + } + return nil +} + +func (c *completionRecorder) Disconnect() error { return nil } + +func TestHandleTaskAtCapacityReportsRejectionToAdmin(t *testing.T) { + w, err := NewWorker(&types.WorkerConfig{ + BaseWorkingDir: t.TempDir(), + MaxConcurrent: 1, + }) + if err != nil { + t.Fatalf("NewWorker: %v", err) + } + admin := &completionRecorder{completed: make(chan string, 1)} + w.SetAdminClient(admin) + + if err := w.setTask(&types.TaskInput{ID: "t1"}); err != nil { + t.Fatalf("setTask(t1): %v", err) + } + if err := w.HandleTask(&types.TaskInput{ID: "t2"}); err == nil { + t.Fatalf("HandleTask at capacity = nil error, want capacity error") + } + select { + case id := <-admin.completed: + if id != "t2" { + t.Errorf("failure reported for %q, want t2", id) + } + default: + t.Fatalf("rejected task was not reported to the admin, which keeps it assigned") + } + + w.removeTask(&types.TaskInput{ID: "t1"}) + if err := w.Stop(); err != nil { + t.Fatalf("Stop: %v", err) + } +} From ff9c9ca007b79d034f02d6b17f4519ac4185cd08 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:19:09 -0800 Subject: [PATCH 17/29] filer: keep the metadata log a shutdown could not flush and restore it on start (#13470) * filer: keep the metadata log a shutdown could not flush and restore it on start When the shutdown flush budget runs out, the events still in the log buffer were dropped, so a peer or subscriber that had not read them yet never got them. Keep the unflushed records in the filer store instead, in parts small enough for stores that cap value size, and put them back into the log buffer with their original timestamps when the store is set, before the filer serves. The buffer then flushes them as usual. Co-Authored-By: Claude Opus 5.5 * filer: keep the unflushed metadata log per address on a shared store Filers sharing one store would overwrite and replay each other's kept log under one key. Once a peer has been seen on this filer's store, key the kept log by the filer's address; a store of its own keeps the address-free key, so a filer restarting under a new address (a new pod IP) still finds what it left. Co-Authored-By: Claude Opus 5.5 * filer: drop the restored metadata log copy only once a flush covers it The kept copy was deleted as soon as its records were back in the log buffer, so a crash before the next flush lost them again. Keep it until a flush covers the last restored entry, and let the next shutdown's kept log replace it, since that shutdown's flushes and kept tail then hold every restored record. Co-Authored-By: Claude Opus 5.5 * filer: do not count the subscription to itself as a peer on the store Every filer follows its own log, and that subscription always reports the filer's own store, so every store looked shared and the kept log was keyed by address even on an embedded store, where a new pod IP then missed it. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- weed/filer/filer.go | 2 + weed/filer/filer_notify.go | 9 +- weed/filer/filer_notify_unflushed.go | 214 ++++++++++++++++++++++ weed/filer/filer_notify_unflushed_test.go | 193 +++++++++++++++++++ weed/filer/meta_aggregator.go | 5 + 5 files changed, 422 insertions(+), 1 deletion(-) create mode 100644 weed/filer/filer_notify_unflushed.go create mode 100644 weed/filer/filer_notify_unflushed_test.go diff --git a/weed/filer/filer.go b/weed/filer/filer.go index c3b621e94d..4c1d1b21d9 100644 --- a/weed/filer/filer.go +++ b/weed/filer/filer.go @@ -105,6 +105,7 @@ type Filer struct { manifestRetryQueue *DeletionRetryQueue persistedLogCache *persistedLogCache metaLogInflight metaLogInflight + restoredMetaLog restoredMetaLog remoteTombstones *remoteDeletionTombstones // EntryLockTable serializes mutations per entry path. The filer server // holds it across local read-modify-write mutations and the meta @@ -488,6 +489,7 @@ func (f *Filer) SetStore(store FilerStore) (isFresh bool) { f.Store = wrapper isFresh = f.setOrLoadFilerStoreSignature(store) + f.replayUnflushedMetaLog() // Recover deletions that were pending when a previous process died, and keep // the durable ledger snapshotted while running (see filer_deletion_persist.go). diff --git a/weed/filer/filer_notify.go b/weed/filer/filer_notify.go index a1f47b892b..a1a4cad3b1 100644 --- a/weed/filer/filer_notify.go +++ b/weed/filer/filer_notify.go @@ -412,6 +412,7 @@ func (f *Filer) logFlushFunc(logBuffer *log_buffer.LogBuffer, startTime, stopTim if ctx == nil { ctx = context.Background() } + whole := buf for len(buf) > 0 { piece := nextLogPiece(buf, limit) if err := f.appendToFile(ctx, targetFile, piece); err != nil { @@ -424,7 +425,12 @@ func (f *Filer) logFlushFunc(logBuffer *log_buffer.LogBuffer, startTime, stopTim select { case <-ctx.Done(): logBuffer.NoteFlushDropped(len(buf)) - glog.V(0).Infof("metadata log flush abandoned during shutdown, %d bytes left for %s: %v", len(buf), targetFile, ctx.Err()) + unflushed := whole[lastLogRecordEnd(whole, len(whole)-len(buf)):] + if keepErr := f.keepUnflushedMetaLog(unflushed); keepErr != nil { + glog.V(0).Infof("metadata log flush abandoned during shutdown, %d bytes left for %s: %v; not kept: %v", len(unflushed), targetFile, ctx.Err(), keepErr) + } else { + glog.V(0).Infof("metadata log flush abandoned during shutdown, %d bytes for %s kept for the next start", len(unflushed), targetFile) + } return case <-time.After(737 * time.Millisecond): } @@ -432,6 +438,7 @@ func (f *Filer) logFlushFunc(logBuffer *log_buffer.LogBuffer, startTime, stopTim } buf = buf[len(piece):] } + f.noteMetaLogFlushed(stopTime.UnixNano()) } // nextLogPiece returns the leading piece of a flushed log buffer, at most diff --git a/weed/filer/filer_notify_unflushed.go b/weed/filer/filer_notify_unflushed.go new file mode 100644 index 0000000000..4dbacbf9cb --- /dev/null +++ b/weed/filer/filer_notify_unflushed.go @@ -0,0 +1,214 @@ +package filer + +import ( + "context" + "errors" + "fmt" + "math" + "sort" + "strconv" + "sync" + + "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/util" +) + +// The metadata log a shutdown could not flush is kept in the filer store and +// put back into the log buffer on the next start, before the filer serves, so +// peers and subscribers that had not read those events yet still get them. +const ( + KvKeyUnflushedMetaLog = "filer.metaLog.unflushed.v1" + unflushedMetaLogPartSize = 64 * 1024 +) + +// unflushedMetaLogKey scopes the kept log by address only once a peer has been +// seen on this filer's store: a store of its own stays this filer's under +// whatever address it restarts with. +func (f *Filer) unflushedMetaLogKey() string { + if f.MetaAggregator != nil && f.MetaAggregator.storeShared.Load() { + if key := f.scopedUnflushedMetaLogKey(); key != "" { + return key + } + } + return KvKeyUnflushedMetaLog +} + +func (f *Filer) scopedUnflushedMetaLogKey() string { + if f.Dlm == nil || f.Dlm.Host == "" { + return "" + } + return KvKeyUnflushedMetaLog + "." + f.Dlm.Host.ToHttpAddress() +} + +// restoredMetaLog holds the kept copies a start restored until the log buffer +// has flushed everything restored from them. +type restoredMetaLog struct { + sync.Mutex + parts map[string]int + tsNs int64 + flushedTsNs int64 +} + +func unflushedMetaLogPartKey(key string, part int) []byte { + return []byte(fmt.Sprintf("%s.part.%05d", key, part)) +} + +func (f *Filer) unflushedMetaLogParts(ctx context.Context, key string) (int, error) { + value, err := f.Store.KvGet(ctx, []byte(key)) + if err != nil { + return 0, err + } + return strconv.Atoi(string(value)) +} + +// keepUnflushedMetaLog appends log records the flush gave up on to what this +// filer already keeps. The part count is written last, so a failure part way +// leaves the earlier kept log intact. +func (f *Filer) keepUnflushedMetaLog(buf []byte) error { + if f.Store == nil { + return fmt.Errorf("no filer store") + } + ctx := context.Background() + // This shutdown's flushes and what it keeps now cover a copy restored at + // the last start. + f.restoredMetaLog.Lock() + for key, parts := range f.restoredMetaLog.parts { + f.deleteUnflushedMetaLog(ctx, key, parts) + } + f.restoredMetaLog.parts = nil + f.restoredMetaLog.Unlock() + key := f.unflushedMetaLogKey() + parts, err := f.unflushedMetaLogParts(ctx, key) + if errors.Is(err, ErrKvNotFound) { + parts, err = 0, nil + } + if err != nil { + return fmt.Errorf("read %s: %w", key, err) + } + for len(buf) > 0 { + n := len(buf) + if n > unflushedMetaLogPartSize { + n = unflushedMetaLogPartSize + } + if err := f.Store.KvPut(ctx, unflushedMetaLogPartKey(key, parts), buf[:n]); err != nil { + return fmt.Errorf("write %s part %d: %w", key, parts, err) + } + parts++ + buf = buf[n:] + } + if err := f.Store.KvPut(ctx, []byte(key), []byte(strconv.Itoa(parts))); err != nil { + return fmt.Errorf("write %s: %w", key, err) + } + return nil +} + +func (f *Filer) readUnflushedMetaLog(ctx context.Context, key string) (data []byte, parts int, err error) { + if parts, err = f.unflushedMetaLogParts(ctx, key); err != nil { + return nil, 0, err + } + for i := 0; i < parts; i++ { + part, err := f.Store.KvGet(ctx, unflushedMetaLogPartKey(key, i)) + if err != nil { + return data, parts, fmt.Errorf("part %d: %w", i, err) + } + data = append(data, part...) + } + return data, parts, nil +} + +func (f *Filer) deleteUnflushedMetaLog(ctx context.Context, key string, parts int) { + if err := f.Store.KvDelete(ctx, []byte(key)); err != nil { + glog.Warningf("delete %s: %v", key, err) + return + } + for i := 0; i < parts; i++ { + _ = f.Store.KvDelete(ctx, unflushedMetaLogPartKey(key, i)) + } +} + +// noteMetaLogFlushed drops a restored copy once a flush covers its last entry. +func (f *Filer) noteMetaLogFlushed(stopTsNs int64) { + f.restoredMetaLog.Lock() + defer f.restoredMetaLog.Unlock() + f.restoredMetaLog.flushedTsNs = max(f.restoredMetaLog.flushedTsNs, stopTsNs) + f.dropRestoredMetaLogLocked() +} + +func (f *Filer) dropRestoredMetaLogLocked() { + r := &f.restoredMetaLog + if len(r.parts) == 0 || r.flushedTsNs < r.tsNs { + return + } + for key, parts := range r.parts { + f.deleteUnflushedMetaLog(context.Background(), key, parts) + } + r.parts = nil +} + +// replayUnflushedMetaLog puts the log kept by the last shutdown back into the +// log buffer with its original timestamps; the buffer flushes it as usual, and +// the kept copy stays until that flush lands. +func (f *Filer) replayUnflushedMetaLog() { + ctx := context.Background() + keys := []string{KvKeyUnflushedMetaLog} + if scoped := f.scopedUnflushedMetaLogKey(); scoped != "" { + keys = append(keys, scoped) + } + var entries []*filer_pb.LogEntry + read := make(map[string]int) + for _, key := range keys { + data, parts, err := f.readUnflushedMetaLog(ctx, key) + if errors.Is(err, ErrKvNotFound) && parts == 0 { + continue + } + if err != nil { + glog.Warningf("read unflushed metadata log %s: %v", key, err) + if !errors.Is(err, ErrKvNotFound) { + continue + } + } + decoded, _, decodeErr := decodeLogRecords(data) + if decodeErr != nil { + glog.Warningf("unflushed metadata log %s: %d entries readable: %v", key, len(decoded), decodeErr) + } + entries = append(entries, decoded...) + read[key] = parts + } + if len(read) == 0 { + return + } + sort.SliceStable(entries, func(i, j int) bool { return entries[i].TsNs < entries[j].TsNs }) + f.restoredMetaLog.Lock() + f.restoredMetaLog.parts, f.restoredMetaLog.tsNs = read, math.MaxInt64 + f.restoredMetaLog.Unlock() + var lastTsNs int64 + for _, logEntry := range entries { + logEntry.Offset = -1 + if err := f.LocalMetaLogBuffer.AddLogEntryToBuffer(logEntry); err != nil { + glog.Warningf("restore metadata log entry %d: %v", logEntry.TsNs, err) + continue + } + f.metaLogInflight.delivered(logEntry.TsNs) + lastTsNs = logEntry.TsNs + } + f.restoredMetaLog.Lock() + f.restoredMetaLog.tsNs = lastTsNs + f.dropRestoredMetaLogLocked() + f.restoredMetaLog.Unlock() + glog.V(0).Infof("restored %d metadata log entries the last shutdown could not flush", len(entries)) +} + +// lastLogRecordEnd returns where the last record wholly inside buf[:n] ends, +// so a record cut by size is kept whole rather than from its middle. +func lastLogRecordEnd(buf []byte, n int) int { + pos := 0 + for pos+4 <= n { + end := pos + 4 + int(util.BytesToUint32(buf[pos:pos+4])) + if end > n { + break + } + pos = end + } + return pos +} diff --git a/weed/filer/filer_notify_unflushed_test.go b/weed/filer/filer_notify_unflushed_test.go new file mode 100644 index 0000000000..b17df59282 --- /dev/null +++ b/weed/filer/filer_notify_unflushed_test.go @@ -0,0 +1,193 @@ +package filer + +import ( + "fmt" + "strings" + "testing" + "time" + + "github.com/seaweedfs/seaweedfs/weed/cluster/lock_manager" + "github.com/seaweedfs/seaweedfs/weed/pb" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" + "github.com/seaweedfs/seaweedfs/weed/util" + "github.com/seaweedfs/seaweedfs/weed/util/log_buffer" +) + +// restartOnStore starts a filer on store whose log buffer hands what it +// flushes to the returned function, which stops the buffer and decodes it. +func restartOnStore(t *testing.T, store FilerStore, host pb.ServerAddress) (*Filer, func() []*filer_pb.LogEntry) { + t.Helper() + f := NewFiler(pb.ServerDiscovery{}, nil, host, "", "", "", "", 255, nil) + f.LocalMetaLogBuffer.ShutdownLogBuffer() + f.LocalMetaLogBuffer.WaitForShutdown() + var flushed []byte + f.LocalMetaLogBuffer = log_buffer.NewLogBuffer("local", time.Hour, func(_ *log_buffer.LogBuffer, _, stopTime time.Time, buf []byte, _, _ int64) { + flushed = append(flushed, buf...) + f.noteMetaLogFlushed(stopTime.UnixNano()) + }, nil, nil) + t.Cleanup(func() { + close(f.deletionQuit) + f.flushCancel() + }) + f.SetStore(store) + return f, func() []*filer_pb.LogEntry { + f.LocalMetaLogBuffer.ShutdownLogBuffer() + f.LocalMetaLogBuffer.WaitForShutdown() + entries, _, err := decodeLogRecords(flushed) + if err != nil { + t.Fatalf("decode restored log: %v", err) + } + return entries + } +} + +// followSelf gives f the aggregator state of its subscription to itself, +// which always reports this filer's own store. +func followSelf(f *Filer, self pb.ServerAddress) { + stop := make(chan struct{}) + f.MetaAggregator = &MetaAggregator{ + self: self, + peerChans: map[pb.ServerAddress]chan struct{}{self: stop}, + peerSharesStore: map[pb.ServerAddress]bool{}, + } + f.MetaAggregator.notePeerStore(self, stop, true) +} + +func keptMetaLogKeys(store *stubFilerStore) (keys []string) { + store.mu.Lock() + defer store.mu.Unlock() + for key := range store.kv { + if strings.HasPrefix(key, KvKeyUnflushedMetaLog) { + keys = append(keys, key) + } + } + return keys +} + +func addMetaLogEvent(t *testing.T, f *Filer, data string) int64 { + t.Helper() + tsNs, err := f.LocalMetaLogBuffer.AddDataToBufferAndGetTs([]byte("/dir"), []byte(data), 0) + if err != nil { + t.Fatal(err) + } + return tsNs +} + +func TestShutdownKeepsUnflushedMetaLogForNextStart(t *testing.T) { + store := newStubFilerStore() + first := NewFiler(pb.ServerDiscovery{}, nil, "10.0.0.1:8888", "", "", "", "", 255, nil) + first.SetStore(store) + followSelf(first, "10.0.0.1:8888") + var wantTs []int64 + var wantData []string + for i := 0; i < 3; i++ { + wantData = append(wantData, fmt.Sprintf("event %d", i)) + wantTs = append(wantTs, addMetaLogEvent(t, first, wantData[i])) + } + // No master to assign a volume, and the shutdown flush budget already spent. + first.flushCancel() + first.Shutdown() + if len(keptMetaLogKeys(store)) == 0 { + t.Fatal("shutdown kept no unflushed metadata log") + } + + // The address changes on every restart, as a pod IP does, and the second + // start cannot flush either: its shutdown keeps the restored events again. + second := NewFiler(pb.ServerDiscovery{}, nil, "10.0.0.2:8888", "", "", "", "", 255, nil) + second.SetStore(store) + if len(keptMetaLogKeys(store)) == 0 { + t.Fatal("restored copy dropped before a flush wrote it") + } + wantData = append(wantData, "event after restart") + wantTs = append(wantTs, addMetaLogEvent(t, second, wantData[3])) + second.flushCancel() + second.Shutdown() + + third, stop := restartOnStore(t, store, "10.0.0.3:8888") + if fence := third.LogFenceTsNs(); fence <= wantTs[len(wantTs)-1] { + t.Errorf("new stamps start at %d, not above the restored %d", fence, wantTs[len(wantTs)-1]) + } + got := stop() + if len(got) != len(wantTs) { + t.Fatalf("restored %d entries, want %d", len(got), len(wantTs)) + } + for i, entry := range got { + if entry.TsNs != wantTs[i] || string(entry.Data) != wantData[i] || string(entry.Key) != "/dir" { + t.Errorf("entry %d = ts %d key %q data %q, want ts %d data %q", i, entry.TsNs, entry.Key, entry.Data, wantTs[i], wantData[i]) + } + } + if keys := keptMetaLogKeys(store); len(keys) != 0 { + t.Errorf("flushed restored log left %v behind", keys) + } +} + +func TestUnflushedMetaLogStaysWithItsFilerOnSharedStore(t *testing.T) { + store := newStubFilerStore() + wrapped := NewFilerStoreWrapper(store) + shared := &Filer{Store: wrapped, Dlm: lock_manager.NewDistributedLockManager("10.0.0.1:8888"), MetaAggregator: &MetaAggregator{}} + shared.MetaAggregator.storeShared.Store(true) + record := encodeLogRecord(t, &filer_pb.LogEntry{TsNs: 7, Key: []byte("/dir"), Data: []byte("event")}) + if err := shared.keepUnflushedMetaLog(record); err != nil { + t.Fatal(err) + } + + if _, stop := restartOnStore(t, store, "10.0.0.2:8888"); len(stop()) != 0 { + t.Error("a peer on the shared store restored another filer's log") + } + if _, stop := restartOnStore(t, store, "10.0.0.1:8888"); len(stop()) != 1 { + t.Error("the filer did not restore its own log") + } +} + +func TestUnflushedMetaLogSplitsIntoParts(t *testing.T) { + store := newStubFilerStore() + f := &Filer{Store: NewFilerStoreWrapper(store)} + var buf []byte + var n int + for len(buf) <= 2*unflushedMetaLogPartSize { + buf = append(buf, encodeLogRecord(t, &filer_pb.LogEntry{TsNs: int64(n + 1), Data: make([]byte, 1000)})...) + n++ + } + half := lastLogRecordEnd(buf, len(buf)/2) + if err := f.keepUnflushedMetaLog(buf[:half]); err != nil { + t.Fatal(err) + } + if err := f.keepUnflushedMetaLog(buf[half:]); err != nil { + t.Fatal(err) + } + for key, value := range store.kv { + if len(value) > unflushedMetaLogPartSize { + t.Errorf("%s holds %d bytes", key, len(value)) + } + } + if _, stop := restartOnStore(t, store, "10.0.0.1:8888"); len(stop()) != n { + t.Errorf("restored a different number of entries than the %d kept", n) + } +} + +func TestLastLogRecordEndKeepsRecordCutBySize(t *testing.T) { + first := encodeLogRecord(t, &filer_pb.LogEntry{TsNs: 1, Data: []byte("small")}) + second := encodeLogRecord(t, &filer_pb.LogEntry{TsNs: 2, Data: make([]byte, 100)}) + buf := append(append([]byte{}, first...), second...) + for _, tc := range []struct{ sent, want int }{ + {0, 0}, + {len(first), len(first)}, + {len(first) + 10, len(first)}, + {len(buf), len(buf)}, + } { + if got := lastLogRecordEnd(buf, tc.sent); got != tc.want { + t.Errorf("after %d bytes sent: keep from %d, want %d", tc.sent, got, tc.want) + } + } +} + +func encodeLogRecord(t *testing.T, entry *filer_pb.LogEntry) []byte { + t.Helper() + data, err := entry.MarshalVT() + if err != nil { + t.Fatal(err) + } + record := make([]byte, 4, 4+len(data)) + util.Uint32toBytes(record, uint32(len(data))) + return append(record, data...) +} diff --git a/weed/filer/meta_aggregator.go b/weed/filer/meta_aggregator.go index 63eed78b1c..46e35b3f78 100644 --- a/weed/filer/meta_aggregator.go +++ b/weed/filer/meta_aggregator.go @@ -58,6 +58,8 @@ type MetaAggregator struct { // peerSharesStore marks followed peers whose store signature matched this // filer's when their subscription last connected. Guarded by peerChansLock. peerSharesStore map[pb.ServerAddress]bool + // storeShared stays set once any followed peer has shared this store. + storeShared atomic.Bool // lowWatermarkTsNs and lowFlushWatermarkTsNs are the last minima signalled // on deliveryAdvanced and flushAdvanced, each closed and replaced when its // own minimum rises. Held readers park on the one that bounds them: @@ -219,6 +221,9 @@ func (ma *MetaAggregator) notePeerStore(peer pb.ServerAddress, stopChan <-chan s defer ma.peerChansLock.Unlock() if ma.peerChans[peer] == stopChan { ma.peerSharesStore[peer] = sharesStore + if sharesStore && !peer.Equals(ma.self) { + ma.storeShared.Store(true) + } } } From 4a4651007ad7b7d25660642e3890cf55dcab3143 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:19:58 -0800 Subject: [PATCH 18/29] seaweed-block: the observation host reads the store clock under its lock (#13455) * seaweed-block: the observation host reads the store clock under its lock The rebuild loop read the store's clock source without the store lock while SetNowForTest swaps it under that lock, so a test that swaps the clock on a running host raced the loop arming its deadline timer. Co-Authored-By: Claude Opus 5.5 * seaweed-block: test swapping the clock on a running observation host Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .../authority/observation_changes_test.go | 29 +++++++++++++++++++ .../core/authority/observation_host.go | 2 +- .../core/authority/observation_store.go | 8 +++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/seaweed-block/core/authority/observation_changes_test.go b/seaweed-block/core/authority/observation_changes_test.go index c48b97e55c..46adf8e9e7 100644 --- a/seaweed-block/core/authority/observation_changes_test.go +++ b/seaweed-block/core/authority/observation_changes_test.go @@ -106,6 +106,35 @@ func TestObservationHostRebuildsAtAnExpiryWithNoHeartbeat(t *testing.T) { waitFor("the expiry's build", func(b BuildResult) bool { return len(b.Snapshot.Servers) == 0 && b.BuiltAt.Equal(clk.Now()) }) } +// A clock swapped while the host runs is the one its next build uses; under +// -race the swap does not race the host reading the clock for its deadline. +func TestObservationHostClockSwappedWhileRunning(t *testing.T) { + start := time.Now() + host := NewObservationHost(ObservationHostConfig{ + Freshness: FreshnessConfig{FreshnessWindow: time.Hour}, + Topology: AcceptedTopology{Volumes: []VolumeExpected{threeSlotVolume("v1")}}, + }) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + host.Start(ctx) + defer host.Stop() + _ = host.IngestHeartbeat(serverObs("s1", start, healthySlot("v1", "r1"))) + time.Sleep(50 * time.Millisecond) // the host is waiting on s1's expiry + + clk := newFakeClock(start.Add(2 * time.Hour)) + host.SetNowForTest(clk.Now) + host.Wake() + deadline := time.Now().Add(3 * time.Second) + for time.Now().Before(deadline) { + if b, have := host.LastBuild(); have && len(b.Snapshot.Servers) == 0 && b.BuiltAt.Equal(clk.Now()) { + return + } + time.Sleep(10 * time.Millisecond) + } + b, _ := host.LastBuild() + t.Fatalf("s1 not expired on the swapped clock: last build at %v with %d servers", b.BuiltAt, len(b.Snapshot.Servers)) +} + // normalizedBuild is a build with its stamps cleared: when it was built, the // store revision, and the timestamps the evidence carries. func normalizedBuild(b BuildResult) BuildResult { diff --git a/seaweed-block/core/authority/observation_host.go b/seaweed-block/core/authority/observation_host.go index d1d851bbe7..853ed643db 100644 --- a/seaweed-block/core/authority/observation_host.go +++ b/seaweed-block/core/authority/observation_host.go @@ -258,7 +258,7 @@ func (h *ObservationHost) run(ctx context.Context) { var deadlineC <-chan time.Time var timer *time.Timer if at := h.store.NextDeadline(); !at.IsZero() { - d := at.Sub(h.store.now()) + d := at.Sub(h.store.clock()) if d < 10*time.Millisecond { d = 10 * time.Millisecond } diff --git a/seaweed-block/core/authority/observation_store.go b/seaweed-block/core/authority/observation_store.go index 7be900c3ee..00f6d4ab5d 100644 --- a/seaweed-block/core/authority/observation_store.go +++ b/seaweed-block/core/authority/observation_store.go @@ -285,6 +285,14 @@ func (s *ObservationStore) SetNowForTest(now func() time.Time) { s.now = now } +// clock reads the time from the clock source SetNowForTest may swap. +func (s *ObservationStore) clock() time.Time { + s.mu.Lock() + now := s.now + s.mu.Unlock() + return now() +} + // NewObservationStore constructs a store with the given freshness // configuration. `now` is injected for deterministic testing; pass // time.Now in production. From e4321a3e89f0f8995334e8387ebc56f1d268acff Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:22:02 -0800 Subject: [PATCH 19/29] master: write a recovered TopologyId into the hashicorp raft log on leadership (#13467) * master: write a recovered TopologyId into the hashicorp raft log on leadership A hashicorp raft leader whose TopologyId came from the max_volume_id mirror never wrote it to the raft log, so followers kept an empty id. The next leader then minted a new one, and the first master crashed with split-brain on its next restart when it read the old id back from its mirror. Sync the id after the barrier, as the goraft path already does. Co-Authored-By: Claude Opus 5.5 * master: test that followers learn a leader's mirrored TopologyId Co-Authored-By: Claude Opus 5.5 * master: call the TopologyId sync directly in its test The leader loop never returns, so running it leaked a goroutine per test. Co-Authored-By: Claude Opus 5.5 * master: retry the barrier before syncing the TopologyId A failed barrier skipped the sync for the whole leader term, leaving followers without the id the next leader needs. Co-Authored-By: Claude Opus 5.5 * master: test that the next leader keeps a mirrored TopologyId Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- weed/server/raft_hashicorp.go | 28 +++++++++- weed/server/raft_hashicorp_test.go | 85 ++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/weed/server/raft_hashicorp.go b/weed/server/raft_hashicorp.go index 987755a450..2f42556d13 100644 --- a/weed/server/raft_hashicorp.go +++ b/weed/server/raft_hashicorp.go @@ -61,7 +61,7 @@ func (s *RaftServer) monitorLeaderLoop(updatePeers bool) { updatePeers = false } - s.topo.DoBarrier() + s.syncRaftForTopologyId() EnsureTopologyId(s.topo, func() bool { return s.RaftHashicorp.State() == hashicorpRaft.Leader @@ -93,6 +93,32 @@ func (s *RaftServer) monitorLeaderLoop(updatePeers bool) { } } +// syncRaftForTopologyId writes the leader's TopologyId into the raft log. An id +// restored from the max_volume_id mirror is otherwise known to this master +// only, and the next leader would mint a different one. +func (s *RaftServer) syncRaftForTopologyId() { + for s.RaftHashicorp.State() == hashicorpRaft.Leader { + if !s.topo.DoBarrier() { + time.Sleep(time.Second) + continue + } + topologyId := s.topo.GetTopologyId() + if topologyId == "" { + return + } + b, err := json.Marshal(topology.NewMaxVolumeIdCommand(s.topo.GetMaxVolumeId(), topologyId)) + if err != nil { + glog.Errorf("marshal TopologyId %s: %v", topologyId, err) + return + } + if err = s.RaftHashicorp.Apply(b, 5*time.Second).Error(); err == nil { + return + } + glog.Errorf("failed to sync raft for topologyId %s, retrying in 1s: %v", topologyId, err) + time.Sleep(time.Second) + } +} + func (s *RaftServer) updatePeers() { peerLeader := raftServerID(s.serverAddr) desiredPeers := make(map[string]pb.ServerAddress, len(s.peers)) diff --git a/weed/server/raft_hashicorp_test.go b/weed/server/raft_hashicorp_test.go index 8342a6749b..70d9d536d1 100644 --- a/weed/server/raft_hashicorp_test.go +++ b/weed/server/raft_hashicorp_test.go @@ -1,14 +1,19 @@ package weed_server import ( + "encoding/json" + "os" + "path/filepath" "sort" "testing" + "time" "github.com/hashicorp/go-metrics" "github.com/hashicorp/raft" prom "github.com/prometheus/client_golang/prometheus" "github.com/seaweedfs/seaweedfs/weed/pb" "github.com/seaweedfs/seaweedfs/weed/stats" + "github.com/seaweedfs/seaweedfs/weed/topology" ) func TestRaftServerID(t *testing.T) { @@ -98,3 +103,83 @@ func TestRaftMetricsReachPrometheus(t *testing.T) { } t.Fatalf("%s_raft_peers was not gathered", stats.Namespace) } + +func TestLeaderReplicatesTopologyIdFromMirrorFile(t *testing.T) { + mirror := filepath.Join(t.TempDir(), "max_volume_id") + state, err := json.Marshal(&topology.MaxVolumeIdCommand{MaxVolumeId: 7, TopologyId: "cluster-a", StartedAt: time.Now().Unix()}) + if err != nil { + t.Fatal(err) + } + if err := os.WriteFile(mirror, state, 0644); err != nil { + t.Fatal(err) + } + leaderTopo := topology.NewTopology("leader", nil, 128*1024*1024, 0, false) + leaderTopo.SetMaxVolumeIdFile(mirror) + + newNode := func(id string, topo *topology.Topology) (*raft.Raft, raft.ServerAddress, *raft.InmemTransport) { + conf := raft.DefaultConfig() + conf.LocalID = raft.ServerID(id) + conf.HeartbeatTimeout = 50 * time.Millisecond + conf.ElectionTimeout = 50 * time.Millisecond + conf.LeaderLeaseTimeout = 25 * time.Millisecond + conf.CommitTimeout = 5 * time.Millisecond + addr, transport := raft.NewInmemTransport(raft.ServerAddress(id)) + r, err := raft.NewRaft(conf, &StateMachine{topo: topo}, + raft.NewInmemStore(), raft.NewInmemStore(), raft.NewInmemSnapshotStore(), transport) + if err != nil { + t.Fatalf("new raft %s: %v", id, err) + } + t.Cleanup(func() { r.Shutdown() }) + return r, addr, transport + } + leader, leaderAddr, leaderTransport := newNode("master-0:9333", leaderTopo) + leaderTopo.HashicorpRaft = leader + if err := leader.BootstrapCluster(raft.Configuration{ + Servers: []raft.Server{{Suffrage: raft.Voter, ID: "master-0:9333", Address: leaderAddr}}, + }).Error(); err != nil { + t.Fatalf("bootstrap: %v", err) + } + + followerTopo := topology.NewTopology("follower", nil, 128*1024*1024, 0, false) + follower, followerAddr, followerTransport := newNode("master-1:9333", followerTopo) + followerTopo.HashicorpRaft = follower + leaderTransport.Connect(followerAddr, followerTransport) + followerTransport.Connect(leaderAddr, leaderTransport) + for deadline := time.Now().Add(10 * time.Second); leader.State() != raft.Leader; time.Sleep(10 * time.Millisecond) { + if time.Now().After(deadline) { + t.Fatal("no leader elected") + } + } + if err := leader.AddVoter("master-1:9333", followerAddr, 0, 5*time.Second).Error(); err != nil { + t.Fatalf("add voter: %v", err) + } + (&RaftServer{RaftHashicorp: leader, topo: leaderTopo}).syncRaftForTopologyId() + + for deadline := time.Now().Add(10 * time.Second); followerTopo.GetTopologyId() != "cluster-a"; time.Sleep(10 * time.Millisecond) { + if time.Now().After(deadline) { + t.Fatalf("follower TopologyId = %q, want the leader's mirrored cluster-a in the raft log", followerTopo.GetTopologyId()) + } + } + + // The original master restarting hands leadership to a master that never + // read the mirror; it must keep the id rather than mint a new one. + if err := leader.LeadershipTransferToServer("master-1:9333", followerAddr).Error(); err != nil { + t.Fatalf("leadership transfer: %v", err) + } + for deadline := time.Now().Add(10 * time.Second); follower.State() != raft.Leader; time.Sleep(10 * time.Millisecond) { + if time.Now().After(deadline) { + t.Fatal("master-1 did not take leadership") + } + } + (&RaftServer{RaftHashicorp: follower, topo: followerTopo}).syncRaftForTopologyId() + EnsureTopologyId(followerTopo, func() bool { return follower.State() == raft.Leader }, func(topologyId string) error { + b, err := json.Marshal(topology.NewMaxVolumeIdCommand(followerTopo.GetMaxVolumeId(), topologyId)) + if err != nil { + return err + } + return follower.Apply(b, 5*time.Second).Error() + }) + if got := followerTopo.GetTopologyId(); got != "cluster-a" { + t.Fatalf("new leader TopologyId = %q, want cluster-a", got) + } +} From 0a30cfada136f48be8b8f153b63ef52c1a62cce1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 11:23:05 -0800 Subject: [PATCH 20/29] seaweed-block: docs: point the snapshot delete known issue's heading and the manual at the interrupted delete (#13462) * seaweed-block: docs: exiting or a no_progress answer does not stop a snapshot delete run Review: a write the earlier run already sent to the filer can still land after a no_progress answer, a timeout or the command's exit, so the note asks for the earlier run's final answer before a resume, says waiting for the filer only lowers the risk, and says resumes the volume host starts on its own are outside the operator's control in v1.1.1. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: v1.1.1 has no reliable workaround for an overlapping snapshot delete Review: waiting for a final answer or for the filer is not a workaround an operator can rely on. The note now says there is none in v1.1.1, that not re-running or resuming an interrupted snapshot delete by hand reduces exposure, and that the fix is planned for v1.1.2. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the volume host retries only its own delete, for up to 30 seconds Review: the host never picks up a delete the command started; a delete sent to the host is retried by the host itself for up to 30 seconds. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the outstanding filer write, not a live run, is what makes a resume unsafe Review: the trigger described an earlier run that is still alive, so an operator could read a terminated process as ruling it out. The trigger and the advice now name the filer write the earlier run already sent, which can land after a no_progress answer, a timeout or the command's exit. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: a paused run has not sent its page update yet Review: the trigger now names both cases of an update that has not landed: the earlier run's process paused before sending it, or the update sent and not yet applied by the filer. Only in the second case need the earlier run not still be running. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: name the failures the volume host retries Review: the host retries its own delete for up to 30 seconds only while an attempt answers layout_busy or head_conflict; any other failure, including no_progress, is returned at once. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: title the snapshot delete known issue by the interrupted delete The Trigger now says the earlier run need not still be running, so a heading about a delete that is still running suggests an exited command is safe to resume. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: point the manual's snapshot-delete retry advice at the v1.1.1 known issue The typed-error table told operators to keep retrying a snapshot delete with the same request id after no_progress or layout_busy. The v1.1.1 notes now say resuming an interrupted delete is not safe, and a volume that hit the issue answers layout_busy for good. Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: give snapshot and snapshot-delete separate no_progress actions Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: do not repeat an interrupted snapshot-delete after an unknown outcome Co-Authored-By: Claude Opus 5.5 * seaweed-block: docs: the host's last snapshot delete retry can start after 30 seconds Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: pingqiu Co-authored-by: Claude Opus 5.5 --- seaweed-block/docs/operations-manual.md | 8 +++++--- seaweed-block/docs/releases/v1.1.1.md | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index 6156637a3a..9a771e2ac1 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -766,9 +766,9 @@ says otherwise. | `remote_full` | cuts, snapshots | The chunk store has no space. | Add capacity, then retry. | | `queue_full` | cuts, snapshots | Reclamation work must drain before another producer publishes. | Retry later. | | `format_level_below_head_version` | cuts, in the holder log | The holder still runs at the format level it attached at, from before the finalize. | A v1.1.1 holder adopts the finalized level at its next lease renewal; restart a v1.1.0 holder (section 7). | -| `no_progress` (retryable) | snapshot, snapshot-delete | The operation has not settled: a snapshot stalled (for example right after a finalize, section 7), or a snapshot delete's work did not finish in this call. Retrying with the same request id settles it, which can take several minutes. | Keep retrying with the same id. | +| `no_progress` (retryable) | snapshot, snapshot-delete | The operation has not settled: a snapshot stalled (for example right after a finalize, section 7), or a snapshot delete's work did not finish in this call. Retrying a snapshot with the same request id settles it, which can take several minutes. | For snapshot, keep retrying with the same id. For snapshot-delete, do not resume it by hand: a resume can stop the volume's snapshot deletes and cleaning (see the snapshot delete known issue in the [v1.1.1 notes](releases/v1.1.1.md)). | | `snapshot_has_dependents` (exit 1) | snapshot-delete | A restored volume depends on the snapshot. Not retryable: retrying does not help until that volume is deleted. | Delete the dependent volume first (section 6), then run the same command with the same request id; or keep the snapshot. | -| `layout_busy` (retryable, exit 1) | snapshot-delete | `layout: another transaction is open`: an earlier snapshot delete on the same volume waits for its cleaning pass, which can take up to `--chunk-maintenance-interval` (1 h). | Keep retrying with the same id; it settles after that pass. | +| `layout_busy` (retryable, exit 1) | snapshot-delete | `layout: another transaction is open`: an earlier snapshot delete on the same volume waits for its cleaning pass, which can take up to `--chunk-maintenance-interval` (1 h). | Keep retrying with the same id; it settles after that pass. If it does not settle after a cleaning pass, see the snapshot delete known issue in the [v1.1.1 notes](releases/v1.1.1.md). | | `outcome_unknown` | various | The request may or may not have taken effect. | See below. | | `snapshot_exists`, `snapshot_limit` | snapshot | The name is taken, or there are too many snapshots. | Use another name, or delete old snapshots. | | `snapshot_not_found` | restore | No snapshot has that name. (To see it, you need a target in the spec; there is no need to provoke it.) | Check `ops chunk snapshots`. | @@ -784,7 +784,9 @@ says otherwise. - **Commands with `--request-id`** (`ops chunk snapshot`, `snapshot-delete`, `restore`, `volume-delete`, `ops workspace move` with or without `--clean`, and `ops workspace force-move`): repeat the command with the same - request id until it answers. The answer settles what happened. This can take several minutes. + request id until it answers. The answer settles what happened. This can take several minutes. Do not repeat an + interrupted `snapshot-delete` by hand: a resume can stop the volume's snapshot deletes and cleaning (see the snapshot + delete known issue in the [v1.1.1 notes](releases/v1.1.1.md)). - **`ops chunk cut`** has no request id. Repeat the cut: a later cut gives a later durable point. It does not tell you whether the earlier cut committed; for that, check the volume's snapshots and its last cut in status. - **`volume stop`**: run the same `sudo /usr/local/bin/sw-block volume stop ` again. Before its cut succeeds diff --git a/seaweed-block/docs/releases/v1.1.1.md b/seaweed-block/docs/releases/v1.1.1.md index d4d3bef40f..1304b45abf 100644 --- a/seaweed-block/docs/releases/v1.1.1.md +++ b/seaweed-block/docs/releases/v1.1.1.md @@ -53,11 +53,11 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo - No acknowledged write is lost: under these profiles every replica holds every acknowledged write. - What to do: after `sw-block ops failover`, read the volume's line with `sw-block ops volumes --master-api -o json`; if `primary_replica` moved again, repeat the failover with `--expect-current @`. No read confirms that the primary stays: blockmaster applies the queued rebalance when its assignment queue reaches it, not at a fixed time, so it can still move the primary after any read, and the guest is then started again on the new primary. A fix is planned for a later v1.1.x release. -## Known issue: resuming a snapshot delete that is still running can stop the volume's snapshot deletes and cleaning +## Known issue: resuming an interrupted snapshot delete can stop the volume's snapshot deletes and cleaning - **Trigger:** On a volume whose HEAD is version 1 (a version-0 HEAD takes v1.0's name-only delete and is not affected), two runs of the same snapshot delete overlap. A run is resumed (`--request-id`, as a `no_progress` answer suggests, or by the volume host) while an earlier run of the same delete still has a page update that has not landed: its process is paused before sending it, or it already sent it and the filer has not applied it, and a cleaning pass runs in between. In the second case the earlier run need not still be running: the write it already sent is what matters. - **Effect:** the snapshot delete is recorded with an intent page whose data was freed. From then on every snapshot delete on that volume fails with `layout_busy`, a retryable answer that does not clear on retry, and the volume's cleaning stops, so space is not reclaimed on that volume. The volume's data and its other snapshots stay readable. -- **What to do:** v1.1.1 has no reliable workaround. To reduce exposure, do not re-run or resume an interrupted snapshot delete by hand (for example with `--request-id` after a `no_progress` answer). After a `no_progress` answer, a timeout, or the command's exit, a filer write the earlier run already sent can still land, so a later resume is not safe. On a volume whose HEAD is version 1, a delete sent to the volume host is retried by the host itself for about 30 seconds, but only while an attempt answers `layout_busy` or `head_conflict`; any other failure, including `no_progress`, is returned at once. On a version-0 HEAD the host runs v1.0's name-only delete, which it does not retry. The fix is planned for v1.1.2. +- **What to do:** v1.1.1 has no reliable workaround. To reduce exposure, do not re-run or resume an interrupted snapshot delete by hand (for example with `--request-id` after a `no_progress` answer). After a `no_progress` answer, a timeout, or the command's exit, a filer write the earlier run already sent can still land, so a later resume is not safe. On a volume whose HEAD is version 1, a delete sent to the volume host is retried by the host itself for about 30 seconds, but only while an attempt answers `layout_busy` or `head_conflict`; any other failure, including `no_progress`, is returned at once. The last retry can start just after the 30 seconds and run longer. On a version-0 HEAD the host runs v1.0's name-only delete, which it does not retry. The fix is planned for v1.1.2. - **Recovery:** none in v1.1.1. A volume that already shows this needs a repair that is planned for a later release. A fix that prevents the record is planned for v1.1.2. ## Upgrade notes From 1fe0429d054fdc9944525ca41797815bc1a89774 Mon Sep 17 00:00:00 2001 From: NginxL <56709951@qq.com> Date: Sun, 6 Dec 2026 03:28:12 +0800 Subject: [PATCH 21/29] docs: add non-root PVC deployment example (#13463) * docs: add non-root PVC deployment example Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com> * helm: move the non-root example's data and logs off hostPath kubelet does not apply fsGroup to hostPath, and master, volume and filer data and logs default to hostPath, so the example alone left root-owned mounts the uid 1000 process cannot write. Co-Authored-By: Claude Opus 5.5 --------- Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com> Co-authored-by: NginxL <8777777+NginxL@users.noreply.github.com> Co-authored-by: Chris Lu Co-authored-by: Claude Opus 5.5 --- k8s/charts/seaweedfs/README.md | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/k8s/charts/seaweedfs/README.md b/k8s/charts/seaweedfs/README.md index a11ff16927..ce2987d711 100644 --- a/k8s/charts/seaweedfs/README.md +++ b/k8s/charts/seaweedfs/README.md @@ -722,6 +722,53 @@ The chart does not enable `runAsNonRoot` by default because its default `hostPat Security contexts configured for a component also apply to the chart-managed helper containers for that component. User-provided init containers and sidecars must define their own container security context and writable mounts. +### Run as a non-root user with PVC storage + +The standard SeaweedFS image creates a `seaweed` user and group with UID/GID `1000`. Configure the pod security context so kubelet gives that user access to the mounted volumes. kubelet applies `fsGroup` to claims and `emptyDir`, but not to `hostPath`, which the master, volume and filer data and logs use by default, so move those off `hostPath` as well: + +```yaml +master: + data: + type: "persistentVolumeClaim" + size: "1Gi" + logs: + type: "emptyDir" + podSecurityContext: + enabled: true + runAsUser: 1000 + runAsGroup: 1000 + runAsNonRoot: true + fsGroup: 1000 + +volume: + dataDirs: + - name: data1 + type: "persistentVolumeClaim" + size: "100Gi" + maxVolumes: 0 + podSecurityContext: + enabled: true + runAsUser: 1000 + runAsGroup: 1000 + runAsNonRoot: true + fsGroup: 1000 + +filer: + data: + type: "persistentVolumeClaim" + size: "25Gi" + logs: + type: "emptyDir" + podSecurityContext: + enabled: true + runAsUser: 1000 + runAsGroup: 1000 + runAsNonRoot: true + fsGroup: 1000 +``` + +Apply the same `podSecurityContext` to every other enabled workload, such as `s3`, `admin`, `worker`, or `sftp`, and set `s3.logs` and `sftp.logs` to `emptyDir`; for an all-in-one deployment, use the `allInOne` values key. If you use a custom image with a different UID/GID, replace `1000` with the values for that image. Storage classes that do not support `fsGroup` may need permissions adjusted on the storage backend. A release that already runs on `hostPath` cannot switch its claims in place; see [Master data](#master-data-hostpath-vs-a-claim). + ## OpenShift Support SeaweedFS can be deployed on OpenShift or any cluster enforcing the Kubernetes "restricted" Pod Security Standard. By default, OpenShift blocks containers that run as root or use `hostPath` volumes. From de239e740472b292cbf3816fbebf85db539b5a01 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 11:28:54 -0800 Subject: [PATCH 22/29] seaweed-block: preserve unchanged master imports and batch durability (#13458) * seaweed-block: preserve unchanged imports and batch durable publication * seaweed-block: name the rejected entry in a startup import error The batch import returned the bare validation error, so a bad cluster-spec node or placement seed stopped startup without saying which entry. The per-entry RegisterNode/ApplyPlan loop named it. Co-Authored-By: Claude Opus 5.5 * seaweed-block: name the import path in the freshness row and registry guard Startup now replays nodes through ImportNodes, not RegisterNode; list it where the freshness invariant and the registry-writer guard name the writers. Drop a doubled blank line in the operations manual. Co-Authored-By: Claude Opus 5.5 * seaweed-block: poison a lifecycle store only on a persistence error A node registration whose SeenAt cannot be encoded failed before any file I/O, but RegisterNode latched the marshal error and every later mutation returned ErrLifecycleRecoveryRequired until reopen. Latch only a RecordPersistenceError, as the volume store already did. Co-Authored-By: Claude Opus 5.5 * seaweed-block: keep a node's SeenAt when its declaration changes registrationLocked kept SeenAt only for an unchanged declaration. A restart that changed a node's declared pools or address stamped the current time, so a silent node passed the stale-observation check. A declaration without an observation time now keeps the stored one; a new node still gets the current time. Co-Authored-By: Claude Opus 5.5 * seaweed-block: use the import syncfs only on filesystems that report its errors The batch path was chosen from the kernel release alone. On overlayfs, syncfs checks the overlay superblock's writeback errors, not the upper file's, and on FUSE it does not send FSYNC to the daemon, so an import could publish records whose data never became durable. Select syncfs only when the records directory is on ext4, xfs, btrfs or tmpfs, and keep per-file fsync elsewhere. The startup line now reports the path for the lifecycle store, after it exists. Co-Authored-By: Claude Opus 5.5 * seaweed-block: assert the imported values before the reopen check The import step control compared the store's snapshot with a reopen, so an import that synced and renamed but committed the old values passed. Check the changed and unchanged values before and after reopen. Co-Authored-By: Claude Opus 5.5 * seaweed-block: check both views after a removal retry present() returned record && snapshot, so a removal that cleared only one view passed the final check. Report both and require both absent. Co-Authored-By: Claude Opus 5.5 * seaweed-block: assert the one-second fail-stop bound The blocked-logger control checked only exit status 1 inside a four-second child timeout, so a longer exit timer still passed. The child now reports when it triggers the failure, and the parent requires exit within the one-second deadline plus one second of scheduler tolerance. Co-Authored-By: Claude Opus 5.5 * seaweed-block: add the lifecycle machine's transition table Every other Part A machine lists its transitions with guard, enforcing code and Part B rows; the lifecycle record I/O machine had only its diagram. Also name DeletePlacement and DeleteVolume beside RemoveNode in the open gap: none of them syncs the directory after removing a record. Co-Authored-By: Claude Opus 5.5 * seaweed-block: scope the manual's lifecycle exit policy to the stores it covers Only the node, placement and volume stores have the fail-stop handler. State that deletion-reservation and workspace-binding write failures return the error without exiting, and that an uncertain binding store needs a restart. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: pingqiu Co-authored-by: Chris Lu Co-authored-by: Claude Opus 5.5 --- .../cmd/blockmaster/import_unchanged_test.go | 91 +++++ seaweed-block/cmd/blockmaster/main.go | 16 +- .../blockmaster/node_registry_guard_test.go | 6 +- .../cmd/blockmaster/persist_exit_test.go | 112 ++++++ .../master_import_restart_integration_test.go | 111 +++++ seaweed-block/core/host/master/host.go | 18 + .../core/host/master/lifecycle_failure.go | 25 ++ .../host/master/lifecycle_failure_test.go | 273 +++++++++++++ .../core/lifecycle/import_entry_error_test.go | 41 ++ .../core/lifecycle/import_recovery_test.go | 239 +++++++++++ .../core/lifecycle/import_step_sync_test.go | 210 ++++++++++ .../core/lifecycle/import_syncfs_test.go | 379 ++++++++++++++++++ .../core/lifecycle/layout_identity_test.go | 7 + .../core/lifecycle/layout_redraw_test.go | 9 +- .../lifecycle/node_import_freshness_test.go | 95 +++++ .../core/lifecycle/node_inventory.go | 127 +++++- .../core/lifecycle/placement_intent.go | 138 +++++-- .../core/lifecycle/placement_snapshot_test.go | 1 + .../lifecycle/placement_unchanged_test.go | 60 +++ seaweed-block/core/lifecycle/record_file.go | 213 +++++++++- .../core/lifecycle/record_syncfs_linux.go | 61 +++ .../core/lifecycle/record_syncfs_other.go | 12 + .../core/lifecycle/remove_retry_test.go | 106 +++++ seaweed-block/core/lifecycle/store.go | 49 ++- .../core/lifecycle/store_parent_sync_test.go | 4 +- .../core/lifecycle/volume_recovery_test.go | 111 +++++ seaweed-block/docs/design/invariants.md | 55 ++- seaweed-block/docs/operations-manual.md | 13 + seaweed-block/docs/time-bounds.tsv | 1 + 29 files changed, 2506 insertions(+), 77 deletions(-) create mode 100644 seaweed-block/cmd/blockmaster/import_unchanged_test.go create mode 100644 seaweed-block/cmd/blockmaster/persist_exit_test.go create mode 100644 seaweed-block/cmd/blockvolume/master_import_restart_integration_test.go create mode 100644 seaweed-block/core/host/master/lifecycle_failure.go create mode 100644 seaweed-block/core/host/master/lifecycle_failure_test.go create mode 100644 seaweed-block/core/lifecycle/import_entry_error_test.go create mode 100644 seaweed-block/core/lifecycle/import_recovery_test.go create mode 100644 seaweed-block/core/lifecycle/import_step_sync_test.go create mode 100644 seaweed-block/core/lifecycle/import_syncfs_test.go create mode 100644 seaweed-block/core/lifecycle/node_import_freshness_test.go create mode 100644 seaweed-block/core/lifecycle/placement_unchanged_test.go create mode 100644 seaweed-block/core/lifecycle/record_syncfs_linux.go create mode 100644 seaweed-block/core/lifecycle/record_syncfs_other.go create mode 100644 seaweed-block/core/lifecycle/remove_retry_test.go create mode 100644 seaweed-block/core/lifecycle/volume_recovery_test.go diff --git a/seaweed-block/cmd/blockmaster/import_unchanged_test.go b/seaweed-block/cmd/blockmaster/import_unchanged_test.go new file mode 100644 index 0000000000..8a0f95bd8f --- /dev/null +++ b/seaweed-block/cmd/blockmaster/import_unchanged_test.go @@ -0,0 +1,91 @@ +package main + +import ( + "context" + "fmt" + "os" + "path/filepath" + "testing" + "time" + + "github.com/seaweedfs/seaweed-block/core/host/master" + "github.com/seaweedfs/seaweed-block/core/lifecycle" +) + +// Re-importing the same declarative spec must preserve the durable records, +// including the registration observation time. This checks replacement, not +// just equal JSON: an identical rewrite still pays the durability barriers. +func TestUnchangedSpecRestartKeepsAll999ImportRecords(t *testing.T) { + const count = 999 + authorityDir, lifecycleDir := t.TempDir(), t.TempDir() + open := func() *master.Host { + t.Helper() + h, err := master.New(master.Config{Listen: "127.0.0.1:0", AuthorityStoreDir: authorityDir, LifecycleStoreDir: lifecycleDir}) + if err != nil { + t.Fatal(err) + } + return h + } + closeHost := func(h *master.Host) { + t.Helper() + h.Start() + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + if err := h.Close(ctx); err != nil { + t.Fatal(err) + } + } + nodes := make([]lifecycle.NodeRegistration, count) + intents := make([]lifecycle.PlacementIntent, count) + for i := range nodes { + id := fmt.Sprintf("n%04d", i) + nodes[i] = lifecycle.NodeRegistration{ServerID: id, Addr: "127.0.0.1:19001"} + intents[i] = lifecycle.PlacementIntent{VolumeID: fmt.Sprintf("v%04d", i), DesiredRF: 1, Slots: []lifecycle.PlacementSlotIntent{{ServerID: id, ReplicaID: "r1", Source: lifecycle.PlacementSourceExistingReplica}}} + } + importSpec := func(h *master.Host) { + t.Helper() + if err := importLifecycleNodeInventory(h, nodes); err != nil { + t.Fatal(err) + } + if err := importLifecyclePlacementIntents(h, intents); err != nil { + t.Fatal(err) + } + } + h := open() + importSpec(h) + closeHost(h) + before := make(map[string]os.FileInfo, 2*count) + for _, kind := range []string{"nodes", "placements"} { + entries, err := os.ReadDir(filepath.Join(lifecycleDir, kind)) + if err != nil { + t.Fatal(err) + } + if len(entries) != count { + t.Fatalf("%s records=%d, want %d", kind, len(entries), count) + } + for _, entry := range entries { + path := filepath.Join(lifecycleDir, kind, entry.Name()) + info, err := os.Stat(path) + if err != nil { + t.Fatal(err) + } + before[path] = info + } + } + h = open() + importSpec(h) + closeHost(h) + rewritten := map[string]int{} + for path, info := range before { + after, err := os.Stat(path) + if err != nil { + t.Fatal(err) + } + if !os.SameFile(info, after) || !info.ModTime().Equal(after.ModTime()) { + rewritten[filepath.Base(filepath.Dir(path))]++ + } + } + if rewritten["nodes"] != 0 || rewritten["placements"] != 0 { + t.Fatalf("unchanged restart replaced records: nodes=%d placements=%d; want zero", rewritten["nodes"], rewritten["placements"]) + } +} diff --git a/seaweed-block/cmd/blockmaster/main.go b/seaweed-block/cmd/blockmaster/main.go index b73a2e6987..1018d03ceb 100644 --- a/seaweed-block/cmd/blockmaster/main.go +++ b/seaweed-block/cmd/blockmaster/main.go @@ -274,6 +274,7 @@ func run(f flags) int { fmt.Fprintln(os.Stderr, "blockmaster: dynamic lifecycle topology enabled by cluster-spec node inventory; assignments will be derived from verified placement intents") } cfg := master.Config{ + FailStopLifecycleWrites: true, EphemeralLauncherState: (f.launcherManifestDir != "" || f.launcherKubernetesApply) && f.launcherStateHostPath == "", AuthorityStoreDir: f.authorityStore, LifecycleStoreDir: f.lifecycleStore, @@ -339,6 +340,7 @@ func run(f flags) int { fmt.Fprintln(os.Stderr, "blockmaster:", err) return 1 } + fmt.Fprintf(os.Stderr, "blockmaster: lifecycle import durability: %s\n", lifecycle.ImportDurabilityMode(f.lifecycleStore)) // Every promotion decides on the probe round's answers: each candidate // answers a fresh round over its authenticated node stream. h.SetPromotionEvidenceProvider(h.NewRoundPromotionEvidenceProvider(f.launcherReplicationAck, nil)) @@ -478,10 +480,8 @@ func importLifecycleNodeInventory(h *master.Host, nodes []lifecycle.NodeRegistra if stores == nil { return fmt.Errorf("lifecycle node import requires --lifecycle-store") } - for _, node := range nodes { - if _, err := stores.Nodes.RegisterNode(node); err != nil { - return fmt.Errorf("register lifecycle node %s: %w", node.ServerID, err) - } + if err := stores.Nodes.ImportNodes(nodes); err != nil { + return fmt.Errorf("import lifecycle nodes: %w", err) } return nil } @@ -510,6 +510,7 @@ func importLifecyclePlacementIntents(h *master.Host, intents []lifecycle.Placeme if stores == nil { return fmt.Errorf("lifecycle placement import requires --lifecycle-store") } + plans := make([]lifecycle.PlacementPlan, 0, len(intents)) for _, intent := range intents { if stores.Deletions.Reserved(intent.VolumeID) { continue // never placed again (see importLifecycleVolumes) @@ -528,9 +529,10 @@ func importLifecyclePlacementIntents(h *master.Host, intents []lifecycle.Placeme Source: slot.Source, }) } - if _, err := stores.Placements.ApplyPlan(plan); err != nil { - return fmt.Errorf("apply lifecycle placement seed %s: %w", intent.VolumeID, err) - } + plans = append(plans, plan) + } + if err := stores.Placements.ImportPlans(plans); err != nil { + return fmt.Errorf("import lifecycle placement seeds: %w", err) } return nil } diff --git a/seaweed-block/cmd/blockmaster/node_registry_guard_test.go b/seaweed-block/cmd/blockmaster/node_registry_guard_test.go index 77b785079e..1843615437 100644 --- a/seaweed-block/cmd/blockmaster/node_registry_guard_test.go +++ b/seaweed-block/cmd/blockmaster/node_registry_guard_test.go @@ -19,7 +19,7 @@ import ( // only a host that holds no volume: a retired id is then unregistered, so a // holder RPC under it is refused (refuseWorkspaceHolderHost) and the checks // only get stricter. This guard fails when any other non-test caller of -// RegisterNode or RemoveNode appears anywhere. +// RegisterNode, ImportNodes or RemoveNode appears anywhere. func TestNodeRegistryIsWrittenOnlyAtStartup(t *testing.T) { root, err := filepath.Abs(filepath.Join("..", "..")) if err != nil { @@ -56,7 +56,7 @@ func TestNodeRegistryIsWrittenOnlyAtStartup(t *testing.T) { if !ok { return true } - if sel, ok := call.Fun.(*ast.SelectorExpr); ok && (sel.Sel.Name == "RegisterNode" || sel.Sel.Name == "RemoveNode") { + if sel, ok := call.Fun.(*ast.SelectorExpr); ok && (sel.Sel.Name == "RegisterNode" || sel.Sel.Name == "ImportNodes" || sel.Sel.Name == "RemoveNode") { sites = append(sites, filepath.ToSlash(rel)+":"+fn.Name.Name+"."+sel.Sel.Name) } return true @@ -68,7 +68,7 @@ func TestNodeRegistryIsWrittenOnlyAtStartup(t *testing.T) { t.Fatal(err) } sort.Strings(sites) - want := []string{"cmd/blockmaster/main.go:importLifecycleNodeInventory.RegisterNode", "core/host/master/format_gate.go:RetireHost.RemoveNode"} + want := []string{"cmd/blockmaster/main.go:importLifecycleNodeInventory.ImportNodes", "core/host/master/format_gate.go:RetireHost.RemoveNode"} if strings.Join(sites, ",") != strings.Join(want, ",") { t.Fatalf("node registry writers = %v, want only %v: an adder after start, or another remover, breaks the identity checks' assumption", sites, want) } diff --git a/seaweed-block/cmd/blockmaster/persist_exit_test.go b/seaweed-block/cmd/blockmaster/persist_exit_test.go new file mode 100644 index 0000000000..fa719b63f9 --- /dev/null +++ b/seaweed-block/cmd/blockmaster/persist_exit_test.go @@ -0,0 +1,112 @@ +//go:build linux + +package main + +import ( + "context" + "encoding/json" + "errors" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/seaweedfs/seaweed-block/core/host/master" + "github.com/seaweedfs/seaweed-block/core/lifecycle" +) + +func TestMasterImportPersistenceFailureExitsAndRecovers(t *testing.T) { + root := t.TempDir() + nodeDir := filepath.Join(root, "lifecycle", "nodes") + store, err := lifecycle.OpenNodeInventoryStore(nodeDir) + if err != nil { + t.Fatal(err) + } + old := lifecycle.NodeRegistration{ServerID: "kept", Addr: "127.0.0.1:19001"} + old, err = store.RegisterNode(old) + if err != nil { + t.Fatal(err) + } + // A real rename failure, even as root; the preceding committed record + // stays untouched. Directories are not parsed as JSON records on reload. + block := filepath.Join(nodeDir, "new.json") + if err := os.Mkdir(block, 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(block, "blocker"), []byte("fixture"), 0600); err != nil { + t.Fatal(err) + } + spec := filepath.Join(root, "spec.yaml") + if err := os.WriteFile(spec, []byte("nodes:\n - server_id: new\n addr: 127.0.0.1:19002\n"), 0600); err != nil { + t.Fatal(err) + } + args := []string{"--listen", "127.0.0.1:0", "--authority-store", filepath.Join(root, "authority"), "--lifecycle-store", filepath.Join(root, "lifecycle"), "--cluster-spec", spec} + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestGuardHelperProcess$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), guardHelperEnv+"="+strings.Join(args, guardHelperSep)) + out, runErr := cmd.CombinedOutput() + var exit *exec.ExitError + if ctx.Err() != nil || !errors.As(runErr, &exit) || exit.ExitCode() != 1 { + t.Fatalf("master did not fail-stop with exit1: %v context=%v\n%s", runErr, ctx.Err(), out) + } + text := string(out) + if strings.Count(text, "exiting so the supervisor restarts from durable state") != 1 || !strings.Contains(text, "ERROR") || !strings.Contains(text, "new.json") || !strings.Contains(text, nodeDir) { + t.Fatalf("missing single persistence ERROR: %s", text) + } + oldRaw, err := json.Marshal(old) + if err != nil { + t.Fatal(err) + } + recovery := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestMasterImportPersistenceRecoveryChild$", "-test.timeout=8s") + recovery.Env = append(os.Environ(), "MASTER_RECOVERY_ROOT="+root, "MASTER_RECOVERY_OLD="+string(oldRaw)) + if out, err := recovery.CombinedOutput(); err != nil { + t.Fatalf("bounded recovery: %v context=%v\n%s", err, ctx.Err(), out) + } +} + +func TestMasterImportPersistenceRecoveryChild(t *testing.T) { + root := os.Getenv("MASTER_RECOVERY_ROOT") + if root == "" { + t.Skip("bounded recovery subprocess") + } + nodeDir := filepath.Join(root, "lifecycle", "nodes") + var old lifecycle.NodeRegistration + if err := json.Unmarshal([]byte(os.Getenv("MASTER_RECOVERY_OLD")), &old); err != nil { + t.Fatal(err) + } + // A new master must load the complete committed record, not a speculative + // new registration or partial JSON from the failed write. + h, err := master.New(master.Config{Listen: "127.0.0.1:0", AuthorityStoreDir: filepath.Join(root, "authority"), LifecycleStoreDir: filepath.Join(root, "lifecycle")}) + if err != nil { + t.Fatal(err) + } + h.Start() + t.Cleanup(func() { + closeCtx, stop := context.WithTimeout(context.Background(), 5*time.Second) + defer stop() + if err := h.Close(closeCtx); err != nil { + t.Error(err) + } + }) + if got, ok := h.Lifecycle().Nodes.GetNodeSnapshot("kept"); !ok || got.ServerID != old.ServerID || got.Addr != old.Addr || !got.SeenAt.Equal(old.SeenAt) { + t.Fatalf("committed record lost on restart: %+v %v", got, ok) + } + if _, ok := h.Lifecycle().Nodes.GetNodeSnapshot("new"); ok { + t.Fatal("failed record appeared on restart") + } + entries, err := os.ReadDir(nodeDir) + if err != nil { + t.Fatal(err) + } + for _, entry := range entries { + if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".json") { + raw, err := os.ReadFile(filepath.Join(nodeDir, entry.Name())) + if err != nil || !json.Valid(raw) { + t.Fatalf("partial record %s: %v", entry.Name(), err) + } + } + } +} diff --git a/seaweed-block/cmd/blockvolume/master_import_restart_integration_test.go b/seaweed-block/cmd/blockvolume/master_import_restart_integration_test.go new file mode 100644 index 0000000000..b1cf9c3fee --- /dev/null +++ b/seaweed-block/cmd/blockvolume/master_import_restart_integration_test.go @@ -0,0 +1,111 @@ +//go:build linux && subprocess && chunkstore_integration + +package main_test + +import ( + "context" + "testing" + "time" + + "github.com/seaweedfs/seaweed-block/core/rpc/control" + "google.golang.org/grpc" +) + +// A master restart must not replace live holders while rebuilding its +// heartbeat view. Registration time is deliberately older than the window; +// only the new process's received heartbeats make its node evidence fresh. +func TestMasterImportRestartKeepsLiveHoldersAcrossFreshnessWindow(t *testing.T) { + const window = 6 * time.Second + env := startHandoffEnvVolumes(t, 1, []string{"v2"}, "--freshness-window", window.String(), "--lifecycle-product-loop-interval", "100ms") + env.volExtra = append(env.volExtra, "--heartbeat-interval", "250ms") + for id, volume := range map[string]string{"s1": "v1", "n-v2": "v2"} { + host := env.hosts[id] + host.volume, host.replica = volume, "r1" + env.hosts[id] = host + } + first, second := f1Up(t, env, "s1"), f1Up(t, env, "n-v2") + epochs := map[string]uint64{} + for volume, holder := range map[string]*daemon{"v1": first, "v2": second} { + epoch, err := adoptedEpochOf(volume, holder.line("blockvolume: volume "+volume+" adopted as PRIMARY at r1@")) + if err != nil { + t.Fatal(err) + } + epochs[volume] = epoch + } + // Both durable registrations now age beyond freshness while holders keep + // reporting; a restart must not renew these durable observation times. + time.Sleep(window + 100*time.Millisecond) + env.masterProcess.term(t, 10*time.Second) + started := time.Now() + env.masterProcess = env.h.start(t, "blockmaster-import-restarted", env.h.master, env.masterArgs...) + conn, err := grpc.NewClient(env.h.masterAddr, env.masterDialOption(t, "admin")) + if err != nil { + t.Fatal(err) + } + defer conn.Close() + client := control.NewClusterEvidenceServiceClient(conn) + fresh := map[string]bool{} + verified := map[string]bool{} + observed := map[string]bool{} + samples := 0 + for time.Since(started) < window { + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + status, err := client.GetClusterStatus(ctx, &control.GetClusterStatusRequest{}) + cancel() + if err == nil { + samples++ + for _, node := range status.Nodes { + if at := node.GetLastHeartbeatAt(); at != nil && at.AsTime().After(started) { + fresh[node.GetNodeName()] = true + } + } + for _, volume := range status.Volumes { + if epoch, ok := epochs[volume.VolumeId]; ok && volume.Epoch != 0 { + observed[volume.VolumeId] = true + if volume.Epoch != epoch { + t.Fatalf("%s changed epoch after restart: %d -> %d", volume.VolumeId, epoch, volume.Epoch) + } + } + } + for _, event := range status.Events { + if event.EventType == "placement_verified" { + verified[event.VolumeId] = true + } + } + } + for _, bad := range []string{"primary lost:", "decision=replace("} { + if env.masterProcess.has(bad) { + t.Fatalf("live-holder restart made a loss/replacement decision: %s", bad) + } + } + for id, d := range map[string]*daemon{"s1": first, "n-v2": second} { + select { + case <-d.done: + t.Fatalf("live holder %s exited during master restart: %v", id, d.err) + default: + } + } + time.Sleep(100 * time.Millisecond) + } + if samples == 0 { + t.Fatal("no successful status sample in the freshness window") + } + for _, id := range []string{"s1", "n-v2"} { + if !fresh[id] { + t.Fatalf("live node %s never became fresh after restart", id) + } + } + for id := range epochs { + if !observed[id] { + t.Fatalf("volume %s never showed its authoritative epoch again", id) + } + if !verified[id] { + t.Fatalf("placement %s did not verify again within one window", id) + } + } + for _, id := range []string{"s1", "n-v2"} { + block := pattern("restart-live-io!") + env.writeBlock(t, id, 0, block) + } + t.Logf("master restart: %d status samples, both nodes fresh, both placements verified, no loss/replacement or holder exit within %s", samples, window) +} diff --git a/seaweed-block/core/host/master/host.go b/seaweed-block/core/host/master/host.go index 407908c61a..095578b3a4 100644 --- a/seaweed-block/core/host/master/host.go +++ b/seaweed-block/core/host/master/host.go @@ -121,6 +121,11 @@ type Config struct { // GET /status/workspace-lease on this loopback address. StatusListen string + // FailStopLifecycleWrites exits the process on uncertain lifecycle-store + // persistence. The supervised blockmaster executable enables it; embedders + // that leave it off must reopen a failed store before attempting mutations. + FailStopLifecycleWrites bool + // Logger is used for structured startup and error logging. If // nil, the default log package logger is used. Logger *log.Logger @@ -275,6 +280,10 @@ func New(cfg Config) (*Host, error) { if lg == nil { lg = log.Default() } + var persistenceFailure lifecycle.PersistenceFailureHandler + if cfg.FailStopLifecycleWrites { + persistenceFailure = lifecycleFailStop(lg) + } holder := &publisherHolder{} ctrlCfg := cfg.ControllerConfig @@ -323,9 +332,18 @@ func New(cfg Config) (*Host, error) { // the master's state it reads. lifecycleStores, err := openLifecycleStores(cfg.LifecycleStoreDir) if err != nil { + var failure *lifecycle.RecordPersistenceError + if persistenceFailure != nil && errors.As(err, &failure) { + persistenceFailure(failure) + } _ = boot.Close() return nil, fmt.Errorf("master.New: lifecycle stores: %w", err) } + if lifecycleStores != nil && persistenceFailure != nil { + lifecycleStores.Nodes.SetPersistenceFailureHandler(persistenceFailure) + lifecycleStores.Placements.SetPersistenceFailureHandler(persistenceFailure) + lifecycleStores.Volumes.SetPersistenceFailureHandler(persistenceFailure) + } // A new cluster starts at the current level: with no prior // state in any master store (no authority record reloaded or skipped, no // attestation file, no volume, node, placement or deletion in the diff --git a/seaweed-block/core/host/master/lifecycle_failure.go b/seaweed-block/core/host/master/lifecycle_failure.go new file mode 100644 index 0000000000..4da45848c5 --- /dev/null +++ b/seaweed-block/core/host/master/lifecycle_failure.go @@ -0,0 +1,25 @@ +package master + +import ( + "log" + "os" + "sync" + "time" + + "github.com/seaweedfs/seaweed-block/core/lifecycle" +) + +func lifecycleFailStop(logger *log.Logger) lifecycle.PersistenceFailureHandler { + var once sync.Once + return func(failure *lifecycle.RecordPersistenceError) { + once.Do(func() { + // Arm termination before touching the logger: its writer or output + // mutex may be blocked. ERROR delivery is best effort in that case. + time.AfterFunc(time.Second, func() { os.Exit(1) }) + logger.Printf("ERROR lifecycle persistence failure store=%q record=%q error=%q; exiting so the supervisor restarts from durable state", failure.Store, failure.Record, failure.Err) + // A graceful close can wait on the writer that discovered the error. + // The supervisor restarts; Open establishes the recovery barriers. + os.Exit(1) + }) + } +} diff --git a/seaweed-block/core/host/master/lifecycle_failure_test.go b/seaweed-block/core/host/master/lifecycle_failure_test.go new file mode 100644 index 0000000000..7acf455a36 --- /dev/null +++ b/seaweed-block/core/host/master/lifecycle_failure_test.go @@ -0,0 +1,273 @@ +//go:build linux + +package master + +import ( + "context" + "crypto/sha256" + "encoding/json" + "errors" + "fmt" + "log" + "os" + "os/exec" + "path/filepath" + "runtime" + "strconv" + "strings" + "sync" + "syscall" + "testing" + "time" + + "github.com/seaweedfs/seaweed-block/core/lifecycle" +) + +func TestLifecyclePersistenceFailureStopsTheProcess(t *testing.T) { + for _, kind := range []string{"nodes", "placements", "volumes", "concurrent"} { + t.Run(kind, func(t *testing.T) { + root := t.TempDir() + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLifecyclePersistenceExitChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "LIFECYCLE_EXIT_ROOT="+root, "LIFECYCLE_EXIT_KIND="+kind) + out, err := cmd.CombinedOutput() + var exit *exec.ExitError + if ctx.Err() != nil || !errors.As(err, &exit) || exit.ExitCode() != 1 { + t.Fatalf("master failed to exit1: %v context=%v\n%s", err, ctx.Err(), out) + } + text := string(out) + record := "new.json" + if kind == "volumes" { + record = "kept.json" + } + if strings.Count(text, "exiting so the supervisor restarts from durable state") != 1 || !strings.Contains(text, "ERROR") || !strings.Contains(text, record) || !strings.Contains(text, filepath.Join(root, "lifecycle")) { + t.Fatalf("missing single record/store/error line: %s", text) + } + recovery := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLifecyclePersistenceRecoveryChild$", "-test.timeout=8s") + recovery.Env = append(os.Environ(), "LIFECYCLE_RECOVERY_ROOT="+root, "LIFECYCLE_EXIT_KIND="+kind) + if out, err := recovery.CombinedOutput(); err != nil { + t.Fatalf("bounded recovery: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } +} + +func TestLifecyclePersistenceRecoveryChild(t *testing.T) { + root := os.Getenv("LIFECYCLE_RECOVERY_ROOT") + if root == "" { + t.Skip("bounded recovery subprocess") + } + kind := os.Getenv("LIFECYCLE_EXIT_KIND") + h, err := New(Config{Listen: "127.0.0.1:0", AuthorityStoreDir: filepath.Join(root, "authority"), LifecycleStoreDir: filepath.Join(root, "lifecycle"), FailStopLifecycleWrites: true}) + if err != nil { + t.Fatal("restart", err) + } + h.Start() + t.Cleanup(func() { + c, stop := context.WithTimeout(context.Background(), 5*time.Second) + defer stop() + if err := h.Close(c); err != nil { + t.Error(err) + } + }) + kinds := []string{kind} + if kind == "concurrent" { + kinds = []string{"nodes", "placements"} + } + for _, part := range kinds { + raw, err := os.ReadFile(filepath.Join(root, "lifecycle", part, "kept.json")) + if err != nil { + t.Fatal(err) + } + want, err := os.ReadFile(filepath.Join(root, part+"-sha256")) + if err != nil || fmt.Sprintf("%x", sha256.Sum256(raw)) != string(want) { + t.Fatalf("restart changed committed %s: %v", part, err) + } + var kept, failed bool + switch part { + case "nodes": + _, kept = h.Lifecycle().Nodes.GetNodeSnapshot("kept") + _, failed = h.Lifecycle().Nodes.GetNodeSnapshot("new") + case "placements": + _, kept = h.Lifecycle().Placements.GetPlacementSnapshot("kept") + _, failed = h.Lifecycle().Placements.GetPlacementSnapshot("new") + case "volumes": + _, kept = h.Lifecycle().Volumes.GetVolumeSnapshot("kept") + _, failed = h.Lifecycle().Volumes.GetVolumeSnapshot("new") + } + if !kept || failed { + t.Fatalf("restart published wrong %s records", part) + } + entries, err := os.ReadDir(filepath.Join(root, "lifecycle", part)) + if err != nil { + t.Fatal(err) + } + for _, entry := range entries { + if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".json") { + raw, err := os.ReadFile(filepath.Join(root, "lifecycle", part, entry.Name())) + if err != nil || !json.Valid(raw) { + t.Fatalf("partial record %s: %v", entry.Name(), err) + } + } + } + } +} + +type blockedLifecycleLog struct { + entered chan struct{} + once sync.Once +} + +func (w *blockedLifecycleLog) Write(p []byte) (int, error) { + w.once.Do(func() { close(w.entered) }) + select {} +} + +func TestLifecycleFailStopExitsWithBlockedLogger(t *testing.T) { + for _, mode := range []string{"writer", "held-lock"} { + t.Run(mode, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 6*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLifecycleBlockedLoggerChild$", "-test.timeout=4s") + cmd.Env = append(os.Environ(), "LIFECYCLE_BLOCKED_LOG="+mode) + out, err := cmd.CombinedOutput() + exited := time.Now() + var exit *exec.ExitError + if ctx.Err() != nil || !errors.As(err, &exit) || exit.ExitCode() != 1 { + t.Fatalf("blocked logger prevented own exit1: %v context=%v\n%s", err, ctx.Err(), out) + } + var triggered int64 + for _, line := range strings.Split(string(out), "\n") { + if v, ok := strings.CutPrefix(line, "lifecycle-failure-triggered="); ok { + triggered, _ = strconv.ParseInt(v, 10, 64) + } + } + if triggered == 0 { + t.Fatalf("child did not report its failure trigger:\n%s", out) + } + // One-second deadline plus one second of scheduler tolerance; the + // subprocess watchdog above is separate and longer. + if elapsed := exited.Sub(time.Unix(0, triggered)); elapsed > 2*time.Second { + t.Fatalf("exit took %s after the failure, want within the one-second deadline", elapsed) + } + }) + } +} + +func TestLifecycleBlockedLoggerChild(t *testing.T) { + mode := os.Getenv("LIFECYCLE_BLOCKED_LOG") + if mode == "" { + t.Skip("bounded blocked-sink child") + } + w := &blockedLifecycleLog{entered: make(chan struct{})} + logger := log.New(w, "", 0) + if mode == "held-lock" { + go logger.Print("earlier message") + <-w.entered + } + fail := lifecycleFailStop(logger) + fmt.Printf("lifecycle-failure-triggered=%d\n", time.Now().UnixNano()) + go fail(&lifecycle.RecordPersistenceError{Store: "nodes", Record: "v.json", Err: errors.New("fixture")}) + fail(&lifecycle.RecordPersistenceError{Store: "placements", Record: "v.json", Err: errors.New("fixture")}) + os.Exit(91) +} + +func TestLifecyclePersistenceExitChild(t *testing.T) { + root := os.Getenv("LIFECYCLE_EXIT_ROOT") + if root == "" { + t.Skip("bounded fail-stop subprocess") + } + h, err := New(Config{Listen: "127.0.0.1:0", AuthorityStoreDir: filepath.Join(root, "authority"), LifecycleStoreDir: filepath.Join(root, "lifecycle"), FailStopLifecycleWrites: true}) + if err != nil { + t.Fatal(err) + } + h.Start() + put := func(kind, id string) error { + switch kind { + case "nodes": + _, err := h.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{ServerID: id, Addr: "127.0.0.1:19001"}) + return err + case "placements": + _, err := h.Lifecycle().Placements.ApplyPlan(lifecycle.PlacementPlan{VolumeID: id, DesiredRF: 1, Candidates: []lifecycle.PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: lifecycle.PlacementSourceExistingReplica}}}) + return err + default: + _, err := h.Lifecycle().Volumes.CreateVolume(lifecycle.VolumeSpec{VolumeID: id, SizeBytes: 1 << 20, ReplicationFactor: 1}) + return err + } + } + kinds := []string{os.Getenv("LIFECYCLE_EXIT_KIND")} + if kinds[0] == "concurrent" { + kinds = []string{"nodes", "placements"} + } + for _, kind := range kinds { + if err := put(kind, "kept"); err != nil { + t.Fatal(err) + } + raw, err := os.ReadFile(filepath.Join(root, "lifecycle", kind, "kept.json")) + if err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(root, kind+"-sha256"), []byte(fmt.Sprintf("%x", sha256.Sum256(raw))), 0600); err != nil { + t.Fatal(err) + } + if kind == "volumes" { + continue + } + block := filepath.Join(root, "lifecycle", kind, "new.json") + if err := os.Mkdir(block, 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(block, "blocker"), []byte("fixture"), 0600); err != nil { + t.Fatal(err) + } + } + var descriptors []*os.File + if kinds[0] == "volumes" { + // Attach has no pre-write record lookup on disk. Exhaust only this child's + // descriptor budget so CreateTemp fails while its committed file stays intact. + var limit syscall.Rlimit + if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil { + t.Fatal(err) + } + if limit.Cur > 128 { + limit.Cur = 128 + } + if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil { + t.Fatal(err) + } + for { + file, err := os.Open(os.DevNull) + if errors.Is(err, syscall.EMFILE) { + break + } + if err != nil { + t.Fatal(err) + } + descriptors = append(descriptors, file) + } + } + start := make(chan struct{}) + done := make(chan error, len(kinds)) + for _, kind := range kinds { + go func(kind string) { + <-start + if kind == "volumes" { + _, err := h.Lifecycle().Volumes.AttachVolume("kept", "node") + done <- err + return + } + done <- put(kind, "new") + }(kind) + } + close(start) + for range kinds { + if err := <-done; err != nil { + fmt.Fprintln(os.Stderr, "persistence error returned instead of exiting:", err) + os.Exit(91) + } + } + runtime.KeepAlive(descriptors) + fmt.Fprintln(os.Stderr, "failed persistence did not stop master") + os.Exit(92) +} diff --git a/seaweed-block/core/lifecycle/import_entry_error_test.go b/seaweed-block/core/lifecycle/import_entry_error_test.go new file mode 100644 index 0000000000..d5f6e93626 --- /dev/null +++ b/seaweed-block/core/lifecycle/import_entry_error_test.go @@ -0,0 +1,41 @@ +package lifecycle + +import ( + "errors" + "strings" + "testing" +) + +func TestImportRejectionNamesTheEntry(t *testing.T) { + nodes, err := OpenNodeInventoryStore(t.TempDir()) + if err != nil { + t.Fatal(err) + } + err = nodes.ImportNodes([]NodeRegistration{{ServerID: "good", Addr: "127.0.0.1:19001"}, {ServerID: "no-addr"}}) + if !errors.Is(err, ErrInvalidNodeRegistration) || !strings.Contains(err.Error(), "no-addr") { + t.Fatalf("node import error = %v, want ErrInvalidNodeRegistration naming no-addr", err) + } + if _, ok := nodes.GetNodeSnapshot("good"); ok { + t.Fatal("rejected node step published an entry") + } + if err := nodes.ImportNodes([]NodeRegistration{{ServerID: "good", Addr: "127.0.0.1:19001"}}); err != nil { + t.Fatalf("validation rejection blocked the next import: %v", err) + } + + placements, err := OpenPlacementIntentStore(t.TempDir()) + if err != nil { + t.Fatal(err) + } + valid := PlacementPlan{VolumeID: "good", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}} + short := PlacementPlan{VolumeID: "short", DesiredRF: 2, Candidates: valid.Candidates} + err = placements.ImportPlans([]PlacementPlan{valid, short}) + if !errors.Is(err, ErrInsufficientPlacementCandidates) || !strings.Contains(err.Error(), "short") { + t.Fatalf("placement import error = %v, want ErrInsufficientPlacementCandidates naming short", err) + } + if _, ok := placements.GetPlacementSnapshot("good"); ok { + t.Fatal("rejected placement step published an entry") + } + if err := placements.ImportPlans([]PlacementPlan{valid}); err != nil { + t.Fatalf("validation rejection blocked the next import: %v", err) + } +} diff --git a/seaweed-block/core/lifecycle/import_recovery_test.go b/seaweed-block/core/lifecycle/import_recovery_test.go new file mode 100644 index 0000000000..d6ab9e29c4 --- /dev/null +++ b/seaweed-block/core/lifecycle/import_recovery_test.go @@ -0,0 +1,239 @@ +//go:build linux + +package lifecycle + +import ( + "context" + "errors" + "os" + "os/exec" + "path/filepath" + "reflect" + "strings" + "testing" + "time" +) + +func TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk(t *testing.T) { + for _, kind := range []string{"nodes", "placements"} { + for _, mode := range []string{"reopen-barrier", "single-directory", "batch-directory", "batch-second-file"} { + t.Run(kind+"/"+mode, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestRecordEqualityRecoveryChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "RECORD_RECOVERY_KIND="+kind, "RECORD_RECOVERY_MODE="+mode) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("recovery control: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } + } +} + +func TestRecordEqualityRecoveryChild(t *testing.T) { + kind := os.Getenv("RECORD_RECOVERY_KIND") + if kind == "" { + t.Skip("isolated recovery hooks") + } + mode := os.Getenv("RECORD_RECOVERY_MODE") + dir := t.TempDir() + fault := errors.New("injected recovery barrier failure") + var cause error = fault + if mode == "syncfs-second-rename" { + cause = os.ErrNotExist + } + useSyncfs := strings.HasPrefix(mode, "syncfs-") + var apply func(bool) error + var view func() any + var reopen func() error + var otherMutations func() []error + var setPolicy func(PersistenceFailureHandler) + var latched func() bool + if kind == "nodes" { + var store *NodeInventoryStore + reopen = func() error { var err error; store, err = OpenNodeInventoryStore(dir); return err } + apply = func(changed bool) error { + nodes := []NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001", SeenAt: time.Unix(1, 0).UTC()}, {ServerID: "b", Addr: "127.0.0.1:19001", SeenAt: time.Unix(1, 0).UTC()}} + if changed { + for i := range nodes { + nodes[i].Addr = "127.0.0.1:19002" + } + } + if mode == "single-directory" { + _, err := store.RegisterNode(nodes[0]) + return err + } + return store.ImportNodes(nodes) + } + view = func() any { return store.ListNodes() } + setPolicy = func(handler PersistenceFailureHandler) { store.SetPersistenceFailureHandler(handler) } + latched = func() bool { return store.writeErr != nil } + otherMutations = func() []error { + _, e := store.RegisterNode(NodeRegistration{ServerID: "c", Addr: "127.0.0.1:19001"}) + return []error{e, store.ImportNodes(nil), store.RemoveNode("a")} + } + } else { + var store *PlacementIntentStore + reopen = func() error { var err error; store, err = OpenPlacementIntentStore(dir); return err } + apply = func(changed bool) error { + plans := make([]PlacementPlan, 2) + for i, id := range []string{"a", "b"} { + plans[i] = PlacementPlan{VolumeID: id, DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}} + if changed { + plans[i].Candidates[0].ReplicaID = "r2" + } + } + if mode == "single-directory" { + _, err := store.ApplyPlan(plans[0]) + return err + } + return store.ImportPlans(plans) + } + view = func() any { return store.ListPlacements() } + setPolicy = func(handler PersistenceFailureHandler) { store.SetPersistenceFailureHandler(handler) } + latched = func() bool { return store.writeErr != nil } + otherMutations = func() []error { + _, e := store.ApplyPlan(PlacementPlan{VolumeID: "c", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}) + return []error{e, store.ImportPlans(nil), store.DeletePlacement("a")} + } + } + if err := reopen(); err != nil { + t.Fatal(err) + } + if err := apply(false); err != nil { + t.Fatal(err) + } + old := view() + callbacks := 0 + setPolicy(func(failure *RecordPersistenceError) { + callbacks++ + record := "" + if mode == "single-directory" { + record = "a.json" + } + if mode == "batch-second-file" || mode == "syncfs-second-rename" { + record = "b.json" + } + if !latched() || failure.Store != dir || failure.Record != record || !errors.Is(failure, cause) { + t.Fatalf("incorrect failure-policy context: %+v", failure) + } + }) + if mode == "reopen-barrier" { + called := 0 + durableRecordHooksForTest.Store(&durableRecordHooks{dirSync: func(path string) error { + called++ + if path != dir { + t.Fatal("recovery synced wrong directory") + } + return fault + }}) + defer durableRecordHooksForTest.Store(nil) + if err := reopen(); !errors.Is(err, fault) { + t.Fatalf("loaded records published without a successful recovery barrier: %v calls=%d", err, called) + } + if called != 1 { + t.Fatalf("recovery directory barriers=%d want1", called) + } + durableRecordHooksForTest.Store(nil) + if err := reopen(); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(view(), old) { + t.Fatal("recovery barrier changed record contents") + } + return + } + files, filesystemSyncs, renames, directorySyncs, ioCalls := 0, 0, 0, 0, 0 + durableRecordHooksForTest.Store(&durableRecordHooks{batchSyncfs: &useSyncfs, + crash: func(point string) { + ioCalls++ + if point == "before-rename" { + renames++ + if mode == "syncfs-second-rename" && renames == 2 { + temps, err := filepath.Glob(filepath.Join(dir, "b.json.*.tmp")) + if err != nil || len(temps) != 1 { + t.Fatalf("second rename has no unique staged file: %v %v", temps, err) + } + if err := os.Remove(temps[0]); err != nil { + t.Fatal(err) + } + } + } + }, + fileSync: func(f *os.File) error { + ioCalls++ + files++ + if useSyncfs { + t.Fatal("batch syncfs control fell back to per-file fsync") + } + if mode == "batch-second-file" && files == 2 { + return fault + } + return f.Sync() + }, + fsSync: func(fd *os.File) error { + ioCalls++ + filesystemSyncs++ + if mode == "syncfs-failure" { + return fault + } + return syncRecordFilesystem(fd) + }, + dirSync: func(string) error { ioCalls++; directorySyncs++; return fault }, + }) + defer durableRecordHooksForTest.Store(nil) + if err := apply(true); !errors.Is(err, cause) { + t.Fatalf("fixture did not expose the failed persistence: %v", err) + } + if callbacks != 1 { + t.Fatalf("failure callbacks=%d want1", callbacks) + } + if !reflect.DeepEqual(view(), old) { + t.Fatal("failed write published its records") + } + if useSyncfs { + wantRenames, wantDirs := 0, 0 + if mode == "syncfs-second-rename" { + wantRenames = 2 + } + if mode == "syncfs-directory" { + wantRenames = 2 + wantDirs = 1 + } + if filesystemSyncs != 1 || renames != wantRenames || directorySyncs != wantDirs || files != 0 { + t.Fatalf("failure boundary: syncfs=%d renames=%d dir=%d files=%d", filesystemSyncs, renames, directorySyncs, files) + } + } + beforeRefusals := ioCalls + for _, err := range otherMutations() { + if !errors.Is(err, ErrLifecycleRecoveryRequired) { + t.Fatalf("mutation after uncertainty: %v", err) + } + } + if callbacks != 1 { + t.Fatalf("refused mutation called policy again: %d", callbacks) + } + retryErr := apply(false) + if !errors.Is(retryErr, ErrLifecycleRecoveryRequired) { + t.Fatalf("old-value retry must require recovery: %v", retryErr) + } + if callbacks != 1 || ioCalls != beforeRefusals { + t.Fatalf("poisoned mutation retried I/O/policy: io=%d/%d callbacks=%d", ioCalls, beforeRefusals, callbacks) + } + durableRecordHooksForTest.Store(nil) + if err := reopen(); err != nil { + t.Fatal(err) + } + if useSyncfs && !reflect.DeepEqual(view(), syncfsFailureReopenedView(old, mode)) { + t.Fatalf("reopen did not expose complete records at the injected boundary: got=%+v want=%+v", view(), syncfsFailureReopenedView(old, mode)) + } + if err := apply(false); err != nil { + t.Fatalf("recovered store cannot restore the old value: %v", err) + } + if err := reopen(); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(view(), old) { + t.Fatal("successful post-recovery write did not match disk") + } +} diff --git a/seaweed-block/core/lifecycle/import_step_sync_test.go b/seaweed-block/core/lifecycle/import_step_sync_test.go new file mode 100644 index 0000000000..7d0ab8a005 --- /dev/null +++ b/seaweed-block/core/lifecycle/import_step_sync_test.go @@ -0,0 +1,210 @@ +//go:build linux + +package lifecycle + +import ( + "context" + "errors" + "fmt" + "os" + "os/exec" + "reflect" + "testing" + "time" +) + +func TestImportStepSyncsChangedFilesThenOneDirectory(t *testing.T) { + for _, kind := range []string{"nodes", "placements"} { + for _, failure := range []string{"none", "file", "second-file", "directory"} { + t.Run(kind+"/"+failure, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportStepSyncChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "IMPORT_STEP_KIND="+kind, "IMPORT_STEP_FAILURE="+failure) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("import control: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } + } +} + +func TestImportStepSyncChild(t *testing.T) { + kind := os.Getenv("IMPORT_STEP_KIND") + if kind == "" { + t.Skip("isolated filesystem hooks") + } + failure := os.Getenv("IMPORT_STEP_FAILURE") + dir := t.TempDir() + var apply func(bool) error + var snapshot func() any + var reopen func() any + var values func() []string + var wantValues []string + if kind == "nodes" { + store, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + nodes := []NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19001"}, {ServerID: "unchanged", Addr: "127.0.0.1:19001"}} + apply = func(change bool) error { + next := append([]NodeRegistration(nil), nodes...) + if change { + next[0].Addr = "127.0.0.1:19002" + next[1].Addr = "127.0.0.1:19002" + } + return store.ImportNodes(next) + } + snapshot = func() any { + var got []NodeRegistration + for _, node := range nodes { + r, _ := store.GetNodeSnapshot(node.ServerID) + got = append(got, r) + } + return got + } + values = func() []string { + var got []string + for _, node := range nodes { + r, _ := store.GetNodeSnapshot(node.ServerID) + got = append(got, r.Addr) + } + return got + } + wantValues = []string{"127.0.0.1:19002", "127.0.0.1:19002", "127.0.0.1:19001"} + reopen = func() any { + s, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + store = s + return s.ListNodes() + } + } else { + store, err := OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + plans := make([]PlacementPlan, 3) + for i, id := range []string{"a", "b", "unchanged"} { + plans[i] = PlacementPlan{VolumeID: id, DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}} + } + apply = func(change bool) error { + next := make([]PlacementPlan, len(plans)) + copy(next, plans) + for i := range next { + next[i].Candidates = append([]PlacementCandidate(nil), plans[i].Candidates...) + } + if change { + next[0].Candidates[0].ReplicaID = "r2" + next[1].Candidates[0].ReplicaID = "r2" + } + return store.ImportPlans(next) + } + snapshot = func() any { + var got []PlacementIntent + for _, p := range plans { + r, _ := store.GetPlacementSnapshot(p.VolumeID) + got = append(got, r) + } + return got + } + values = func() []string { + var got []string + for _, p := range plans { + r, _ := store.GetPlacementSnapshot(p.VolumeID) + if len(r.Slots) != 1 { + return nil + } + got = append(got, r.Slots[0].ReplicaID) + } + return got + } + wantValues = []string{"r2", "r2", "r1"} + reopen = func() any { + s, err := OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + store = s + return s.ListPlacements() + } + } + if err := apply(false); err != nil { + t.Fatal(err) + } + old := snapshot() + var events []string + fault := errors.New("injected import sync failure") + // Qualify the portable per-file fallback independently of the syncfs path. + useSyncfs := false + durableRecordHooksForTest.Store(&durableRecordHooks{ + batchSyncfs: &useSyncfs, + fileSync: func(file *os.File) error { + events = append(events, "file") + if failure == "file" || failure == "second-file" && len(events) == 2 { + return fault + } + return file.Sync() + }, + dirSync: func(path string) error { + events = append(events, "directory") + if !reflect.DeepEqual(snapshot(), old) { + t.Fatal("step published before its directory barrier") + } + if path != dir { + t.Fatal("wrong import directory barrier") + } + if failure == "directory" { + return fault + } + return syncBindingParent(path) + }, + }) + defer durableRecordHooksForTest.Store(nil) + err := apply(true) + want := []string{"file", "file", "directory"} + if failure == "file" { + want = []string{"file"} + } else if failure == "second-file" { + want = []string{"file", "file"} + } + if !reflect.DeepEqual(events, want) { + t.Fatalf("events %v want %v", events, want) + } + if failure != "none" { + if !errors.Is(err, fault) { + t.Fatalf("sync failure hidden: %v", err) + } + if !reflect.DeepEqual(snapshot(), old) { + t.Fatal("failed step changed the published snapshot") + } + // A failed step requires recovery before any further mutations. + durableRecordHooksForTest.Store(nil) + if err := apply(true); !errors.Is(err, ErrLifecycleRecoveryRequired) { + t.Fatalf("mutation after failed persistence: %v", err) + } + reopen() + if err := apply(true); err != nil { + t.Fatal(err) + } + } else if err != nil { + t.Fatal(err) + } + if got := values(); !reflect.DeepEqual(got, wantValues) { + t.Fatalf("completed import published %v want %v", got, wantValues) + } + completed := snapshot() + durableRecordHooksForTest.Store(nil) + if !reflect.DeepEqual(reopen(), completed) { + t.Fatal("completed import did not survive reopen") + } + if got := values(); !reflect.DeepEqual(got, wantValues) { + t.Fatalf("reopened store holds %v want %v", got, wantValues) + } + events = nil + durableRecordHooksForTest.Store(&durableRecordHooks{fileSync: func(*os.File) error { return fmt.Errorf("unchanged file synced") }, dirSync: func(string) error { return fmt.Errorf("unchanged directory synced") }}) + if err := apply(true); err != nil { + t.Fatalf("unchanged step did I/O: %v", err) + } +} diff --git a/seaweed-block/core/lifecycle/import_syncfs_test.go b/seaweed-block/core/lifecycle/import_syncfs_test.go new file mode 100644 index 0000000000..5f9eaa0162 --- /dev/null +++ b/seaweed-block/core/lifecycle/import_syncfs_test.go @@ -0,0 +1,379 @@ +//go:build linux + +package lifecycle + +import ( + "context" + "encoding/json" + "errors" + "os" + "os/exec" + "path/filepath" + "reflect" + "testing" + "time" + + "golang.org/x/sys/unix" +) + +func TestImportBatchStagesAllFilesBeforeAnyRename(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportBatchStageChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "IMPORT_BATCH_STAGE_CHILD=1") + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("batch stage control: %v context=%v\n%s", err, ctx.Err(), out) + } +} + +func TestImportBatchStageChild(t *testing.T) { + if os.Getenv("IMPORT_BATCH_STAGE_CHILD") == "" { + t.Skip("isolated filesystem hooks") + } + dir := t.TempDir() + s, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + checked := false + useSyncfs := true + durableRecordHooksForTest.Store(&durableRecordHooks{batchSyncfs: &useSyncfs, crash: func(point string) { + if point != "before-rename" || checked { + return + } + checked = true + temps, err := filepath.Glob(filepath.Join(dir, "*.tmp")) + if err != nil { + t.Fatal(err) + } + if len(temps) != 2 { + t.Fatalf("first rename has %d staged files, want 2", len(temps)) + } + }}) + defer durableRecordHooksForTest.Store(nil) + if err := s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}}); err != nil { + t.Fatal(err) + } + if !checked { + t.Fatal("rename boundary not observed") + } +} + +func TestImportSyncfsFailureAndOrdering(t *testing.T) { + for _, kind := range []string{"nodes", "placements"} { + for _, mode := range []string{"success", "failure", "old-kernel"} { + t.Run(kind+"/"+mode, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportSyncfsChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "IMPORT_SYNCFS_KIND="+kind, "IMPORT_SYNCFS_MODE="+mode) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("syncfs control: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } + } +} + +func TestImportSyncfsChild(t *testing.T) { + kind := os.Getenv("IMPORT_SYNCFS_KIND") + if kind == "" { + t.Skip("isolated filesystem hooks") + } + mode := os.Getenv("IMPORT_SYNCFS_MODE") + dir := t.TempDir() + var apply func() error + var reopen func() + var snapshot func() int + if kind == "nodes" { + var s *NodeInventoryStore + reopen = func() { + var err error + s, err = OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + } + apply = func() error { + return s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}}) + } + snapshot = func() int { + n := 0 + for _, id := range []string{"a", "b"} { + if _, ok := s.GetNodeSnapshot(id); ok { + n++ + } + } + return n + } + } else { + var s *PlacementIntentStore + reopen = func() { + var err error + s, err = OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + } + apply = func() error { + return s.ImportPlans([]PlacementPlan{{VolumeID: "a", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}, {VolumeID: "b", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}}) + } + snapshot = func() int { + n := 0 + for _, id := range []string{"a", "b"} { + if _, ok := s.GetPlacementSnapshot(id); ok { + n++ + } + } + return n + } + } + reopen() + useSyncfs := mode != "old-kernel" + fault := errors.New("injected filesystem writeback failure") + var events []string + var failedTemps []string + install := func(fail bool) { + durableRecordHooksForTest.Store(&durableRecordHooks{ + batchSyncfs: &useSyncfs, + crash: func(point string) { + if point == "batch-open" { + temps, _ := filepath.Glob(filepath.Join(dir, "*.tmp")) + if len(temps) != 0 { + t.Fatal("syncfs fd opened after temp writes") + } + events = append(events, "open") + } + if point == "before-rename" { + if useSyncfs && !reflect.DeepEqual(events, []string{"open", "syncfs"}) && !reflect.DeepEqual(events, []string{"open", "syncfs", "rename"}) { + t.Fatalf("rename before syncfs completed: %v", events) + } + events = append(events, "rename") + } + }, + fileSync: func(f *os.File) error { + if useSyncfs { + t.Fatal("syncfs path used per-file fsync") + } + events = append(events, "file") + return f.Sync() + }, + fsSync: func(fd *os.File) error { + if fd.Name() != dir { + t.Fatal("wrong filesystem fd") + } + for _, name := range []string{"a.json", "b.json"} { + if _, err := os.Stat(filepath.Join(dir, name)); !os.IsNotExist(err) { + t.Fatalf("final record visible before syncfs: %s %v", name, err) + } + } + temps, _ := filepath.Glob(filepath.Join(dir, "*.tmp")) + if len(temps) != 2 { + t.Fatalf("staged temps=%v", temps) + } + if snapshot() != 0 { + t.Fatal("published before syncfs") + } + if fail { + failedTemps = temps + events = append(events, "syncfs") + return fault + } + for _, temp := range temps { + for _, old := range failedTemps { + if temp == old { + t.Fatal("reused failed temp") + } + } + } + if err := syncRecordFilesystem(fd); err != nil { + return err + } + events = append(events, "syncfs") + return nil + }, + dirSync: func(path string) error { + if snapshot() != 0 { + t.Fatal("published before directory barrier") + } + events = append(events, "directory") + return syncBindingParent(path) + }, + }) + } + defer durableRecordHooksForTest.Store(nil) + install(mode == "failure") + err := apply() + if mode == "failure" { + if !errors.Is(err, fault) || !reflect.DeepEqual(events, []string{"open", "syncfs"}) { + t.Fatalf("failed syncfs retried/renamed: %v %v", events, err) + } + if snapshot() != 0 { + t.Fatal("failed import published") + } + if err := apply(); !errors.Is(err, ErrLifecycleRecoveryRequired) { + t.Fatalf("failed store admitted retry: %v", err) + } + if !reflect.DeepEqual(events, []string{"open", "syncfs"}) { + t.Fatal("poisoned retry performed I/O") + } + durableRecordHooksForTest.Store(nil) + reopen() + events = nil + install(false) + err = apply() + } + if err != nil { + t.Fatal(err) + } + want := []string{"open", "syncfs", "rename", "rename", "directory"} + if !useSyncfs { + want = []string{"file", "rename", "file", "rename", "directory"} + } + if !reflect.DeepEqual(events, want) { + t.Fatalf("events=%v want=%v", events, want) + } + if snapshot() != 2 { + t.Fatal("successful import not published") + } + durableRecordHooksForTest.Store(nil) + reopen() + if snapshot() != 2 { + t.Fatal("completed import lost on reopen") + } +} + +// Returned-error controls complement the process-crash ordering controls: +// the published view stays old while complete disk records may be old or new. +func TestImportSyncfsReturnedFailurePolicyAndReplay(t *testing.T) { + for _, kind := range []string{"nodes", "placements"} { + for _, mode := range []string{"syncfs-failure", "syncfs-second-rename", "syncfs-directory"} { + t.Run(kind+"/"+mode, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestRecordEqualityRecoveryChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "RECORD_RECOVERY_KIND="+kind, "RECORD_RECOVERY_MODE="+mode) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("returned syncfs failure control: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } + } +} + +func syncfsFailureReopenedView(old any, mode string) any { + changed := func(id string) bool { + return mode == "syncfs-directory" || (mode == "syncfs-second-rename" && id == "a") + } + switch records := old.(type) { + case []NodeRegistration: + out := make([]NodeRegistration, len(records)) + for i, rec := range records { + out[i] = copyNodeRegistration(rec) + if changed(rec.ServerID) { + out[i].Addr = "127.0.0.1:19002" + } + } + return out + case []PlacementIntent: + out := make([]PlacementIntent, len(records)) + for i, rec := range records { + out[i] = copyPlacementIntent(rec) + if changed(rec.VolumeID) { + out[i].Slots[0].ReplicaID = "r2" + } + } + return out + default: + panic("unexpected fixture records") + } +} + +func TestSyncfsKernelGate(t *testing.T) { + for release, want := range map[string]bool{"5.7.19": false, "5.8.0": true, "6.8.0-azure": true, "4.19.0": false, "unknown": false, "5.x.0": false} { + if got := kernelHasSyncfsErrors(release); got != want { + t.Errorf("%s: got %v want %v", release, got, want) + } + } +} + +func TestImportSyncfsCrashBoundaries(t *testing.T) { + for _, point := range []string{"before-syncfs", "after-syncfs", "after-rename"} { + t.Run(point, func(t *testing.T) { + dir := t.TempDir() + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportSyncfsCrashChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "IMPORT_CRASH_DIR="+dir, "IMPORT_CRASH_POINT="+point) + out, err := cmd.CombinedOutput() + var exit *exec.ExitError + if ctx.Err() != nil || !errors.As(err, &exit) || exit.ExitCode() != 86 { + t.Fatalf("crash child: %v context=%v\n%s", err, ctx.Err(), out) + } + s, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + want := 0 + if point == "after-rename" { + want = 1 + } + if len(s.ListNodes()) != want { + t.Fatalf("reopen records=%v want=%d", s.ListNodes(), want) + } + for _, rec := range s.ListNodes() { + if rec.ServerID != "a" || rec.Addr != "127.0.0.1:19001" { + t.Fatalf("incomplete record: %+v", rec) + } + } + // A malformed final name is refused, never silently admitted; leftover + // unsynced temp names are ignored. This is a process-crash ordering + // control, not a claim to simulate a machine power loss. + if err := os.WriteFile(filepath.Join(dir, "broken.json"), []byte(`{"server_id":`), 0600); err != nil { + t.Fatal(err) + } + if _, err := OpenNodeInventoryStore(dir); err == nil { + t.Fatal("torn JSON accepted") + } + }) + } +} + +func TestImportSyncfsCrashChild(t *testing.T) { + dir := os.Getenv("IMPORT_CRASH_DIR") + if dir == "" { + t.Skip("bounded crash child") + } + s, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + useSyncfs := true + durableRecordHooksForTest.Store(&durableRecordHooks{batchSyncfs: &useSyncfs, crash: func(point string) { + if point == os.Getenv("IMPORT_CRASH_POINT") { + os.Exit(86) + } + }}) + if err := s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}}); err != nil { + t.Fatal(err) + } + raw, _ := json.Marshal(s.ListNodes()) + t.Fatalf("crash boundary not reached: %s", raw) +} + +func TestSyncfsFilesystemGate(t *testing.T) { + for name, tc := range map[string]struct { + magic uint32 + want bool + }{ + "ext4": {unix.EXT4_SUPER_MAGIC, true}, "xfs": {unix.XFS_SUPER_MAGIC, true}, "btrfs": {unix.BTRFS_SUPER_MAGIC, true}, "tmpfs": {unix.TMPFS_MAGIC, true}, + "overlay": {unix.OVERLAYFS_SUPER_MAGIC, false}, "fuse": {unix.FUSE_SUPER_MAGIC, false}, "nfs": {unix.NFS_SUPER_MAGIC, false}, "unknown": {0, false}, + } { + if got := filesystemReportsSyncfsErrors(tc.magic); got != tc.want { + t.Errorf("%s: got %v want %v", name, got, tc.want) + } + } + if recordBatchSyncfsSupported(filepath.Join(t.TempDir(), "missing")) { + t.Error("an unreadable records directory selected syncfs") + } +} diff --git a/seaweed-block/core/lifecycle/layout_identity_test.go b/seaweed-block/core/lifecycle/layout_identity_test.go index da9a6fb8e5..1318622b3d 100644 --- a/seaweed-block/core/lifecycle/layout_identity_test.go +++ b/seaweed-block/core/lifecycle/layout_identity_test.go @@ -126,6 +126,13 @@ func TestLifecycleLayoutIdentity(t *testing.T) { t.Fatal(err) } failed = false + if _, err := loaded.CreateVolume(failedSpec); !errors.Is(err, ErrLifecycleRecoveryRequired) { + t.Fatalf("retry before recovery: %v", err) + } + loaded, err = OpenFileStore(dir) + if err != nil { + t.Fatal(err) + } b, err = loaded.CreateVolume(failedSpec) if err != nil || b.Spec.LayoutID != written.Spec.LayoutID { t.Fatalf("unknown put retry changed identity: %v %+v", err, b) diff --git a/seaweed-block/core/lifecycle/layout_redraw_test.go b/seaweed-block/core/lifecycle/layout_redraw_test.go index 96b67b022b..b2a96a3a5c 100644 --- a/seaweed-block/core/lifecycle/layout_redraw_test.go +++ b/seaweed-block/core/lifecycle/layout_redraw_test.go @@ -61,8 +61,15 @@ func TestRedrawPendingLayoutID(t *testing.T) { t.Fatal(e) } fail = false + if _, e := s.CreateVolume(spec); !errors.Is(e, ErrLifecycleRecoveryRequired) { + t.Fatalf("retry before recovery: %v", e) + } + s, e = OpenFileStore(s.dir) + if e != nil { + t.Fatal(e) + } // Exercise the public retry path, including metadata enrichment. It - // must settle disk B before a metadata put could overwrite it with A. + // must preserve recovered disk B before a metadata put could overwrite it with A. retry := spec retry.PVCName, retry.PVName = "claim", "pv" public, retryErr := s.CreateVolume(retry) diff --git a/seaweed-block/core/lifecycle/node_import_freshness_test.go b/seaweed-block/core/lifecycle/node_import_freshness_test.go new file mode 100644 index 0000000000..8c7dba0929 --- /dev/null +++ b/seaweed-block/core/lifecycle/node_import_freshness_test.go @@ -0,0 +1,95 @@ +//go:build linux + +package lifecycle + +import ( + "testing" + "time" +) + +func TestUnchangedNodeRestartDoesNotRefreshAStaleObservation(t *testing.T) { + dir := t.TempDir() + now := time.Now().UTC() + oldSeen := now.Add(-2 * time.Hour) + reg := NodeRegistration{ServerID: "node", Addr: "127.0.0.1:19001", SeenAt: oldSeen} + store, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + if _, err := store.RegisterNode(reg); err != nil { + t.Fatal(err) + } + store, err = OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + reg.SeenAt = time.Time{} // cluster-spec registrations have no observation time + if _, err := store.RegisterNode(reg); err != nil { + t.Fatal(err) + } + got, ok := store.GetNodeSnapshot("node") + if !ok { + t.Fatal("node missing after re-import") + } + intent := PlacementIntent{VolumeID: "volume", DesiredRF: 1, Slots: []PlacementSlotIntent{{ServerID: "node", PoolID: "pool", Source: PlacementSourceBlankPool}}} + verified := VerifyPlacementIntent(intent, []NodeRegistration{got}, VerificationConfig{Now: now, FreshnessWindow: time.Hour}) + if verified.Verified || verified.Reason != VerifyReasonStaleObservation { + t.Fatalf("restart laundered a stale node fresh: seen=%s result=%+v", got.SeenAt, verified) + } + if !got.SeenAt.Equal(oldSeen) { + t.Fatalf("observation changed: got %s want %s", got.SeenAt, oldSeen) + } + // An explicit timestamp on otherwise identical declarative input cannot + // impersonate a heartbeat either. + reg.SeenAt = now + if _, err := store.RegisterNode(reg); err != nil { + t.Fatal(err) + } + got, _ = store.GetNodeSnapshot("node") + if !got.SeenAt.Equal(oldSeen) { + t.Fatal("timestamp-only registration refreshed the observation") + } + reopened, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + got, _ = reopened.GetNodeSnapshot("node") + if !got.SeenAt.Equal(oldSeen) { + t.Fatal("reloaded observation did not retain its original time") + } +} + +func TestChangedNodeImportDoesNotRefreshAStaleObservation(t *testing.T) { + dir := t.TempDir() + now := time.Now().UTC() + oldSeen := now.Add(-2 * time.Hour) + store, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + reg := NodeRegistration{ServerID: "node", Addr: "127.0.0.1:19001", SeenAt: oldSeen, Pools: []StoragePool{{PoolID: "pool", BlockSize: 4096, TotalBytes: 1 << 30}}} + if _, err := store.RegisterNode(reg); err != nil { + t.Fatal(err) + } + store, err = OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + reg.SeenAt = time.Time{} + reg.Pools = []StoragePool{{PoolID: "pool", BlockSize: 4096, TotalBytes: 2 << 30}} + if err := store.ImportNodes([]NodeRegistration{reg}); err != nil { + t.Fatal(err) + } + got, ok := store.GetNodeSnapshot("node") + if !ok || got.Pools[0].TotalBytes != 2<<30 { + t.Fatalf("changed declaration not imported: %+v", got) + } + if !got.SeenAt.Equal(oldSeen) { + t.Fatalf("changed declaration refreshed the observation: got %s want %s", got.SeenAt, oldSeen) + } + intent := PlacementIntent{VolumeID: "volume", DesiredRF: 1, Slots: []PlacementSlotIntent{{ServerID: "node", PoolID: "pool", Source: PlacementSourceBlankPool}}} + verified := VerifyPlacementIntent(intent, []NodeRegistration{got}, VerificationConfig{Now: now, FreshnessWindow: time.Hour}) + if verified.Verified || verified.Reason != VerifyReasonStaleObservation { + t.Fatalf("restart laundered a stale node fresh: %+v", verified) + } +} diff --git a/seaweed-block/core/lifecycle/node_inventory.go b/seaweed-block/core/lifecycle/node_inventory.go index 20027f6e09..09db0bc2a9 100644 --- a/seaweed-block/core/lifecycle/node_inventory.go +++ b/seaweed-block/core/lifecycle/node_inventory.go @@ -7,6 +7,7 @@ import ( "log" "os" "path/filepath" + "reflect" "sort" "sync" "time" @@ -65,11 +66,13 @@ type NodeRegistration struct { // NodeInventoryStore persists one JSON registration record per server. type NodeInventoryStore struct { - mu sync.Mutex - dir string - records map[string]NodeRegistration - published sync.Map // committed NodeRegistration values; holder host checks never take mu (INV-WS-RENEW-NONBLOCKING-001) - failWrite func() error // tests: a non-nil error fails the next record write or removal + mu sync.Mutex + dir string + writeErr error // failed persistence requires reopen before another mutation + onPersistenceFailure PersistenceFailureHandler + records map[string]NodeRegistration + published sync.Map // committed NodeRegistration values; holder host checks never take mu (INV-WS-RENEW-NONBLOCKING-001) + failWrite func() error // tests: a non-nil error fails the next record write or removal } // SetPersistHookForTest installs (nil clears) a callback that each later @@ -81,6 +84,14 @@ func (s *NodeInventoryStore) SetPersistHookForTest(hook func() error) { s.failWrite = hook } +// SetPersistenceFailureHandler installs the process host policy before serving. +// The callback runs under the writer mutex and must not reenter the store. +func (s *NodeInventoryStore) SetPersistenceFailureHandler(handler PersistenceFailureHandler) { + s.mu.Lock() + defer s.mu.Unlock() + s.onPersistenceFailure = handler +} + // OpenNodeInventoryStore opens or creates a node inventory store. func OpenNodeInventoryStore(dir string) (*NodeInventoryStore, error) { if dir == "" { @@ -111,6 +122,11 @@ func OpenNodeInventoryStore(dir string) (*NodeInventoryStore, error) { if err := s.load(); err != nil { return nil, err } + // Loaded names may come from a failed rename/barrier attempt. Establish + // their durability before exposing them or taking an equality shortcut. + if err := syncRecordDirectory(dir); err != nil { + return nil, &RecordPersistenceError{Store: dir, Record: "", Err: err} + } for id, rec := range s.records { s.published.Store(id, copyNodeRegistration(rec)) } @@ -137,24 +153,29 @@ func (s *NodeInventoryStore) HoldWritesForTest() (release func()) { } // RegisterNode records the latest observed inventory for a server. -// Repeating registration replaces observation fields, but still does not -// publish authority or readiness. +// Changed registration replaces observation fields, but still does not +// publish authority or readiness. A declaration without SeenAt retains the +// stored one (INV-NODE-REGISTRATION-FRESHNESS-001); only a heartbeat adds fresh evidence. func (s *NodeInventoryStore) RegisterNode(reg NodeRegistration) (NodeRegistration, error) { if err := validateNodeRegistration(reg); err != nil { return NodeRegistration{}, err } s.mu.Lock() defer s.mu.Unlock() - if reg.SeenAt.IsZero() { - reg.SeenAt = time.Now().UTC() + if err := recoveryRequired(s.writeErr); err != nil { + return NodeRegistration{}, err + } + reg, changed := s.registrationLocked(reg) + if !changed { + return copyNodeRegistration(reg), nil } - reg = normalizeNodeRegistration(reg) if err := s.putLocked(reg); err != nil { + latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure) return NodeRegistration{}, err } s.records[reg.ServerID] = reg s.published.Store(reg.ServerID, copyNodeRegistration(reg)) // committed: the file is in place - return reg, nil + return copyNodeRegistration(reg), nil } // RemoveNode deletes one registration record. Missing nodes are a @@ -165,15 +186,18 @@ func (s *NodeInventoryStore) RemoveNode(serverID string) error { } s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return err + } if s.failWrite != nil { if err := s.failWrite(); err != nil { return fmt.Errorf("lifecycle: remove node %s: %w", serverID, err) } } - delete(s.records, serverID) if err := os.Remove(s.path(serverID)); err != nil && !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("lifecycle: remove node %s: %w", serverID, err) } + delete(s.records, serverID) s.published.Delete(serverID) // committed: the file is gone return nil } @@ -327,3 +351,82 @@ func copyStringMap(in map[string]string) map[string]string { } return out } + +// ImportNodes replays one startup node step. All changed data is durable before +// rename; one directory barrier precedes publication of the changed snapshots. +func (s *NodeInventoryStore) ImportNodes(nodes []NodeRegistration) error { + s.mu.Lock() + defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return err + } + changed := make(map[string]NodeRegistration) + seen := make(map[string]bool) + order := make([]string, 0, len(nodes)) + for _, node := range nodes { + if err := validateNodeRegistration(node); err != nil { + return fmt.Errorf("lifecycle: import node %s: %w", node.ServerID, err) + } + reg, differs := s.registrationLocked(node) + if !seen[reg.ServerID] { + order = append(order, reg.ServerID) + seen[reg.ServerID] = true + } + if !differs { + delete(changed, reg.ServerID) + continue + } + changed[reg.ServerID] = reg + } + writes := make([]recordWrite, 0, len(order)) + for _, id := range order { + if _, ok := changed[id]; !ok { + continue + } + if s.failWrite != nil { + if err := s.failWrite(); err != nil { + return err + } + } + raw, err := json.MarshalIndent(changed[id], "", " ") + if err != nil { + return fmt.Errorf("lifecycle: marshal node %s: %w", id, err) + } + writes = append(writes, recordWrite{name: id + ".json", raw: raw}) + } + if err := writeRecordBatchDurably(s.dir, writes); err != nil { + latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure) + return err + } + for _, id := range order { + if _, ok := changed[id]; !ok { + continue + } + reg := changed[id] + s.records[id] = reg + s.published.Store(id, copyNodeRegistration(reg)) + } + return nil +} + +func (s *NodeInventoryStore) registrationLocked(reg NodeRegistration) (NodeRegistration, bool) { + // Retain an independent value: a caller may reuse its pool slices. + reg = copyNodeRegistration(reg) + if old, ok := s.records[reg.ServerID]; ok { + unchanged := reg + unchanged.SeenAt = old.SeenAt + if reflect.DeepEqual(old, unchanged) { + // Declarative replay is not a new observation. Heartbeats supply + // freshness independently of this durable registration. + return copyNodeRegistration(old), false + } + if reg.SeenAt.IsZero() { + // A changed declaration is not an observation either. + reg.SeenAt = old.SeenAt + } + } + if reg.SeenAt.IsZero() { + reg.SeenAt = time.Now().UTC() + } + return reg, true +} diff --git a/seaweed-block/core/lifecycle/placement_intent.go b/seaweed-block/core/lifecycle/placement_intent.go index 69216ae01c..c717579e50 100644 --- a/seaweed-block/core/lifecycle/placement_intent.go +++ b/seaweed-block/core/lifecycle/placement_intent.go @@ -7,6 +7,7 @@ import ( "log" "os" "path/filepath" + "slices" "sort" "sync" ) @@ -36,10 +37,20 @@ type PlacementIntent struct { // PlacementIntentStore persists one placement intent per volume. type PlacementIntentStore struct { - mu sync.Mutex - dir string - records map[string]PlacementIntent - published sync.Map // committed immutable PlacementIntent values; renewal never takes mu + mu sync.Mutex + dir string + writeErr error // failed persistence requires reopen before another mutation + onPersistenceFailure PersistenceFailureHandler + records map[string]PlacementIntent + published sync.Map // committed immutable PlacementIntent values; renewal never takes mu +} + +// SetPersistenceFailureHandler installs the process host policy before serving. +// The callback runs under the writer mutex and must not reenter the store. +func (s *PlacementIntentStore) SetPersistenceFailureHandler(handler PersistenceFailureHandler) { + s.mu.Lock() + defer s.mu.Unlock() + s.onPersistenceFailure = handler } // OpenPlacementIntentStore opens or creates a placement intent store. @@ -72,6 +83,11 @@ func OpenPlacementIntentStore(dir string) (*PlacementIntentStore, error) { if err := s.load(); err != nil { return nil, err } + // Loaded names may come from a failed rename/barrier attempt. Establish + // their durability before exposing them or taking an equality shortcut. + if err := syncRecordDirectory(dir); err != nil { + return nil, &RecordPersistenceError{Store: dir, Record: "", Err: err} + } for volume, rec := range s.records { s.published.Store(volume, copyPlacementIntent(rec)) } @@ -81,32 +97,21 @@ func OpenPlacementIntentStore(dir string) (*PlacementIntentStore, error) { // ApplyPlan records placement intent from a sufficient plan. Insufficient // plans are rejected rather than persisted as partial authority-shaped state. func (s *PlacementIntentStore) ApplyPlan(plan PlacementPlan) (PlacementIntent, error) { - if !plan.EnoughCandidates() { - return PlacementIntent{}, ErrInsufficientPlacementCandidates - } - intent := PlacementIntent{ - VolumeID: plan.VolumeID, - DesiredRF: plan.DesiredRF, - Slots: make([]PlacementSlotIntent, 0, plan.DesiredRF), - } - for _, candidate := range plan.Candidates[:plan.DesiredRF] { - intent.Slots = append(intent.Slots, PlacementSlotIntent{ - ServerID: candidate.ServerID, - PoolID: candidate.PoolID, - ReplicaID: candidate.ReplicaID, - Source: candidate.Source, - DataAddr: candidate.DataAddr, - CtrlAddr: candidate.CtrlAddr, - ISCSIListenPort: candidate.ISCSIListenPort, - NVMeListenPort: candidate.NVMeListenPort, - }) - } - if err := validatePlacementIntent(intent); err != nil { + intent, err := placementIntentFromPlan(plan) + if err != nil { return PlacementIntent{}, err } s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return PlacementIntent{}, err + } + // Equal input already has a durable record; preserve it on restart. + if old, ok := s.records[intent.VolumeID]; ok && old.DesiredRF == intent.DesiredRF && slices.Equal(old.Slots, intent.Slots) { + return copyPlacementIntent(old), nil + } if err := s.putLocked(intent); err != nil { + latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure) return PlacementIntent{}, err } s.records[intent.VolumeID] = intent @@ -122,6 +127,9 @@ func (s *PlacementIntentStore) DeletePlacement(volumeID string) error { } s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return err + } if err := os.Remove(s.path(volumeID)); err != nil && !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("lifecycle: remove placement intent %s: %w", volumeID, err) } @@ -262,3 +270,83 @@ func copyPlacementIntent(in PlacementIntent) PlacementIntent { out.Slots = append([]PlacementSlotIntent(nil), in.Slots...) return out } + +// ImportPlans replays one startup placement step and publishes only after +// the changed files and their shared directory barrier have completed. +func (s *PlacementIntentStore) ImportPlans(plans []PlacementPlan) error { + s.mu.Lock() + defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return err + } + changed := make(map[string]PlacementIntent) + seen := make(map[string]bool) + order := make([]string, 0, len(plans)) + for _, plan := range plans { + intent, err := placementIntentFromPlan(plan) + if err != nil { + return fmt.Errorf("lifecycle: import placement intent %s: %w", plan.VolumeID, err) + } + old, ok := s.records[intent.VolumeID] + if !seen[intent.VolumeID] { + order = append(order, intent.VolumeID) + seen[intent.VolumeID] = true + } + if ok && old.DesiredRF == intent.DesiredRF && slices.Equal(old.Slots, intent.Slots) { + delete(changed, intent.VolumeID) + continue + } + changed[intent.VolumeID] = intent + } + writes := make([]recordWrite, 0, len(order)) + for _, id := range order { + if _, ok := changed[id]; !ok { + continue + } + raw, err := json.MarshalIndent(changed[id], "", " ") + if err != nil { + return fmt.Errorf("lifecycle: marshal placement intent %s: %w", id, err) + } + writes = append(writes, recordWrite{name: id + ".json", raw: raw}) + } + if err := writeRecordBatchDurably(s.dir, writes); err != nil { + latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure) + return err + } + for _, id := range order { + if _, ok := changed[id]; !ok { + continue + } + intent := changed[id] + s.records[id] = intent + s.published.Store(id, copyPlacementIntent(intent)) + } + return nil +} + +func placementIntentFromPlan(plan PlacementPlan) (PlacementIntent, error) { + if !plan.EnoughCandidates() { + return PlacementIntent{}, ErrInsufficientPlacementCandidates + } + intent := PlacementIntent{ + VolumeID: plan.VolumeID, + DesiredRF: plan.DesiredRF, + Slots: make([]PlacementSlotIntent, 0, plan.DesiredRF), + } + for _, candidate := range plan.Candidates[:plan.DesiredRF] { + intent.Slots = append(intent.Slots, PlacementSlotIntent{ + ServerID: candidate.ServerID, + PoolID: candidate.PoolID, + ReplicaID: candidate.ReplicaID, + Source: candidate.Source, + DataAddr: candidate.DataAddr, + CtrlAddr: candidate.CtrlAddr, + ISCSIListenPort: candidate.ISCSIListenPort, + NVMeListenPort: candidate.NVMeListenPort, + }) + } + if err := validatePlacementIntent(intent); err != nil { + return PlacementIntent{}, err + } + return intent, nil +} diff --git a/seaweed-block/core/lifecycle/placement_snapshot_test.go b/seaweed-block/core/lifecycle/placement_snapshot_test.go index e74baa86aa..4f3dec9b5e 100644 --- a/seaweed-block/core/lifecycle/placement_snapshot_test.go +++ b/seaweed-block/core/lifecycle/placement_snapshot_test.go @@ -135,6 +135,7 @@ func TestPlacementSnapshotFailedCommitStaysCommitted(t *testing.T) { if ok != existed || !reflect.DeepEqual(got, before) { t.Fatal("reopen did not retain the committed placement") } + s = reopened // failed persistence requires reopening before further writes if _, err = s.ApplyPlan(plan); err != nil { t.Fatal("unblocked commit", err) } diff --git a/seaweed-block/core/lifecycle/placement_unchanged_test.go b/seaweed-block/core/lifecycle/placement_unchanged_test.go new file mode 100644 index 0000000000..1e44c407a9 --- /dev/null +++ b/seaweed-block/core/lifecycle/placement_unchanged_test.go @@ -0,0 +1,60 @@ +//go:build linux + +package lifecycle + +import ( + "os" + "path/filepath" + "testing" +) + +func TestPlacementRepeatKeepsRecordAndChangedPlanReplacesIt(t *testing.T) { + dir := t.TempDir() + store, err := OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + plan := PlacementPlan{VolumeID: "volume", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}} + if _, err := store.ApplyPlan(plan); err != nil { + t.Fatal(err) + } + path := filepath.Join(dir, "volume.json") + original, err := os.Stat(path) + if err != nil { + t.Fatal(err) + } + // Reloading must not cause an otherwise equal import to rewrite the file. + store, err = OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + if _, err := store.ApplyPlan(plan); err != nil { + t.Fatal(err) + } + repeated, err := os.Stat(path) + if err != nil { + t.Fatal(err) + } + if !os.SameFile(original, repeated) || !original.ModTime().Equal(repeated.ModTime()) { + t.Fatal("equal placement plan rewrote its durable record") + } + plan.Candidates[0].ReplicaID = "r2" + if _, err := store.ApplyPlan(plan); err != nil { + t.Fatal(err) + } + changed, err := os.Stat(path) + if err != nil { + t.Fatal(err) + } + if os.SameFile(repeated, changed) { + t.Fatal("changed placement did not replace its record") + } + reopened, err := OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + got, ok := reopened.GetPlacementSnapshot("volume") + if !ok || len(got.Slots) != 1 || got.Slots[0].ReplicaID != "r2" { + t.Fatalf("changed plan did not survive reload: %+v", got) + } +} diff --git a/seaweed-block/core/lifecycle/record_file.go b/seaweed-block/core/lifecycle/record_file.go index 04e5b5e772..eb47298c64 100644 --- a/seaweed-block/core/lifecycle/record_file.go +++ b/seaweed-block/core/lifecycle/record_file.go @@ -1,18 +1,63 @@ package lifecycle import ( + "errors" "fmt" "os" "path/filepath" "sync/atomic" ) +// ErrLifecycleRecoveryRequired means a failed persistence operation may have +// changed disk. Reopen the store before making further mutations. +var ErrLifecycleRecoveryRequired = errors.New("lifecycle: store recovery required") + +// RecordPersistenceError identifies the operation whose durable outcome is +// uncertain. A process host can fail-stop rather than remain alive and poisoned. +type RecordPersistenceError struct { + Store string + Record string + Err error +} + +func (e *RecordPersistenceError) Error() string { + return fmt.Sprintf("lifecycle: persist store %q record %q: %v", e.Store, e.Record, e.Err) +} + +func (e *RecordPersistenceError) Unwrap() error { return e.Err } + +// PersistenceFailureHandler is called synchronously after a failed I/O has +// poisoned a store. It must not reenter a store; production exits the process. +type PersistenceFailureHandler func(*RecordPersistenceError) + +// Only a write that may have touched disk poisons the store; a marshal error +// happens before any I/O, so the caller can correct the input and retry. +func latchPersistenceFailure(err error, prior *error, handler PersistenceFailureHandler) { + var failure *RecordPersistenceError + if !errors.As(err, &failure) { + return + } + *prior = err + if handler != nil { + handler(failure) + } +} + +func recoveryRequired(writeErr error) error { + if writeErr == nil { + return nil + } + return fmt.Errorf("%w: %v", ErrLifecycleRecoveryRequired, writeErr) +} + // Hooks are installed only in isolated subprocess tests. Production uses // the real filesystem operations; one helper owns all publication seams. type durableRecordHooks struct { - crash func(string) - fileSync func(*os.File) error - dirSync func(string) error + crash func(string) + fileSync func(*os.File) error + dirSync func(string) error + batchSyncfs *bool + fsSync func(*os.File) error } var durableRecordHooksForTest atomic.Pointer[durableRecordHooks] @@ -20,42 +65,170 @@ var durableRecordHooksForTest atomic.Pointer[durableRecordHooks] // writeRecordDurably implements INV-LIFECYCLE-STORE-DURABLE-001 for puts and // replacements. A post-rename error may leave the new record on disk. func writeRecordDurably(dir, name string, raw []byte) error { + if err := writeRecordBeforeDirectorySync(dir, name, raw); err != nil { + return &RecordPersistenceError{Store: dir, Record: name, Err: err} + } + if err := syncRecordDirectory(dir); err != nil { + return &RecordPersistenceError{Store: dir, Record: name, Err: err} + } + return nil +} + +type recordWrite struct { + name string + raw []byte +} + +// A startup import makes all changed data durable before rename, then shares +// a directory barrier before publication. A failed step leaves complete old/new +// names. Linux >= 5.8 on ext4, xfs, btrfs or tmpfs uses one syncfs for staged +// temps; other systems sync each. +func writeRecordBatchDurably(dir string, records []recordWrite) error { + if len(records) == 0 { + return nil + } + useSyncfs := recordBatchSyncfsSupported(dir) + hooks := durableRecordHooksForTest.Load() + if hooks != nil && hooks.batchSyncfs != nil { + useSyncfs = *hooks.batchSyncfs + } + if useSyncfs { + return writeRecordBatchWithSyncfs(dir, records) + } + for _, record := range records { + if err := writeRecordBeforeDirectorySync(dir, record.name, record.raw); err != nil { + return &RecordPersistenceError{Store: dir, Record: record.name, Err: err} + } + } + if err := syncRecordDirectory(dir); err != nil { + return &RecordPersistenceError{Store: dir, Record: "", Err: err} + } + return nil +} + +// ImportDurabilityMode reports the batch persistence path for records under dir. +// Single-record mutations always retain their file and directory fsyncs. +func ImportDurabilityMode(dir string) string { + if recordBatchSyncfsSupported(dir) { + return "syncfs (Linux >= 5.8, local filesystem)" + } + return "per-file fsync (syncfs writeback error reporting unavailable)" +} + +func writeRecordBatchWithSyncfs(dir string, records []recordWrite) error { + // Opening before any write samples the filesystem's writeback errseq. + fd, err := os.Open(dir) + if err != nil { + return &RecordPersistenceError{Store: dir, Record: "", Err: err} + } + defer fd.Close() + hooks := durableRecordHooksForTest.Load() + if hooks != nil && hooks.crash != nil { + hooks.crash("batch-open") + } + temps := make([]string, 0, len(records)) + defer func() { + for _, temp := range temps { + _ = os.Remove(temp) + } + }() + for _, record := range records { + temp, err := writeRecordTemp(dir, record.name, record.raw, false) + if err != nil { + return &RecordPersistenceError{Store: dir, Record: record.name, Err: err} + } + temps = append(temps, temp) + } + fsSync := syncRecordFilesystem + if hooks != nil && hooks.fsSync != nil { + fsSync = hooks.fsSync + } + // Never retry a failed syncfs: it consumes the writeback error. The caller + // poisons the store; recovery creates fresh temps for any subsequent import. + if hooks != nil && hooks.crash != nil { + hooks.crash("before-syncfs") + } + if err := fsSync(fd); err != nil { + return &RecordPersistenceError{Store: dir, Record: "", Err: fmt.Errorf("lifecycle: sync record filesystem: %w", err)} + } + if hooks != nil && hooks.crash != nil { + hooks.crash("after-syncfs") + } + for i, record := range records { + if hooks != nil && hooks.crash != nil { + hooks.crash("before-rename") + } + if err := os.Rename(temps[i], filepath.Join(dir, record.name)); err != nil { + return &RecordPersistenceError{Store: dir, Record: record.name, Err: err} + } + if hooks != nil && hooks.crash != nil { + hooks.crash("after-rename") + } + } + if err := syncRecordDirectory(dir); err != nil { + return &RecordPersistenceError{Store: dir, Record: "", Err: err} + } + return nil +} + +func writeRecordBeforeDirectorySync(dir, name string, raw []byte) error { + temp, err := writeRecordTemp(dir, name, raw, true) + if err != nil { + return err + } + defer os.Remove(temp) + hooks := durableRecordHooksForTest.Load() + if hooks != nil && hooks.crash != nil { + hooks.crash("before-rename") + } + if err := os.Rename(temp, filepath.Join(dir, name)); err != nil { + return fmt.Errorf("lifecycle: rename record %s: %w", name, err) + } + if hooks != nil && hooks.crash != nil { + hooks.crash("after-rename") + } + return nil +} + +func writeRecordTemp(dir, name string, raw []byte, syncFile bool) (temp string, resultErr error) { f, err := os.CreateTemp(dir, name+".*.tmp") if err != nil { - return fmt.Errorf("lifecycle: temp record %s: %w", name, err) + return "", fmt.Errorf("lifecycle: temp record %s: %w", name, err) } - defer os.Remove(f.Name()) + defer func() { + if resultErr != nil { + _ = os.Remove(f.Name()) + } + }() if _, err := f.Write(raw); err != nil { _ = f.Close() - return fmt.Errorf("lifecycle: write record %s: %w", name, err) + return "", fmt.Errorf("lifecycle: write record %s: %w", name, err) } hooks := durableRecordHooksForTest.Load() fileSync := f.Sync if hooks != nil && hooks.fileSync != nil { fileSync = func() error { return hooks.fileSync(f) } } - if err := fileSync(); err != nil { - _ = f.Close() - return fmt.Errorf("lifecycle: sync record %s: %w", name, err) + if syncFile { + if err := fileSync(); err != nil { + _ = f.Close() + return "", fmt.Errorf("lifecycle: sync record %s: %w", name, err) + } } if err := f.Close(); err != nil { - return fmt.Errorf("lifecycle: close record %s: %w", name, err) - } - if hooks != nil && hooks.crash != nil { - hooks.crash("before-rename") - } - if err := os.Rename(f.Name(), filepath.Join(dir, name)); err != nil { - return fmt.Errorf("lifecycle: rename record %s: %w", name, err) - } - if hooks != nil && hooks.crash != nil { - hooks.crash("after-rename") + return "", fmt.Errorf("lifecycle: close record %s: %w", name, err) } + return f.Name(), nil +} + +func syncRecordDirectory(dir string) error { + hooks := durableRecordHooksForTest.Load() dirSync := syncBindingParent if hooks != nil && hooks.dirSync != nil { dirSync = hooks.dirSync } if err := dirSync(dir); err != nil { - return fmt.Errorf("lifecycle: sync record directory %s: %w", name, err) + return fmt.Errorf("lifecycle: sync record directory %s: %w", dir, err) } return nil } diff --git a/seaweed-block/core/lifecycle/record_syncfs_linux.go b/seaweed-block/core/lifecycle/record_syncfs_linux.go new file mode 100644 index 0000000000..5f843056bb --- /dev/null +++ b/seaweed-block/core/lifecycle/record_syncfs_linux.go @@ -0,0 +1,61 @@ +//go:build linux + +package lifecycle + +import ( + "os" + "strconv" + "strings" + + "golang.org/x/sys/unix" +) + +var recordKernelSyncfsErrors = detectRecordSyncfs() + +// recordBatchSyncfsSupported reports whether syncfs on dir's filesystem +// returns the writeback errors a per-file fsync would. Overlay, FUSE and +// network mounts keep per-file fsync: syncfs does not reach their backing files. +func recordBatchSyncfsSupported(dir string) bool { + if !recordKernelSyncfsErrors { + return false + } + var st unix.Statfs_t + if unix.Statfs(dir, &st) != nil { + return false + } + return filesystemReportsSyncfsErrors(uint32(st.Type)) +} + +func filesystemReportsSyncfsErrors(fsType uint32) bool { + switch fsType { + case unix.EXT4_SUPER_MAGIC, unix.XFS_SUPER_MAGIC, unix.BTRFS_SUPER_MAGIC, unix.TMPFS_MAGIC: + return true + } + return false +} + +func detectRecordSyncfs() bool { + var u unix.Utsname + if unix.Uname(&u) != nil { + return false + } + return kernelHasSyncfsErrors(unix.ByteSliceToString(u.Release[:])) +} + +func kernelHasSyncfsErrors(release string) bool { + parts := strings.SplitN(release, ".", 3) + if len(parts) < 2 { + return false + } + major, err := strconv.Atoi(parts[0]) + if err != nil { + return false + } + minor, err := strconv.Atoi(parts[1]) + if err != nil { + return false + } + return major > 5 || major == 5 && minor >= 8 +} + +func syncRecordFilesystem(fd *os.File) error { return unix.Syncfs(int(fd.Fd())) } diff --git a/seaweed-block/core/lifecycle/record_syncfs_other.go b/seaweed-block/core/lifecycle/record_syncfs_other.go new file mode 100644 index 0000000000..2232679853 --- /dev/null +++ b/seaweed-block/core/lifecycle/record_syncfs_other.go @@ -0,0 +1,12 @@ +//go:build !linux + +package lifecycle + +import ( + "fmt" + "os" +) + +func recordBatchSyncfsSupported(string) bool { return false } + +func syncRecordFilesystem(*os.File) error { return fmt.Errorf("syncfs unavailable on this platform") } diff --git a/seaweed-block/core/lifecycle/remove_retry_test.go b/seaweed-block/core/lifecycle/remove_retry_test.go new file mode 100644 index 0000000000..2f5229aec9 --- /dev/null +++ b/seaweed-block/core/lifecycle/remove_retry_test.go @@ -0,0 +1,106 @@ +package lifecycle + +import ( + "os" + "path/filepath" + "testing" + "time" +) + +func TestFailedRemoveKeepsRecordForRetry(t *testing.T) { + for _, kind := range []string{"node", "placement", "volume"} { + t.Run(kind, func(t *testing.T) { + dir := t.TempDir() + var remove func() error + var present func() (record, snapshot bool) + switch kind { + case "node": + s, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + if _, err := s.RegisterNode(NodeRegistration{ServerID: "v", Addr: "127.0.0.1:19001"}); err != nil { + t.Fatal(err) + } + remove = func() error { return s.RemoveNode("v") } + present = func() (bool, bool) { _, a := s.GetNode("v"); _, b := s.GetNodeSnapshot("v"); return a, b } + case "placement": + s, err := OpenPlacementIntentStore(dir) + if err != nil { + t.Fatal(err) + } + if _, err := s.ApplyPlan(PlacementPlan{VolumeID: "v", DesiredRF: 1, Candidates: []PlacementCandidate{{ServerID: "node", ReplicaID: "r1", Source: PlacementSourceExistingReplica}}}); err != nil { + t.Fatal(err) + } + remove = func() error { return s.DeletePlacement("v") } + present = func() (bool, bool) { _, a := s.GetPlacement("v"); _, b := s.GetPlacementSnapshot("v"); return a, b } + case "volume": + s, err := OpenFileStore(dir) + if err != nil { + t.Fatal(err) + } + if _, err := s.CreateVolume(VolumeSpec{VolumeID: "v", SizeBytes: 1 << 20, ReplicationFactor: 1}); err != nil { + t.Fatal(err) + } + remove = func() error { return s.DeleteVolume("v") } + present = func() (bool, bool) { _, a := s.GetVolume("v"); _, b := s.GetVolumeSnapshot("v"); return a, b } + } + path := filepath.Join(dir, "v.json") + backup := path + ".saved" + if err := os.Rename(path, backup); err != nil { + t.Fatal(err) + } + if err := os.Mkdir(path, 0700); err != nil { + t.Fatal(err) + } + blocker := filepath.Join(path, "blocker") + if err := os.WriteFile(blocker, []byte("fixture"), 0600); err != nil { + t.Fatal(err) + } + if err := remove(); err == nil { + t.Fatal("nonempty-directory removal succeeded") + } + if record, snapshot := present(); !record || !snapshot { + t.Fatalf("failed removal hid retry state: record=%v snapshot=%v", record, snapshot) + } + if err := os.Remove(blocker); err != nil { + t.Fatal(err) + } + if err := os.Remove(path); err != nil { + t.Fatal(err) + } + if err := os.Rename(backup, path); err != nil { + t.Fatal(err) + } + if err := remove(); err != nil { + t.Fatalf("later removal retry: %v", err) + } + if record, snapshot := present(); record || snapshot { + t.Fatalf("successful removal left state: record=%v snapshot=%v", record, snapshot) + } + if _, err := os.Stat(path); !os.IsNotExist(err) { + t.Fatalf("record file survived successful retry: %v", err) + } + }) + } +} + +func TestNodeMarshalErrorDoesNotRequireRecovery(t *testing.T) { + s, err := OpenNodeInventoryStore(t.TempDir()) + if err != nil { + t.Fatal(err) + } + var latched []*RecordPersistenceError + s.SetPersistenceFailureHandler(func(f *RecordPersistenceError) { latched = append(latched, f) }) + reg := NodeRegistration{ServerID: "n", Addr: "127.0.0.1:19001", SeenAt: time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC)} + if _, err := s.RegisterNode(reg); err == nil { + t.Fatal("unencodable SeenAt was accepted") + } + reg.SeenAt = time.Now().UTC() + if _, err := s.RegisterNode(reg); err != nil { + t.Fatalf("corrected registration after a marshal error: %v", err) + } + if len(latched) != 0 { + t.Fatalf("marshal error reached the persistence policy: %v", latched) + } +} diff --git a/seaweed-block/core/lifecycle/store.go b/seaweed-block/core/lifecycle/store.go index 7ea6a7c77f..289b02a86b 100644 --- a/seaweed-block/core/lifecycle/store.go +++ b/seaweed-block/core/lifecycle/store.go @@ -67,9 +67,11 @@ type VolumeRecord struct { // FileStore persists one JSON record per volume ID. type FileStore struct { - mu sync.Mutex - dir string - records map[string]VolumeRecord + mu sync.Mutex + dir string + writeErr error // a failed put requires reopen before another mutation + onPersistenceFailure PersistenceFailureHandler + records map[string]VolumeRecord // snap mirrors records as an immutable copy, republished at every change // of records, for lock-free renewal-path reads. snap atomic.Pointer[map[string]VolumeRecord] @@ -97,6 +99,14 @@ func (s *FileStore) GetVolumeSnapshot(volumeID string) (VolumeRecord, bool) { return rec, ok } +// SetPersistenceFailureHandler installs the process host policy before serving. +// The callback runs under the writer mutex and must not reenter the store. +func (s *FileStore) SetPersistenceFailureHandler(handler PersistenceFailureHandler) { + s.mu.Lock() + defer s.mu.Unlock() + s.onPersistenceFailure = handler +} + // OpenFileStore opens or creates a lifecycle intent store. func OpenFileStore(dir string) (*FileStore, error) { if dir == "" { @@ -127,6 +137,11 @@ func OpenFileStore(dir string) (*FileStore, error) { if err := s.load(); err != nil { return nil, err } + // Visible names can come from a failed directory barrier. Recover their + // durability before publication or an equal create can acknowledge them. + if err := syncRecordDirectory(dir); err != nil { + return nil, &RecordPersistenceError{Store: dir, Record: "", Err: err} + } s.publishLocked() return s, nil } @@ -137,6 +152,9 @@ func (s *FileStore) CreateVolume(spec VolumeSpec) (VolumeRecord, error) { spec = normalizeVolumeSpec(spec) s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return VolumeRecord{}, err + } if existing, ok := s.records[spec.VolumeID]; ok { if existing.Spec.SourceVolume != spec.SourceVolume || existing.Spec.SourceLayoutID != spec.SourceLayoutID || existing.Spec.SourceSnapshot != spec.SourceSnapshot || existing.Spec.CreateRequestID != spec.CreateRequestID { return VolumeRecord{}, ErrVolumeConflict @@ -221,6 +239,9 @@ func (s *FileStore) CreateVolume(spec VolumeSpec) (VolumeRecord, error) { func (s *FileStore) RedrawPendingLayoutID(volumeID, rejectedID string) (VolumeRecord, error) { s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return VolumeRecord{}, err + } rec, ok := s.records[volumeID] if !ok { return VolumeRecord{}, ErrVolumeNotFound @@ -301,6 +322,9 @@ func (s *FileStore) settlePendingLayoutIDLocked(rec VolumeRecord) (VolumeRecord, func (s *FileStore) MarkStoreReady(volumeID, layoutID string) (VolumeRecord, error) { s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return VolumeRecord{}, err + } rec, ok := s.records[volumeID] if !ok { return VolumeRecord{}, ErrVolumeNotFound @@ -362,11 +386,14 @@ func (s *FileStore) DeleteVolume(volumeID string) error { } s.mu.Lock() defer s.mu.Unlock() - delete(s.records, volumeID) - s.publishLocked() + if err := recoveryRequired(s.writeErr); err != nil { + return err + } if err := os.Remove(s.path(volumeID)); err != nil && !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("lifecycle: remove %s: %w", volumeID, err) } + delete(s.records, volumeID) + s.publishLocked() return nil } @@ -381,6 +408,9 @@ func (s *FileStore) AttachVolume(volumeID, nodeID string) (VolumeRecord, error) } s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return VolumeRecord{}, err + } rec, ok := s.records[volumeID] if !ok { return VolumeRecord{}, ErrVolumeNotFound @@ -405,6 +435,9 @@ func (s *FileStore) DetachVolume(volumeID, nodeID string) (VolumeRecord, error) } s.mu.Lock() defer s.mu.Unlock() + if err := recoveryRequired(s.writeErr); err != nil { + return VolumeRecord{}, err + } rec, ok := s.records[volumeID] if !ok { return VolumeRecord{}, ErrVolumeNotFound @@ -480,7 +513,11 @@ func (s *FileStore) putLocked(rec VolumeRecord) error { if err != nil { return fmt.Errorf("lifecycle: marshal %s: %w", rec.Spec.VolumeID, err) } - return writeRecordDurably(s.dir, rec.Spec.VolumeID+".json", raw) + err = writeRecordDurably(s.dir, rec.Spec.VolumeID+".json", raw) + if err != nil { + latchPersistenceFailure(err, &s.writeErr, s.onPersistenceFailure) + } + return err } func (s *FileStore) path(volumeID string) string { diff --git a/seaweed-block/core/lifecycle/store_parent_sync_test.go b/seaweed-block/core/lifecycle/store_parent_sync_test.go index 9897d3ed98..5ad2aa3df5 100644 --- a/seaweed-block/core/lifecycle/store_parent_sync_test.go +++ b/seaweed-block/core/lifecycle/store_parent_sync_test.go @@ -60,6 +60,8 @@ func TestLifecycleStoreParentSyncChild(t *testing.T) { want = append(want, "/"+strings.Join(parts[:n], "/")) } want = append(want, "/") + ancestor := want[len(want)-2] + want = append(want, abs) var calls []string var warnings bytes.Buffer log.SetOutput(&warnings) @@ -68,7 +70,7 @@ func TestLifecycleStoreParentSyncChild(t *testing.T) { fault := &os.PathError{Op: "open", Path: want[0], Err: os.ErrPermission} syncBindingParent = func(path string) error { calls = append(calls, path) - if shape == "ancestor-permission" && path == want[len(want)-2] { + if shape == "ancestor-permission" && path == ancestor { return &os.PathError{Op: "open", Path: path, Err: os.ErrPermission} } if failFirst { diff --git a/seaweed-block/core/lifecycle/volume_recovery_test.go b/seaweed-block/core/lifecycle/volume_recovery_test.go new file mode 100644 index 0000000000..407db0b2bd --- /dev/null +++ b/seaweed-block/core/lifecycle/volume_recovery_test.go @@ -0,0 +1,111 @@ +//go:build linux + +package lifecycle + +import ( + "context" + "errors" + "os" + "os/exec" + "reflect" + "testing" + "time" +) + +func TestVolumeEqualityRequiresRecovery(t *testing.T) { + for _, mode := range []string{"reopen", "failed-put"} { + t.Run(mode, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestVolumeRecoveryChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "VOLUME_RECOVERY_MODE="+mode) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("volume recovery: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } +} + +func TestVolumeRecoveryChild(t *testing.T) { + mode := os.Getenv("VOLUME_RECOVERY_MODE") + if mode == "" { + t.Skip("isolated recovery hooks") + } + dir := t.TempDir() + s, err := OpenFileStore(dir) + if err != nil { + t.Fatal(err) + } + spec := VolumeSpec{VolumeID: "v", SizeBytes: 1 << 20, ReplicationFactor: 1} + rec, err := s.CreateVolume(spec) + if err != nil { + t.Fatal(err) + } + if _, err := s.MarkStoreReady("v", rec.Spec.LayoutID); err != nil { + t.Fatal(err) + } + old, _ := s.GetVolumeSnapshot("v") + fault := errors.New("injected volume directory barrier failure") + callbacks := 0 + s.SetPersistenceFailureHandler(func(failure *RecordPersistenceError) { + callbacks++ + if s.writeErr == nil || failure.Store != dir || failure.Record != "v.json" || !errors.Is(failure, fault) { + t.Fatalf("incorrect volume policy context: %+v", failure) + } + }) + durableRecordHooksForTest.Store(&durableRecordHooks{dirSync: func(string) error { return fault }}) + defer durableRecordHooksForTest.Store(nil) + if mode == "reopen" { + if _, err := OpenFileStore(dir); !errors.Is(err, fault) { + t.Fatalf("loaded volume published without recovery barrier: %v", err) + } + durableRecordHooksForTest.Store(nil) + reopened, err := OpenFileStore(dir) + if err != nil { + t.Fatal(err) + } + if got, _ := reopened.GetVolumeSnapshot("v"); got != old { + t.Fatal("recovery changed volume") + } + return + } + if _, err := s.AttachVolume("v", "node"); !errors.Is(err, fault) { + t.Fatalf("attachment did not fail at barrier: %v", err) + } + if callbacks != 1 { + t.Fatalf("volume failure callbacks=%d want1", callbacks) + } + if got, _ := s.GetVolumeSnapshot("v"); got != old { + t.Fatal("failed attach published") + } + durableRecordHooksForTest.Store(nil) + if _, err := s.CreateVolume(spec); !errors.Is(err, ErrLifecycleRecoveryRequired) { + t.Fatalf("equal create must refuse after possibly-applied failure: %v", err) + } + _, redrawErr := s.RedrawPendingLayoutID("v", rec.Spec.LayoutID) + _, markErr := s.MarkStoreReady("v", rec.Spec.LayoutID) + _, attachErr := s.AttachVolume("v", "node") + _, detachErr := s.DetachVolume("v", "node") + for _, err := range []error{redrawErr, markErr, attachErr, detachErr, s.DeleteVolume("v")} { + if !errors.Is(err, ErrLifecycleRecoveryRequired) { + t.Fatalf("mutation after uncertainty: %v", err) + } + } + reopened, err := OpenFileStore(dir) + if err != nil { + t.Fatal(err) + } + if got, _ := reopened.GetVolumeSnapshot("v"); got.AttachedTo != "node" { + t.Fatal("fixture did not retain renamed attachment") + } + if _, err := reopened.DetachVolume("v", "node"); err != nil { + t.Fatal(err) + } + again, err := OpenFileStore(dir) + if err != nil { + t.Fatal(err) + } + if got, _ := again.GetVolumeSnapshot("v"); !reflect.DeepEqual(got, old) { + t.Fatal("recovered successful detach differs on disk") + } +} diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 15434dcbc8..c0ddb4386a 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -48,6 +48,55 @@ The design is described in three documents, and this one collects their machines Each machine lists its states, the allowed transitions, the guard that must hold for each transition, where the guard is enforced, and the IDs of the Part B rows that protect it. A state name in `code font` is a value in the code; the other names describe a condition and are not code types. +### Lifecycle record I/O and supervised master recovery + +This is the process projection of `INV-LIFECYCLE-STORE-DURABLE-001` and +`INV-LIFECYCLE-FAILSTOP-001`; it adds no record format or authority state. + +```mermaid +stateDiagram-v2 + [*] --> Recovering: supervisor starts master + Recovering --> Ready: complete records loaded, directory barriers succeed + Ready --> Ready: changed files synced, renamed, directory synced + Ready --> Faulted: record put/import persistence failure + Recovering --> Faulted: recovery directory sync failure + Faulted --> Exited: one ERROR attempt, exit 1 within 1 s + Exited --> Recovering: supervisor restarts +``` + +| From | To | Guard | Enforced in | Protects | +|---|---|---|---|---| +| — | Recovering | the supervisor starts blockmaster with a lifecycle store | `cmd/blockmaster/main.go` `run`; `deploy/systemd/sw-blockmaster.service` | `INV-LIFECYCLE-FAILSTOP-001` | +| Recovering | Ready | each node, placement and volume store loads complete records and its records-directory barrier succeeds; the cluster-spec import completes before serving | `core/lifecycle/node_inventory.go` `OpenNodeInventoryStore`; `core/lifecycle/placement_intent.go` `OpenPlacementIntentStore`; `core/lifecycle/store.go` `OpenFileStore`; `cmd/blockmaster/main.go` `run` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-LIFECYCLE-FAILSTOP-001` | +| Ready | Ready | a changed put or import: changed files are durable before rename (per-file fsync, or one `syncfs` on a qualified filesystem) and one directory barrier precedes publication; an unchanged record does no I/O and keeps its SeenAt | `core/lifecycle/record_file.go` `writeRecordDurably`, `writeRecordBatchDurably`; `core/lifecycle/node_inventory.go` `ImportNodes`, `registrationLocked`; `core/lifecycle/placement_intent.go` `ImportPlans` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-NODE-REGISTRATION-FRESHNESS-001` | +| Ready | Faulted | a put or import returns a `RecordPersistenceError`; the store latches it, so later mutations return `ErrLifecycleRecoveryRequired`, before calling the process policy; a marshal error before any I/O does not latch | `core/lifecycle/record_file.go` `latchPersistenceFailure`; each store's `putLocked`, `ImportNodes`, `ImportPlans` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-LIFECYCLE-FAILSTOP-001` | +| Recovering | Faulted | a store open's records-directory sync fails; `New` hands the `RecordPersistenceError` to the process policy | `core/lifecycle/record_file.go` `syncRecordDirectory`; `core/host/master/host.go` `New` | `INV-LIFECYCLE-STORE-DURABLE-001`, `INV-LIFECYCLE-FAILSTOP-001` | +| Faulted | Exited | the policy arms a one-second exit timer, attempts one ERROR line, then exits 1 | `core/host/master/lifecycle_failure.go` `lifecycleFailStop` | `INV-LIFECYCLE-FAILSTOP-001` | +| Exited | Recovering | the supervisor restarts blockmaster (`Restart=on-failure`) | `deploy/systemd/sw-blockmaster.service` | `INV-LIFECYCLE-FAILSTOP-001` | + +A store latches the error before calling the process policy. A failed step may +leave a mix of complete old and new files; recovery syncs their directory and +startup reconciles the declarative import before serving. Temporary files are +not records. On Linux >= 5.8 with the records on ext4, xfs, btrfs or tmpfs, +startup import opens the records-directory fd before writing, writes and +closes every changed temp, calls one `syncfs`, then renames all temps and +syncs the directory before publication. A failed `syncfs` is never retried +within the step: its writeback error may have been consumed. Recovery writes +fresh temps. Older kernels, other filesystems (overlay, FUSE, NFS: syncfs does +not reach their backing files) and other platforms retain per-file fsync +before rename; startup reports the chosen path. The filesystem-wide sync can +also wait for unrelated writeback on that filesystem. +The executable arms a one-second process-exit timer before logging +and exits immediately after the log returns, rather than waiting for graceful +shutdown behind a writer. Embedders without this process policy must reopen a +failed store before any further mutation. Removal errors do not invoke this +policy: the in-memory record and its published snapshot stay present until +removal succeeds, so a later retirement tick can retry. This is covered by +`TestFailedRemoveKeepsRecordForRetry` and +`TestSpecRetirementLocalFailureDoesNotStopOtherVolumesOrProductTick`. +A successful removal still has the separate directory-sync limitation +recorded below. + ### M1 walstore: open, recover, serve, fault The local storage engine and the durable backend in front of it. Diagrams in the core design: the per-I/O gate in [§1.1](block-design.md#11-frontends-and-the-backend-contract), and the life of one write (appended, synced, in the extent, checkpointed, reusable) in [§1.2](block-design.md#12-walstore-wal-plus-extent). @@ -971,14 +1020,16 @@ Notes: | `INV-FMT-LEVEL0-V100-001` | At format level 0 the master writes as v1.0: grants clamp to the persisted horizon, an extender keeps it current, forced moves and re-grants wait for the later of horizon and deadline plus skew, records are version 1. Every grant raises the deadline at both levels. | M2 Granted → Granted; Expired → Moved (forced); Expired → Granted (level 0) | `core/authority/workspace_lease_v100.go` `renewV100Locked`, `extendWorkspaceLease`, `forcedMoveBarrierV100Locked`, `ackValidityLocked`, `envelopeVersionLocked`; `core/authority/workspace_lease_view.go` `RenewWorkspaceLease` | `TestALevel0RenewalKeepsTheHorizonCurrent`, `TestALevel0GrantIsClampedToTheHorizon`, `TestTheForcedBarrierFollowsTheFormatLevel`, `TestRecordEnvelopeVersionFollowsTheFormatLevel` (`core/authority/workspace_format_level_test.go`) | `FormatGateMaster` `OneServer`, `GraceOnlyFinal` (mutations `level0_no_horizon`, `old_starts_after_finalize`) | ACTIVE | | `INV-FMT-RETIRE-001` | A host retire, the node registry's only writer after start, is refused, naming the volumes, while the host holds a placement or a live line, and unless confirm repeats the id. A retired id is unregistered; if the host returns it registers again at its reported level. | FormatGate Retire | `core/host/master/format_gate.go` `RetireHost`; `core/host/master/journal_isolation.go` `volumesServedBy` | `TestRetireHostRefusesAHostThatHoldsWork` (`core/host/master/format_gate_test.go`); `TestACleanMoveReleasesTheTopologyHome`, `TestTheTopologyHomeHoldsTheVolumeBeforeAMove`, `TestTheTopologyHomeAloneHoldsTheVolumeBeforeAMove` (`core/host/master/served_topology_move_test.go`); `TestClusterRetireHost` (`cmd/sw-block/cluster_format_test.go`); `TestNodeRegistryIsWrittenOnlyAtStartup` (`cmd/blockmaster/node_registry_guard_test.go`) | `FormatGate` r2 `OneServer` (mutation `retire_holding_host`) | ACTIVE | | `INV-LIFECYCLE-SNAPSHOT-001` | The Volumes and deletion-reservation snapshots read by the renewal path equal the store records after every change of the records, including load, delete and a protective reservation kept in memory on an unknown write outcome; a published snapshot is never mutated. | M2 Bound → Deleting (renewal reads) | `core/lifecycle/store.go` `publishLocked`, `GetVolumeSnapshot`; `core/lifecycle/deletion_reservations.go` `publishLocked`, `ReservedSnapshot` | `TestDeletionReservationSnapshotFollowsRecords`, `TestFileStoreSnapshotFollowsRecords`, `TestLifecycleSnapshotReadsDoNotTakeStoreMutex`, `TestLifecycleSnapshotConcurrentWriters` (`core/lifecycle/renewal_snapshot_test.go`); `TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation` (`core/host/master/workspace_lease_horizon_test.go`) | — | ACTIVE | -| `INV-LIFECYCLE-STORE-DURABLE-001` | Node registration, volume record and placement-intent puts/replacements are atomic and durable: after a crash the record file is the complete old or the complete new record; a put that returned nil has fsynced the file and its directory. | M2 lifecycle record publication | `core/lifecycle/record_file.go` `writeRecordDurably`; `node_inventory.go`, `store.go`, `placement_intent.go` `putLocked` | `TestNodeInventoryCrashKeepsCompleteRegistration` (`core/lifecycle/node_inventory_crash_test.go`); `TestFileStoreCrashKeepsCompleteRecord`, `TestPlacementStoreCrashKeepsCompleteRecord`, `TestLifecyclePutSyncOrderAndFailure` (`core/lifecycle/store_crash_test.go`); `TestLifecycleStoreParentSync` (`core/lifecycle/store_parent_sync_test.go`) | � | ACTIVE | +| `INV-NODE-REGISTRATION-FRESHNESS-001` | Replaying a node registration without an observation time preserves its stored SeenAt; unchanged non-time fields do not rewrite its record. A restart is not a fresh observation, also when the declaration changed; a live heartbeat supplies freshness independently. | M2 lifecycle registration replay (no authority transition) | `core/lifecycle/node_inventory.go` `ImportNodes`, `RegisterNode`, `registrationLocked`; `core/host/master/observation_snapshot.go` `nodeHeartbeat`; `core/lifecycle/verified_placement.go` `VerifyPlacementIntent` | `TestUnchangedNodeRestartDoesNotRefreshAStaleObservation`, `TestChangedNodeImportDoesNotRefreshAStaleObservation` (`core/lifecycle/node_import_freshness_test.go`); `TestObservationNodesReportTheNewestHeartbeat` (`core/host/master/observation_heartbeat_test.go`); live-holder process restart qualification pending | Observation time is evidence, not authority; a declaration is not an observation | STUB | +| `INV-LIFECYCLE-STORE-DURABLE-001` | A successful record put/import publishes only after complete replacement records and their directory are durable. Open syncs the records directory before publication. A possibly-applied failure blocks mutations until reopen; recovery reconciles complete old/new records. | M2 lifecycle record publication | `core/lifecycle/record_file.go` `writeRecordDurably`, `writeRecordBatchDurably`; `node_inventory.go` `ImportNodes`; `placement_intent.go` `ImportPlans`; `node_inventory.go`, `store.go`, `placement_intent.go` `putLocked` | `TestNodeInventoryCrashKeepsCompleteRegistration` (`core/lifecycle/node_inventory_crash_test.go`); `TestFileStoreCrashKeepsCompleteRecord`, `TestPlacementStoreCrashKeepsCompleteRecord`, `TestLifecyclePutSyncOrderAndFailure` (`core/lifecycle/store_crash_test.go`); `TestLifecycleStoreParentSync` (`core/lifecycle/store_parent_sync_test.go`); `TestImportStepSyncsChangedFilesThenOneDirectory` (`core/lifecycle/import_step_sync_test.go`); `TestImportSyncfsFailureAndOrdering`, `TestImportSyncfsReturnedFailurePolicyAndReplay`, `TestImportSyncfsCrashBoundaries`, `TestSyncfsKernelGate`, `TestSyncfsFilesystemGate` (`core/lifecycle/import_syncfs_test.go`); `TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk` (`core/lifecycle/import_recovery_test.go`); `TestVolumeEqualityRequiresRecovery` (`core/lifecycle/volume_recovery_test.go`); `TestNodeMarshalErrorDoesNotRequireRecovery` (`core/lifecycle/remove_retry_test.go`) | Lifecycle record publication, including startup-step durability barrier | ACTIVE | +| `INV-LIFECYCLE-FAILSTOP-001` | A supervised master exits nonzero within one second of a lifecycle put/import or open-barrier persistence failure, independently of logging. It attempts one ERROR; restart completes recovery barriers and import before serving. | Lifecycle process ready/recovering → faulted → exited → recovering | `core/host/master/lifecycle_failure.go` `lifecycleFailStop`; `host.go` `New`; `cmd/blockmaster/main.go` `run`; lifecycle store failure handlers | `TestMasterImportPersistenceFailureExitsAndRecovers` (`cmd/blockmaster/persist_exit_test.go`); `TestLifecyclePersistenceFailureStopsTheProcess`, `TestLifecycleFailStopExitsWithBlockedLogger` (`core/host/master/lifecycle_failure_test.go`) | Manual process-fault/recovery projection of lifecycle record durability; no new wire or format state | ACTIVE | | `INV-VOL-ID-NO-REUSE-001` | A deleted volume id is never created or attached again. | M2 Deleting; M6 purging → deleted | `core/host/master/services.go` `MarkVolumeDeleting`; `core/frontend/chunkstore/layout/create.go` `createVolume` | `TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart` (`core/host/master/volume_deleting_test.go`); `TestCreateVolume_OverAnExistingHeadByState` (`core/frontend/chunkstore/layout/create_test.go`) | `ChunkLifecycleFixed` `NoIdReuse` | ACTIVE | | `INV-MASTER-JOURNAL-ISOLATION-001` | Under strict journal isolation, blockmaster gives no new work to a node whose durable root shares the authority store's file system: it refuses that node's heartbeat while it serves no volume, a new placement on it and a move onto it; work the node already has is kept. | M2 workspace move: Acked or Expired → (move refused, nothing written); workspace placement admission; node heartbeat | `core/host/master/journal_isolation.go` `refuseColocatedHeartbeat`, `colocatedTargetRefused`, `reconcilePlacements`, `nodeServesVolumes`; `core/host/master/workspace_service.go` `workspaceMoveCheckLocked`; `core/host/master/workspace_binding.go` `PlaceWorkspace` | `TestColocatedNodeIsAlarmedButAcceptedByDefault`, `TestStrictRefusesColocatedNodeWithoutVolumes`, `TestStrictAcceptsColocatedNodeThatAlreadyServes`, `TestStrictRefusesPlacementAndMoveOntoColocatedNode`, `TestStrictProductLoopSkipsColocatedNodeForNewPlacement` (`core/host/master/journal_isolation_test.go`); `TestStrictReplaysAnIssuedMoveToANowColocatedTarget`, `TestStrictKeepsAnIdempotentPlacementOnANowColocatedNode` (`core/host/master/journal_isolation_fold_test.go`) | — | ACTIVE | | `INV-SEC-CONTROL-BIND-001` | blockmaster's unauthenticated control listeners bind only loopback: --listen without mutual TLS, and the runtime HTTP listener always; a non-loopback address, and --insecure-external-bind, are refused at startup. | AUTHORITY: control API reachability | `core/host/master/journal_isolation.go` `ValidateControlListen`; `cmd/blockmaster/main.go` `parseFlags` | `TestParseFlags_PlaintextControlListenersStayOnLoopback`, `TestManifests_NoPlaintextExternalBlockmasterBind` (`cmd/blockmaster/external_bind_test.go`); `TestAuthFlags` (`cmd/blockmaster/auth_flags_test.go`) | — (no state machine; the flag test is the proof form) | ACTIVE | Notes: -- `INV-LIFECYCLE-STORE-DURABLE-001` open gaps: Store-directory ancestor sync on Open is best-effort: failures are logged and do not block startup; a new directory entry may not survive an immediate crash when an ancestor cannot be synced. Record-file and store-directory sync after a put remain mandatory. `NodeInventoryStore.RemoveNode` does not fsync its directory after deletion, so a removed node can reappear after a crash. A failed put may still be on disk: if directory fsync fails after rename, restart can load the new record. +- `INV-LIFECYCLE-STORE-DURABLE-001` open gaps: Store-directory ancestor sync on Open is best-effort: failures are logged and do not block startup; a new directory entry may not survive an immediate crash when an ancestor cannot be synced. Record-file and store-directory sync after a put remain mandatory. `NodeInventoryStore.RemoveNode`, `PlacementIntentStore.DeletePlacement` and `FileStore.DeleteVolume` do not fsync their directory after deletion, so a removed node, placement or volume record can reappear after a crash. A failed put may still be on disk: if directory fsync fails after rename, restart can load the new record. - `INV-AUTH-PERSIST-BEFORE-PUBLISH-001`: a failure before the rename leaves the old record and is reported failed (the in-memory rollback test); a directory open or fsync failure after the rename leaves the outcome unknown and fail-stops the process, for every record type, so the restart reloads whatever survived and callers re-read. A workspace volume's uncertainty latch (`INV-AUTH-UNCERTAIN-001`) stays for its other causes. - `INV-AUTH-UNCERTAIN-001`: The cited test asserts the refusal after an unknown-outcome lease extension (rename landed, then a failure; the file store fail-stops on a directory fsync failure instead, `INV-AUTH-PERSIST-BEFORE-PUBLISH-001`): the next renewal, a revocation and an endpoint change are all refused. The TLA+ configuration `S5_red_noUncertain` violates `UniqueEpoch` without it. A Revoking lease still gets its bounded drain reply, min(horizon, deadline), never extended: see M2 any (workspace) → Uncertain. A failed move on an uncertain volume is answered as an unknown outcome before any admission refusal, the request's own cancellation or deadline stays typed, and an issued move's replay still returns its stored grant: see M2 Uncertain → Uncertain (move answer). The renewal path reads uncertainty from the lease view (`INV-LEASE-VIEW-001`), not from `persistWorkspaceLocked`. - `INV-WS-LEASE-HORIZON-001`: The forced-barrier argument (a renewal that reads its clock after the barrier has read the deadline is refused) assumes nondecreasing master time. That is an assumption of the current `WorkspaceTakeover` model, whose `Tick` and `SlowTick` actions only advance `now`; it is not a consequence of `time.Now` carrying a monotonic reading, because persisted `UnixNano` deadlines are compared as wall-clock values. The existing deadline check stays alongside the horizon. The model still renews with `exp = deadline = now + TTL`; the horizon/grant split is a pending specification update (Part C rule 2). diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index 9a771e2ac1..7d74156b15 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -242,6 +242,19 @@ with its size and home placement. A volume's record comes from the cluster spec: blockmaster reads the cluster spec only when it starts. After editing the spec, run `sudo systemctl restart sw-blockmaster`. Serving volumes keep serving across that restart. +blockmaster must run under systemd or an equivalent restart supervisor. A node, placement +or volume lifecycle record write or recovery-directory sync failure attempts one `ERROR` naming the store, +record and error, ending with `exiting so the supervisor restarts from durable state`, +and exits with status 1. Termination is armed before logging and occurs within one second even if the log writer or its lock is blocked; a blocked sink may lose that diagnostic. It does not remain alive with a failed store. The shipped +`sw-blockmaster.service` has `Restart=on-failure` and `RestartSec=5s`; restart reloads +complete records through the recovery barriers before serving again. + +Deletion-reservation and workspace-binding write failures do not exit: the request returns +the error and blockmaster keeps serving. A deletion reservation whose write outcome is unknown +keeps a new exclusion in memory. A workspace-binding rename or directory-sync failure leaves +the binding store uncertain, and every later binding operation fails with `restart required` +until `sudo systemctl restart sw-blockmaster`. + ## 3. Create and attach a volume 1. **Add the volume to the cluster spec** with its `size_bytes` (edit it as root, as in section 2), and restart diff --git a/seaweed-block/docs/time-bounds.tsv b/seaweed-block/docs/time-bounds.tsv index 55cbde057c..f6bf33e297 100644 --- a/seaweed-block/docs/time-bounds.tsv +++ b/seaweed-block/docs/time-bounds.tsv @@ -201,6 +201,7 @@ core/host/master/host.go New http.Server.ReadHeaderTimeout 1 per-call NONE: no m core/host/master/host.go New http.Server.ReadTimeout 1 per-call NONE: no model row maps this file yet one HTTP request or connection core/host/master/host.go New http.Server.WriteTimeout 1 per-call NONE: no model row maps this file yet one HTTP request or connection core/host/master/host.go New http.Server.IdleTimeout 1 per-call NONE: no model row maps this file yet one HTTP request or connection +core/host/master/lifecycle_failure.go lifecycleFailStop time.AfterFunc 1 availability-contract NONE: process-fault exit projection of INV-LIFECYCLE-FAILSTOP-001, no wire state one-second exit deadline armed before logger; independent of blocked sink core/host/master/probe_round.go roundEvidenceProvider.round time.NewTimer 1 per-call FencingRound.Deliver; FencingRound.Open one probe round's evidence wait core/host/master/services.go services.deleteHolderEvidence context.WithTimeout 1 per-call FormatGate.Report one RPC or request core/host/master/spec_retirement.go Host.reconcileDeletedSpecVolumes context.WithTimeout 1 per-call DeleteRetire.ReadOK one fresh HEAD read after the no-live-lease barrier From cccad8d5ceb97bf23cd560b50bbacc32b4447527 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 11:29:24 -0800 Subject: [PATCH 23/29] seaweed-block: a stale metadata change cannot land on a re-created intent page (filer chunk condition, page re-read as fallback) (#13457) * seaweed-block: red: a snapshot delete is published over a page whose data was freed Two overlapping runs of one snapshot delete write their intent pages under the same tag. If the first run's stalled page update lands between the second run's read of a page and its adoption (after a cleaning pass deleted and the second run re-staged the page), the second run adopts and publishes an intent whose page data was freed: later snapshot deletes on the volume are refused and its cleaning stops. Co-Authored-By: Claude Opus 5.5 * seaweed-block: a snapshot delete re-reads each intent page after adopting it Publication reads every intent page, adopts it under this run's tag, then publishes. A stalled update from another run of the same delete can land between that read and the adoption and put a deleted page's data reference on the entry. Reading the page again after the adoption, before the transition publishes, refuses that case: once this run's tag is on the entry, no such update passes. No persisted change; a run that hits it stays refused, and a new request id writes new pages. Co-Authored-By: Claude Opus 5.5 * seaweed-block: ledger row for the intent page re-read INV-SNAPSHOT-DELETE-ADOPT-002 names the re-read after adoption, its test and the model row it projects (PublishedReadable; the refused run is the residue a new request id clears). Co-Authored-By: Claude Opus 5.5 * seaweed-block: the intent page re-read: typed refusal, twins and a store witness Review: the re-read test now separates the guard from weaker ones. A page that reads but holds other bytes, and a change to only the later of two pages, are refused as well as a freed page; the refusal is a precondition that writes nothing to HEAD, keeps the snapshot, and comes after the adoption; the same schedule with intact bytes publishes. The test is a consequence-level projection; a store-level witness shows the tag-only metadata update writing a deleted object's chunk over a re-created one, which the re-read does not depend on refusing. The ledger row names the witness and marks the model as checked outside the repository. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the intent page re-read keeps its error's cause The refusal wrapped the re-read's error with %v, so a caller deadline that ended the re-read reached the CLI as a precondition ("page changed during adoption", no_progress) instead of deadline_exceeded, unlike the same deadline on the chain's first read. Wrap both errors. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the intent page re-read sees only data the filer already freed The filer frees a deleted entry's chunks, and the chunks an update drops, from its deletion queue: polled every 1.123 s, and retried after 5 min when a volume server does not answer. A stale update that puts such a reference on an adopted page therefore reads back intact while the deletion is still queued, and the intent publishes over data that is freed moments later. The intact-bytes twin publishes for that reason. State that bound in INV-SNAPSHOT-DELETE-ADOPT-002 and at the guard instead of "changed or vanished ... refuses the publication". Co-Authored-By: Claude Opus 5.5 * seaweed-block: the delete intent publication row and diagram carry the re-read Part C rule 2 moves a changed guard's Part A row and diagram with it. The publication row now names the re-read after adoption and INV-SNAPSHOT-DELETE-ADOPT-002, and the M9 diagram gains the transition's idle and snap self-loops, which it lacked. Co-Authored-By: Claude Opus 5.5 * seaweed-block: red: a stale adoption or mark lands on a re-created object A metadata change writes the looked-up entry back, chunks included, conditional only on its tags: paused between its lookup and its update, it lands on an object deleted and created again with the same tags in between, puts the deleted object's chunk on it, and a cleaner's stale mark then deletes it. The filer's IF_CHUNKS_EQUAL condition refuses such a write. This commit adds the plumbing and the tests, not the guard itself: - the filer protocol subset gains WriteCondition (IF_CHUNKS_EQUAL) on UpdateEntryRequest; SWFS sends it through UpdateEntryIfChunks, and the fakes evaluate it (or drop it, as an older filer does); - a startup probe sends a mismatched conditional update to the disposable probe HEAD; only a definite refusal turns the guard on for the stores the catalog opens. The startup log and /status/chunk (metadata_guard) name it. The two guard tests fail here: changeMeta does not send the condition yet. Co-Authored-By: Claude Opus 5.5 * seaweed-block: metadata changes send the filer's chunk condition With the guard on (the startup probe saw the filer enforce it), an adoption or mark sends IF_CHUNKS_EQUAL with the looked-up entry's chunk fids. A re-created object always has a new chunk, so a stale whole-entry write is refused instead of putting a deleted object's chunk on it; a cleaner's delete expects its own mark and so follows. Without the guard the write is unchanged and the intent page re-read stays the check. Co-Authored-By: Claude Opus 5.5 * seaweed-block: ledger rows for the chunk condition and its probe INV-LAYOUT-META-CHUNKS-001 (adoption and mark under IF_CHUNKS_EQUAL) and INV-WS-CHUNK-CONDITION-PROBE-001 (the startup probe decides it, the log and /status/chunk name it); ADOPT-002 names the renamed store test. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the chunk probe without a definite refusal leaves the guard off; fallback wording Review: the existing failure cases stop at the HEAD gate. New cases pass the gate and then fail only the chunk condition probe (unavailable, lost, deadline, filer error, vanished entry, failed HEAD read): the catalog, its stores, the startup log and the usage all stay on page_reread_only. page_reread_only now reads as enforcement not established, not as a filer without the condition; INV-SNAPSHOT-DELETE-ADOPT-002 cites MetaABA r2's delayed-free counterexample, r1 kept as historical scope. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Chris Lu --- .../core/frontend/chunkstore/catalog_b.go | 30 +- .../core/frontend/chunkstore/fake_test.go | 19 + .../chunkstore/filerpb/filer_subset.pb.go | 375 +++++++++++++----- .../chunkstore/filerpb/filer_subset.proto | 17 + .../frontend/chunkstore/head_readers_test.go | 1 + .../chunkstore/layout/delete_intent.go | 12 + .../layout/delete_intent_reread_test.go | 171 ++++++++ .../layout_change_meta_recreated_test.go | 218 ++++++++++ .../core/frontend/chunkstore/layout_store.go | 22 + .../core/frontend/chunkstore/memfiler.go | 17 + .../core/frontend/chunkstore/remote.go | 43 ++ .../startup_chunk_condition_probe_test.go | 80 ++++ .../frontend/chunkstore/startup_head_probe.go | 29 ++ .../chunkstore/startup_head_probe_test.go | 91 ++++- .../core/frontend/chunkstore/swfs.go | 13 +- .../core/host/volume/status_chunk_test.go | 2 +- seaweed-block/docs/design/invariants.md | 7 +- seaweed-block/docs/status-schema.md | 1 + 18 files changed, 1035 insertions(+), 113 deletions(-) create mode 100644 seaweed-block/core/frontend/chunkstore/layout/delete_intent_reread_test.go create mode 100644 seaweed-block/core/frontend/chunkstore/layout_change_meta_recreated_test.go create mode 100644 seaweed-block/core/frontend/chunkstore/startup_chunk_condition_probe_test.go diff --git a/seaweed-block/core/frontend/chunkstore/catalog_b.go b/seaweed-block/core/frontend/chunkstore/catalog_b.go index ac2a1f73de..37a6c472ed 100644 --- a/seaweed-block/core/frontend/chunkstore/catalog_b.go +++ b/seaweed-block/core/frontend/chunkstore/catalog_b.go @@ -31,6 +31,9 @@ type BCatalog struct { base string cleanMu sync.Mutex cursors map[VolumeRef]*cleanCursor + // chunkGuard: the startup probe saw the filer refuse a mismatched + // IF_CHUNKS_EQUAL update; every store it opens sends the condition. + chunkGuard bool } // NewBCatalog returns the catalog of the volumes under base. @@ -49,9 +52,29 @@ func (c *BCatalog) Store(v VolumeRef) (*LayoutStore, error) { } counts, _ := c.headWrites.LoadOrStore(v.Dir(), s.headWrites) s.headWrites = counts.(*headWriteCounters) + s.chunkGuard = c.chunkGuard return s, nil } +// Metadata change protections, as /status and the startup log name them. +const ( + MetadataGuardChunks = "filer_chunk_condition" // the probe saw IF_CHUNKS_EQUAL enforced; the page re-read stays as well + // MetadataGuardReread: enforcement was not established. The filer + // applied the probe, or did not answer it definitely, or this client + // cannot send the condition; it says nothing about what the filer + // supports. The re-read is the only check. + MetadataGuardReread = "page_reread_only" +) + +// MetadataGuard names the protection this catalog's metadata changes run +// under, decided once by the startup probe. +func (c *BCatalog) MetadataGuard() string { + if c.chunkGuard { + return MetadataGuardChunks + } + return MetadataGuardReread +} + func (c *BCatalog) open(v VolumeRef) (*LayoutStore, *layout.Reader, error) { s, err := c.Store(v) if err != nil { @@ -343,6 +366,11 @@ type Usage struct { Dependents int `json:"dependents"` OwnChunks int `json:"own_chunks"` ForeignChunks int `json:"foreign_chunks"` + // MetadataGuard names the protection of the volume's metadata changes: + // filer_chunk_condition (the startup probe saw the filer enforce the + // chunk condition) or page_reread_only (enforcement was not established + // at startup; delete intent pages are re-read). + MetadataGuard string `json:"metadata_guard"` } // Usage reads the volume's usage from its HEAD and current root. @@ -358,7 +386,7 @@ func (c *BCatalog) Usage(ctx context.Context, v VolumeRef) (Usage, error) { if !found { return Usage{}, layout.ErrHeadAbsent } - u := Usage{Snapshots: len(h.Snapshots)} + u := Usage{Snapshots: len(h.Snapshots), MetadataGuard: c.MetadataGuard()} for _, sn := range h.Snapshots { u.Dependents += len(sn.Dependents) } diff --git a/seaweed-block/core/frontend/chunkstore/fake_test.go b/seaweed-block/core/frontend/chunkstore/fake_test.go index b1bc06d73f..28bb19510f 100644 --- a/seaweed-block/core/frontend/chunkstore/fake_test.go +++ b/seaweed-block/core/frontend/chunkstore/fake_test.go @@ -64,6 +64,9 @@ type fakeFiler struct { // (lookups overlap) and bounded by ctx, as a remote filer's. slowLookup func(p string) time.Duration deferredCreates []deferredCreate + // ignoreChunkCondition makes UpdateEntryIfChunks ignore its condition, + // as a filer that predates IF_CHUNKS_EQUAL drops the unknown field. + ignoreChunkCondition bool } func newFakeFiler() *fakeFiler { return &fakeFiler{entries: map[string]*filerpb.Entry{}} } @@ -137,6 +140,19 @@ func (f *fakeFiler) CreateEntry(ctx context.Context, dir string, e *filerpb.Entr } func (f *fakeFiler) UpdateEntry(_ context.Context, dir string, e *filerpb.Entry, expected map[string][]byte) error { + return f.updateEntry(dir, e, expected, nil) +} + +// UpdateEntryIfChunks evaluates IF_CHUNKS_EQUAL as the filer does (stored +// chunk fids equal fids as a multiset), unless ignoreChunkCondition. +func (f *fakeFiler) UpdateEntryIfChunks(_ context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error { + if fids == nil { + fids = []string{} + } + return f.updateEntry(dir, e, expected, fids) +} + +func (f *fakeFiler) updateEntry(dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error { f.mu.Lock() defer f.mu.Unlock() p := path.Join(dir, e.Name) @@ -155,6 +171,9 @@ func (f *fakeFiler) UpdateEntry(_ context.Context, dir string, e *filerpb.Entry, return fmt.Errorf("%w: extended %q changed", ErrPrecondition, k) } } + if fids != nil && !f.ignoreChunkCondition && !fidsEqual(entryFids(cur), fids) { + return fmt.Errorf("%w: chunks of %s changed", ErrPrecondition, p) + } f.entries[p] = proto.Clone(e).(*filerpb.Entry) f.written = append(f.written, proto.Clone(e).(*filerpb.Entry)) f.updates++ diff --git a/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.pb.go b/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.pb.go index d97b8f6085..decb9a253a 100644 --- a/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.pb.go +++ b/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.pb.go @@ -97,6 +97,52 @@ func (FilerError) EnumDescriptor() ([]byte, []int) { return file_filer_subset_proto_rawDescGZIP(), []int{0} } +type WriteCondition_Kind int32 + +const ( + WriteCondition_NONE WriteCondition_Kind = 0 + WriteCondition_IF_CHUNKS_EQUAL WriteCondition_Kind = 9 // fail unless the stored chunk fid multiset equals fids (absent entry = no chunks) +) + +// Enum value maps for WriteCondition_Kind. +var ( + WriteCondition_Kind_name = map[int32]string{ + 0: "NONE", + 9: "IF_CHUNKS_EQUAL", + } + WriteCondition_Kind_value = map[string]int32{ + "NONE": 0, + "IF_CHUNKS_EQUAL": 9, + } +) + +func (x WriteCondition_Kind) Enum() *WriteCondition_Kind { + p := new(WriteCondition_Kind) + *p = x + return p +} + +func (x WriteCondition_Kind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WriteCondition_Kind) Descriptor() protoreflect.EnumDescriptor { + return file_filer_subset_proto_enumTypes[1].Descriptor() +} + +func (WriteCondition_Kind) Type() protoreflect.EnumType { + return &file_filer_subset_proto_enumTypes[1] +} + +func (x WriteCondition_Kind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WriteCondition_Kind.Descriptor instead. +func (WriteCondition_Kind) EnumDescriptor() ([]byte, []int) { + return file_filer_subset_proto_rawDescGZIP(), []int{9, 0} +} + type LookupDirectoryEntryRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` @@ -711,6 +757,54 @@ func (x *CreateEntryResponse) GetErrorCode() FilerError { return FilerError_OK } +// WriteCondition is copied from weed/pb/filer.proto (this repository): the +// IF_CHUNKS_EQUAL clause only. A filer that predates it drops field 6 of +// UpdateEntryRequest as unknown and applies the write unguarded, so the +// chunkstore decides at startup, by a probe, whether it is enforced. +type WriteCondition struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clauses []*WriteCondition_Clause `protobuf:"bytes,1,rep,name=clauses,proto3" json:"clauses,omitempty"` // all must hold (logical AND) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteCondition) Reset() { + *x = WriteCondition{} + mi := &file_filer_subset_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteCondition) ProtoMessage() {} + +func (x *WriteCondition) ProtoReflect() protoreflect.Message { + mi := &file_filer_subset_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteCondition.ProtoReflect.Descriptor instead. +func (*WriteCondition) Descriptor() ([]byte, []int) { + return file_filer_subset_proto_rawDescGZIP(), []int{9} +} + +func (x *WriteCondition) GetClauses() []*WriteCondition_Clause { + if x != nil { + return x.Clauses + } + return nil +} + type UpdateEntryRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` @@ -718,13 +812,14 @@ type UpdateEntryRequest struct { IsFromOtherCluster bool `protobuf:"varint,3,opt,name=is_from_other_cluster,json=isFromOtherCluster,proto3" json:"is_from_other_cluster,omitempty"` Signatures []int32 `protobuf:"varint,4,rep,packed,name=signatures,proto3" json:"signatures,omitempty"` ExpectedExtended map[string][]byte `protobuf:"bytes,5,rep,name=expected_extended,json=expectedExtended,proto3" json:"expected_extended,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Condition *WriteCondition `protobuf:"bytes,6,opt,name=condition,proto3" json:"condition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateEntryRequest) Reset() { *x = UpdateEntryRequest{} - mi := &file_filer_subset_proto_msgTypes[9] + mi := &file_filer_subset_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -736,7 +831,7 @@ func (x *UpdateEntryRequest) String() string { func (*UpdateEntryRequest) ProtoMessage() {} func (x *UpdateEntryRequest) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[9] + mi := &file_filer_subset_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -749,7 +844,7 @@ func (x *UpdateEntryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateEntryRequest.ProtoReflect.Descriptor instead. func (*UpdateEntryRequest) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{9} + return file_filer_subset_proto_rawDescGZIP(), []int{10} } func (x *UpdateEntryRequest) GetDirectory() string { @@ -787,6 +882,13 @@ func (x *UpdateEntryRequest) GetExpectedExtended() map[string][]byte { return nil } +func (x *UpdateEntryRequest) GetCondition() *WriteCondition { + if x != nil { + return x.Condition + } + return nil +} + type UpdateEntryResponse struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -795,7 +897,7 @@ type UpdateEntryResponse struct { func (x *UpdateEntryResponse) Reset() { *x = UpdateEntryResponse{} - mi := &file_filer_subset_proto_msgTypes[10] + mi := &file_filer_subset_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -807,7 +909,7 @@ func (x *UpdateEntryResponse) String() string { func (*UpdateEntryResponse) ProtoMessage() {} func (x *UpdateEntryResponse) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[10] + mi := &file_filer_subset_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -820,7 +922,7 @@ func (x *UpdateEntryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateEntryResponse.ProtoReflect.Descriptor instead. func (*UpdateEntryResponse) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{10} + return file_filer_subset_proto_rawDescGZIP(), []int{11} } type DeleteEntryRequest struct { @@ -836,7 +938,7 @@ type DeleteEntryRequest struct { func (x *DeleteEntryRequest) Reset() { *x = DeleteEntryRequest{} - mi := &file_filer_subset_proto_msgTypes[11] + mi := &file_filer_subset_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -848,7 +950,7 @@ func (x *DeleteEntryRequest) String() string { func (*DeleteEntryRequest) ProtoMessage() {} func (x *DeleteEntryRequest) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[11] + mi := &file_filer_subset_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -861,7 +963,7 @@ func (x *DeleteEntryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteEntryRequest.ProtoReflect.Descriptor instead. func (*DeleteEntryRequest) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{11} + return file_filer_subset_proto_rawDescGZIP(), []int{12} } func (x *DeleteEntryRequest) GetDirectory() string { @@ -908,7 +1010,7 @@ type DeleteEntryResponse struct { func (x *DeleteEntryResponse) Reset() { *x = DeleteEntryResponse{} - mi := &file_filer_subset_proto_msgTypes[12] + mi := &file_filer_subset_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -920,7 +1022,7 @@ func (x *DeleteEntryResponse) String() string { func (*DeleteEntryResponse) ProtoMessage() {} func (x *DeleteEntryResponse) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[12] + mi := &file_filer_subset_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -933,7 +1035,7 @@ func (x *DeleteEntryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteEntryResponse.ProtoReflect.Descriptor instead. func (*DeleteEntryResponse) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{12} + return file_filer_subset_proto_rawDescGZIP(), []int{13} } func (x *DeleteEntryResponse) GetError() string { @@ -961,7 +1063,7 @@ type AssignVolumeRequest struct { func (x *AssignVolumeRequest) Reset() { *x = AssignVolumeRequest{} - mi := &file_filer_subset_proto_msgTypes[13] + mi := &file_filer_subset_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -973,7 +1075,7 @@ func (x *AssignVolumeRequest) String() string { func (*AssignVolumeRequest) ProtoMessage() {} func (x *AssignVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[13] + mi := &file_filer_subset_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -986,7 +1088,7 @@ func (x *AssignVolumeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AssignVolumeRequest.ProtoReflect.Descriptor instead. func (*AssignVolumeRequest) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{13} + return file_filer_subset_proto_rawDescGZIP(), []int{14} } func (x *AssignVolumeRequest) GetCount() int32 { @@ -1077,7 +1179,7 @@ type AssignVolumeResponse struct { func (x *AssignVolumeResponse) Reset() { *x = AssignVolumeResponse{} - mi := &file_filer_subset_proto_msgTypes[14] + mi := &file_filer_subset_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1089,7 +1191,7 @@ func (x *AssignVolumeResponse) String() string { func (*AssignVolumeResponse) ProtoMessage() {} func (x *AssignVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[14] + mi := &file_filer_subset_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1102,7 +1204,7 @@ func (x *AssignVolumeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AssignVolumeResponse.ProtoReflect.Descriptor instead. func (*AssignVolumeResponse) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{14} + return file_filer_subset_proto_rawDescGZIP(), []int{15} } func (x *AssignVolumeResponse) GetFileId() string { @@ -1184,7 +1286,7 @@ type LookupVolumeRequest struct { func (x *LookupVolumeRequest) Reset() { *x = LookupVolumeRequest{} - mi := &file_filer_subset_proto_msgTypes[15] + mi := &file_filer_subset_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1196,7 +1298,7 @@ func (x *LookupVolumeRequest) String() string { func (*LookupVolumeRequest) ProtoMessage() {} func (x *LookupVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[15] + mi := &file_filer_subset_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1209,7 +1311,7 @@ func (x *LookupVolumeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupVolumeRequest.ProtoReflect.Descriptor instead. func (*LookupVolumeRequest) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{15} + return file_filer_subset_proto_rawDescGZIP(), []int{16} } func (x *LookupVolumeRequest) GetVolumeIds() []string { @@ -1228,7 +1330,7 @@ type Locations struct { func (x *Locations) Reset() { *x = Locations{} - mi := &file_filer_subset_proto_msgTypes[16] + mi := &file_filer_subset_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1240,7 +1342,7 @@ func (x *Locations) String() string { func (*Locations) ProtoMessage() {} func (x *Locations) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[16] + mi := &file_filer_subset_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1253,7 +1355,7 @@ func (x *Locations) ProtoReflect() protoreflect.Message { // Deprecated: Use Locations.ProtoReflect.Descriptor instead. func (*Locations) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{16} + return file_filer_subset_proto_rawDescGZIP(), []int{17} } func (x *Locations) GetLocations() []*Location { @@ -1276,7 +1378,7 @@ type Location struct { func (x *Location) Reset() { *x = Location{} - mi := &file_filer_subset_proto_msgTypes[17] + mi := &file_filer_subset_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1288,7 +1390,7 @@ func (x *Location) String() string { func (*Location) ProtoMessage() {} func (x *Location) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[17] + mi := &file_filer_subset_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1301,7 +1403,7 @@ func (x *Location) ProtoReflect() protoreflect.Message { // Deprecated: Use Location.ProtoReflect.Descriptor instead. func (*Location) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{17} + return file_filer_subset_proto_rawDescGZIP(), []int{18} } func (x *Location) GetUrl() string { @@ -1348,7 +1450,7 @@ type LookupVolumeResponse struct { func (x *LookupVolumeResponse) Reset() { *x = LookupVolumeResponse{} - mi := &file_filer_subset_proto_msgTypes[18] + mi := &file_filer_subset_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1360,7 +1462,7 @@ func (x *LookupVolumeResponse) String() string { func (*LookupVolumeResponse) ProtoMessage() {} func (x *LookupVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[18] + mi := &file_filer_subset_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1373,7 +1475,7 @@ func (x *LookupVolumeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LookupVolumeResponse.ProtoReflect.Descriptor instead. func (*LookupVolumeResponse) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{18} + return file_filer_subset_proto_rawDescGZIP(), []int{19} } func (x *LookupVolumeResponse) GetLocationsMap() map[string]*Locations { @@ -1391,7 +1493,7 @@ type GetFilerConfigurationRequest struct { func (x *GetFilerConfigurationRequest) Reset() { *x = GetFilerConfigurationRequest{} - mi := &file_filer_subset_proto_msgTypes[19] + mi := &file_filer_subset_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1403,7 +1505,7 @@ func (x *GetFilerConfigurationRequest) String() string { func (*GetFilerConfigurationRequest) ProtoMessage() {} func (x *GetFilerConfigurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[19] + mi := &file_filer_subset_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1416,7 +1518,7 @@ func (x *GetFilerConfigurationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFilerConfigurationRequest.ProtoReflect.Descriptor instead. func (*GetFilerConfigurationRequest) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{19} + return file_filer_subset_proto_rawDescGZIP(), []int{20} } // Only the fields the single-filer startup check reads. @@ -1430,7 +1532,7 @@ type GetFilerConfigurationResponse struct { func (x *GetFilerConfigurationResponse) Reset() { *x = GetFilerConfigurationResponse{} - mi := &file_filer_subset_proto_msgTypes[20] + mi := &file_filer_subset_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1442,7 +1544,7 @@ func (x *GetFilerConfigurationResponse) String() string { func (*GetFilerConfigurationResponse) ProtoMessage() {} func (x *GetFilerConfigurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_filer_subset_proto_msgTypes[20] + mi := &file_filer_subset_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1455,7 +1557,7 @@ func (x *GetFilerConfigurationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFilerConfigurationResponse.ProtoReflect.Descriptor instead. func (*GetFilerConfigurationResponse) Descriptor() ([]byte, []int) { - return file_filer_subset_proto_rawDescGZIP(), []int{20} + return file_filer_subset_proto_rawDescGZIP(), []int{21} } func (x *GetFilerConfigurationResponse) GetMasters() []string { @@ -1472,6 +1574,58 @@ func (x *GetFilerConfigurationResponse) GetFilerGroup() string { return "" } +type WriteCondition_Clause struct { + state protoimpl.MessageState `protogen:"open.v1"` + Kind WriteCondition_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=filer_pb.WriteCondition_Kind" json:"kind,omitempty"` + Fids []string `protobuf:"bytes,9,rep,name=fids,proto3" json:"fids,omitempty"` // chunk fid strings for IF_CHUNKS_EQUAL + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteCondition_Clause) Reset() { + *x = WriteCondition_Clause{} + mi := &file_filer_subset_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteCondition_Clause) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteCondition_Clause) ProtoMessage() {} + +func (x *WriteCondition_Clause) ProtoReflect() protoreflect.Message { + mi := &file_filer_subset_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteCondition_Clause.ProtoReflect.Descriptor instead. +func (*WriteCondition_Clause) Descriptor() ([]byte, []int) { + return file_filer_subset_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *WriteCondition_Clause) GetKind() WriteCondition_Kind { + if x != nil { + return x.Kind + } + return WriteCondition_NONE +} + +func (x *WriteCondition_Clause) GetFids() []string { + if x != nil { + return x.Fids + } + return nil +} + var File_filer_subset_proto protoreflect.FileDescriptor const file_filer_subset_proto_rawDesc = "" + @@ -1530,7 +1684,15 @@ const file_filer_subset_proto_rawDesc = "" + "\x13CreateEntryResponse\x12\x14\n" + "\x05error\x18\x01 \x01(\tR\x05error\x123\n" + "\n" + - "error_code\x18\x03 \x01(\x0e2\x14.filer_pb.FilerErrorR\terrorCode\"\xd2\x02\n" + + "error_code\x18\x03 \x01(\x0e2\x14.filer_pb.FilerErrorR\terrorCode\"\xc3\x01\n" + + "\x0eWriteCondition\x129\n" + + "\aclauses\x18\x01 \x03(\v2\x1f.filer_pb.WriteCondition.ClauseR\aclauses\x1aO\n" + + "\x06Clause\x121\n" + + "\x04kind\x18\x01 \x01(\x0e2\x1d.filer_pb.WriteCondition.KindR\x04kind\x12\x12\n" + + "\x04fids\x18\t \x03(\tR\x04fids\"%\n" + + "\x04Kind\x12\b\n" + + "\x04NONE\x10\x00\x12\x13\n" + + "\x0fIF_CHUNKS_EQUAL\x10\t\"\x8a\x03\n" + "\x12UpdateEntryRequest\x12\x1c\n" + "\tdirectory\x18\x01 \x01(\tR\tdirectory\x12%\n" + "\x05entry\x18\x02 \x01(\v2\x0f.filer_pb.EntryR\x05entry\x121\n" + @@ -1538,7 +1700,8 @@ const file_filer_subset_proto_rawDesc = "" + "\n" + "signatures\x18\x04 \x03(\x05R\n" + "signatures\x12_\n" + - "\x11expected_extended\x18\x05 \x03(\v22.filer_pb.UpdateEntryRequest.ExpectedExtendedEntryR\x10expectedExtended\x1aC\n" + + "\x11expected_extended\x18\x05 \x03(\v22.filer_pb.UpdateEntryRequest.ExpectedExtendedEntryR\x10expectedExtended\x126\n" + + "\tcondition\x18\x06 \x01(\v2\x18.filer_pb.WriteConditionR\tcondition\x1aC\n" + "\x15ExpectedExtendedEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01\"\x15\n" + @@ -1639,74 +1802,80 @@ func file_filer_subset_proto_rawDescGZIP() []byte { return file_filer_subset_proto_rawDescData } -var file_filer_subset_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_filer_subset_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_filer_subset_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_filer_subset_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_filer_subset_proto_goTypes = []any{ (FilerError)(0), // 0: filer_pb.FilerError - (*LookupDirectoryEntryRequest)(nil), // 1: filer_pb.LookupDirectoryEntryRequest - (*LookupDirectoryEntryResponse)(nil), // 2: filer_pb.LookupDirectoryEntryResponse - (*ListEntriesRequest)(nil), // 3: filer_pb.ListEntriesRequest - (*ListEntriesResponse)(nil), // 4: filer_pb.ListEntriesResponse - (*Entry)(nil), // 5: filer_pb.Entry - (*FileChunk)(nil), // 6: filer_pb.FileChunk - (*FuseAttributes)(nil), // 7: filer_pb.FuseAttributes - (*CreateEntryRequest)(nil), // 8: filer_pb.CreateEntryRequest - (*CreateEntryResponse)(nil), // 9: filer_pb.CreateEntryResponse - (*UpdateEntryRequest)(nil), // 10: filer_pb.UpdateEntryRequest - (*UpdateEntryResponse)(nil), // 11: filer_pb.UpdateEntryResponse - (*DeleteEntryRequest)(nil), // 12: filer_pb.DeleteEntryRequest - (*DeleteEntryResponse)(nil), // 13: filer_pb.DeleteEntryResponse - (*AssignVolumeRequest)(nil), // 14: filer_pb.AssignVolumeRequest - (*AssignVolumeResponse)(nil), // 15: filer_pb.AssignVolumeResponse - (*LookupVolumeRequest)(nil), // 16: filer_pb.LookupVolumeRequest - (*Locations)(nil), // 17: filer_pb.Locations - (*Location)(nil), // 18: filer_pb.Location - (*LookupVolumeResponse)(nil), // 19: filer_pb.LookupVolumeResponse - (*GetFilerConfigurationRequest)(nil), // 20: filer_pb.GetFilerConfigurationRequest - (*GetFilerConfigurationResponse)(nil), // 21: filer_pb.GetFilerConfigurationResponse - nil, // 22: filer_pb.Entry.ExtendedEntry - nil, // 23: filer_pb.UpdateEntryRequest.ExpectedExtendedEntry - nil, // 24: filer_pb.DeleteEntryRequest.ExpectedExtendedEntry - nil, // 25: filer_pb.LookupVolumeResponse.LocationsMapEntry + (WriteCondition_Kind)(0), // 1: filer_pb.WriteCondition.Kind + (*LookupDirectoryEntryRequest)(nil), // 2: filer_pb.LookupDirectoryEntryRequest + (*LookupDirectoryEntryResponse)(nil), // 3: filer_pb.LookupDirectoryEntryResponse + (*ListEntriesRequest)(nil), // 4: filer_pb.ListEntriesRequest + (*ListEntriesResponse)(nil), // 5: filer_pb.ListEntriesResponse + (*Entry)(nil), // 6: filer_pb.Entry + (*FileChunk)(nil), // 7: filer_pb.FileChunk + (*FuseAttributes)(nil), // 8: filer_pb.FuseAttributes + (*CreateEntryRequest)(nil), // 9: filer_pb.CreateEntryRequest + (*CreateEntryResponse)(nil), // 10: filer_pb.CreateEntryResponse + (*WriteCondition)(nil), // 11: filer_pb.WriteCondition + (*UpdateEntryRequest)(nil), // 12: filer_pb.UpdateEntryRequest + (*UpdateEntryResponse)(nil), // 13: filer_pb.UpdateEntryResponse + (*DeleteEntryRequest)(nil), // 14: filer_pb.DeleteEntryRequest + (*DeleteEntryResponse)(nil), // 15: filer_pb.DeleteEntryResponse + (*AssignVolumeRequest)(nil), // 16: filer_pb.AssignVolumeRequest + (*AssignVolumeResponse)(nil), // 17: filer_pb.AssignVolumeResponse + (*LookupVolumeRequest)(nil), // 18: filer_pb.LookupVolumeRequest + (*Locations)(nil), // 19: filer_pb.Locations + (*Location)(nil), // 20: filer_pb.Location + (*LookupVolumeResponse)(nil), // 21: filer_pb.LookupVolumeResponse + (*GetFilerConfigurationRequest)(nil), // 22: filer_pb.GetFilerConfigurationRequest + (*GetFilerConfigurationResponse)(nil), // 23: filer_pb.GetFilerConfigurationResponse + nil, // 24: filer_pb.Entry.ExtendedEntry + (*WriteCondition_Clause)(nil), // 25: filer_pb.WriteCondition.Clause + nil, // 26: filer_pb.UpdateEntryRequest.ExpectedExtendedEntry + nil, // 27: filer_pb.DeleteEntryRequest.ExpectedExtendedEntry + nil, // 28: filer_pb.LookupVolumeResponse.LocationsMapEntry } var file_filer_subset_proto_depIdxs = []int32{ - 5, // 0: filer_pb.LookupDirectoryEntryResponse.entry:type_name -> filer_pb.Entry - 5, // 1: filer_pb.ListEntriesResponse.entry:type_name -> filer_pb.Entry - 6, // 2: filer_pb.Entry.chunks:type_name -> filer_pb.FileChunk - 7, // 3: filer_pb.Entry.attributes:type_name -> filer_pb.FuseAttributes - 22, // 4: filer_pb.Entry.extended:type_name -> filer_pb.Entry.ExtendedEntry - 5, // 5: filer_pb.CreateEntryRequest.entry:type_name -> filer_pb.Entry + 6, // 0: filer_pb.LookupDirectoryEntryResponse.entry:type_name -> filer_pb.Entry + 6, // 1: filer_pb.ListEntriesResponse.entry:type_name -> filer_pb.Entry + 7, // 2: filer_pb.Entry.chunks:type_name -> filer_pb.FileChunk + 8, // 3: filer_pb.Entry.attributes:type_name -> filer_pb.FuseAttributes + 24, // 4: filer_pb.Entry.extended:type_name -> filer_pb.Entry.ExtendedEntry + 6, // 5: filer_pb.CreateEntryRequest.entry:type_name -> filer_pb.Entry 0, // 6: filer_pb.CreateEntryResponse.error_code:type_name -> filer_pb.FilerError - 5, // 7: filer_pb.UpdateEntryRequest.entry:type_name -> filer_pb.Entry - 23, // 8: filer_pb.UpdateEntryRequest.expected_extended:type_name -> filer_pb.UpdateEntryRequest.ExpectedExtendedEntry - 24, // 9: filer_pb.DeleteEntryRequest.expected_extended:type_name -> filer_pb.DeleteEntryRequest.ExpectedExtendedEntry - 18, // 10: filer_pb.AssignVolumeResponse.location:type_name -> filer_pb.Location - 18, // 11: filer_pb.AssignVolumeResponse.replicas:type_name -> filer_pb.Location - 0, // 12: filer_pb.AssignVolumeResponse.error_code:type_name -> filer_pb.FilerError - 18, // 13: filer_pb.Locations.locations:type_name -> filer_pb.Location - 25, // 14: filer_pb.LookupVolumeResponse.locations_map:type_name -> filer_pb.LookupVolumeResponse.LocationsMapEntry - 17, // 15: filer_pb.LookupVolumeResponse.LocationsMapEntry.value:type_name -> filer_pb.Locations - 1, // 16: filer_pb.SeaweedFiler.LookupDirectoryEntry:input_type -> filer_pb.LookupDirectoryEntryRequest - 3, // 17: filer_pb.SeaweedFiler.ListEntries:input_type -> filer_pb.ListEntriesRequest - 8, // 18: filer_pb.SeaweedFiler.CreateEntry:input_type -> filer_pb.CreateEntryRequest - 10, // 19: filer_pb.SeaweedFiler.UpdateEntry:input_type -> filer_pb.UpdateEntryRequest - 12, // 20: filer_pb.SeaweedFiler.DeleteEntry:input_type -> filer_pb.DeleteEntryRequest - 14, // 21: filer_pb.SeaweedFiler.AssignVolume:input_type -> filer_pb.AssignVolumeRequest - 16, // 22: filer_pb.SeaweedFiler.LookupVolume:input_type -> filer_pb.LookupVolumeRequest - 20, // 23: filer_pb.SeaweedFiler.GetFilerConfiguration:input_type -> filer_pb.GetFilerConfigurationRequest - 2, // 24: filer_pb.SeaweedFiler.LookupDirectoryEntry:output_type -> filer_pb.LookupDirectoryEntryResponse - 4, // 25: filer_pb.SeaweedFiler.ListEntries:output_type -> filer_pb.ListEntriesResponse - 9, // 26: filer_pb.SeaweedFiler.CreateEntry:output_type -> filer_pb.CreateEntryResponse - 11, // 27: filer_pb.SeaweedFiler.UpdateEntry:output_type -> filer_pb.UpdateEntryResponse - 13, // 28: filer_pb.SeaweedFiler.DeleteEntry:output_type -> filer_pb.DeleteEntryResponse - 15, // 29: filer_pb.SeaweedFiler.AssignVolume:output_type -> filer_pb.AssignVolumeResponse - 19, // 30: filer_pb.SeaweedFiler.LookupVolume:output_type -> filer_pb.LookupVolumeResponse - 21, // 31: filer_pb.SeaweedFiler.GetFilerConfiguration:output_type -> filer_pb.GetFilerConfigurationResponse - 24, // [24:32] is the sub-list for method output_type - 16, // [16:24] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 25, // 7: filer_pb.WriteCondition.clauses:type_name -> filer_pb.WriteCondition.Clause + 6, // 8: filer_pb.UpdateEntryRequest.entry:type_name -> filer_pb.Entry + 26, // 9: filer_pb.UpdateEntryRequest.expected_extended:type_name -> filer_pb.UpdateEntryRequest.ExpectedExtendedEntry + 11, // 10: filer_pb.UpdateEntryRequest.condition:type_name -> filer_pb.WriteCondition + 27, // 11: filer_pb.DeleteEntryRequest.expected_extended:type_name -> filer_pb.DeleteEntryRequest.ExpectedExtendedEntry + 20, // 12: filer_pb.AssignVolumeResponse.location:type_name -> filer_pb.Location + 20, // 13: filer_pb.AssignVolumeResponse.replicas:type_name -> filer_pb.Location + 0, // 14: filer_pb.AssignVolumeResponse.error_code:type_name -> filer_pb.FilerError + 20, // 15: filer_pb.Locations.locations:type_name -> filer_pb.Location + 28, // 16: filer_pb.LookupVolumeResponse.locations_map:type_name -> filer_pb.LookupVolumeResponse.LocationsMapEntry + 1, // 17: filer_pb.WriteCondition.Clause.kind:type_name -> filer_pb.WriteCondition.Kind + 19, // 18: filer_pb.LookupVolumeResponse.LocationsMapEntry.value:type_name -> filer_pb.Locations + 2, // 19: filer_pb.SeaweedFiler.LookupDirectoryEntry:input_type -> filer_pb.LookupDirectoryEntryRequest + 4, // 20: filer_pb.SeaweedFiler.ListEntries:input_type -> filer_pb.ListEntriesRequest + 9, // 21: filer_pb.SeaweedFiler.CreateEntry:input_type -> filer_pb.CreateEntryRequest + 12, // 22: filer_pb.SeaweedFiler.UpdateEntry:input_type -> filer_pb.UpdateEntryRequest + 14, // 23: filer_pb.SeaweedFiler.DeleteEntry:input_type -> filer_pb.DeleteEntryRequest + 16, // 24: filer_pb.SeaweedFiler.AssignVolume:input_type -> filer_pb.AssignVolumeRequest + 18, // 25: filer_pb.SeaweedFiler.LookupVolume:input_type -> filer_pb.LookupVolumeRequest + 22, // 26: filer_pb.SeaweedFiler.GetFilerConfiguration:input_type -> filer_pb.GetFilerConfigurationRequest + 3, // 27: filer_pb.SeaweedFiler.LookupDirectoryEntry:output_type -> filer_pb.LookupDirectoryEntryResponse + 5, // 28: filer_pb.SeaweedFiler.ListEntries:output_type -> filer_pb.ListEntriesResponse + 10, // 29: filer_pb.SeaweedFiler.CreateEntry:output_type -> filer_pb.CreateEntryResponse + 13, // 30: filer_pb.SeaweedFiler.UpdateEntry:output_type -> filer_pb.UpdateEntryResponse + 15, // 31: filer_pb.SeaweedFiler.DeleteEntry:output_type -> filer_pb.DeleteEntryResponse + 17, // 32: filer_pb.SeaweedFiler.AssignVolume:output_type -> filer_pb.AssignVolumeResponse + 21, // 33: filer_pb.SeaweedFiler.LookupVolume:output_type -> filer_pb.LookupVolumeResponse + 23, // 34: filer_pb.SeaweedFiler.GetFilerConfiguration:output_type -> filer_pb.GetFilerConfigurationResponse + 27, // [27:35] is the sub-list for method output_type + 19, // [19:27] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_filer_subset_proto_init() } @@ -1719,8 +1888,8 @@ func file_filer_subset_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_filer_subset_proto_rawDesc), len(file_filer_subset_proto_rawDesc)), - NumEnums: 1, - NumMessages: 25, + NumEnums: 2, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.proto b/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.proto index 601343588e..b051fdd106 100644 --- a/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.proto +++ b/seaweed-block/core/frontend/chunkstore/filerpb/filer_subset.proto @@ -102,12 +102,29 @@ message CreateEntryResponse { FilerError error_code = 3; } +// WriteCondition is copied from weed/pb/filer.proto (this repository): the +// IF_CHUNKS_EQUAL clause only. A filer that predates it drops field 6 of +// UpdateEntryRequest as unknown and applies the write unguarded, so the +// chunkstore decides at startup, by a probe, whether it is enforced. +message WriteCondition { + enum Kind { + NONE = 0; + IF_CHUNKS_EQUAL = 9; // fail unless the stored chunk fid multiset equals fids (absent entry = no chunks) + } + message Clause { + Kind kind = 1; + repeated string fids = 9; // chunk fid strings for IF_CHUNKS_EQUAL + } + repeated Clause clauses = 1; // all must hold (logical AND) +} + message UpdateEntryRequest { string directory = 1; Entry entry = 2; bool is_from_other_cluster = 3; repeated int32 signatures = 4; map expected_extended = 5; + WriteCondition condition = 6; } message UpdateEntryResponse { diff --git a/seaweed-block/core/frontend/chunkstore/head_readers_test.go b/seaweed-block/core/frontend/chunkstore/head_readers_test.go index fa7734b33b..170bf840cb 100644 --- a/seaweed-block/core/frontend/chunkstore/head_readers_test.go +++ b/seaweed-block/core/frontend/chunkstore/head_readers_test.go @@ -45,6 +45,7 @@ var headReaders = map[string]string{ "core/frontend/chunkstore/layout_verify.go verifyHead -> LookupEntry": "absent or unknown generation makes verify incomplete and suppresses MISSING/ORPHAN (TestVerifyLayoutRequiresStableHeadForMissingAndOrphans)", "core/frontend/chunkstore/layout_verify.go verifyHead -> DecodeLayoutHeadEntry": "invalid inline envelope supplies no generation and cannot confirm findings (TestVerifyLayoutRequiresStableHeadForMissingAndOrphans)", "core/frontend/chunkstore/startup_head_probe.go checkConditionalHead -> ReadHead": "absent/unreadable/changed disposable HEAD refuses startup; no volume HEAD is read (TestCatalogStartupRequiresWrongGenerationHeadRefusal)", + "core/frontend/chunkstore/startup_head_probe.go probeChunkCondition -> LookupEntry": "absent/unreadable disposable HEAD leaves the chunk guard off (page re-read only); no volume HEAD is read (TestCatalogStartupRequiresWrongGenerationHeadRefusal)", "cmd/blockvolume/chunk_maintenance.go newChunkMaintenance -> ReadHead": "diagnostic absent HEAD reports headGen0 and headGenError; it neither authorizes nor changes cleaning (TestMaintenanceStatusRealPassAndTimeout/head-absent)", "core/frontend/chunkstore/layout_remote.go ProbeSnapshots -> ReadHead": "absent or failed reads do not infer snapshot deletion; open local activity skips the read (TestMaintenanceNoticesSnapshotDeleteWithoutNotification, TestLayoutSnapshotProbeSkipsOpenActivityWithoutReadingHEAD)", "core/frontend/durable/provider_seal_replay.go readLayoutSeal -> ReadHead": "absent, unreadable and foreign layout proof refuse without cached success (TestLayoutPlainDetachReplayAfterRestartNeedsNoLegacyFactory)", diff --git a/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go b/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go index 625fdf5dee..35cce3af77 100644 --- a/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go +++ b/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go @@ -172,6 +172,18 @@ func RunDeleteSnapshotWithIntent(ctx context.Context, st ListChainStore, base ui if !found || meta.Volume != h.VolumeID || meta.Session != deleteIntentWriter(base, ref) || meta.Mark != "" { return ErrPrecondition } + // Read the page again now that this run owns its tag. A stalled + // update from another run of the same delete can land between + // the read above and the adoption, putting a deleted page's data + // reference on this entry; once this run's tag is on it, no such + // update passes. An intent published over a page whose data is + // gone could never be consumed. The filer frees chunks from a + // deletion queue, so this sees only data already freed. + again := c + again.Ref = ref + if _, err := readListPage(ctx, st, h.VolumeID, again); err != nil { + return fmt.Errorf("%w: delete intent page changed during adoption: %w", ErrPrecondition, err) + } return nil }); err != nil { return Head{}, false, err diff --git a/seaweed-block/core/frontend/chunkstore/layout/delete_intent_reread_test.go b/seaweed-block/core/frontend/chunkstore/layout/delete_intent_reread_test.go new file mode 100644 index 0000000000..737d483b70 --- /dev/null +++ b/seaweed-block/core/frontend/chunkstore/layout/delete_intent_reread_test.go @@ -0,0 +1,171 @@ +package layout + +import ( + "context" + "errors" + "fmt" + "testing" +) + +// staleUpdateBeforeAdoption is the store as the second run of a snapshot +// delete sees it when the first run's stalled page update lands between the +// second run's read of one page (rel) and its adoption: the page then +// carries the first run's writer tag, and its data is whatever the update +// left. This is a consequence-level projection of that update: it edits the +// tag and decides what a later read of the page returns (mode). The backend +// mechanism itself, a tag-conditional whole-entry update writing a deleted +// object's chunk reference over a re-created one, is exercised on the real +// store in package chunkstore: refused with the filer's chunk condition +// (TestAStaleMetadataChangeDoesNotOverwriteARecreatedObject), and landing +// without it (TestWithoutTheChunkGuardAStaleMetadataChangeOverwritesARecreatedObject). +type staleUpdateBeforeAdoption struct { + *chainStore + rel string + staleTag string + mode string // "freed": the read fails; "wrong": it returns other bytes; "deadline": the caller's deadline ends the read; "valid": the bytes are intact + wrong []byte + landed bool +} + +func (s *staleUpdateBeforeAdoption) Stat(ctx context.Context, rel string) (ObjectMeta, bool, error) { + if rel == s.rel && !s.landed { + s.landed = true + if o, ok := s.objs[s.full(rel)]; ok { + o.meta.Session = s.staleTag + } + } + return s.chainStore.Stat(ctx, rel) +} + +func (s *staleUpdateBeforeAdoption) ReadListPage(ctx context.Context, ref ListRef) ([]byte, bool, error) { + if rel, _ := ref.Path(); s.landed && rel == s.rel { + switch s.mode { + case "freed": + return nil, false, errors.New("the page's data was freed") + case "wrong": + return append([]byte(nil), s.wrong...), true, nil + case "deadline": + return nil, false, fmt.Errorf("lookup: %w", context.DeadlineExceeded) + } + } + return s.chainStore.ReadListPage(ctx, ref) +} + +// rerunFixture stages a snapshot delete's intent at the first base, lets a +// cleaning pass delete the unlinked pages, and stages them again at the new +// base: the second run. With twoPages the intent has two pages and the +// stale update hits the later one, the second page the chain visits. +func rerunFixture(t *testing.T, twoPages bool) (s *chainStore, c ListCursor, hit ListRef, other []byte, firstBase, secondBase uint64) { + t.Helper() + ctx := context.Background() + s, c, p := deleteIntentFixture(t) + firstBase = s.h.Gen + pages := []ListPage{p} + if twoPages { + tail := p + tail.Entries = p.Entries[1:] + tailRef, err := tail.Ref() + if err != nil { + t.Fatal(err) + } + head := p + head.Entries = p.Entries[:1] + head.Pages = 2 + head.Next = &tailRef + headRef, err := head.Ref() + if err != nil { + t.Fatal(err) + } + pages = []ListPage{tail, head} + c.Ref = headRef + } + stage := func(base uint64) { + for _, pg := range pages { + if _, err := StageSnapshotDeletePage(ctx, s, base, pg); err != nil { + t.Fatal(err) + } + } + } + stage(firstBase) + s.h.Gen = firstBase + 2 // a cleaning pass + for _, pg := range pages { + ref, _ := pg.Ref() + rel, _ := ref.Path() + delete(s.objs, s.full(rel)) + } + secondBase = s.h.Gen + stage(secondBase) + hit, _ = pages[0].Ref() // the only page, or the tail: the later page visited + for _, pg := range pages { + if ref, _ := pg.Ref(); ref != hit { + other, _, _ = s.ReadListPage(ctx, ref) + } + } + if other == nil { + other = []byte(`{"pages":1,"entries":["not this page"]}`) + } + return s, c, hit, other, firstBase, secondBase +} + +// The second run of a snapshot delete must not publish an intent whose page +// lost its data, or holds other bytes, after a stalled update from the first +// run landed between the second run's read of the page and its adoption. +// The refusal comes after the adoption (the page carries this run's tag), is +// a precondition, and writes nothing to HEAD: the snapshot stays. The same +// schedule with the page's bytes intact publishes. +func TestASnapshotDeleteIsNotPublishedOverAPageWhoseDataWasFreed(t *testing.T) { + for _, tc := range []struct { + name string + mode string + twoPages bool + publish bool + cause error + }{ + {"freed, one page", "freed", false, false, nil}, + {"other bytes, one page", "wrong", false, false, nil}, + {"freed, the later of two pages", "freed", true, false, nil}, + {"other bytes, the later of two pages", "wrong", true, false, nil}, + {"the caller's deadline ends the re-read", "deadline", false, false, context.DeadlineExceeded}, + {"intact bytes after the stale tag, one page", "valid", false, true, nil}, + {"intact bytes after the stale tag, two pages", "valid", true, true, nil}, + } { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + s, c, hit, other, firstBase, secondBase := rerunFixture(t, tc.twoPages) + rel, err := hit.Path() + if err != nil { + t.Fatal(err) + } + st := &staleUpdateBeforeAdoption{chainStore: s, rel: rel, staleTag: deleteIntentWriter(firstBase, hit), mode: tc.mode, wrong: other} + updates := s.updates + _, publishErr := RunDeleteSnapshotWithIntent(ctx, st, secondBase, c) + if !st.landed { + t.Fatal("fixture: the stale update never landed (the adoption did not Stat the page)") + } + if tc.publish { + if publishErr != nil || s.h.List == nil { + t.Fatalf("an intact page after the stale tag did not publish: %v, list %+v", publishErr, s.h.List) + } + if _, kept := s.h.Snapshots["daily"]; kept { + t.Fatal("published, but the snapshot is still named") + } + return + } + if !errors.Is(publishErr, ErrPrecondition) { + t.Fatalf("publishing over a page whose data changed answered %v, want ErrPrecondition", publishErr) + } + if tc.cause != nil && !errors.Is(publishErr, tc.cause) { + t.Fatalf("the refusal dropped the re-read's cause: %v, want it to keep %v", publishErr, tc.cause) + } + if s.h.List != nil || s.updates != updates { + t.Fatalf("the refusal wrote HEAD: list %+v, %d update(s)", s.h.List, s.updates-updates) + } + if snap, kept := s.h.Snapshots["daily"]; !kept || snap.Gen != 4 { + t.Fatalf("the refusal did not keep the snapshot: %+v (kept %v)", snap, kept) + } + if meta, found, _ := s.Stat(ctx, rel); !found || meta.Session != deleteIntentWriter(secondBase, hit) { + t.Fatalf("the refusal came before the adoption: the page's tag is %+v, want this run's %q", meta, deleteIntentWriter(secondBase, hit)) + } + }) + } +} diff --git a/seaweed-block/core/frontend/chunkstore/layout_change_meta_recreated_test.go b/seaweed-block/core/frontend/chunkstore/layout_change_meta_recreated_test.go new file mode 100644 index 0000000000..666d2d54b1 --- /dev/null +++ b/seaweed-block/core/frontend/chunkstore/layout_change_meta_recreated_test.go @@ -0,0 +1,218 @@ +package chunkstore + +import ( + "bytes" + "context" + "errors" + "sync" + "testing" + + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/filerpb" + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/layout" +) + +// betweenLookupAndUpdate runs before, once, ahead of the first update: what +// other writers do while a stale one is between its lookup and its +// conditional update. It forwards the chunk condition, so a store over it can +// run with the guard on. +type betweenLookupAndUpdate struct { + Filer + once sync.Once + before func() +} + +func (f *betweenLookupAndUpdate) UpdateEntry(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte) error { + f.once.Do(f.before) + return f.Filer.UpdateEntry(ctx, dir, e, expected) +} + +func (f *betweenLookupAndUpdate) UpdateEntryIfChunks(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error { + f.once.Do(f.before) + return f.Filer.(ChunkConditionFiler).UpdateEntryIfChunks(ctx, dir, e, expected, fids) +} + +// recreatedObject is one object that a stale writer looked up, then (while +// the writer was between its lookup and its update) a cleaner marked and +// deleted, and another executor of the same operation created again with the +// same producer tag and a new chunk. +type recreatedObject struct { + f *fakeFiler + others, stale *LayoutStore + rel string + meta layout.ObjectMeta + first, second string + fid func() (string, bool) +} + +func newRecreatedObject(t *testing.T, guard bool) *recreatedObject { + t.Helper() + ctx := context.Background() + f, b := newFakeFiler(), newFakeBlobs() + var id layout.VolumeID + for i := range id { + id[i] = 0x30 + byte(i) + } + others, err := NewLayoutStore(f, b, "/vol", id) + if err != nil { + t.Fatal(err) + } + hooked := &betweenLookupAndUpdate{Filer: f} + stale, err := NewLayoutStore(hooked, b, "/vol", id) + if err != nil { + t.Fatal(err) + } + stale.SetChunkGuard(guard) + data := bytes.Repeat([]byte{0x5a}, 4096) + o := &recreatedObject{f: f, others: others, stale: stale, rel: layout.NameChunk(1, data).Path()} + dir, name, err := others.object(o.rel) + if err != nil { + t.Fatal(err) + } + o.fid = func() (string, bool) { + e, err := f.LookupEntry(ctx, dir, name) + if errors.Is(err, ErrNotFound) { + return "", false + } + if err != nil || len(e.Chunks) != 1 { + t.Fatalf("lookup %s: %+v %v", o.rel, e, err) + } + return e.Chunks[0].FileId, true + } + if err := others.Create(ctx, o.rel, data, "producer-1"); err != nil { + t.Fatal(err) + } + o.first, _ = o.fid() + meta, found, err := others.Stat(ctx, o.rel) + if err != nil || !found { + t.Fatalf("stat: %v %v", found, err) + } + o.meta = meta + hooked.before = func() { + if err := others.Mark(ctx, o.rel, meta, "clean-1"); err != nil { + t.Errorf("mark: %v", err) + } + if err := others.DeleteMarked(ctx, o.rel, "clean-1"); err != nil { + t.Errorf("delete: %v", err) + } + if err := others.Create(ctx, o.rel, data, "producer-1"); err != nil { + t.Errorf("re-create: %v", err) + } + o.second, _ = o.fid() + } + return o +} + +func (o *recreatedObject) checkRecreated(t *testing.T) { + t.Helper() + if o.second == "" || o.second == o.first { + t.Fatalf("fixture: the object was not re-created with a new chunk (first %s, second %s)", o.first, o.second) + } +} + +// A stale metadata change (a delete-intent page's adoption by an executor +// that paused between its lookup and its update) must not write the entry it +// looked up over an object deleted and created again with the same tags in +// between: the update would put the deleted object's chunk on the new entry, +// and the filer would free the new entry's chunk. With the filer's chunk +// condition the write is refused, since a re-created object has a new chunk. +func TestAStaleMetadataChangeDoesNotOverwriteARecreatedObject(t *testing.T) { + o := newRecreatedObject(t, true) + err := o.stale.Reuse(context.Background(), o.rel, o.meta, "writer-1") + o.checkRecreated(t) + if !errors.Is(err, layout.ErrPrecondition) { + t.Fatalf("the stale update over a re-created object answered %v, want ErrPrecondition", err) + } + if got, _ := o.fid(); got != o.second { + t.Fatalf("the stale update wrote chunk %s over the re-created object's %s", got, o.second) + } +} + +// With the guard on, a metadata change of an object nobody touched since its +// lookup still lands: adoption retags it, and a cleaner marks and deletes it. +func TestWithTheChunkGuardAnUnchangedObjectIsStillAdoptedMarkedAndDeleted(t *testing.T) { + ctx := context.Background() + f, b := newFakeFiler(), newFakeBlobs() + var id layout.VolumeID + for i := range id { + id[i] = 0x40 + byte(i) + } + st, err := NewLayoutStore(f, b, "/vol", id) + if err != nil { + t.Fatal(err) + } + st.SetChunkGuard(true) + data := bytes.Repeat([]byte{0x3c}, 4096) + rel := layout.NameChunk(1, data).Path() + if err := st.Create(ctx, rel, data, "producer-1"); err != nil { + t.Fatal(err) + } + meta, _, err := st.Stat(ctx, rel) + if err != nil { + t.Fatal(err) + } + if err := st.Reuse(ctx, rel, meta, "writer-1"); err != nil { + t.Fatalf("guarded adoption of an unchanged object: %v", err) + } + if meta, _, err = st.Stat(ctx, rel); err != nil || meta.Session != "writer-1" { + t.Fatalf("after adoption: %+v %v", meta, err) + } + if err := st.Mark(ctx, rel, meta, "clean-1"); err != nil { + t.Fatalf("guarded mark of an unchanged object: %v", err) + } + if err := st.DeleteMarked(ctx, rel, "clean-1"); err != nil { + t.Fatalf("delete: %v", err) + } + if _, found, err := st.Stat(ctx, rel); err != nil || found { + t.Fatalf("the marked object was not deleted: found %v %v", found, err) + } +} + +// A cleaner that looked up an object to mark it, then paused, must not +// delete the object created again in between: its mark is refused, so its +// delete (which expects that mark) is refused too. +func TestAStaleCleanerMarkDoesNotDeleteARecreatedObject(t *testing.T) { + o := newRecreatedObject(t, true) + ctx := context.Background() + markErr := o.stale.Mark(ctx, o.rel, o.meta, "clean-2") + o.checkRecreated(t) + if !errors.Is(markErr, layout.ErrPrecondition) { + t.Fatalf("the stale mark over a re-created object answered %v, want ErrPrecondition", markErr) + } + if err := o.stale.DeleteMarked(ctx, o.rel, "clean-2"); !errors.Is(err, layout.ErrPrecondition) { + t.Fatalf("deleting under the refused mark answered %v, want ErrPrecondition", err) + } + if got, found := o.fid(); !found || got != o.second { + t.Fatalf("the re-created object is gone or changed: chunk %q found %v, want %s", got, found, o.second) + } +} + +// Without the chunk condition (a filer that does not enforce it) both stale +// writes land: the store behavior the delete intent page re-read exists for, +// kept visible here. +func TestWithoutTheChunkGuardAStaleMetadataChangeOverwritesARecreatedObject(t *testing.T) { + t.Run("adoption", func(t *testing.T) { + o := newRecreatedObject(t, false) + err := o.stale.Reuse(context.Background(), o.rel, o.meta, "writer-1") + o.checkRecreated(t) + if err != nil { + t.Fatalf("the unguarded stale update was refused (%v)", err) + } + if got, _ := o.fid(); got != o.first { + t.Fatalf("the unguarded stale update left chunk %s, want the deleted object's %s", got, o.first) + } + }) + t.Run("cleaner", func(t *testing.T) { + o := newRecreatedObject(t, false) + ctx := context.Background() + if err := o.stale.Mark(ctx, o.rel, o.meta, "clean-2"); err != nil { + t.Fatalf("the unguarded stale mark was refused (%v)", err) + } + o.checkRecreated(t) + if err := o.stale.DeleteMarked(ctx, o.rel, "clean-2"); err != nil { + t.Fatalf("delete: %v", err) + } + if _, found := o.fid(); found { + t.Fatal("the unguarded stale mark did not lead to the re-created object's deletion") + } + }) +} diff --git a/seaweed-block/core/frontend/chunkstore/layout_store.go b/seaweed-block/core/frontend/chunkstore/layout_store.go index 2b15656a03..05eee901d7 100644 --- a/seaweed-block/core/frontend/chunkstore/layout_store.go +++ b/seaweed-block/core/frontend/chunkstore/layout_store.go @@ -36,6 +36,9 @@ type LayoutStore struct { b Blobs root string id layout.VolumeID + // chunkGuard: the filer enforces IF_CHUNKS_EQUAL (the startup probe said + // so), and metadata changes send the looked-up entry's chunk fids with it. + chunkGuard bool } func NewLayoutStore(f Filer, b Blobs, root string, id layout.VolumeID) (*LayoutStore, error) { @@ -362,9 +365,28 @@ func (s *LayoutStore) changeMeta(ctx context.Context, rel string, expect layout. e.Extended[layoutMark] = []byte(mark) // Preserve the original FileChunks: an UpdateEntry dropping them // would tell the filer to delete the object's immutable data. + // + // The update writes the whole looked-up entry back, chunks included, and + // its tags alone do not tell this object from one deleted and created + // again with the same tags since the lookup: written over that one, the + // update would put the deleted object's chunks on it and the filer would + // free the new chunks. A re-created object always has new chunks, so the + // filer's chunk condition refuses that write. Without it (a filer that + // does not enforce the condition), delete intent publication re-reads + // each adopted page instead (layout.RunDeleteSnapshotWithIntent). + if cf, ok := s.f.(ChunkConditionFiler); ok && s.chunkGuard { + return layoutError(cf.UpdateEntryIfChunks(ctx, dir, e, objectExpected(expect), entryFids(e))) + } return layoutError(s.f.UpdateEntry(ctx, dir, e, objectExpected(expect))) } +// SetChunkGuard turns the filer chunk condition on or off for this store's +// metadata changes; BCatalog sets it from its startup probe. +func (s *LayoutStore) SetChunkGuard(on bool) { s.chunkGuard = on } + +// ChunkGuard reports whether metadata changes send the chunk condition. +func (s *LayoutStore) ChunkGuard() bool { return s.chunkGuard } + func (s *LayoutStore) Reuse(ctx context.Context, rel string, expect layout.ObjectMeta, session string) error { if session == "" { return errors.New("chunkstore: reuse needs a session") diff --git a/seaweed-block/core/frontend/chunkstore/memfiler.go b/seaweed-block/core/frontend/chunkstore/memfiler.go index 412cc12553..b9c99e9440 100644 --- a/seaweed-block/core/frontend/chunkstore/memfiler.go +++ b/seaweed-block/core/frontend/chunkstore/memfiler.go @@ -63,6 +63,23 @@ func (m *MemFiler) UpdateEntry(_ context.Context, dir string, e *filerpb.Entry, return nil } +// UpdateEntryIfChunks is UpdateEntry that also requires the stored chunk +// fids to equal fids as a multiset, as the filer's IF_CHUNKS_EQUAL does. +func (m *MemFiler) UpdateEntryIfChunks(_ context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error { + m.mu.Lock() + defer m.mu.Unlock() + p := path.Join(dir, e.GetName()) + cur, ok := m.e[p] + if !ok { + return ErrNotFound + } + if !extendedMatch(cur, expected) || !fidsEqual(entryFids(cur), fids) { + return ErrPrecondition + } + m.e[p] = proto.Clone(e).(*filerpb.Entry) + return nil +} + func (m *MemFiler) ListEntries(_ context.Context, dir, prefix, startAfter string, limit uint32) ([]*filerpb.Entry, error) { m.mu.Lock() defer m.mu.Unlock() diff --git a/seaweed-block/core/frontend/chunkstore/remote.go b/seaweed-block/core/frontend/chunkstore/remote.go index f588d3e397..f8fd406d70 100644 --- a/seaweed-block/core/frontend/chunkstore/remote.go +++ b/seaweed-block/core/frontend/chunkstore/remote.go @@ -35,6 +35,49 @@ type Filer interface { DeleteEntry(ctx context.Context, dir, name string, expected map[string][]byte) error } +// ChunkConditionFiler is a Filer that can also send the filer's +// IF_CHUNKS_EQUAL write condition: UpdateEntryIfChunks applies e only if every +// expected extended key still holds its value AND the stored entry's chunk +// fids still equal fids as a multiset; otherwise ErrPrecondition. A filer +// that predates the condition drops it and applies the write unguarded, which +// only a probe can tell (BCatalog.checkConditionalHead); a wrapper that does +// not forward this method is treated the same way. +type ChunkConditionFiler interface { + UpdateEntryIfChunks(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error +} + +// chunksEqual is the filer write condition that the stored chunk fids equal +// fids as a multiset (no fids: the entry has no chunks). +func chunksEqual(fids []string) *filerpb.WriteCondition { + return &filerpb.WriteCondition{Clauses: []*filerpb.WriteCondition_Clause{{Kind: filerpb.WriteCondition_IF_CHUNKS_EQUAL, Fids: fids}}} +} + +// entryFids is the multiset of e's chunk fids, in its order. +func entryFids(e *filerpb.Entry) []string { + fids := make([]string, 0, len(e.GetChunks())) + for _, c := range e.GetChunks() { + fids = append(fids, c.GetFileId()) + } + return fids +} + +// fidsEqual compares two fid lists as multisets, as the filer does. +func fidsEqual(a, b []string) bool { + if len(a) != len(b) { + return false + } + n := make(map[string]int, len(a)) + for _, f := range a { + n[f]++ + } + for _, f := range b { + if n[f]--; n[f] < 0 { + return false + } + } + return true +} + // Blobs stores immutable chunk payloads as SeaweedFS needles. type Blobs interface { // Put stores data as a new needle and returns its fid. A fid is never diff --git a/seaweed-block/core/frontend/chunkstore/startup_chunk_condition_probe_test.go b/seaweed-block/core/frontend/chunkstore/startup_chunk_condition_probe_test.go new file mode 100644 index 0000000000..4a7b0f30c8 --- /dev/null +++ b/seaweed-block/core/frontend/chunkstore/startup_chunk_condition_probe_test.go @@ -0,0 +1,80 @@ +package chunkstore + +import ( + "context" + "errors" + "testing" + + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/filerpb" + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/layout" +) + +// hidesChunkCondition is a Filer wrapper that does not forward +// UpdateEntryIfChunks: to the probe it is a filer without the condition. +type hidesChunkCondition struct{ Filer } + +// chunkProbeFails answers every conditional update with err (the HEAD gate, +// an unconditional update, is unaffected): no definite refusal. +type chunkProbeFails struct { + *fakeFiler + err error +} + +func (f chunkProbeFails) UpdateEntryIfChunks(context.Context, string, *filerpb.Entry, map[string][]byte, []string) error { + return f.err +} + +// The startup probe decides the metadata change guard from the filer's +// answer alone: a filer that refuses a mismatched IF_CHUNKS_EQUAL update turns +// the guard on for every store the catalog opens; a filer that drops the +// condition (or a client that cannot send it) leaves the page re-read as the +// only check. No version string is read. +func TestTheStartupProbeTurnsTheChunkGuardOnOnlyForAFilerThatEnforcesIt(t *testing.T) { + for _, tc := range []struct { + name string + filer func() Filer + guard string + storeG bool + }{ + {"a filer that enforces the condition", func() Filer { return newFakeFiler() }, MetadataGuardChunks, true}, + {"a filer that drops the condition", func() Filer { f := newFakeFiler(); f.ignoreChunkCondition = true; return f }, MetadataGuardReread, false}, + {"a client wrapper that cannot send it", func() Filer { return hidesChunkCondition{newFakeFiler()} }, MetadataGuardReread, false}, + // Enforcement not established: the probe got no definite refusal. + {"a probe that times out", func() Filer { return chunkProbeFails{newFakeFiler(), context.DeadlineExceeded} }, MetadataGuardReread, false}, + {"a probe whose answer is lost", func() Filer { return chunkProbeFails{newFakeFiler(), errors.New("transport: lost answer")} }, MetadataGuardReread, false}, + {"a probe whose entry vanished", func() Filer { return chunkProbeFails{newFakeFiler(), ErrNotFound} }, MetadataGuardReread, false}, + } { + t.Run(tc.name, func(t *testing.T) { + cat, err := NewBCatalog(tc.filer(), newFakeBlobs(), "/blocks") + if err != nil { + t.Fatal(err) + } + if err := cat.checkConditionalHead(context.Background()); err != nil { + t.Fatalf("the conditional HEAD probe failed: %v", err) + } + if got := cat.MetadataGuard(); got != tc.guard { + t.Fatalf("metadata guard %q, want %q", got, tc.guard) + } + id, err := layout.NewVolumeID() + if err != nil { + t.Fatal(err) + } + v := VolumeRef{Name: "v1", ID: id} + st, err := cat.Store(v) + if err != nil { + t.Fatal(err) + } + if st.ChunkGuard() != tc.storeG { + t.Fatalf("a store opened by the catalog has chunk guard %v, want %v", st.ChunkGuard(), tc.storeG) + } + // /status/chunk answers the catalog's usage: it names the guard. + ctx := context.Background() + if _, err := cat.CreateVolume(ctx, v, layout.Geometry{SizeBytes: 64 * 4096, BlockSize: 4096, ChunkBytes: 4 * 4096}); err != nil { + t.Fatal(err) + } + if u, err := cat.Usage(ctx, v); err != nil || u.MetadataGuard != tc.guard { + t.Fatalf("usage names guard %q (%v), want %q", u.MetadataGuard, err, tc.guard) + } + }) + } +} diff --git a/seaweed-block/core/frontend/chunkstore/startup_head_probe.go b/seaweed-block/core/frontend/chunkstore/startup_head_probe.go index cf6ae98aa6..a02fdfec26 100644 --- a/seaweed-block/core/frontend/chunkstore/startup_head_probe.go +++ b/seaweed-block/core/frontend/chunkstore/startup_head_probe.go @@ -152,5 +152,34 @@ func (c *BCatalog) checkConditionalHead(ctx context.Context) error { if err != nil || !bytes.Equal(before, after) { return fmt.Errorf("%w: wrong-generation update changed %s", ErrConditionalHead, root) } + c.chunkGuard = probeChunkCondition(ctx, c.f, root) + log.Printf("chunkstore: metadata change guard: %s", c.MetadataGuard()) return nil } + +// probeChunkCondition asks the filer to rewrite the disposable probe HEAD +// only if it holds a chunk it does not have. A filer that enforces +// IF_CHUNKS_EQUAL refuses; one that predates it drops the unknown field and +// applies the write (the same entry, in a directory nothing else reads). +// Only a definite refusal turns the guard on; anything else leaves the +// page re-read as the only check. No version string is consulted. +func probeChunkCondition(ctx context.Context, f Filer, root string) bool { + cf, ok := f.(ChunkConditionFiler) + if !ok { + return false + } + e, err := f.LookupEntry(ctx, root, layout.HeadName) + if err != nil { + log.Printf("chunkstore: WARNING chunk condition probe: read %s: %v", root, err) + return false + } + absent := append(entryFids(e), "0,"+strings.TrimPrefix(path.Base(root), startupProbePrefix)) + err = cf.UpdateEntryIfChunks(ctx, root, e, nil, absent) + if errors.Is(err, ErrPrecondition) { + return true + } + if err != nil { + log.Printf("chunkstore: WARNING chunk condition probe: update %s: %v", root, err) + } + return false +} diff --git a/seaweed-block/core/frontend/chunkstore/startup_head_probe_test.go b/seaweed-block/core/frontend/chunkstore/startup_head_probe_test.go index cc3a439562..a9f3615a57 100644 --- a/seaweed-block/core/frontend/chunkstore/startup_head_probe_test.go +++ b/seaweed-block/core/frontend/chunkstore/startup_head_probe_test.go @@ -23,8 +23,13 @@ type conditionalProbeServer struct { configFiler store *fakeFiler mode string - updates int - creates []*filerpb.CreateEntryRequest + updates int // updates without a write condition: the wrong-generation exchange + // chunkProbes counts updates carrying a write condition: the chunk + // condition probe. Only mode conditional-chunk-filer enforces it; the + // other modes drop it, as a filer that predates it does. + chunkProbes int + headReadsAfterUpdate int + creates []*filerpb.CreateEntryRequest } func (f *conditionalProbeServer) CreateEntry(ctx context.Context, r *filerpb.CreateEntryRequest) (*filerpb.CreateEntryResponse, error) { @@ -38,9 +43,42 @@ func (f *conditionalProbeServer) CreateEntry(ctx context.Context, r *filerpb.Cre } func (f *conditionalProbeServer) UpdateEntry(ctx context.Context, r *filerpb.UpdateEntryRequest) (*filerpb.UpdateEntryResponse, error) { f.mu.Lock() - f.updates++ + if r.GetCondition() != nil { + f.chunkProbes++ + } else { + f.updates++ + } mode := f.mode f.mu.Unlock() + if r.GetCondition() != nil { + // The HEAD gate passed; only the chunk condition probe fails here. + switch mode { + case "chunk-probe-unavailable": + return nil, status.Error(codes.Unavailable, "lost answer") + case "chunk-probe-deadline": + return nil, status.Error(codes.DeadlineExceeded, "no answer in time") + case "chunk-probe-internal": + return nil, status.Error(codes.Internal, "filer error") + case "chunk-probe-not-found": + return nil, status.Error(codes.NotFound, "update target absent") + } + } + if mode == "conditional-chunk-filer" && r.GetCondition() != nil { + var fids []string + for _, c := range r.GetCondition().GetClauses() { + if c.GetKind() != filerpb.WriteCondition_IF_CHUNKS_EQUAL { + return nil, status.Error(codes.InvalidArgument, "unexpected clause") + } + fids = append(fids, c.GetFids()...) + } + if err := f.store.UpdateEntryIfChunks(ctx, r.Directory, r.Entry, r.ExpectedExtended, fids); err != nil { + if errors.Is(err, ErrPrecondition) { + return nil, status.Error(codes.FailedPrecondition, err.Error()) + } + return nil, status.Error(codes.Internal, err.Error()) + } + return &filerpb.UpdateEntryResponse{}, nil + } if mode == "not-found" { return nil, status.Error(codes.NotFound, "update target absent") } @@ -64,6 +102,17 @@ func (f *conditionalProbeServer) UpdateEntry(ctx context.Context, r *filerpb.Upd return &filerpb.UpdateEntryResponse{}, nil } func (f *conditionalProbeServer) LookupDirectoryEntry(ctx context.Context, r *filerpb.LookupDirectoryEntryRequest) (*filerpb.LookupDirectoryEntryResponse, error) { + f.mu.Lock() + if r.Name == layout.HeadName && f.updates > 0 { + f.headReadsAfterUpdate++ + } + failProbeRead := f.mode == "chunk-probe-lookup-error" && f.headReadsAfterUpdate == 2 + f.mu.Unlock() + // After the wrong-generation exchange the gate confirms HEAD (first read); + // the second read is the chunk condition probe's. + if failProbeRead { + return nil, status.Error(codes.Unavailable, "lookup lost") + } e, err := f.store.LookupEntry(ctx, r.Directory, r.Name) if err != nil { return nil, status.Error(codes.NotFound, err.Error()) @@ -95,7 +144,9 @@ func (f *conditionalProbeServer) DeleteEntry(ctx context.Context, r *filerpb.Del return &filerpb.DeleteEntryResponse{}, nil } func TestCatalogStartupRequiresWrongGenerationHeadRefusal(t *testing.T) { - for _, mode := range []string{"ignores-conditions", "mutates-then-refuses", "transport-error", "not-found", "conditional-filer", "cleanup-head-error", "cleanup-dir-error"} { + for _, mode := range []string{"ignores-conditions", "mutates-then-refuses", "transport-error", "not-found", "conditional-filer", "conditional-chunk-filer", "cleanup-head-error", "cleanup-dir-error", + // The HEAD gate passes; the chunk condition probe gets no definite refusal. + "chunk-probe-unavailable", "chunk-probe-deadline", "chunk-probe-internal", "chunk-probe-not-found", "chunk-probe-lookup-error"} { t.Run(mode, func(t *testing.T) { var logs bytes.Buffer previous := log.Writer() @@ -120,7 +171,8 @@ func TestCatalogStartupRequiresWrongGenerationHeadRefusal(t *testing.T) { if client != nil { defer client.Close() } - if mode != "conditional-filer" && !strings.HasPrefix(mode, "cleanup-") { + admitted := mode == "conditional-filer" || mode == "conditional-chunk-filer" || strings.HasPrefix(mode, "cleanup-") || strings.HasPrefix(mode, "chunk-probe-") + if !admitted { if !errors.Is(err, ErrConditionalHead) || cat != nil || !strings.Contains(err.Error(), "conditional HEAD") { t.Fatalf("broken conditional startup: cat=%v err=%v", cat, err) } @@ -131,9 +183,36 @@ func TestCatalogStartupRequiresWrongGenerationHeadRefusal(t *testing.T) { t.Fatalf("cleanup warning missing: %s", logs.String()) } f.mu.Lock() - updates := f.updates + updates, chunkProbes := f.updates, f.chunkProbes creates := append([]*filerpb.CreateEntryRequest(nil), f.creates...) f.mu.Unlock() + // An admitted startup sends one chunk condition probe, over the + // real client, and keeps the guard on only if the filer refused it. + wantProbes, wantGuard := 0, "" + if admitted { + wantProbes, wantGuard = 1, MetadataGuardReread + if mode == "chunk-probe-lookup-error" { + wantProbes = 0 // the probe could not read HEAD, so it sent nothing + } + if mode == "conditional-chunk-filer" { + wantGuard = MetadataGuardChunks + } + } + if chunkProbes != wantProbes { + t.Fatalf("chunk condition probes=%d want %d", chunkProbes, wantProbes) + } + if admitted && cat.MetadataGuard() != wantGuard { + t.Fatalf("metadata guard %q want %q", cat.MetadataGuard(), wantGuard) + } + if admitted && !strings.Contains(logs.String(), "metadata change guard: "+wantGuard) { + t.Fatalf("the startup log does not name the guard %q: %s", wantGuard, logs.String()) + } + if admitted { + st, err := cat.Store(VolumeRef{Name: "v1", ID: layout.VolumeID{1}}) + if err != nil || st.ChunkGuard() != (wantGuard == MetadataGuardChunks) { + t.Fatalf("a store the catalog opens has chunk guard %v (%v), want %v", st.ChunkGuard(), err, wantGuard == MetadataGuardChunks) + } + } // This mint is a disposable HEAD label, not an alternate volume // creator. No VOLUME, lifecycle identity or real volume root is used. if len(creates) != 1 { diff --git a/seaweed-block/core/frontend/chunkstore/swfs.go b/seaweed-block/core/frontend/chunkstore/swfs.go index 23941589bd..6e9c738323 100644 --- a/seaweed-block/core/frontend/chunkstore/swfs.go +++ b/seaweed-block/core/frontend/chunkstore/swfs.go @@ -160,8 +160,19 @@ func (c *SWFS) CreateEntry(ctx context.Context, dir string, e *filerpb.Entry, oE // FailedPrecondition. Any other error is ambiguous (the write may or may not // have applied) and is returned unwrapped from the sentinels. func (c *SWFS) UpdateEntry(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte) error { + return c.updateEntry(ctx, dir, e, expected, nil) +} + +// UpdateEntryIfChunks implements ChunkConditionFiler: UpdateEntry that also +// sends the filer's IF_CHUNKS_EQUAL condition with fids. A failed condition +// comes back as gRPC FailedPrecondition, like a failed expected_extended. +func (c *SWFS) UpdateEntryIfChunks(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error { + return c.updateEntry(ctx, dir, e, expected, chunksEqual(fids)) +} + +func (c *SWFS) updateEntry(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, cond *filerpb.WriteCondition) error { return maintenanceError(ctx, func(ctx context.Context) error { - _, err := c.fc.UpdateEntry(ctx, &filerpb.UpdateEntryRequest{Directory: dir, Entry: e, ExpectedExtended: expected}) + _, err := c.fc.UpdateEntry(ctx, &filerpb.UpdateEntryRequest{Directory: dir, Entry: e, ExpectedExtended: expected, Condition: cond}) if err == nil { return nil } diff --git a/seaweed-block/core/host/volume/status_chunk_test.go b/seaweed-block/core/host/volume/status_chunk_test.go index 69782bc4e3..cec62f8ba8 100644 --- a/seaweed-block/core/host/volume/status_chunk_test.go +++ b/seaweed-block/core/host/volume/status_chunk_test.go @@ -16,7 +16,7 @@ import ( // GET /status/chunk?volume= answers the served volume's space accounting // and retention policy; the usual chunk-route guards apply. func TestStatusServer_StatusChunkUsage(t *testing.T) { - fake := &fakeChunkControl{usage: chunkstore.Usage{Snapshots: 1, Dependents: 2, OwnChunks: 3, ForeignChunks: 4}} + fake := &fakeChunkControl{usage: chunkstore.Usage{Snapshots: 1, Dependents: 2, OwnChunks: 3, ForeignChunks: 4, MetadataGuard: chunkstore.MetadataGuardChunks}} s := chunkServer(t, fake, true) w := serveStatusChunk(t, s, http.MethodGet, "/status/chunk?volume=v1") if w.Code != http.StatusOK { diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index c0ddb4386a..b7dfe5d590 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -641,6 +641,8 @@ stateDiagram-v2 idle --> clean: BeginClean(c) clean --> idle: EndClean(c) snap --> snap: PublishList (durable session pages, base CAS) + idle --> idle: DeleteSnapshotWithIntent (adopted pages read again, one CAS) + snap --> snap: DeleteSnapshotWithIntent (adopted pages read again, one CAS) clean --> clean: AdvanceList (effects then cursor CAS) clean --> clean: roots, segments, chunk shards and unreached list pages (conditional removal) idle --> deleting: MarkDeleting (no holder, no dependents) @@ -655,7 +657,7 @@ stateDiagram-v2 | snap(s), list slot empty | snap(s), list cursor published | same full holder, open session and original base generation; every page durable; full slot returns queue_full without replacing work; unknown reply retains protection | `list_chain.go` `StageListPage`, `RunPublishList` | `INV-LIST-PUBLISH-001` | | clean(c), current list page | clean(c), next continuation or none | exact observed cursor CAS only after authenticated page effects succeed; failed reads and failed effects leave cursor unchanged | `list_chain.go` `RunAdvanceList` | `INV-LIST-CURSOR-001` | | clean(c), stored list page | clean(c), unreached page removed | tags before HEAD; current clean session; spare all current-chain pages; conditional mark then delete | `remove.go` `Cleaner.Page` | `INV-LIST-RETIRE-001` | -| idle/snap, retained snapshot | same activity, row removed and intent published | one CAS removes only captured name/gen and names its durable chain; each page present, this attempt's tag, unmarked; clean activity refuses | `delete_intent.go` `RunDeleteSnapshotWithIntent` | `INV-SNAPSHOT-DELETE-INTENT-001`, `INV-SNAPSHOT-DELETE-ADOPT-001` | +| idle/snap, retained snapshot | same activity, row removed and intent published | one CAS removes only captured name/gen and names its durable chain; each page present, this attempt's tag, unmarked, then read and authenticated again after adoption; clean activity refuses | `delete_intent.go` `RunDeleteSnapshotWithIntent` | `INV-SNAPSHOT-DELETE-INTENT-001`, `INV-SNAPSHOT-DELETE-ADOPT-001`, `INV-SNAPSHOT-DELETE-ADOPT-002` | | idle live/detached, persisted delete intent | idle live/detached, next intent page or none | receipt-independent continuation from current HEAD; live-root and conditional effect guards; cursor follows completed effects | `delete_intent.go` `RunConsumeSnapshotDeleteIntent`; `BCatalog.CleanSnapshotDeletePage`; `LayoutRemote.Clean` | `INV-SNAPSHOT-DELETE-CONSUME-001` | | idle | snap(s) | caller is the holder at HEAD's epoch (epoch, server and claim id); HEAD present; snap(s) again is a replay, any other activity is refused | head.go `Head.Begin`, `runTransition` | `INV-SNAPK-HEAD-WRITE-001`, `INV-SNAPK-BEGIN-001` | | snap(s) | idle | holder at HEAD's epoch (epoch, server and claim id); activity is snap(s); over idle it succeeds without a write and means only that no activity remains; before resuming a failed stop, abort its still-open session and re-read HEAD: only matching live/idle resumes, detached goes Down, absent/unknown stays stopped | head.go `Head.Abort`; durable/provider_layout.go `settleLayoutStop` | `INV-SNAPK-ABORT-001` | @@ -1095,6 +1097,7 @@ Notes: | `INV-WS-ONE-PROCESS-PER-HOST-001` | One host runs at most one live blockvolume per volume: each takes the volume's exclusive host lock before its store opens and holds it until the store closes; a second is refused before it opens anything, whatever its `--durable-root`. | M4 (start) → Attaching, Refused | `core/frontend/durable/provider.go` `DurableProvider.lockVolumeOnHost` | `TestOneLiveProcessPerVolumePerHost`, `TestHostVolumeLockDirectoryCreatedOrRefused`, `TestHostVolumeLockRefusesNonDirectoryLockPath`, `TestHostVolumeLockTakesReadOnlyLockFile` (`core/frontend/durable/one_process_per_volume_test.go`); `TestHostVolumeLockCreatesParent0755AndLocks0700`, `TestHostVolumeLockKeepsExistingDirectoryModes` (`core/frontend/durable/volume_lock_parent_mode_test.go`); `TestVolumeLockDirTestOnlyRefusedUnderSystemd` (`cmd/blockvolume/volume_lock_flag_test.go`) | — | ACTIVE | | `INV-CHUNK-LEASE-REQUIRED-001` | Blockvolume refuses walstore-chunk startup without --workspace-lease before any host or store is opened. The refusal names concurrent acknowledging writers and acknowledged-write loss after a forced move; plain walstore startup is unchanged. | M4 startup → Refused | `cmd/blockvolume/main.go` `parseFlags` | `TestChunkVolumeRequiresWorkspaceLeaseBeforeStart` | — | ACTIVE | | `INV-WS-CONDITIONAL-HEAD-001` | Catalog startup requires a wrong-generation conditional update of a disposable HEAD to be definitely refused and leave its bytes and generation unchanged. Unknown probe outcomes refuse admission; cleanup failures only warn with the leftover path. No volume HEAD is used. | M4 startup → Refused | `core/frontend/chunkstore/swfs_catalog.go` `DialBCatalog`; `startup_head_probe.go` `checkConditionalHead` | `TestCatalogStartupRequiresWrongGenerationHeadRefusal`, `TestConditionalHeadNextStartCleansCrashLeftovers`, `TestConditionalHeadSweepWaitsAndLeavesNewProbes`, `TestCatalogStartupDoesNotWaitForUndeletableProbe`, `TestLayoutIdentityWriterAndReaders` | — | ACTIVE | +| `INV-WS-CHUNK-CONDITION-PROBE-001` | Catalog startup turns the chunk guard on only if the filer definitely refuses a mismatched chunk-condition update of the disposable HEAD; any other answer leaves the page re-read as the only check. No version string is read; the startup log and /status/chunk name the guard. | M4 startup | `core/frontend/chunkstore/startup_head_probe.go` `probeChunkCondition`; `catalog_b.go` `Store`, `MetadataGuard`, `Usage` | `TestTheStartupProbeTurnsTheChunkGuardOnOnlyForAFilerThatEnforcesIt` (`core/frontend/chunkstore/startup_chunk_condition_probe_test.go`), `TestCatalogStartupRequiresWrongGenerationHeadRefusal` (`core/frontend/chunkstore/startup_head_probe_test.go`), `TestStatusServer_StatusChunkUsage` (`core/host/volume/status_chunk_test.go`) | MetaABA r2, checked outside the repository: guard on = `safe_chunks_equal`; the fallback is the re-read, which a chunk still queued for deletion defeats (`mut_reread_delayed`) | ACTIVE | | `INV-WS-SINGLE-FILER-001` | Startup requires all configured masters to answer and agree on a leader; only that leader listing exactly the target filer and confirming leadership afterward admits. Followers' lists do not decide. Unknown views retry within 60 s. This census does not fence later filer registration. | M4 (startup) → Refused | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring`; `cmd/sw-block/chunk.go` `refuseUnlessSingleFiler` | `TestSingleFilerCensusUsesTheAgreedLeader`; `TestCheckSingleFilerRefusesAnotherOrSeveralFilers`, `TestCheckSingleFilerFailsClosed`, `TestCheckSingleFilerNeedsEveryMasterToAnswer`, `TestIsTargetComparesScopedAddresses`, `TestCheckSingleFilerPasses` (`core/frontend/chunkstore/single_filer_test.go`), `TestChunkWiringRefusesAMultiFilerGroup` (`cmd/blockvolume/single_filer_test.go`), `TestOpsChunk_WritingCommandsRunTheSingleFilerCheck` (`cmd/sw-block/chunk_start_check_test.go`), `TestOpsChunk_VerifyRunsTheSingleFilerCheck` (`cmd/sw-block/chunk_verify_test.go`) | — | ACTIVE | | `INV-CLI-SINGLE-FILER-CLIENT-001` | Chunk metadata commands refuse missing, typed-nil and non-SWFS clients before catalog access; only a live SWFS client can run the census. | M4 startup client admission | `cmd/sw-block/chunk.go` `checkSingleFiler`, `refuseUnlessSingleFiler` | `TestSingleFilerCheckRefusesUnsupportedClients`, `TestOpsChunkWritingRefusesUnsupportedFilerBeforeCatalogAccess` | — (client capability guard) | ACTIVE | | `INV-WS-LEASE-REGRANT-001` | Re-grant after expiry keeps the same holder and epoch, with no pending move or revocation, a certain store, and one durable write after the horizon/deadline plus skew barrier. Restart begins a new session and voids the old; ordinary reopen keeps HEAD identity (epoch, holder, claim) unchanged. | M2 Expired → Granted; M9 Start | `core/authority/workspace_lease_view.go` `regrantWorkspaceLease`; `core/authority/workspace.go` `forcedMoveBarrierLocked`; `core/frontend/chunkstore/layout/start.go` `Start` | `TestWorkspaceLeaseExpiredSameHolderRegrantIsDurable`, `TestWorkspaceLeaseRegrantWaitsForFullSkew`, `TestWorkspaceLeaseRegrantDefeatsAlreadyPassedForcedPreflight`, `TestWorkspaceLeaseForcedIssueDefeatsOldHolderRegrant`, `TestWorkspaceLeaseRegrantWaitsForDurabilityAndLatchesFailure` (`core/authority/workspace_regrant_test.go`); `TestWorkspaceLeaseRegrantPreservesLocalLogThroughFirstCut` (`core/authority/workspace_regrant_storage_test.go`); `TestStart_OwnEpochFreshRootRefusedBeforeClaim`, `TestStart_OwnEpochSameRootContinues` (`core/frontend/chunkstore/layout/start_test.go`); `TestClaim_WritesItsClaimID`, `TestRunClaim_VoidsTheOldSession` (`core/frontend/chunkstore/layout/claim_test.go`); `TestLocalReopenClaimsBeforeServing` (`core/frontend/durable/provider_reopen_belt_test.go`) | `WorkspaceRegrant` `NoDualServingInc`, `RegrantNoLoss`, `DiskCoversMemory`; `INV-SNAPK-START-ROOT-001` | ACTIVE | @@ -1547,6 +1550,8 @@ Notes: | `INV-SNAPSHOT-DELETE-INTENT-001` | Removing a captured snapshot incarnation and publishing its durable intent are one HEAD CAS; an unrelated metadata retry keeps the same target and durable pages. | M9 metadata delete | `delete_intent.go` `RunDeleteSnapshotWithIntent` | `TestDeleteSnapshotWithIntent_Closure`, `TestRunDeleteSnapshotWithIntent_InterruptAtEveryStep`, `TestDeleteIntentRetryKeepsDurablePagesAcrossMetadataCAS` | SnapDelete 241-245; PageChain 246-249 | DORMANT | | `INV-SNAPSHOT-DELETE-CONSUME-001` | Only current persisted delete intent authorizes offline reclamation; live roots remain protected, failed effects retain the cursor, and receipt retirement cannot erase work. | M9 idle intent continuation | `core/frontend/chunkstore/layout/delete_intent.go` `RunConsumeSnapshotDeleteIntent`; `core/frontend/chunkstore/layout/remove.go` `Cleaner.removePlanned`; `core/frontend/chunkstore/layout_remote.go` `LayoutRemote.Clean` | `TestConsumeSnapshotDeleteIntent_Closure`, `TestDeleteIntentOfflineAndReplacementPreserved`, `TestDeleteIntentMarkConflictKeepsUnfinishedPage`, `TestLayoutSnapshotDeleteIntentResumesWithoutReceipt`, `TestCatalogDeleteIntentResumesOnePageWithoutNamespaceScan`, `TestCatalogIntentCursorInterruptAndLostReply`, `TestHolderMaintenanceResumesThePersistedDeleteIntent`, `TestHolderMaintenanceIntentIsCancelledBeforeTheCutJoins` | PageChain r2 246,251-253 (az1 13/13); StaleClean 159-161 | ACTIVE | | `INV-SNAPSHOT-DELETE-ADOPT-001` | Publication adopts every intent page with a fresh CAS-base tag and checks it is present, this attempt's and unmarked; stale cleaners/adopters cannot remove or retag a published page, and staging never restores old tags. | M9 delete intent publication | `delete_intent.go` `adoptDeleteIntentPage`, `RunDeleteSnapshotWithIntent`, `StageSnapshotDeletePage` | `TestDeleteIntentRefreshedBaseFencesDelayedCleanerMark`, `TestDeleteIntentRefreshedBaseFencesDelayedCleanerDelete`, `TestDeleteIntentAdoptionCannotRestoreStaleTags`, `TestDeleteIntentStagingNeverRevertsPublishedTags`, `TestDeleteIntentPublicationChecksAdoptedPageMetadata`, `TestGenericIntentStagingCannotUndoRefreshedPublication` | StaleClean 159-161; exact-head refinement read required | DORMANT | +| `INV-SNAPSHOT-DELETE-ADOPT-002` | After adopting an intent page under its own tag, publication reads the page again and authenticates it; a page that no longer reads or holds other bytes refuses the publication. The filer frees chunks from a deletion queue, so a reference whose chunk is still queued reads intact and publishes. | M9 delete intent publication | `delete_intent.go` `RunDeleteSnapshotWithIntent`, `readListPage` | `TestASnapshotDeleteIsNotPublishedOverAPageWhoseDataWasFreed` (`core/frontend/chunkstore/layout/delete_intent_reread_test.go`); store witness `TestWithoutTheChunkGuardAStaleMetadataChangeOverwritesARecreatedObject` (`core/frontend/chunkstore/layout_change_meta_recreated_test.go`) | MetaABA r2, checked outside the repository: the re-read alone does not hold `PublishedReadable` once the filer frees chunks later from a queue (`mut_reread_delayed`); with the chunk guard it holds (`safe_chunks_equal`). r1's `safe_reread_only` held only for immediate frees (historical scope) | ACTIVE | +| `INV-LAYOUT-META-CHUNKS-001` | With the chunk guard on, an adoption or mark writes its looked-up entry back only while the entry's chunk fids are unchanged, so it cannot land on an object deleted and created again since its lookup; a cleaner's delete expects its own mark, so it follows. | M9 delete intent publication | `core/frontend/chunkstore/layout_store.go` `changeMeta`; `swfs.go` `UpdateEntryIfChunks` | `TestAStaleMetadataChangeDoesNotOverwriteARecreatedObject`, `TestAStaleCleanerMarkDoesNotDeleteARecreatedObject`, `TestWithTheChunkGuardAnUnchangedObjectIsStillAdoptedMarkedAndDeleted` (`core/frontend/chunkstore/layout_change_meta_recreated_test.go`) | MetaABA r2, checked outside the repository: `PublishedReadable` (`safe_chunks_equal`, `safe_legacy_chunks_equal`) | ACTIVE | The snapshot-delete consumer and list-page retirement above are reachable through holder maintenance and covered by Go assertions. Their ACTIVE status describes that reachability and test coverage, not fresh Linux, composed-operation or release qualification. Cut and upload-intent producers remain deferred; their dormant publication rows are not activated by this consumer slice. diff --git a/seaweed-block/docs/status-schema.md b/seaweed-block/docs/status-schema.md index c39a41b0fb..68624489d6 100644 --- a/seaweed-block/docs/status-schema.md +++ b/seaweed-block/docs/status-schema.md @@ -468,6 +468,7 @@ Chunk store usage of a walstore-chunk volume (only with --chunk-control-endpoint | `dependents` | int | — | | `own_chunks` | int | — | | `foreign_chunks` | int | — | +| `metadata_guard` | string | MetadataGuard names the protection of the volume's metadata changes: filer_chunk_condition (the startup probe saw the filer enforce the chunk condition) or page_reread_only (enforcement was not established at startup; delete intent pages are re-read). | ### `GET /status/nvme` From 94e6fcf61cf1e2f3b954f88d5d983a4c5af0d180 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 11:30:00 -0800 Subject: [PATCH 24/29] ci: integrate the imported block module workflows (#13360) * ci: port block workflows to the shared repository * ci: preserve policy self-exclusion at the root path * ci: check block documentation relative links * ci: keep the block post-merge-review check on hosted runners The job's own comment records that it ended in 'Set up job' with no log on every self-hosted runner, and the source repository ran it on ubuntu-latest. The port made it follow BLOCK_RUNNER_LABEL, so setting the variable would bring that failure back for every labelled same-repository PR. Co-Authored-By: Claude Opus 5.5 * ci: publish block releases from hosted runners The release job holds contents: write and packages: write and logs in to GHCR, and builds its images with the runner's Docker. Following BLOCK_RUNNER_LABEL put it on the persistent pool that same-repository PR test jobs also use, whose Docker and build cache those jobs can leave state in, and whose Docker setup is still listed as unvalidated. The source repository published from ubuntu-latest; keep that. Co-Authored-By: Claude Opus 5.5 * ci: refuse a block release without notes before pushing images The notes file was first checked in the last step, after both images (and, for the highest stable tag, :alpha) were already pushed to GHCR, so a tag without docs/releases/vX.Y.Z.md left the images published and no GitHub release. Check it with the tag format, before anything is pushed. Co-Authored-By: Claude Opus 5.5 * ci: run the block documentation link check from root scripts The Relative documentation links step called .github/scripts/doc-links-check.py and its test inside seaweed-block/, but neither the imported module nor upstream seaweed-block has them, so the unit suite would fail once the step runs. Add the checker and its test under .github/block/scripts/ with the other port scripts and point the step and its contract test there. Co-Authored-By: Claude Opus 5.5 * ci: use the integrated root documentation link checker * ci(block): bound runner disk use and clean job workspaces * ci(block): pin merge evidence and refuse control changes * ci(block): refuse workspace aliases before cleanup * fix(block-ci): refresh test evidence before reporting readiness * block-ci: judge known bugs with the module helper; list only live reproductions The inline loop called an empty -run match or a skip a fix, and the list still named #188 (closed, test passes) and #189 (test absent), so every nightly run failed. Use known-bugs.sh and its controls, as the module workflow does, and keep only #186: #187's reproduction passes at this revision because values.yaml sets blockmaster.stateHostPath. Co-Authored-By: Claude Opus 5.5 * block-ci: let a release rerun replace the assets of a published tag gh release create fails once the tag's release exists, after both image pushes have already run again. Keep the imported helper's existing-release path: edit the prerelease flag and upload with --clobber. Co-Authored-By: Claude Opus 5.5 * block-ci: list both sides of a move when planning unit packages Without --no-renames a file moved out of core/storage/ shows only its new path, so the planner skipped the package it left. The sibling scope scripts already pass the flag. Co-Authored-By: Claude Opus 5.5 * block-ci: give each master push its own Block Test concurrency group A group admits one running and one pending run; a newer push cancels the pending one even with cancel-in-progress off, so a burst of merges left some without a post-merge result. Key pushes on the commit. Co-Authored-By: Claude Opus 5.5 * block-ci: refuse only control changes the PR itself makes The two-dot diff against current master listed every block workflow master changed after the PR branched, so an older docs-only PR hit workflow_review_required for good. Diff from the merge base; the gate already requires the tested base to be current master. Co-Authored-By: Claude Opus 5.5 * block-ci: check host paths in a labelled post-merge-review PR The changed-path list holds module paths and block controls only, so a labelled PR that also changed host files passed on its module part. Add every other changed path with its root name; the allow list refuses it. The spec-trace scope stays module-only. Co-Authored-By: Claude Opus 5.5 * block-ci: keep the public-text adapter in step with the module checker The root adapter carried the v1.1.0 signatures: it passed /home// paths and run metadata, and an empty docs/spec/**/recorded-* artifact, which the module checker refuses. Take the module's pattern and artifact path check, keep module-relative paths, skip the root adapter's own pattern when run from the root, and run the module self-test against the adapter so the two cannot drift. Co-Authored-By: Claude Opus 5.5 * block-ci: match doc links per paragraph, with nested parentheses and long fences A link whose label wraps onto the next line was never checked, a target such as guide(v2).md was cut at its first ')', and a three-backtick line inside a four-backtick fence closed it. Close a fence only with the same character at least as long, keep one level of balanced parentheses in a destination, and match links over each paragraph. Co-Authored-By: Claude Opus 5.5 * block-ci: test the root wiring the active workflows use The nested self-tests read the module's inactive test.yml, deploy/ Dockerfiles and chunkstore-scope.sh. Assert the docs-only gates in block-test.yml, that each root image refuses every binary it builds, and that the root classifier selects run for chunkstore, storage and durable edits. Co-Authored-By: Claude Opus 5.5 * block-ci: refuse host files in a labelled PR outside the allow list Host paths went through the module allow list, where "*_test.go", "*.md" and "docs/*" also match root files, so a labelled PR changing weed/example_test.go or README.md passed. List host changes separately and fail on any of them; the module list still runs. The port test now runs the step in a scratch repository. Co-Authored-By: Claude Opus 5.5 * block-ci: keep root block CI files clean under the public-text scan The port test fixture spelled out a recorded-artifact path, and the unit group test a pid literal, so the checker flagged both as added lines of any PR that touches them. Build the fixture path from parts, name the pid through a variable, and scan the root block CI files with the checker's own pattern. Co-Authored-By: Claude Opus 5.5 * fix(block-ci): normalize artifact paths from both checker entry points * fix(block-ci): refuse ambiguous merge bases in readiness checks * fix(block-ci): mask code spans that wrap lines before matching links Co-Authored-By: Claude Opus 5.5 * fix(block-ci): publish the draft a rerun of block-release finds An interrupted first run can leave the tag with an unpublished draft. The rerun took the existing-release branch, replaced the assets and exited 0 with the release still a draft. Publish after the uploads, keeping it off the repository's Latest. Co-Authored-By: Claude Opus 5.5 * fix(block-ci): require complete matching code-span delimiters * fix(block-ci): preserve escapes and context when masking code * fix(block-ci): preserve original link destination bytes * fix(block-ci): validate original destination syntax * test(block-ci): cover masked whitespace in reference destinations --------- Co-authored-by: pingqiu Co-authored-by: Chris Lu Co-authored-by: Claude Opus 5.5 --- .github/block/README.md | 41 ++ .github/block/scripts/block-ci-port-test.py | 408 ++++++++++++++++ .github/block/scripts/changed-go-blobs.sh | 30 ++ .github/block/scripts/check-pr-base.sh | 13 + .github/block/scripts/chunkstore-scope.sh | 33 ++ .github/block/scripts/doc-links-check-test.py | 142 ++++++ .github/block/scripts/doc-links-check.py | 128 +++++ .github/block/scripts/docs-only-scope.sh | 35 ++ .github/block/scripts/ledger_check.py | 121 +++++ .../scripts/post-merge-review-changed.sh | 14 + .github/block/scripts/public-text-check.sh | 70 +++ .github/block/scripts/run-unit-groups-test.py | 145 ++++++ .github/block/scripts/run-unit-groups.py | 123 +++++ .../block/scripts/runner-workspace-test.py | 106 +++++ .github/block/scripts/safe-merge-check.py | 132 ++++++ .../block/scripts/unit-test-shards-test.py | 52 ++ .github/block/scripts/unit-test-shards.py | 55 +++ .github/dockerfiles/block-blockcsi.Dockerfile | 27 ++ .github/dockerfiles/block-sw-block.Dockerfile | 24 + .github/workflows/block-known-bugs.yml | 127 +++++ .github/workflows/block-post-merge-review.yml | 146 ++++++ .github/workflows/block-release.yml | 201 ++++++++ .github/workflows/block-spec-trace.yml | 164 +++++++ .github/workflows/block-test.yml | 445 ++++++++++++++++++ 24 files changed, 2782 insertions(+) create mode 100644 .github/block/README.md create mode 100644 .github/block/scripts/block-ci-port-test.py create mode 100644 .github/block/scripts/changed-go-blobs.sh create mode 100644 .github/block/scripts/check-pr-base.sh create mode 100644 .github/block/scripts/chunkstore-scope.sh create mode 100644 .github/block/scripts/doc-links-check-test.py create mode 100644 .github/block/scripts/doc-links-check.py create mode 100644 .github/block/scripts/docs-only-scope.sh create mode 100644 .github/block/scripts/ledger_check.py create mode 100644 .github/block/scripts/post-merge-review-changed.sh create mode 100644 .github/block/scripts/public-text-check.sh create mode 100644 .github/block/scripts/run-unit-groups-test.py create mode 100644 .github/block/scripts/run-unit-groups.py create mode 100644 .github/block/scripts/runner-workspace-test.py create mode 100644 .github/block/scripts/safe-merge-check.py create mode 100644 .github/block/scripts/unit-test-shards-test.py create mode 100644 .github/block/scripts/unit-test-shards.py create mode 100644 .github/dockerfiles/block-blockcsi.Dockerfile create mode 100644 .github/dockerfiles/block-sw-block.Dockerfile create mode 100644 .github/workflows/block-known-bugs.yml create mode 100644 .github/workflows/block-post-merge-review.yml create mode 100644 .github/workflows/block-release.yml create mode 100644 .github/workflows/block-spec-trace.yml create mode 100644 .github/workflows/block-test.yml diff --git a/.github/block/README.md b/.github/block/README.md new file mode 100644 index 0000000000..900337da38 --- /dev/null +++ b/.github/block/README.md @@ -0,0 +1,41 @@ +# Block CI in the shared repository + +The block module stays in `seaweed-block/` with its own `go.mod` and unchanged module path. Root `block-*.yml` workflows run shell commands there; action inputs name the subdirectory explicitly. The imported subtree is unchanged: every port file lives under root `.github/`. Existing module scripts and data remain base-owned inputs; only the Git adapters, unit-group coordinator and relative documentation link check live in root `.github/block/scripts/`. The existing nested workflows are inert because GitHub only discovers root workflows. + +PR and master-push workflows select `seaweed-block/**` and their root block workflow files. All jobs default to `ubuntu-latest`. Set the repository variable `BLOCK_RUNNER_LABEL` only after the corresponding dedicated runner label is registered and available; same-repository/trusted events of the test, spec-trace and known-bugs jobs then use that label. The post-merge-review paths check and the release always run hosted. Fork PRs always use GitHub-hosted runners. GitHub Actions cannot fall back after requesting an unavailable label, so an unset variable is the explicit safe default. Unset it again if the registered pool is withdrawn. Runner discovery would require runner-management API access that the read-only workflow token does not have; no new credential is requested. + +The unit check keeps `go test (linux)` and `process-level tests (real binaries)` under workflow `Block Test`. Module-relative diff/blob adapters preserve the block model map and allow list. Root block workflow/Docker recipe changes still pass the block trace/public-text checks; unrelated host code is excluded. No imported module paths or product formats change. + +## Read-only merge checks + +From a trusted current master checkout, run inside the module: + +```sh +python3 ../.github/block/scripts/safe-merge-check.py 123 +``` + +It requires an open, ready, mergeable PR, the latest successful `Block Test` run at its exact head against current master, both successful named jobs, and the base-owned spec-trace/public-text checks. It rechecks head/base after inspection. It never merges or comments. The manager performs the authorized squash merge with `--match-head-commit`. + +For a batch, preserve its builder's exact order in a local manifest: + +```json +{"base":"BASE_SHA","batch_pr":123,"head":"BATCH_SHA","prs":[{"number":121,"head":"HEAD_121","evidence":"evidence/121.txt"},{"number":122,"head":"HEAD_122","evidence":"evidence/122.txt"}]} +``` + +```sh +python3 ../.github/block/scripts/safe-merge-check.py --batch batch.json +# After the authorized ordered squash merges, compare master with the printed tested tree: +python3 ../.github/block/scripts/safe-merge-check.py --verify-tree TESTED_TREE_SHA +``` + +The manifest and acceptance files are operator inputs from the batch builder, never files supplied by a PR. Batch readiness refuses a moved master/head, changed order or missing evidence and runs each member's base-owned local checks. Building/pushing a batch and merging remain manager operations. + +## Releases + +Only `seaweed-block/vX.Y.Z[-pre]` tags publish. Image tags omit the namespace and retain the existing block/CSI image names. Only block stable tags decide whether `alpha` advances. Root-context Docker recipes preserve Git revision metadata while building the nested module and retain the lab-binary refusal. + +The Linux amd64 tarball contains `blockmaster`, `blockvolume` and `sw-block` copied from the exact published image digest, with `SHA256SUMS`. The GitHub release uses the namespaced tag and does not replace the shared repository's latest release. Release notes must already exist in the module. No tag, image or release is created by preparation or local tests. + +## Move-window checks + +This revision targets the v1.1.0 import branch. Do not edit files under `seaweed-block/` here; development stays in its source repository until the v1.1.1 history update. The root unit-group helpers project the qualified #1001 source; refresh root CI adapters against the corresponding source when that later import arrives. Run the normal Test workflow, base-owned checks and a controlled nonproduction release rehearsal before enabling real publication. Validate organization runner registration, Docker, GHCR package access, and existing repository rulesets/check names. Existing host workflows are unchanged; their broad Go filters may also select a block-only PR. The first import needs its own reviewed bootstrap evidence: a pre-import master has no block scripts, so neither the new pull_request_target gates nor the base-owned local checker can qualify that initial import from an absent base module. Once the import/port is on the trusted base, subsequent block PRs use these checks. diff --git a/.github/block/scripts/block-ci-port-test.py b/.github/block/scripts/block-ci-port-test.py new file mode 100644 index 0000000000..e763f03a31 --- /dev/null +++ b/.github/block/scripts/block-ci-port-test.py @@ -0,0 +1,408 @@ +"""Local-only checks for the nested-module CI port; no Go suites or publishing.""" +from pathlib import Path +import copy +import importlib.util +import os +import shutil +import re +import subprocess +import tempfile +import unittest +from unittest.mock import patch + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[2] + + +class PortTests(unittest.TestCase): + def test_relative_documentation_links_are_checked(self): + text = (ROOT / ".github/workflows/block-test.yml").read_text() + marker = " - name: Relative documentation links\n" + self.assertEqual(text.count(marker), 1) + step = text.split(marker, 1)[1].split("\n - name:", 1)[0] + self.assertIn("if: matrix.suite == 'unit'", step) + self.assertIn("python3 -B ../.github/block/scripts/doc-links-check-test.py", step) + self.assertIn("python3 -I ../.github/block/scripts/doc-links-check.py .", step) + self.assertNotIn("continue-on-error", step) + self.assertNotIn("|| true", step) + + def test_root_workflows_use_module_run_and_action_paths(self): + for name in ("test", "spec-trace", "post-merge-review", "known-bugs"): + text = (ROOT / (".github/workflows/block-" + name + ".yml")).read_text() + self.assertIn("working-directory: seaweed-block", text) + if name == "post-merge-review": + self.assertIn("runs-on: ubuntu-latest", text) + self.assertNotIn("BLOCK_RUNNER_LABEL", text) + else: + self.assertIn("vars.BLOCK_RUNNER_LABEL", text) + self.assertIn("|| 'ubuntu-latest'", text) + if "go-version-file:" in text: self.assertIn("go-version-file: seaweed-block/go.mod", text) + if name != "known-bugs": + self.assertIn('"seaweed-block/**"', text) + self.assertIn('".github/workflows/block-*.yml"', text) + test = (ROOT / ".github/workflows/block-test.yml").read_text() + self.assertIn("- master", test) + self.assertIn("git diff --relative --name-only --no-renames HEAD^1 HEAD -- .", test) + self.assertIn("go test (linux)", test) + self.assertIn("process-level tests (real binaries)", test) + scope = test.split(" - name: Docs-only pull request\n", 1)[1].split("\n", 2)[1] + self.assertEqual(scope.strip(), "if: matrix.suite == 'process' && github.event_name == 'pull_request'") + self.assertEqual(test.count("if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'"), 5) + self.assertNotRegex(test, r"if: matrix\.suite == 'process'\s*\n") + post = (ROOT / ".github/workflows/block-post-merge-review.yml").read_text() + self.assertIn("working-directory: ${{ github.workspace }}", post) + + def test_labelled_post_merge_review_refuses_host_files(self): + post = (ROOT / ".github/workflows/block-post-merge-review.yml").read_text() + step = post.split(" - name: Check changed paths\n", 1)[1].split(" run: |\n", 1)[1].split("\n\n - name:", 1)[0] + script = "\n".join(line[10:] for line in step.splitlines()) + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp); module = root / "seaweed-block" + def git(*args): return subprocess.check_output(["git", *args], cwd=root, timeout=15) + git("init", "-b", "master"); git("config", "user.name", "Example"); git("config", "user.email", "example@example.invalid"); git("config", "commit.gpgsign", "false") + for name in ("post-merge-review-check.sh", "post-merge-review-allow.txt"): + source = ROOT / "seaweed-block/.github" / ("scripts/" + name if name.endswith(".sh") else name) + target = module / ".github" / ("scripts/" + name if name.endswith(".sh") else name) + target.parent.mkdir(parents=True, exist_ok=True); target.write_bytes(source.read_bytes()) + (module / ".github/scripts/post-merge-review-check-test.sh").write_text("exit 0\n") + (root / ".github/block/scripts").mkdir(parents=True) + (root / ".github/block/scripts/post-merge-review-changed.sh").write_bytes((HERE / "post-merge-review-changed.sh").read_bytes()) + git("add", "."); git("commit", "-m", "base"); git("remote", "add", "origin", str(root)) + base = git("rev-parse", "HEAD").decode().strip() + def check(*paths): + git("reset", "-q", "--hard", base) + for path in paths: (root / path).parent.mkdir(parents=True, exist_ok=True); (root / path).write_text("changed\n") + git("add", "--", *paths); git("commit", "-m", "change") + git("update-ref", "refs/pull/1/head", "HEAD") + env = dict(os.environ, BASE=base, HEAD=git("rev-parse", "HEAD").decode().strip(), PR="1") + return subprocess.run(["bash", "-eo", "pipefail", "-c", script], cwd=module, env=env, capture_output=True, timeout=30) + self.assertEqual(check("seaweed-block/docs/a.md").returncode, 0) + for host in ("weed/example_test.go", "README.md", "docs/a.md"): + out = check("seaweed-block/docs/a.md", host) + self.assertEqual(out.returncode, 1, out) + self.assertEqual([l for l in out.stdout.splitlines() if l.startswith(b"DENY")], [b"DENY host " + host.encode() + b" (outside seaweed-block)"]) + + def test_known_bugs_use_the_module_verdict_helper(self): + text = (ROOT / ".github/workflows/block-known-bugs.yml").read_text() + self.assertIn("bash .github/scripts/known-bugs-test.sh", text) + self.assertIn("bash .github/scripts/known-bugs.sh <<'LIST'", text) + rows = text.split("<<'LIST'\n", 1)[1].split("\n LIST", 1)[0].split("\n") + self.assertTrue(rows) + for row in rows: + issue, pkg, test = row.split() + sources = (ROOT / "seaweed-block" / pkg).glob("*_test.go") + self.assertTrue(any("func " + test + "(" in s.read_text() for s in sources), row) + + def test_release_tag_namespace_and_artifact_identity(self): + text = (ROOT / ".github/workflows/block-release.yml").read_text() + self.assertIn('"seaweed-block/v*"', text) + self.assertNotIn('tags:\n - "v*"', text) + self.assertIn("git tag -l 'seaweed-block/v*'", text) + self.assertIn('docker pull "${BLOCK_IMAGE}@${BLOCK_DIGEST}"', text) + self.assertIn('gh release create "$GITHUB_REF_NAME"', text) + self.assertIn('--latest=false', text) + self.assertIn('gh release upload "$GITHUB_REF_NAME" "$out/$asset" "$out/SHA256SUMS" --repo "$GITHUB_REPOSITORY" --clobber', text) + publish = 'gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --prerelease="$prerelease" --draft=false --latest=false' + self.assertLess(text.index("--clobber"), text.index(publish)) + self.assertIn("runs-on: ubuntu-latest", text) + self.assertNotIn("BLOCK_RUNNER_LABEL", text) + self.assertIn('sw-block-${version}-linux-amd64.tar.gz', text) + self.assertNotIn("go build", text) + self.assertLess(text.index("refusing to publish: release notes"), text.index("docker/build-push-action")) + for name in ("sw-block", "blockcsi"): + recipe = (ROOT / (".github/dockerfiles/block-" + name + ".Dockerfile")).read_text() + self.assertIn("WORKDIR /src/seaweed-block", recipe) + self.assertIn("COPY . /src", recipe) + self.assertGreater(recipe.index("RUN bash scripts/refuse-lab-binary.sh"), recipe.rindex("go build")) + built = re.findall(r"go build -o (\S+)", recipe) + refused = re.search(r"^RUN bash scripts/refuse-lab-binary\.sh (.+)$", recipe, re.M).group(1).split() + self.assertTrue(built) + self.assertEqual(sorted(built), sorted(refused)) + + def test_nested_git_paths_and_blobs_stay_module_relative(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp); module = root / "seaweed-block"; module.mkdir() + def git(*args): + return subprocess.check_output(["git", *args], cwd=root, timeout=15) + git("init", "-b", "master") + git("config", "user.name", "Example"); git("config", "user.email", "example@example.invalid") + git("config", "commit.gpgsign", "false") + (module / "core").mkdir(); (module / "docs").mkdir() + code = module / "core/a.go"; code.write_text("package a\nconst N=1\n") + (root / "host.go").write_text("package host\n") + git("add", "."); git("commit", "-m", "base") + base = git("rev-parse", "HEAD").decode().strip() + (module / "docs/a.md").write_text("documentation\n") + git("add", "."); git("commit", "-m", "docs") + docs = git("rev-parse", "HEAD").decode().strip() + def run(name, *args): + return subprocess.check_output(["bash", str(HERE / name), *args], cwd=module, timeout=20) + self.assertEqual(run("docs-only-scope.sh", base, docs), b"docs_only 1\n") + code.write_text("package a\nconst N=2\n") + (root / "host.go").write_text("package host\nconst Changed=true\n") + git("add", "."); git("commit", "-m", "code") + head = git("rev-parse", "HEAD").decode().strip() + self.assertEqual(run("post-merge-review-changed.sh", docs, head), b"M\0core/a.go\0") + self.assertTrue(run("chunkstore-scope.sh", docs, head).startswith(b"skip 1")) + for durable in ("core/frontend/chunkstore/c.go", "core/storage/s.go", "core/frontend/durable/d.go"): + (module / durable).parent.mkdir(parents=True, exist_ok=True); (module / durable).write_text("package x\n") + git("add", "."); git("commit", "-m", "durable") + self.assertEqual(run("chunkstore-scope.sh", head, "HEAD"), b"run 1 " + durable.encode() + b"\n") + git("reset", "-q", "--hard", head) + blobs = root / "blobs" + run("changed-go-blobs.sh", docs, head, str(blobs)) + self.assertEqual((blobs / "old/core/a.go").read_text(), "package a\nconst N=1\n") + self.assertEqual((blobs / "new/core/a.go").read_text(), "package a\nconst N=2\n") + self.assertFalse((blobs / "new/host.go").exists()) + control = root / ".github/workflows/block-test.yml" + control.parent.mkdir(parents=True) + control.write_text("name: Block Test\n") + git("add", ".github"); git("commit", "-m", "CI control") + control_head = git("rev-parse", "HEAD").decode().strip() + self.assertIn(b".github/workflows/block-test.yml\0", run("post-merge-review-changed.sh", docs, control_head)) + self.assertTrue(run("docs-only-scope.sh", base, control_head).startswith(b"run ")) + checker = root / ".github/block/scripts/public-text-check.sh" + checker.parent.mkdir(parents=True) + checker.write_text("pattern='disk" + "station'\n") + git("add", ".github"); git("commit", "-m", "checker pattern") + pattern_head = git("rev-parse", "HEAD").decode().strip() + title, body = root / "title.txt", root / "body.txt" + title.write_text("CI scope"); body.write_text("Checker patterns") + self.assertEqual(run("public-text-check.sh", control_head, pattern_head, str(title), str(body)), b"public-text: clean\n") + from_root = subprocess.check_output(["bash", str(HERE / "public-text-check.sh"), control_head, pattern_head, str(title), str(body)], cwd=root, timeout=20) + self.assertEqual(from_root, b"public-text: clean\n") + artifact_path = "docs/spec/" + "recorded-example.txt" + artifact = module / artifact_path + artifact.parent.mkdir(parents=True); artifact.write_text("") + git("add", "."); git("commit", "-m", "artifact") + artifact_head = git("rev-parse", "HEAD").decode().strip() + command = ["bash", str(HERE / "public-text-check.sh"), pattern_head, artifact_head, str(title), str(body)] + for cwd in (root, module): + leak = subprocess.run(command, cwd=cwd, capture_output=True, timeout=20) + self.assertEqual(leak.returncode, 1, (cwd, leak.stdout, leak.stderr)) + self.assertIn(b"artifact path: " + artifact_path.encode(), leak.stdout) + git("rm", str(artifact.relative_to(root))); git("commit", "-m", "remove artifact") + deleted = git("rev-parse", "HEAD").decode().strip() + removal = ["bash", str(HERE / "public-text-check.sh"), artifact_head, deleted, str(title), str(body)] + for cwd in (root, module): + result = subprocess.run(removal, cwd=cwd, capture_output=True, timeout=20) + self.assertEqual((result.returncode, result.stdout), (0, b"public-text: clean\n"), result.stderr) + fakebin = root / "fakebin"; fakebin.mkdir() + fakegit = fakebin / "git" + fakegit.write_text("#!/bin/sh\nfor arg; do\n if [ \"$arg\" = --diff-filter=ACMT ]; then\n printf 'docs/spec/partial.txt\\0'\n exit 23\n fi\ndone\nexec \"$PUBLIC_TEXT_REAL_GIT\" \"$@\"\n") + fakegit.chmod(0o755) + env = dict(os.environ, PUBLIC_TEXT_REAL_GIT=shutil.which("git"), PATH=str(fakebin) + os.pathsep + os.environ["PATH"]) + for cwd in (root, module): + result = subprocess.run(removal, cwd=cwd, env=env, capture_output=True, timeout=20) + self.assertEqual(result.returncode, 2, (cwd, result.stdout, result.stderr)) + self.assertIn(b"cannot enumerate artifact paths", result.stderr) + self.assertNotIn(b"public-text: clean", result.stdout) + + def test_public_text_adapter_passes_the_module_self_test(self): + module = ROOT / "seaweed-block/.github/scripts" + pattern = lambda path: [l for l in path.read_text().splitlines() if l.startswith("pat=")] + self.assertEqual(pattern(HERE / "public-text-check.sh"), pattern(module / "public-text-check.sh")) + with tempfile.TemporaryDirectory() as tmp: + for source in (module / "public-text-check-test.sh", HERE / "public-text-check.sh"): + (Path(tmp) / source.name).write_bytes(source.read_bytes()) + subprocess.run(["bash", str(Path(tmp) / "public-text-check-test.sh")], check=True, capture_output=True, timeout=60) + + + def test_root_block_ci_files_pass_the_public_text_scan(self): + pat = next(l for l in (HERE / "public-text-check.sh").read_text().splitlines() if l.startswith("pat='"))[5:-1] + files = [p for p in (ROOT / ".github/block").rglob("*") if p.is_file() and "__pycache__" not in p.parts and p.name != "public-text-check.sh"] + files += sorted((ROOT / ".github/workflows").glob("block-*.yml")) + sorted((ROOT / ".github/dockerfiles").glob("block-*.Dockerfile")) + hits = subprocess.run(["grep", "-E", "-i", "-n", "-H", "--", pat, *map(str, files)], capture_output=True, timeout=20) + self.assertEqual(hits.returncode, 1, hits.stdout.decode() + hits.stderr.decode()) + + def test_safe_merge_refuses_wrong_head_base_and_incomplete_jobs(self): + spec = importlib.util.spec_from_file_location("safe_merge", HERE / "safe-merge-check.py") + check = importlib.util.module_from_spec(spec); spec.loader.exec_module(check) + pr = {"number": 1, "state": "open", "draft": False, "mergeable": True, "base": {"ref": "master"}, "head": {"sha": "head"}} + run = {"path": ".github/workflows/block-test.yml", "name": "Block Test", "head_sha": "head", "status": "completed", "conclusion": "success", "pull_requests": [{"number": 1, "base": {"sha": "base"}}]} + jobs = [{"name": n, "conclusion": "success"} for n in check.JOBS] + check.validate(pr, run, jobs, "base") + for key, value in (("head_sha", "other"), ("conclusion", "cancelled"), ("name", "Other Test")): + wrong = copy.deepcopy(run); wrong[key] = value + with self.assertRaises(ValueError): check.validate(pr, wrong, jobs, "base") + with self.assertRaises(ValueError): check.validate(pr, run, jobs, "moved") + with self.assertRaises(ValueError): check.validate(pr, run, jobs[:1], "base") + failed = copy.deepcopy(jobs); failed[0]["conclusion"] = "failure" + with self.assertRaises(ValueError): check.validate(pr, run, failed, "base") + + def test_same_named_workflow_cannot_satisfy_the_gate(self): + spec = importlib.util.spec_from_file_location("safe_merge", HERE / "safe-merge-check.py") + check = importlib.util.module_from_spec(spec); spec.loader.exec_module(check) + pr = {"number": 1, "state": "open", "draft": False, "mergeable": True, "base": {"ref": "master"}, "head": {"sha": "head"}} + run = {"id": 1, "created_at": "1", "path": ".github/workflows/block-test.yml", "name": "Block Test", "head_sha": "head", "status": "completed", "conclusion": "success", "pull_requests": [{"number": 1, "base": {"sha": "base"}}]} + jobs = [{"name": n, "conclusion": "success"} for n in check.JOBS] + duplicate = dict(run, id=2, created_at="2", path=".github/workflows/pretend.yml") + with self.assertRaises(ValueError): check.validate(pr, duplicate, jobs, "base") + missing = dict(run); del missing["path"] + with self.assertRaises(ValueError): check.validate(pr, missing, jobs, "base") + import json + with patch.object(check, "api", return_value={"workflow_runs": [run, duplicate]}), patch.object(check.subprocess, "check_output", return_value=json.dumps([{"jobs": jobs}]).encode()): + self.assertEqual(check.successful_run(pr, "base")["id"], 1) + with patch.object(check, "api", return_value={"workflow_runs": [duplicate]}): + with self.assertRaises(ValueError): check.successful_run(pr, "base") + + def test_control_path_changes_need_independent_workflow_review(self): + spec = importlib.util.spec_from_file_location("safe_merge", HERE / "safe-merge-check.py") + check = importlib.util.module_from_spec(spec); spec.loader.exec_module(check) + real_output = subprocess.check_output + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + def git(*args): return real_output(["git", *args], cwd=root, timeout=15) + git("init", "-b", "master"); git("config", "user.name", "Example"); git("config", "user.email", "example@example.invalid"); git("config", "commit.gpgsign", "false") + (root / "code.go").write_text("package example") + git("add", "."); git("commit", "-m", "base") + base = git("rev-parse", "HEAD").decode().strip() + for name in (".github/workflows/pretend.yml", ".github/block/scripts/check.py", ".github/dockerfiles/block-image.Dockerfile", "seaweed-block/.github/scripts/record-go-test.sh"): + path = root / name; path.parent.mkdir(parents=True, exist_ok=True); path.write_text("control") + git("add", "."); git("commit", "-m", "control") + added = git("rev-parse", "HEAD").decode().strip() + with patch.object(check.subprocess, "check_output", side_effect=lambda args, **kw: real_output(args, cwd=root, **kw)): + with self.assertRaisesRegex(ValueError, "workflow_review_required"): + check.check_control_paths(base, added) + git("rm", name); git("commit", "-m", "remove") + removed = git("rev-parse", "HEAD").decode().strip() + with patch.object(check.subprocess, "check_output", side_effect=lambda args, **kw: real_output(args, cwd=root, **kw)): + with self.assertRaisesRegex(ValueError, "workflow_review_required"): + check.check_control_paths(added, removed) + (root / "code.go").write_text("package example\nconst N=2") + git("add", "."); git("commit", "-m", "code") + head = git("rev-parse", "HEAD").decode().strip() + with patch.object(check.subprocess, "check_output", side_effect=lambda args, **kw: real_output(args, cwd=root, **kw)): + check.check_control_paths(base, head) + git("checkout", "-q", "-b", "master-later", base) + (root / ".github/workflows").mkdir(parents=True, exist_ok=True) + (root / ".github/workflows/block-test.yml").write_text("master control") + git("add", "."); git("commit", "-m", "master control") + master = git("rev-parse", "HEAD").decode().strip() + with patch.object(check.subprocess, "check_output", side_effect=lambda args, **kw: real_output(args, cwd=root, **kw)): + check.check_control_paths(master, head) + with self.assertRaisesRegex(ValueError, "workflow_review_required"): + check.check_control_paths(head, master) + with patch.object(check, "check_control_paths", side_effect=ValueError("workflow_review_required")), patch.object(check.subprocess, "check_output", side_effect=["base", "head"]), patch.object(check.subprocess, "run") as run: + with self.assertRaisesRegex(ValueError, "workflow_review_required"): + check.local_checks({"number": 1, "body": "body", "title": "title", "head": {"sha": "head"}}, "base") + self.assertEqual(run.call_count, 1) # fetch only; no checker certification + + def test_control_path_diff_refuses_multiple_merge_bases(self): + spec = importlib.util.spec_from_file_location("safe_merge", HERE / "safe-merge-check.py") + check = importlib.util.module_from_spec(spec); spec.loader.exec_module(check) + real_output = subprocess.check_output + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + def git(*args): return real_output(["git", *args], cwd=root, timeout=15).decode().strip() + git("init", "-b", "master") + git("config", "user.name", "Example"); git("config", "user.email", "example@example.invalid") + git("config", "commit.gpgsign", "false") + git("commit", "--allow-empty", "-m", "base"); base = git("rev-parse", "HEAD") + git("checkout", "-q", "-b", "left") + (root / "left.txt").write_text("left") + git("add", "."); git("commit", "-m", "left"); left = git("rev-parse", "HEAD") + git("checkout", "-q", "-b", "right", base) + (root / "right.txt").write_text("right") + git("add", "."); git("commit", "-m", "right"); right = git("rev-parse", "HEAD") + git("checkout", "-q", "left"); git("merge", "--no-ff", right, "-m", "left merge") + left_merge = git("rev-parse", "HEAD") + git("checkout", "-q", "right"); git("merge", "--no-ff", left, "-m", "right merge") + right_merge = git("rev-parse", "HEAD") + self.assertEqual(set(git("merge-base", "--all", left_merge, right_merge).splitlines()), {left, right}) + with patch.object(check.subprocess, "check_output", side_effect=lambda args, **kw: real_output(args, cwd=root, **kw)): + with self.assertRaisesRegex(ValueError, "ambiguous_merge_base"): + check.check_control_paths(left_merge, right_merge) + check.check_control_paths(left, left_merge) + + def test_fork_runner_guard_is_required_not_only_the_fallback(self): + expected = "${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && vars.BLOCK_RUNNER_LABEL || 'ubuntu-latest' }}" + for name in ("test", "spec-trace", "known-bugs"): + text = (ROOT / (".github/workflows/block-" + name + ".yml")).read_text() + lines = [line.strip() for line in text.splitlines() if line.strip().startswith("runs-on:")] + self.assertEqual(lines, ["runs-on: " + expected]) + + def test_rerun_during_local_checks_cannot_report_ready(self): + import contextlib + import io + import json + spec = importlib.util.spec_from_file_location("safe_merge", HERE / "safe-merge-check.py") + check = importlib.util.module_from_spec(spec); spec.loader.exec_module(check) + def pr(number): + return {"number": number, "state": "open", "draft": False, "mergeable": True, + "base": {"ref": "master"}, "head": {"sha": str(number)}} + with tempfile.TemporaryDirectory() as tmp: + evidence = Path(tmp) / "acceptance"; evidence.write_text("accepted") + members = [pr(1), pr(2)] + manifest = {"base": "base", "head": "3", "batch_pr": 3, + "prs": [{"number": n, "head": str(n), "evidence": str(evidence)} for n in (1, 2)]} + path = Path(tmp) / "batch.json"; path.write_text(json.dumps(manifest)) + for batch in (False, True): + for outcome in ("in_progress", "failed_run", "failed_job", "new_run", "success"): + with self.subTest(batch=batch, outcome=outcome): + changed = False + observations = [] + number = 3 if batch else 1 + def api(endpoint): + if endpoint == "git/ref/heads/master": return {"object": {"sha": "base"}} + if endpoint.startswith("pulls/"): return pr(int(endpoint.split("/")[-1])) + if endpoint == "git/commits/3": return {"tree": {"sha": "tree"}} + observations.append(("run", changed)) + run = {"id": 10, "run_attempt": 2 if changed else 1, "created_at": "1", + "path": check.WORKFLOW_PATH, "name": "Block Test", "head_sha": str(number), + "status": "completed", "conclusion": "success", + "pull_requests": [{"number": number, "base": {"sha": "base"}}]} + if changed and outcome in ("in_progress", "new_run"): + run.update(status="in_progress", conclusion=None) + if outcome == "new_run": run.update(id=11, created_at="2") + if changed and outcome == "failed_run": run["conclusion"] = "failure" + return {"workflow_runs": [run]} + def jobs(*args, **kwargs): + observations.append(("jobs", changed)) + result = [{"name": name, "conclusion": "success"} for name in check.JOBS] + if changed and outcome == "failed_job": result[0]["conclusion"] = "failure" + return json.dumps([{"jobs": result}]).encode() + def local(*args): + nonlocal changed + changed = True + output = io.StringIO() + with patch.object(check, "api", side_effect=api), patch.object(check.subprocess, "check_output", side_effect=jobs), patch.object(check, "fetch_review_head"), patch.object(check, "local_checks", side_effect=local), contextlib.redirect_stdout(output): + if outcome == "success": + check.main(["--batch", str(path)] if batch else ["1"]) + else: + with self.assertRaises(ValueError): + check.main(["--batch", str(path)] if batch else ["1"]) + if outcome == "success": + self.assertTrue(json.loads(output.getvalue())["ready"]) + else: + self.assertNotIn('"ready": true', output.getvalue()) + self.assertIn(("run", True), observations) + self.assertIn(("jobs", True), observations) + + def test_batch_preserves_pinned_base_heads_order_and_evidence(self): + spec = importlib.util.spec_from_file_location("safe_merge", HERE / "safe-merge-check.py") + check = importlib.util.module_from_spec(spec); spec.loader.exec_module(check) + with tempfile.TemporaryDirectory() as tmp: + evidence = Path(tmp) / "acceptance"; evidence.write_text("review accepted") + prs = [{"number": n, "state": "open", "draft": False, "base": {"ref": "master"}, "head": {"sha": str(n)}} for n in (1, 2)] + manifest = {"base": "base", "head": "batch", "prs": [{"number": p["number"], "head": p["head"]["sha"], "evidence": str(evidence)} for p in prs]} + check.validate_batch(manifest, prs, "base") + with self.assertRaises(ValueError): check.validate_batch(manifest, prs, "moved") + with self.assertRaises(ValueError): check.validate_batch(manifest, list(reversed(prs)), "base") + wrong = copy.deepcopy(prs); wrong[0]["head"]["sha"] = "new" + with self.assertRaises(ValueError): check.validate_batch(manifest, wrong, "base") + batch_manifest = dict(manifest, batch_pr=3) + manifest_path = Path(tmp) / "batch.json" + import json + manifest_path.write_text(json.dumps(batch_manifest)) + replies = {"git/ref/heads/master": {"object": {"sha": "base"}}, "pulls/1": prs[0], "pulls/2": prs[1], "pulls/3": {"number": 3, "head": {"sha": "batch"}}} + with patch.object(check, "api", side_effect=lambda path: replies[path]), patch.object(check, "fetch_review_head", side_effect=ValueError("workflow_review_required")) as fetch, patch.object(check, "successful_run") as run: + with self.assertRaisesRegex(ValueError, "workflow_review_required"): + check.main(["--batch", str(manifest_path)]) + fetch.assert_called_once_with(replies["pulls/3"], "base") + run.assert_not_called() + evidence.write_text("") + with self.assertRaises(ValueError): check.validate_batch(manifest, prs, "base") + + +if __name__ == "__main__": unittest.main() diff --git a/.github/block/scripts/changed-go-blobs.sh b/.github/block/scripts/changed-go-blobs.sh new file mode 100644 index 0000000000..fb2c4328a1 --- /dev/null +++ b/.github/block/scripts/changed-go-blobs.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Writes the old and new blob of each changed non-test Go file between two +# commits under /old/ and /new/, for the spec trace's +# kind DOCS (objects only; nothing from the PR is built or run). +# +# usage: changed-go-blobs.sh +# +# The paths come from the PR's tree objects, which git does not check when it +# prints a diff. A path that is absolute or has an empty, '.' or '..' +# component would write outside , so it is refused before anything is +# written (exit 1). +set -euo pipefail +mb=$1 head=$2 out=$3 +prefix=$(git rev-parse --show-prefix) +mkdir -p "$out" +git diff --relative --name-only --no-renames -z "$mb" "$head" -- "*.go" ":(exclude)*_test.go" >"$out/.paths" +while IFS= read -r -d "" p; do + case "/$p/" in + *//* | */./* | */../*) + printf 'changed-go-blobs: refusing path %q\n' "$p" >&2 + exit 1 + ;; + esac +done <"$out/.paths" +while IFS= read -r -d "" p; do + mkdir -p "$out/old/$(dirname "$p")" "$out/new/$(dirname "$p")" + git show "$mb:$prefix$p" >"$out/old/$p" 2>/dev/null || rm -f "$out/old/$p" + git show "$head:$prefix$p" >"$out/new/$p" 2>/dev/null || rm -f "$out/new/$p" +done <"$out/.paths" +rm -f "$out/.paths" diff --git a/.github/block/scripts/check-pr-base.sh b/.github/block/scripts/check-pr-base.sh new file mode 100644 index 0000000000..1c19a30c61 --- /dev/null +++ b/.github/block/scripts/check-pr-base.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Run only from a trusted base checkout; HEAD code is inspected as Git objects. +set -euo pipefail +here=$(cd "$(dirname "$0")" && pwd) +base=${1:?BASE}; head=${2:?HEAD}; body=${3:?BODY}; title=${4:?TITLE} +[ "$(git rev-parse HEAD)" = "$(git rev-parse "$base")" ] || { echo "refusing: checkout is not the trusted base" >&2; exit 2; } +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +mb=$(git merge-base "$base" "$head") +bash "$here/post-merge-review-changed.sh" "$mb" "$head" >"$work/changed.bin" +bash "$here/changed-go-blobs.sh" "$mb" "$head" "$work/blobs" +bash .github/scripts/spec-trace-check.sh "$body" "$work/blobs" .github/model-code-trace.tsv <"$work/changed.bin" +bash "$here/public-text-check.sh" "$mb" "$head" "$title" "$body" diff --git a/.github/block/scripts/chunkstore-scope.sh b/.github/block/scripts/chunkstore-scope.sh new file mode 100644 index 0000000000..995fd07cb6 --- /dev/null +++ b/.github/block/scripts/chunkstore-scope.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# chunkstore-scope.sh BASE HEAD: decides whether a pull request runs the +# real-filer integration tests. It prints one line: +# "run N FIRST" at least one of the N changed files is under +# core/frontend/chunkstore/, core/storage/ or +# core/frontend/durable/ (FIRST is one) +# "skip N" none of the N changed files is +# and exits 0. Any error (git fails, the list cannot be read) exits nonzero, +# and the caller then runs the tests: an error never selects skip. +# +# The NUL-delimited list is written to a file first and read to its end, so +# no pipe can stop early and leave a writer's error looking like an answer. +set -euo pipefail +[ "$#" -eq 2 ] || { echo "usage: chunkstore-scope.sh BASE HEAD" >&2; exit 2; } +list=$(mktemp) +trap 'rm -f "$list"' EXIT +if ! git diff --relative --name-only --no-renames -z "$1" "$2" -- . >"$list"; then + echo "chunkstore-scope: git diff $1 $2 failed" >&2 + exit 2 +fi +n=0 +hit="" +while IFS= read -r -d '' f; do + n=$((n + 1)) + case $f in + core/frontend/chunkstore/* | core/storage/* | core/frontend/durable/*) [ -n "$hit" ] || hit=$f ;; + esac +done <"$list" +if [ -n "$hit" ]; then + echo "run $n $hit" +else + echo "skip $n" +fi diff --git a/.github/block/scripts/doc-links-check-test.py b/.github/block/scripts/doc-links-check-test.py new file mode 100644 index 0000000000..9635b4a426 --- /dev/null +++ b/.github/block/scripts/doc-links-check-test.py @@ -0,0 +1,142 @@ +"""Relative Markdown links must resolve; code, anchors and URLs are not paths.""" +import contextlib +import importlib.util +import io +from pathlib import Path +import tempfile +import unittest + +spec = importlib.util.spec_from_file_location("links", Path(__file__).with_name("doc-links-check.py")) +links = importlib.util.module_from_spec(spec) +spec.loader.exec_module(links) + + +class DocLinksTests(unittest.TestCase): + def check(self, files): + with tempfile.TemporaryDirectory() as root: + for name, text in files.items(): + path = Path(root, name) + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(text) + return [(source, target) for source, _, target in links.broken_links(root)] + + def test_existing_targets_pass(self): + broken = self.check({ + "README.md": "[guide](docs/guide.md#start) ![d](docs/d.svg) [dir](docs/) [ref][r]\n\n[r]: \n", + "docs/guide.md": "[up](../README.md) [root](/docs/d.svg) [esc](a%20b.md)\n", + "docs/d.svg": "", + "docs/a b.md": "", + }) + self.assertEqual(broken, []) + + def test_missing_targets_fail(self): + broken = self.check({ + "README.md": "[gone](docs/gone.md) [nested [x]](docs/x.md#a)\n\n[r]: missing.md\n", + "docs/guide.md": "[up](../nope.md)\n", + }) + self.assertCountEqual(broken, [ + ("README.md", "docs/gone.md"), + ("README.md", "docs/x.md#a"), + ("README.md", "missing.md"), + ("docs/guide.md", "../nope.md"), + ]) + + def test_urls_anchors_and_code_are_not_checked(self): + broken = self.check({ + "README.md": "\n".join([ + "[web](https://example.invalid/x) [mail](mailto:a@example.invalid) [top](#top) [proto](//host/x)", + "`[code](gone.md)` and ``[code](gone.md)``", + "```", + "[fenced](gone.md)", + "```", + "~~~md", + "[tilde](gone.md)", + "~~~", + ]) + "\n", + }) + self.assertEqual(broken, []) + + def test_wrapped_labels_parentheses_and_long_fences(self): + with tempfile.TemporaryDirectory() as root: + Path(root, "guide(v2).md").write_text("") + Path(root, "README.md").write_text("\n".join([ + "[guide](guide(v2).md) [old](guide(v1).md)", + "", + "see the [wrapped", + "label](wrapped.md) here", + "", + "`[wrapped", + "code](gone.md)` then [after](after.md)", + "````md", + "```", + "[example](missing.md)", + "```", + "````", + ]) + "\n") + broken = [(line, target) for _, line, target in links.broken_links(root)] + self.assertEqual(broken, [(1, "guide(v1).md"), (3, "wrapped.md"), (7, "after.md")]) + + def test_code_spans_require_complete_equal_delimiter_runs(self): + cases = [ + ("`unmatched\n[real](real.md) ``", [(2, "real.md")]), + ("``unmatched\n[real](real.md) `", [(2, "real.md")]), + ("``unmatched\n[real](real.md) ```", [(2, "real.md")]), + ("`[wrapped\ncode](hidden.md)`\n[after](after.md)", [(3, "after.md")]), + ("``[wrapped `\ncode](hidden.md)``\n[after](after.md)", [(3, "after.md")]), + ] + for text, expected in cases: + with self.subTest(text=text), tempfile.TemporaryDirectory() as root: + Path(root, "README.md").write_text(text + "\n", encoding="utf-8") + broken = [(line, target) for _, line, target in links.broken_links(root)] + self.assertEqual(broken, expected) + + def test_escaped_backticks_do_not_hide_links(self): + cases = [ + ("\\`\n[real](real.md)\n\\`", [(2, "real.md")]), + ("\\\\`[code](hidden.md)`\n[after](after.md)", [(2, "after.md")]), + ("`[code](hidden.md)\\`\n[after](after.md)", [(2, "after.md")]), + ] + for text, expected in cases: + with self.subTest(text=text): + self.assertEqual(list(links.link_targets(text)), expected) + + def test_masked_code_preserves_reference_line_context(self): + text = "Use `code\nmore`[r]: gone.md\n\n[r]: real.md\n" + self.assertEqual(list(links.link_targets(text)), [(4, "real.md")]) + + def test_code_masking_contract(self): + cases = [ + ("unequal runs", "`unmatched\n[real](real.md) ``", [], [(2, "real.md")]), + ("escaped delimiters", "\\`\n[real](real.md)\n\\`", [], [(2, "real.md")]), + ("reference context", "Use `code\nmore`[r]: gone.md\n\n[r]: real.md", [], [(4, "real.md")]), + ("wrapped span", "`[code\nhere](hidden.md)`\n[after](after.md)", [], [(3, "after.md")]), + ("hidden-space invalid target", "[example](`foo bar`)", [], []), + ("hidden-space invalid reference", "[r]: `a b`", [], []), + ("existing literal target", "[example](`foo.md`)", ["`foo.md`"], []), + ("missing literal target", "[example](`foo.md`)", [], [(1, "`foo.md`")]), + ] + for name, text, existing, expected in cases: + with self.subTest(name=name), tempfile.TemporaryDirectory() as root: + Path(root, "README.md").write_text(text + "\n", encoding="utf-8") + for target in existing: + Path(root, target).touch() + broken = [(line, target) for _, line, target in links.broken_links(root)] + self.assertEqual(broken, expected) + masked = links.mask_code_spans(text) + self.assertEqual(len(masked), len(text)) + self.assertEqual([i for i, c in enumerate(masked) if c == "\n"], + [i for i, c in enumerate(text) if c == "\n"]) + + def test_main_exit_status(self): + out = io.StringIO() + with tempfile.TemporaryDirectory() as root, contextlib.redirect_stdout(out), contextlib.redirect_stderr(out): + Path(root, "README.md").write_text("[gone](gone.md)\n") + self.assertEqual(links.main(["doc-links-check.py", root]), 1) + Path(root, "gone.md").write_text("") + self.assertEqual(links.main(["doc-links-check.py", root]), 0) + self.assertEqual(links.main(["doc-links-check.py"]), 2) + self.assertIn("README.md:1: broken relative link gone.md", out.getvalue()) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/block/scripts/doc-links-check.py b/.github/block/scripts/doc-links-check.py new file mode 100644 index 0000000000..926aa2f4e1 --- /dev/null +++ b/.github/block/scripts/doc-links-check.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Fail when a Markdown file links to a relative path that does not exist. + +Usage: doc-links-check.py +""" +import os +import re +import sys +import urllib.parse + +SKIP_DIRS = {".git", "node_modules", "vendor"} +FENCE = re.compile(r"^\s*(`{3,}|~{3,})(.*)$") +BACKTICKS = re.compile(r"`+") +INLINE_DESTINATION = r"<[^>\n]*>|(?:[^\s()]|\([^\s()]*\))+" +REFERENCE_DESTINATION = r"<[^>]*>|\S+" +INLINE_LINK = re.compile(r"!?\[(?:[^\[\]]|\[[^\[\]]*\])*\]\(\s*(" + INLINE_DESTINATION + r")") +REFERENCE = re.compile(r"^[ \t]{0,3}\[[^\]]+\]:\s*(" + REFERENCE_DESTINATION + r")", re.M) +SCHEME = re.compile(r"^[A-Za-z][A-Za-z0-9+.-]*:") + + +def mask_code_spans(text): + runs = list(BACKTICKS.finditer(text)) + masked = list(text) + i = 0 + while i < len(runs): + opening = runs[i] + start = opening.start() + # Only prose escapes delimiters; backslashes inside code are literal. + preceding = start + while preceding > 0 and text[preceding - 1] == "\\": + preceding -= 1 + if (start - preceding) % 2: + start += 1 + width = opening.end() - start + if not width: + i += 1 + continue + closing = next((j for j in range(i + 1, len(runs)) + if len(runs[j].group()) == width), None) + if closing is None: + i += 1 + continue + # Keep columns and non-whitespace line context as well as line numbers. + for pos in range(start, runs[closing].end()): + if text[pos] != "\n": + masked[pos] = "\0" + i = closing + 1 + return "".join(masked) + + +def paragraph_targets(first, lines): + # A link label may wrap, so links are matched per paragraph. + original = "\n".join(lines) + text = mask_code_spans(original) + # Masked bytes are context only, never a synthetic filesystem destination. + found = [] + for regex, syntax in ((INLINE_LINK, INLINE_DESTINATION), (REFERENCE, REFERENCE_DESTINATION)): + for match in regex.finditer(text): + target = original[match.start(1):match.end(1)] + if re.fullmatch(syntax, target): + found.append((match.start(), target)) + for pos, target in sorted(found): + yield first + text.count("\n", 0, pos), target + + +def link_targets(text): + fence, block, first = None, [], 1 + for lineno, line in enumerate(text.splitlines() + [""], 1): + m = FENCE.match(line) + if fence is not None: + # Only a fence of the same character, at least as long, closes it. + if m and m.group(1)[0] == fence[0] and len(m.group(1)) >= len(fence) and not m.group(2).strip(): + fence = None + continue + if m or not line.strip(): + yield from paragraph_targets(first, block) + block = [] + if m: + fence = m.group(1) + continue + if not block: + first = lineno + block.append(line) + + +def local_path(target): + if target.startswith("<") and target.endswith(">"): + target = target[1:-1] + if not target or target.startswith(("#", "//")) or SCHEME.match(target): + return None + path = urllib.parse.unquote(target.split("#", 1)[0].split("?", 1)[0]) + return path or None + + +def broken_links(root): + root = os.path.abspath(root) + for dirpath, dirnames, filenames in os.walk(root): + dirnames[:] = sorted(d for d in dirnames if d not in SKIP_DIRS) + for name in sorted(filenames): + if not name.endswith(".md"): + continue + source = os.path.join(dirpath, name) + with open(source, encoding="utf-8", errors="replace") as f: + text = f.read() + for lineno, target in link_targets(text): + path = local_path(target) + if path is None: + continue + if path.startswith("/"): + resolved = os.path.join(root, path.lstrip("/")) + else: + resolved = os.path.join(dirpath, path) + if not os.path.exists(resolved): + yield os.path.relpath(source, root), lineno, target + + +def main(argv): + if len(argv) != 2: + print(__doc__.strip(), file=sys.stderr) + return 2 + broken = list(broken_links(argv[1])) + for source, lineno, target in broken: + print(f"{source}:{lineno}: broken relative link {target}") + return 1 if broken else 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/.github/block/scripts/docs-only-scope.sh b/.github/block/scripts/docs-only-scope.sh new file mode 100644 index 0000000000..0e16b612d8 --- /dev/null +++ b/.github/block/scripts/docs-only-scope.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# docs-only-scope.sh BASE HEAD: classifies the files changed between BASE and +# HEAD for the process-level suite. It prints one line: +# "docs_only N" every one of the N changed files is under docs/ +# "run N [FIRST-OTHER]" no file changed, or at least one is elsewhere +# and exits 0. Any error (git fails, the list cannot be read) exits nonzero, +# and the caller then runs the tests: an error never selects docs_only. +# +# The NUL-delimited list is written to a file first and read to its end, so +# no pipe can stop early and leave a writer's error looking like an answer. +set -euo pipefail +[ "$#" -eq 2 ] || { echo "usage: docs-only-scope.sh BASE HEAD" >&2; exit 2; } +list=$(mktemp) +trap 'rm -f "$list"' EXIT +if ! git diff --relative --name-only --no-renames -z "$1" "$2" -- . >"$list"; then + echo "docs-only-scope: git diff $1 $2 failed" >&2 + exit 2 +fi +if [ -n "$(git rev-parse --show-prefix)" ]; then + git -C "$(git rev-parse --show-toplevel)" diff --name-only --no-renames -z "$1" "$2" -- '.github/workflows/block-*.yml' '.github/dockerfiles/block-*.Dockerfile' '.github/block/**' >>"$list" +fi +n=0 +other="" +while IFS= read -r -d '' f; do + n=$((n + 1)) + case $f in + docs/*) ;; + *) [ -n "$other" ] || other=$f ;; + esac +done <"$list" +if [ "$n" -gt 0 ] && [ -z "$other" ]; then + echo "docs_only $n" +else + echo "run $n${other:+ $other}" +fi diff --git a/.github/block/scripts/ledger_check.py b/.github/block/scripts/ledger_check.py new file mode 100644 index 0000000000..d255eab967 --- /dev/null +++ b/.github/block/scripts/ledger_check.py @@ -0,0 +1,121 @@ +"""Check that every code and test anchor of the invariants ledger exists at a git ref. + +usage: python -I ledger_check.py [] + +A ledger row is a table line whose first cell holds `INV-...`. In its cells, a +backticked token that ends in .go is a FILE; a backticked identifier (or +Type.Method) is a SYMBOL of the nearest file named before it in the same cell, +or, in the test cell, of any file named in that cell. A file must exist at the +ref; a symbol must occur in its file as a whole word (for a test: `func Name(`). +A symbol with no file in its cell is looked up in the whole tree. A file may +be a glob (`volume_lock*.go`). A lower-case token with an underscore (a build +tag, a JSON key, a reason string) is not a Go symbol and is not checked. +Prints one line per missing anchor and a summary. It reads; it changes nothing. +Exit: 0 when every anchor exists; 1 when one is missing; 2 when git fails or no +row or anchor was found (an error is never read as a pass). +""" +import re +import subprocess +import sys + + +def git(repo, *args): + """git's output. A git failure ends the check with exit 2: an error must + never read as "no anchors". `git grep` finding nothing (exit 1) is not one.""" + r = subprocess.run(["git", "-C", repo] + list(args), capture_output=True, text=True, + encoding="utf-8", errors="replace") + if r.returncode != 0 and not (args and args[0] == "grep" and r.returncode == 1): + print("ledger_check: git %s failed (exit %d): %s" % (" ".join(args[:2]), r.returncode, r.stderr.strip()[:300]), + file=sys.stderr) + sys.exit(2) + return r.stdout + + +def main(): + repo, ref = sys.argv[1], sys.argv[2] + ledger = sys.argv[3] if len(sys.argv) > 3 else "docs/design/invariants.md" + text = git(repo, "show", "%s:%s" % (ref, ledger)) + prefix = sys.argv[4] if len(sys.argv) > 4 else "" + files = set(git(repo, "ls-tree", "-r", "--name-only", ref, "--", prefix or ".").split("\n")) + cache = {} + + def body(path): + if path not in cache: + cache[path] = git(repo, "show", "%s:%s" % (ref, path)) + return cache[path] + + def resolve(tok): + """A file token may be a full path or a bare file name.""" + if tok in files: + return [tok] + if "*" in tok: + rx = re.compile("^(.*/)?" + "[^/]*".join(re.escape(x) for x in tok.split("*")) + "$") + return [f for f in files if rx.match(f)] + if "/" not in tok: + return [f for f in files if f.endswith("/" + tok)] + # a path with a directory matches whole path components only + return [f for f in files if f.endswith("/" + tok)] + + ident = re.compile(r"^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?(\(\))?$") + go_all = None + rows = missing = anchors = 0 + for n, line in enumerate(text.split("\n"), 1): + if not line.startswith("|"): + continue + cells = [c.strip() for c in line.strip().strip("|").split("|")] + m = re.match(r"`(INV-[A-Z0-9-]+)`", cells[0]) if cells else None + if not m or len(cells) < 6: + continue + rows += 1 + inv, status = m.group(1), cells[-1] + if "ARCHIVED" in status: + continue + for ci, kind in ((3, "code"), (4, "test")): + toks = re.findall(r"`([^`]+)`", cells[ci]) + cell_files = [] + for t in toks: + if t.endswith(".go"): + cell_files.append(t) + cur = None + for t in toks: + if t.endswith(".go"): + cur = t + anchors += 1 + if not resolve(t): + missing += 1 + print("%s (line %d, %s, %s): file %s does not exist" % (inv, n, kind, status, t)) + continue + if not ident.match(t): + continue + sym = t.rstrip("()").split(".")[-1] + if sym in ("nil", "true", "false") or sym.isupper() or len(sym) < 3: + continue + if "_" in sym and sym == sym.lower(): + # a build tag, a JSON key or a reason string: not a Go symbol + continue + scope = [cur] if (cur and kind == "code") else cell_files + paths = [p for f in scope for p in resolve(f)] + anchors += 1 + if kind == "test" and sym.startswith(("Test", "Fuzz", "Benchmark")): + pat = re.compile(r"func %s\(" % re.escape(sym)) + else: + pat = re.compile(r"\b%s\b" % re.escape(sym)) + if paths: + ok = any(pat.search(body(p)) for p in paths) + else: + if go_all is None: + go_all = git(repo, "grep", "-h", "-E", r"^(func|type|var|const|\s+[A-Za-z_]+\s)", ref, "--", prefix + "*.go") + ok = bool(pat.search(go_all)) + if not ok: + missing += 1 + where = ", ".join(scope) if scope else "the tree" + print("%s (line %d, %s, %s): %s not found in %s" % (inv, n, kind, status, t, where)) + print("%d rows, %d anchors, %d missing at %s" % (rows, anchors, missing, ref)) + if rows == 0 or anchors == 0: + print("ledger_check: no ledger rows or anchors found: refusing to pass", file=sys.stderr) + sys.exit(2) + sys.exit(1 if missing else 0) + + +if __name__ == "__main__": + main() diff --git a/.github/block/scripts/post-merge-review-changed.sh b/.github/block/scripts/post-merge-review-changed.sh new file mode 100644 index 0000000000..d9d261971b --- /dev/null +++ b/.github/block/scripts/post-merge-review-changed.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Usage: post-merge-review-changed.sh BASE HEAD +# +# Writes what a PR changes (BASE...HEAD) as NUL-separated STATUS, PATH pairs, +# unquoted, so any byte in a name reaches the check as itself. --no-renames +# reports a move as a delete of the old name and an add of the new one. +set -euo pipefail +base=${1:?usage: post-merge-review-changed.sh BASE HEAD} +head=${2:?usage: post-merge-review-changed.sh BASE HEAD} +git diff --relative -z --name-status --no-renames "$base...$head" -- . + +if [ -n "$(git rev-parse --show-prefix)" ]; then + git -C "$(git rev-parse --show-toplevel)" diff -z --name-status --no-renames "$base...$head" -- '.github/workflows/block-*.yml' '.github/dockerfiles/block-*.Dockerfile' '.github/block/**' +fi diff --git a/.github/block/scripts/public-text-check.sh b/.github/block/scripts/public-text-check.sh new file mode 100644 index 0000000000..0cebd0bbc0 --- /dev/null +++ b/.github/block/scripts/public-text-check.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# Refuses internal names in what a pull request makes public: the lines it +# adds, its commit messages, its title and its description. This repository is +# public; internal names, machine paths and raw run artifacts do not belong in it. +# +# Usage: public-text-check.sh MERGE_BASE HEAD TITLE_FILE BODY_FILE +# Exit 0: clean. Exit 1: at least one hit (each printed). Exit 2: usage. +# +# The patterns live only here and in this check's own test; both files are +# excluded from the scan of added lines. +set -euo pipefail +[ "$#" -eq 4 ] || { echo "usage: public-text-check.sh MERGE_BASE HEAD TITLE_FILE BODY_FILE" >&2; exit 2; } +mb=$1; head=$2; title=$3; body=$4 +for f in "$title" "$body"; do + [ -f "$f" ] && [ -r "$f" ] || { echo "public-text: cannot read $f" >&2; exit 2; } +done +git rev-parse -q --verify "$mb^{commit}" >/dev/null && git rev-parse -q --verify "$head^{commit}" >/dev/null || + { echo "public-text: unknown commit $mb or $head" >&2; exit 2; } +# match: a grep error fails the check instead of reading as "no hit". +match() { local rc=0; grep -E -i -- "$pat" "$@" || rc=$?; [ "$rc" -le 1 ] || { echo "public-text: grep failed ($rc)" >&2; exit 2; }; } +pat='(claude|codex)0[0-9]|share[/\]rdma|V:[/\]share|diskstation|/home/[^/[:space:]]+/|(^|[^[:alnum:]_])pid[[:space:]]*[:=][[:space:]]*[0-9]+|[0-9]+[[:space:]]+cores[[:space:]]+with[[:space:]]+[0-9]+([.][0-9]+)?[[:space:]]*(KB|MB|GB|KiB|MiB|GiB)?[[:space:]]+heap|docs/spec/([^/[:space:]]+/)*recorded-[^/[:space:]]+' +out=$(mktemp); paths=; trap 'rm -f "$out" "$paths"' EXIT +paths=$(mktemp) +report() { # report WHERE < matching lines + local where=$1 line + while IFS= read -r line; do + printf 'public-text: %s: %s +' "$where" "${line:0:160}" >>"$out" + done +} +# Raw run artifacts are not public specs, even with scrubbed contents. +# Allow deletions so existing artifacts can be removed. +repo_root=$(git rev-parse --show-toplevel) +if ! (cd "$repo_root" && git diff --name-only -z --no-relative --no-renames --diff-filter=ACMT "$mb" "$head" -- docs/spec/ seaweed-block/docs/spec/) >"$paths"; then + echo 'public-text: cannot enumerate artifact paths' >&2 + exit 2 +fi +while IFS= read -r -d '' path; do + # Match the module's paths the same way from either entry point. + path=${path#seaweed-block/} + if [[ $path =~ ^docs/spec/(.*/)?recorded-[^/]+(/|$) ]]; then + printf '%s\n' "$path" | report "artifact path" + fi +done <"$paths" +# Added lines of the diff, with file and line number. +{ +git diff --relative --no-color --no-renames -U0 "$mb" "$head" -- . \ + ':(exclude).github/scripts/public-text-check.sh' ':(exclude).github/scripts/public-text-check-test.sh' \ + ':(exclude,top).github/block/scripts/public-text-check.sh' +if [ -n "$(git rev-parse --show-prefix)" ]; then + git -C "$(git rev-parse --show-toplevel)" diff --no-color --no-renames -U0 "$mb" "$head" -- '.github/workflows/block-*.yml' '.github/dockerfiles/block-*.Dockerfile' '.github/block/**' ':(exclude).github/block/scripts/public-text-check.sh' +fi +} | + awk ' + /^diff --git / { hdr = 1; next } + hdr && /^\+\+\+ / { f = substr($0, 7); next } + /^@@ / { hdr = 0; split($3, a, ","); n = substr(a[1], 2) + 0; next } + !hdr && /^\+/ { print f ":" n ": " substr($0, 2); n++ } + ' | match | report "added line" +# Commit messages (subjects and bodies) of the pull request. +git log --format='%h %s%n%b' "$mb..$head" | match | report "commit message" +match "$title" | report "title" +match "$body" | report "description" +hits=$(wc -l <"$out" | tr -d ' ') +if [ "$hits" -gt 0 ]; then + cat "$out" + echo "public-text: $hits hit(s). Say what the code or test does instead of who asked for it; keep internal paths out." >&2 + exit 1 +fi +echo "public-text: clean" diff --git a/.github/block/scripts/run-unit-groups-test.py b/.github/block/scripts/run-unit-groups-test.py new file mode 100644 index 0000000000..607fa5e88f --- /dev/null +++ b/.github/block/scripts/run-unit-groups-test.py @@ -0,0 +1,145 @@ +"""Run fake recorders through the real group executor, without product tests.""" +from pathlib import Path +import json +import os +import subprocess +import time +import sys +import tempfile +import unittest +from unittest.mock import Mock, patch +import importlib.util +import signal + +SCRIPT = Path(__file__).with_name("run-unit-groups.py") +FAKE = r'''import json, os, sys, time +from pathlib import Path +out = Path(sys.argv[1]); group = out.parent.name +root = Path(os.environ["FIXTURE_ROOT"]) +(root / (group + ".started")).write_text("started") +deadline = time.monotonic() + 5 +while not all((root / (g + ".started")).exists() for g in os.environ["EXPECTED_GROUPS"].split()): + if time.monotonic() >= deadline: sys.exit(17) + time.sleep(.01) +flags = sys.argv[2:] +assert "-p=" + ("4" if group == "g3" else "1") in flags +assert "-short" in flags and "-count=1" in flags and "20m" in flags +if sys.platform == "linux": + wal = Path(os.environ["TMPDIR"]) / "v1.bin" + with wal.open("w") as descriptor: + assert os.readlink(f"/proc/self/fd/{descriptor.fileno()}") == str(wal), "fixture WAL descriptor not found" +else: + assert Path(os.environ["TMPDIR"]) == Path(os.environ["TMPDIR"]).resolve(), "TMPDIR must identify the canonical directory" +out.write_text(json.dumps({"Action":"pass", "Package":group}) + "\n") +out.with_suffix(".stderr").write_text("fixture stderr") +(root / (group + ".finished")).write_text("finished") +sys.exit(7 if os.environ.get("FAIL_GROUP") == group else 0) +''' + + +class GroupRunnerTests(unittest.TestCase): + def run_groups(self, fail="", empty=False, alias=False): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp); plan = root / "plan"; plan.mkdir() + for group in ("g1", "g2", "g3"): + (plan / (group + ".txt")).write_text("" if empty and group != "g3" else "example/" + group + "\n") + fake = root / "fake.py"; fake.write_text(FAKE) + env = dict(os.environ, FIXTURE_ROOT=str(root), EXPECTED_GROUPS="g3" if empty else "g1 g2 g3", FAIL_GROUP=fail) + scratch = root / "tmp" + if alias: + scratch.mkdir() + link = root / "runner-temp" + link.symlink_to(scratch, target_is_directory=True) + scratch = link + result = subprocess.run([sys.executable, str(SCRIPT), str(plan), str(root / "evidence"), str(scratch), sys.executable, str(fake)], env=env, text=True, capture_output=True, timeout=20) + self.assertEqual(result.returncode, 1 if fail else 0, result.stdout + result.stderr) + expected = ["g3"] if empty else ["g1", "g2", "g3"] + for group in expected: + self.assertTrue((root / (group + ".finished")).exists(), result.stdout + result.stderr) + self.assertTrue((root / "evidence" / group / "go-test.stderr").exists()) + self.assertTrue((root / "tmp" / group).is_dir()) + events = [json.loads(line) for line in (root / "evidence" / "go-test.json").read_text().splitlines()] + self.assertCountEqual([e["Package"] for e in events], expected) + statuses = json.loads((root / "evidence" / "unit-groups.json").read_text()) + self.assertEqual(statuses["groups"]["g2"]["status"], 7 if fail == "g2" else 0) + + @unittest.skipUnless(os.name == "posix", "Linux runner temp symlink control") + def test_runner_temp_symlink_passes_canonical_scratch_paths(self): self.run_groups(alias=True) + + def test_all_groups_overlap_and_keep_separate_events(self): self.run_groups() + def test_failure_fails_job_after_every_group_finishes(self): self.run_groups(fail="g2") + def test_scope_empty_groups_launch_no_recorder(self): self.run_groups(empty=True) + + + def test_cancel_escalates_even_after_group_leader_exits(self): + spec = importlib.util.spec_from_file_location("unit_groups", SCRIPT) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module) + group = 12345 + leader = Mock(pid=group) + leader.wait.return_value = 0 + with patch.object(module.signal, "SIGKILL", 9, create=True), patch.object(module.os, "name", "posix"), patch.object(module.os, "killpg", create=True) as killpg, patch.object(module.time, "monotonic", side_effect=[0, 6]): + module.terminate([leader]) + self.assertIn(unittest.mock.call(group, signal.SIGTERM), killpg.call_args_list) + self.assertIn(unittest.mock.call(group, 9), killpg.call_args_list) + leader.wait.assert_called() + + @unittest.skipUnless(os.name == "posix", "process-group cancellation is a Linux runner control") + def test_cancel_kills_resistant_child_after_recorder_exits(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp); plan = root / "plan"; plan.mkdir() + for group in ("g1", "g2", "g3"): + (plan / (group + ".txt")).write_text("example/g1\n" if group == "g1" else "") + child = root / "child.py" + child.write_text("import os,signal,sys,time\nfrom pathlib import Path\nsignal.signal(signal.SIGTERM,signal.SIG_IGN)\np=Path(sys.argv[1])\np.with_suffix('.tmp').write_text(str(os.getpid()))\np.with_suffix('.tmp').replace(p)\nwhile True: time.sleep(.1)\n") + fake = root / "recorder.py" + fake.write_text("import subprocess,sys,time\nsubprocess.Popen([sys.executable,sys.argv[1],sys.argv[2]])\nwhile True: time.sleep(.1)\n") + marker = root / "child" + runner = subprocess.Popen([sys.executable, str(SCRIPT), str(plan), str(root / "evidence"), str(root / "tmp"), sys.executable, str(fake), str(child), str(marker)], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + pid = None + try: + deadline = time.monotonic() + 5 + while not marker.exists(): + if time.monotonic() >= deadline: self.fail("resistant child did not start") + time.sleep(.01) + pid = int(marker.read_text()) + runner.terminate() + self.assertEqual(runner.wait(timeout=12), 130) + deadline = time.monotonic() + 2 + while True: + stat = Path(f"/proc/{pid}/stat") + if not stat.exists() or stat.read_text().split(") ", 1)[1].startswith("Z"): break + if time.monotonic() >= deadline: self.fail("resistant child survived cancellation") + time.sleep(.01) + finally: + if pid is not None: + try: os.kill(pid, signal.SIGKILL) + except ProcessLookupError: pass + if runner.poll() is None: runner.kill() + runner.communicate(timeout=5) + + @unittest.skipUnless(os.name == "posix", "process-group cancellation is a Linux runner control") + def test_cancel_joins_every_started_group(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp); plan = root / "plan"; plan.mkdir() + for group in ("g1", "g2", "g3"): + (plan / (group + ".txt")).write_text("example/" + group + "\n") + fake = root / "held.py" + fake.write_text("import os,sys,time\nfrom pathlib import Path\np=Path(sys.argv[1]).parent\n(p/'process.tmp').write_text(str(os.getpid()))\n(p/'process.tmp').replace(p/'process')\nwhile True: time.sleep(.1)\n") + runner = subprocess.Popen([sys.executable, str(SCRIPT), str(plan), str(root / "evidence"), str(root / "tmp"), sys.executable, str(fake)], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + try: + deadline = time.monotonic() + 5 + markers = [root / "evidence" / g / "process" for g in ("g1", "g2", "g3")] + while not all(p.exists() for p in markers): + if time.monotonic() >= deadline: self.fail("groups did not start") + time.sleep(.01) + children = [int(p.read_text()) for p in markers] + runner.terminate() + self.assertEqual(runner.wait(timeout=10), 130) + for child in children: + with self.assertRaises(ProcessLookupError): os.kill(child, 0) + finally: + if runner.poll() is None: runner.terminate() + runner.communicate(timeout=10) + + +if __name__ == "__main__": unittest.main() diff --git a/.github/block/scripts/run-unit-groups.py b/.github/block/scripts/run-unit-groups.py new file mode 100644 index 0000000000..b02b4b8391 --- /dev/null +++ b/.github/block/scripts/run-unit-groups.py @@ -0,0 +1,123 @@ +"""Run the three default unit groups concurrently on the current runner. + +Usage: run-unit-groups.py PLAN_DIR EVIDENCE_DIR TMP_DIR RECORDER [RECORDER_ARG ...] +The recorder accepts OUTPUT followed by go-test flags and packages. Each group +owns its logs/events; they are combined only after all group processes exit. +""" +from contextlib import ExitStack +import json +import os +from pathlib import Path +import signal +import subprocess +import sys +import time + + +def stop(_signum, _frame): + raise KeyboardInterrupt + + +def terminate(processes): + for process in processes: + try: + if os.name == "posix": os.killpg(process.pid, signal.SIGTERM) + elif process.poll() is None: process.terminate() + except ProcessLookupError: + pass + if os.name == "posix": + # The leader may exit on TERM while its descendants remain in the group. + # Bound the grace period by group lifetime, never by leader lifetime. + deadline = time.monotonic() + 5 + remaining = list(processes) + while remaining and time.monotonic() < deadline: + alive = [] + for process in remaining: + process.poll() # Reap an exited leader without forgetting its PGID. + try: + os.killpg(process.pid, 0) + alive.append(process) + except ProcessLookupError: + pass + remaining = alive + if remaining: time.sleep(.05) + for process in remaining: + try: os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: pass + for process in processes: + try: + process.wait(timeout=5) + except subprocess.TimeoutExpired: + process.kill() + process.wait(timeout=5) + + + +def run(plan, evidence, temp, recorder): + groups = {g: (plan / (g + ".txt")).read_text().splitlines() for g in ("g1", "g2", "g3")} + evidence.mkdir(parents=True, exist_ok=True) + started = time.monotonic() + processes, results, times = {}, {}, {} + with ExitStack() as files: + try: + for group, packages in groups.items(): + results[group] = {"packages": len(packages), "status": 0, "elapsed_seconds": 0} + if not packages: + print(f"{group}: no packages selected by scope", flush=True) + continue + out = evidence / group; out.mkdir(parents=True, exist_ok=True) + scratch = temp / group; scratch.mkdir(parents=True, exist_ok=True) + # /proc/self/fd exposes resolved paths; preserve fixture identity even + # when the runner temp directory is a symlink to its data disk. + scratch = scratch.resolve(strict=True) + log = files.enter_context((out / "console.log").open("w", encoding="utf-8")) + command = recorder + [str(out / "go-test.json"), "-p=" + ("4" if group == "g3" else "1"), "-short", "-count=1", "-timeout", "20m", *packages] + times[group] = time.monotonic() + processes[group] = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT, stdin=subprocess.DEVNULL, + env=dict(os.environ, TMPDIR=str(scratch)), start_new_session=os.name == "posix") + print(f"{group}: started {len(packages)} packages", flush=True) + remaining = set(processes) + while remaining: + for group in tuple(remaining): + status = processes[group].poll() + if status is not None: + results[group]["status"] = status + results[group]["elapsed_seconds"] = round(time.monotonic() - times[group], 3) + remaining.remove(group) + if remaining: time.sleep(.05) + except BaseException: + signal.signal(signal.SIGTERM, signal.SIG_IGN) + signal.signal(signal.SIGINT, signal.SIG_IGN) + terminate(processes.values()) + raise + for group in processes: + print(f"--- {group} ---", flush=True) + print((evidence / group / "console.log").read_text(errors="replace"), flush=True) + summary = {"elapsed_seconds": round(time.monotonic() - started, 3), "groups": results} + try: + (evidence / "unit-groups.json").write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8") + with (evidence / "go-test.json").open("ab") as combined: + for group in processes: + events = evidence / group / "go-test.json" + if events.exists(): combined.write(events.read_bytes()) + except OSError as error: + print(f"test evidence unavailable: {error}", file=sys.stderr) + print(json.dumps(summary), flush=True) + return int(any(r["status"] != 0 for r in results.values())) + + +def main(argv): + if len(argv) < 5: + print(__doc__.strip(), file=sys.stderr) + return 2 + signal.signal(signal.SIGTERM, stop) + try: + return run(Path(argv[1]), Path(argv[2]), Path(argv[3]), argv[4:]) + except KeyboardInterrupt: + return 130 + except (OSError, ValueError) as error: + print(f"unit groups: {error}", file=sys.stderr) + return 2 + + +if __name__ == "__main__": sys.exit(main(sys.argv)) diff --git a/.github/block/scripts/runner-workspace-test.py b/.github/block/scripts/runner-workspace-test.py new file mode 100644 index 0000000000..999e43d40d --- /dev/null +++ b/.github/block/scripts/runner-workspace-test.py @@ -0,0 +1,106 @@ +"""Exercise the actual pre-checkout and always-run cleanup workflow bodies.""" +import contextlib +import io +import os +from pathlib import Path +import shutil +import tempfile +import textwrap +import unittest +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[3] +WORKFLOWS = sorted((ROOT / ".github/workflows").glob("block-*.yml")) + + +def step(text, name): + marker = " - name: " + name + "\n" + if text.count(marker) != 1: + raise AssertionError("missing or duplicate " + name) + return text.split(marker, 1)[1].split("\n - name:", 1)[0] + + +def code(block): + return textwrap.dedent(block.split(" run: |\n", 1)[1]).split("\n", 1)[1].rsplit("\nPY", 1)[0] + + +def execute(source, workspace, temp, free=None): + output = io.StringIO() + with patch.dict(os.environ, {"GITHUB_WORKSPACE": str(workspace), "RUNNER_TEMP": str(temp)}), contextlib.redirect_stdout(output): + with contextlib.ExitStack() as stack: + if free is not None: + stack.enter_context(patch("shutil.disk_usage", return_value=shutil._ntuple_diskusage(100_000_000_000, 0, free))) + try: + exec(compile(source, "", "exec"), {}) + except SystemExit as err: + return err.code, output.getvalue() + return 0, output.getvalue() + + +class RunnerWorkspaceTests(unittest.TestCase): + def test_every_job_checks_before_checkout_and_cleans_last_even_on_failure(self): + for path in WORKFLOWS: + text = path.read_text() + before = step(text, "Runner free space") + after = step(text, "Clean job workspace") + self.assertLess(text.index("- name: Runner free space"), text.index("- name: Checkout"), path.name) + self.assertIn("if: always() && runner.environment == 'self-hosted'", after) + self.assertNotIn("continue-on-error", after) + self.assertNotIn("- name:", text.split("- name: Clean job workspace", 1)[1]) + self.assertIn("working-directory: ${{ runner.temp }}", before) + self.assertIn("working-directory: ${{ runner.temp }}", after) + self.assertIn("python3 -I -", before) + self.assertIn("python3 -I -", after) + + def test_low_space_refuses_and_boundary_admits(self): + for path in WORKFLOWS: + source = code(step(path.read_text(), "Runner free space")) + with tempfile.TemporaryDirectory() as temp: + root = Path(temp) + rc, out = execute(source, root, root, 9_999_999_999) + self.assertEqual(rc, 75) + self.assertIn("runner_disk_low", out) + self.assertIn("required_bytes=10000000000", out) + self.assertEqual(execute(source, root, root, 10_000_000_000)[0], 0) + with patch("shutil.disk_usage", side_effect=[shutil._ntuple_diskusage(100, 0, 10_000_000_000), shutil._ntuple_diskusage(100, 0, 1)]): + rc, out = execute(source, root / "work", root / "temp") + self.assertEqual(rc, 75) + self.assertIn("runner_disk_low", out) + with patch("shutil.disk_usage", side_effect=OSError("probe failed")): + rc, out = execute(source, root, root) + self.assertEqual(rc, 75) + self.assertIn("runner_disk_check_failed", out) + + def test_cleanup_removes_hidden_and_build_files_but_not_symlink_targets(self): + for path in WORKFLOWS: + source = code(step(path.read_text(), "Clean job workspace")) + with tempfile.TemporaryDirectory() as temp: + root = Path(temp); work = root / "repo/repo"; work.mkdir(parents=True) + (work / ".git").mkdir(); (work / ".git/config").write_text("config") + (work / "binary").write_bytes(b"build") + outside = root / "outside"; outside.mkdir(); (outside / "keep").write_text("keep") + (work / "link").symlink_to(outside, target_is_directory=True) + rc, out = execute(source, work, root) + self.assertEqual(rc, 0, out) + self.assertEqual(list(work.iterdir()), []) + self.assertTrue((outside / "keep").is_file()) + self.assertEqual(execute(source, root, root)[0], 1) + self.assertEqual(execute(source, Path(root.anchor), root)[0], 1) + alias = root / "alias"; alias.symlink_to(work, target_is_directory=True) + self.assertEqual(execute(source, alias, root)[0], 1) + + def test_cleanup_refuses_symlinked_ancestors_and_preserves_external_sentinel(self): + for path in WORKFLOWS: + with self.subTest(workflow=path.name), tempfile.TemporaryDirectory() as temp: + base = Path(temp) + external = base / "external/repo/repo"; external.mkdir(parents=True) + sentinel = external / "keep"; sentinel.write_text("outside checkout") + alias = base / "alias"; alias.symlink_to(base / "external", target_is_directory=True) + source = code(step(path.read_text(), "Clean job workspace")) + rc, out = execute(source, alias / "repo/repo", base) + self.assertTrue(sentinel.is_file(), "cleanup followed a workspace ancestor outside the checkout") + self.assertEqual(rc, 1, out) + self.assertIn("runner_workspace_cleanup_refused", out) + + +if __name__ == "__main__": unittest.main() diff --git a/.github/block/scripts/safe-merge-check.py b/.github/block/scripts/safe-merge-check.py new file mode 100644 index 0000000000..b7c2567675 --- /dev/null +++ b/.github/block/scripts/safe-merge-check.py @@ -0,0 +1,132 @@ +"""Read-only block merge readiness check. Run from a trusted master checkout. + +Usage (inside seaweed-block/): python3 ../.github/block/scripts/safe-merge-check.py PR +Never merges, posts comments, changes account config or pushes refs. +""" +import json +import subprocess +import sys +import tempfile +from pathlib import Path + +REPO = "seaweedfs/seaweedfs" +WORKFLOW_PATH = ".github/workflows/block-test.yml" +JOBS = {"go test (linux)", "process-level tests (real binaries)"} + + +def validate(pr, run, jobs, current): + if pr["state"] != "open" or pr["draft"] or pr["mergeable"] is not True: + raise ValueError("PR must be open, ready and mergeable") + if pr["base"]["ref"] != "master": raise ValueError("expected master base") + if run.get("path") != WORKFLOW_PATH or run["name"] != "Block Test" or run["head_sha"] != pr["head"]["sha"]: + raise ValueError("wrong workflow or head") + if run["status"] != "completed" or run["conclusion"] != "success": + raise ValueError("Block Test is not successful") + bases = [p["base"]["sha"] for p in run["pull_requests"] if p["number"] == pr["number"]] + if bases != [current]: raise ValueError("tested base is not current master") + required = [j for j in jobs if j["name"] in JOBS] + if len(required) != 2 or {j["name"] for j in required} != JOBS or any(j["conclusion"] != "success" for j in required): + raise ValueError("both block test jobs must succeed") + + +def api(path): + return json.loads(subprocess.check_output(["gh", "api", "repos/" + REPO + "/" + path])) + + +def successful_run(pr, current): + runs = api("actions/runs?head_sha=" + pr["head"]["sha"] + "&event=pull_request&per_page=100")["workflow_runs"] + runs = [r for r in runs if r.get("path") == WORKFLOW_PATH and r["name"] == "Block Test"] + if not runs: raise ValueError("no Block Test run") + run = max(runs, key=lambda r: (r["created_at"], r["id"])) + pages = json.loads(subprocess.check_output(["gh", "api", "--paginate", "--slurp", "repos/" + REPO + "/actions/runs/" + str(run["id"]) + "/jobs?per_page=100"])) + validate(pr, run, [j for page in pages for j in page["jobs"]], current) + return run + + +def check_control_paths(base, head): + # Inspect both sides of renames and fail on enumeration errors. These PRs + # need independent workflow review; their own Actions results cannot waive it. + # Diff from the merge base: master's later control changes are not the PR's, + # and the tested merge commit already ran them. + bases = subprocess.check_output(["git", "merge-base", "--all", base, head]).decode("ascii").splitlines() + if len(bases) != 1: + raise ValueError("ambiguous_merge_base: expected exactly one merge base") + paths = subprocess.check_output(["git", "diff", "--no-renames", "--name-only", "-z", bases[0], head]).split(b"\0") + controls = [p.decode("utf-8", errors="replace") for p in paths if p.startswith((b".github/workflows/", b".github/block/", b".github/dockerfiles/block-", b"seaweed-block/.github/"))] + if controls: + raise ValueError("workflow_review_required: CI controls changed: " + ", ".join(controls)) + + +def fetch_review_head(pr, current): + if subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip() != current: + raise ValueError("run from trusted current master checkout") + subprocess.run(["git", "-c", "fetch.fsckObjects=true", "fetch", "--no-tags", "origin", "+refs/pull/" + str(pr["number"]) + "/head:refs/remotes/block-review/head"], check=True) + actual = subprocess.check_output(["git", "rev-parse", "refs/remotes/block-review/head"], text=True).strip() + if actual != pr["head"]["sha"]: raise ValueError("PR head moved; recheck") + check_control_paths(current, actual) + return actual + + +def local_checks(pr, current): + actual = fetch_review_head(pr, current) + with tempfile.TemporaryDirectory() as tmp: + body, title = Path(tmp) / "body", Path(tmp) / "title" + body.write_text(pr["body"] or "", encoding="utf-8") + title.write_text(pr["title"], encoding="utf-8") + subprocess.run(["bash", str(Path(__file__).resolve().with_name("check-pr-base.sh")), current, actual, str(body), str(title)], check=True) + + +def validate_batch(manifest, prs, current): + if manifest["base"] != current: raise ValueError("master moved since batch creation") + if not manifest["head"] or len(manifest["prs"]) < 2: raise ValueError("expected pinned batch and at least two PRs") + numbers = [p["number"] for p in manifest["prs"]] + if len(set(numbers)) != len(numbers) or numbers != [p["number"] for p in prs]: + raise ValueError("batch PR order differs or repeats") + for saved, pr in zip(manifest["prs"], prs): + if pr["state"] != "open" or pr["draft"] or pr["base"]["ref"] != "master" or pr["head"]["sha"] != saved["head"]: + raise ValueError("batch member is not ready or its head changed") + if not Path(saved["evidence"]).is_file() or not Path(saved["evidence"]).read_text().strip(): + raise ValueError("batch member has no acceptance evidence") + + +def main(args): + current = api("git/ref/heads/master")["object"]["sha"] + if len(args) == 2 and args[0] == "--verify-tree": + tree = api("git/commits/" + current)["tree"]["sha"] + if tree != args[1]: raise ValueError("master tree differs from the tested batch") + print(json.dumps({"tree_matches": True, "master": current, "tree": tree})) + return + if len(args) == 2 and args[0] == "--batch": + manifest = json.loads(Path(args[1]).read_text()) + prs = [api("pulls/" + str(p["number"])) for p in manifest["prs"]] + validate_batch(manifest, prs, current) + batch = api("pulls/" + str(manifest["batch_pr"])) + if batch["head"]["sha"] != manifest["head"]: raise ValueError("batch head changed") + fetch_review_head(batch, current) + run = successful_run(batch, current) + for pr in prs: local_checks(pr, current) + if api("git/ref/heads/master")["object"]["sha"] != current: raise ValueError("master moved; recheck") + for pr in prs + [batch]: + if api("pulls/" + str(pr["number"]))["head"]["sha"] != pr["head"]["sha"]: raise ValueError("head moved; recheck") + tree = api("git/commits/" + manifest["head"])["tree"]["sha"] + # A rerun can invalidate the earlier success while local checks execute. + run = successful_run(batch, current) + print(json.dumps({"ready": True, "base": current, "head": manifest["head"], "run": run["id"], "tree": tree, "order": [p["number"] for p in prs]})) + return + if len(args) != 1 or not args[0].isdecimal(): raise ValueError("expected PR, --batch MANIFEST or --verify-tree TREE") + pr = api("pulls/" + args[0]) + run = successful_run(pr, current) + local_checks(pr, current) + if api("git/ref/heads/master")["object"]["sha"] != current or api("pulls/" + args[0])["head"]["sha"] != pr["head"]["sha"]: + raise ValueError("base or head moved; recheck") + # Refresh the latest run and both jobs after every potentially slow check. + run = successful_run(pr, current) + print(json.dumps({"ready": True, "head": pr["head"]["sha"], "base": current, "run": run["id"], "merge_mode": "squash"})) + + +if __name__ == "__main__": + try: + main(sys.argv[1:]) + except (IndexError, KeyError, ValueError, OSError, subprocess.SubprocessError) as error: + print("REFUSED: " + str(error), file=sys.stderr) + sys.exit(1) diff --git a/.github/block/scripts/unit-test-shards-test.py b/.github/block/scripts/unit-test-shards-test.py new file mode 100644 index 0000000000..df49419e7c --- /dev/null +++ b/.github/block/scripts/unit-test-shards-test.py @@ -0,0 +1,52 @@ +"""Exact coverage before scope selection; old heavy-package rules afterward.""" +import importlib.util +from pathlib import Path +import unittest + +spec = importlib.util.spec_from_file_location("planner", Path(__file__).with_name("unit-test-shards.py")) +planner = importlib.util.module_from_spec(spec) +spec.loader.exec_module(planner) +MODULE = "example.invalid/product" +HEAVY = ("core/storage", "core/frontend/durable", "core/host/master", "core/authority") + + +class UnitShardTests(unittest.TestCase): + def setUp(self): + self.packages = [MODULE + "/" + p for p in (*HEAVY, "cmd/sw-block", "core/frontend/chunkstore", "internal/newpackage", "core/storage/child")] + self.groups = planner.partition(MODULE, self.packages) + + def test_exact_cover_and_stable_order(self): + flat = [p for group in self.groups.values() for p in group] + self.assertCountEqual(flat, self.packages) + self.assertEqual(len(flat), len(set(flat))) + self.assertEqual(self.groups, planner.partition(MODULE, list(reversed(self.packages)))) + self.assertEqual(self.groups["g1"], [MODULE + "/core/storage"]) + self.assertEqual(self.groups["g2"], [MODULE + "/" + p for p in HEAVY[1:]]) + self.assertIn(MODULE + "/internal/newpackage", self.groups["g3"]) + self.assertIn(MODULE + "/core/storage/child", self.groups["g3"]) + + def test_existing_heavy_scope_on_main_train_and_prs(self): + all_changed = [p + "/changed.go" for p in HEAVY] + for event, ref in (("push", ""), ("pull_request", "train/next")): + selected = planner.select(MODULE, self.groups, event, ref, all_changed) + self.assertEqual(selected["g1"], []) + self.assertEqual(selected["g2"], []) + self.assertEqual(selected["g3"], self.groups["g3"]) + self.assertEqual(planner.select(MODULE, self.groups, "pull_request", "fix/x", all_changed), self.groups) + for path in HEAVY: + selected = planner.select(MODULE, self.groups, "pull_request", "fix/x", [path + "/x.go"]) + heavy = selected["g1"] + selected["g2"] + self.assertEqual(heavy, [MODULE + "/" + path]) + nested = planner.select(MODULE, self.groups, "pull_request", "fix/x", ["core/storage/child/x.go", "core/storage/"]) + self.assertEqual(nested["g1"], []) + self.assertEqual(nested["g2"], []) + self.assertEqual(nested["g3"], self.groups["g3"]) + + def test_invalid_inventory_is_refused(self): + for packages in ([], self.packages + [self.packages[0]], self.packages[1:], self.packages + ["other/pkg"]): + with self.subTest(packages=packages), self.assertRaises(ValueError): + planner.partition(MODULE, packages) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/block/scripts/unit-test-shards.py b/.github/block/scripts/unit-test-shards.py new file mode 100644 index 0000000000..badb9b8791 --- /dev/null +++ b/.github/block/scripts/unit-test-shards.py @@ -0,0 +1,55 @@ +"""Plan the default unit groups from the full go-list inventory. + +Usage: go list ./... | python3 unit-test-shards.py MODULE OUT_DIR EVENT HEAD_REF CHANGED_FILE +The complete partition covers every package exactly once. Existing scope rules +then select heavy packages only on ordinary PRs that touch their direct files. +""" +from pathlib import Path +import sys + +HEAVY = ("core/storage", "core/frontend/durable", "core/host/master", "core/authority") + + +def partition(module, packages): + if not module or any(c.isspace() for c in module): + raise ValueError("expected one module path") + if not packages or len(packages) != len(set(packages)): + raise ValueError("empty package list or duplicate package") + if any(p != module and not p.startswith(module + "/") for p in packages): + raise ValueError("package outside the selected module") + heavy = [module + "/" + p for p in HEAVY] + if not set(heavy) <= set(packages): + raise ValueError("required heavy packages missing from go list") + return {"g1": heavy[:1], "g2": heavy[1:], "g3": sorted(set(packages) - set(heavy))} + + +def select(module, groups, event, head_ref, changed): + selected = set() + if event != "push" and not head_ref.startswith("train/"): + for p in HEAVY: + if any(f.startswith(p + "/") and f[len(p) + 1:] and "/" not in f[len(p) + 1:] for f in changed): + selected.add(module + "/" + p) + return {name: [p for p in packages if name == "g3" or p in selected] + for name, packages in groups.items()} + + +def main(argv): + if len(argv) != 6: + print(__doc__.strip(), file=sys.stderr) + return 2 + try: + groups = partition(argv[1], sys.stdin.read().split()) + groups = select(argv[1], groups, argv[3], argv[4], Path(argv[5]).read_text().splitlines()) + out = Path(argv[2]) + out.mkdir(parents=True, exist_ok=True) + for name, packages in groups.items(): + (out / (name + ".txt")).write_text("".join(p + "\n" for p in packages), encoding="utf-8") + print(f"{name}: {len(packages)} packages") + except (OSError, ValueError) as error: + print(f"unit-test-shards: {error}", file=sys.stderr) + return 2 + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/.github/dockerfiles/block-blockcsi.Dockerfile b/.github/dockerfiles/block-blockcsi.Dockerfile new file mode 100644 index 0000000000..7e296031c7 --- /dev/null +++ b/.github/dockerfiles/block-blockcsi.Dockerfile @@ -0,0 +1,27 @@ +FROM golang:1.25-bookworm AS build + +WORKDIR /src/seaweed-block +COPY seaweed-block/go.mod seaweed-block/go.sum ./ +RUN go mod download +COPY . /src +RUN CGO_ENABLED=0 go build -o /out/blockcsi ./cmd/blockcsi +# No lab build reaches an image (scripts/refuse-lab-binary.sh): refuse it before the +# runtime stage, so neither a build nor a push of this image can complete. +RUN bash scripts/refuse-lab-binary.sh /out/blockcsi + +FROM debian:bookworm-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + e2fsprogs \ + kmod \ + multipath-tools \ + nvme-cli \ + open-iscsi \ + sg3-utils \ + util-linux && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=build /out/blockcsi /usr/local/bin/blockcsi + +ENTRYPOINT ["/usr/local/bin/blockcsi"] diff --git a/.github/dockerfiles/block-sw-block.Dockerfile b/.github/dockerfiles/block-sw-block.Dockerfile new file mode 100644 index 0000000000..01930b926e --- /dev/null +++ b/.github/dockerfiles/block-sw-block.Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.25-bookworm AS build + +WORKDIR /src/seaweed-block +COPY seaweed-block/go.mod seaweed-block/go.sum ./ +RUN go mod download +COPY . /src +RUN CGO_ENABLED=0 go build -o /out/blockmaster ./cmd/blockmaster && \ + CGO_ENABLED=0 go build -o /out/blockvolume ./cmd/blockvolume && \ + CGO_ENABLED=0 go build -o /out/sw-block ./cmd/sw-block +# No lab build reaches an image (scripts/refuse-lab-binary.sh): refuse it before the +# runtime stage, so neither a build nor a push of this image can complete. +RUN bash scripts/refuse-lab-binary.sh /out/blockmaster /out/blockvolume /out/sw-block + +FROM debian:bookworm-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends kmod && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=build /out/blockmaster /usr/local/bin/blockmaster +COPY --from=build /out/blockvolume /usr/local/bin/blockvolume +COPY --from=build /out/sw-block /usr/local/bin/sw-block + +USER 65532:65532 diff --git a/.github/workflows/block-known-bugs.yml b/.github/workflows/block-known-bugs.yml new file mode 100644 index 0000000000..64cc2d0169 --- /dev/null +++ b/.github/workflows/block-known-bugs.yml @@ -0,0 +1,127 @@ +name: Block known bugs + +# Nightly: every open-issue reproduction that is skipped by default (t.Skip unless +# SEAWEED_KNOWN_BUGS=1) runs and is EXPECTED TO FAIL. If one passes, its bug is +# fixed but its skip is still in place: this job fails and names it, so the skip +# is removed in the fix PR (or right after). A fix PR removes the test's line here +# together with its skip. +on: + schedule: + - cron: "17 6 * * *" + workflow_dispatch: + +defaults: + run: + working-directory: seaweed-block + +permissions: + contents: read + +jobs: + known-bugs: + name: known-bug reproductions still fail + runs-on: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && vars.BLOCK_RUNNER_LABEL || 'ubuntu-latest' }} + timeout-minutes: 15 + env: + CGO_ENABLED: "0" + SEAWEED_KNOWN_BUGS: "1" + steps: + - name: Runner free space + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + import shutil + import sys + required = 10_000_000_000 + for path in dict.fromkeys((os.environ["GITHUB_WORKSPACE"], os.environ["RUNNER_TEMP"])): + try: + free = shutil.disk_usage(path).free + except OSError as err: + print(f"runner_disk_check_failed path={path!r} error={err}") + sys.exit(75) + if free < required: + print(f"runner_disk_low path={path!r} free_bytes={free} required_bytes={required}") + sys.exit(75) + print(f"runner_disk_ok path={path!r} free_bytes={free} required_bytes={required}") + PY + + - name: Checkout + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + with: + persist-credentials: false + + - name: Runner disk is NVMe + # A self-hosted runner whose work, temp or Go cache directory sits on a + # SATA system disk times the process-level tests out under disk load; + # this names the runner and stops the job before it starts. + if: runner.environment == 'self-hosted' + run: | + bash .github/scripts/require-nvme-test.sh + bash .github/scripts/require-nvme.sh "$GITHUB_WORKSPACE" "$RUNNER_TEMP" "${TMPDIR:-/tmp}" "${GOCACHE:-$HOME/.cache/go-build}" + + - name: Set up Go + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 + with: + go-version-file: seaweed-block/go.mod + cache: false + + - name: Known-bug verdict controls + run: bash .github/scripts/known-bugs-test.sh + + - name: Each reproduction still fails + run: | + bash .github/scripts/known-bugs.sh <<'LIST' + #186 ./cmd/blockmaster/ TestChartOptInLoopbackFlagIsAcceptedByBlockmaster + LIST + + - name: Clean job workspace + # Hosted runners are disposable; their setup-go cache upload runs in + # a post action and still needs the checkout. Persistent runners do not + # upload that cache, and must release their checkout/build files here. + if: always() && runner.environment == 'self-hosted' + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + from pathlib import Path + import shutil + import sys + root = Path(os.environ["GITHUB_WORKSPACE"]) + # Refuse aliases rather than resolving them. Open EVERY component without + # following symlinks, then keep cleanup anchored to the verified directory fd. + if not root.is_absolute() or ".." in root.parts or root == Path(root.anchor) or root.name != root.parent.name or root == Path(os.environ["RUNNER_TEMP"]): + print(f"runner_workspace_cleanup_refused path={str(root)!r}") + sys.exit(1) + flags = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW + fd = os.open(root.anchor, flags) + previous = os.open(".", flags) + errors = [] + try: + for part in root.parts[1:]: + child = os.open(part, flags, dir_fd=fd) + os.close(fd) + fd = child + if not shutil.rmtree.avoids_symlink_attacks: + raise OSError("descriptor-safe directory removal is unavailable") + os.fchdir(fd) + for entry in os.scandir("."): + try: + if entry.is_dir(follow_symlinks=False): + shutil.rmtree(entry.name) + else: + os.unlink(entry.name) + except OSError as err: + errors.append(f"{entry.name}: {err}") + except OSError as err: + print(f"runner_workspace_cleanup_refused path={str(root)!r} error={err}") + sys.exit(1) + finally: + os.fchdir(previous) + os.close(previous) + os.close(fd) + if errors: + print("runner_workspace_cleanup_failed " + "; ".join(errors)) + sys.exit(1) + print(f"runner_workspace_clean path={str(root)!r}") + PY diff --git a/.github/workflows/block-post-merge-review.yml b/.github/workflows/block-post-merge-review.yml new file mode 100644 index 0000000000..a004a418bc --- /dev/null +++ b/.github/workflows/block-post-merge-review.yml @@ -0,0 +1,146 @@ +name: Block post-merge-review paths + +# A PR labelled "post-merge-review" may merge before its full review only if +# every changed file is allowed by .github/post-merge-review-allow.txt. +# This check fails such a PR otherwise; without the label it passes. +# +# pull_request_target: the workflow, the allow list and the script all come +# from the base branch, so a PR cannot change its own check. The PR's code is +# never checked out or run: only its commit is fetched, for the file list. +on: + pull_request_target: + paths: + - "seaweed-block/**" + - ".github/workflows/block-*.yml" + - ".github/block/**" + - ".github/dockerfiles/block-*.Dockerfile" + # edited: a retarget changes the base, and with it the diff. + types: [opened, synchronize, reopened, labeled, unlabeled, edited] + +defaults: + run: + working-directory: seaweed-block + +permissions: + contents: read + +concurrency: + group: block-post-merge-review-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + paths: + name: post-merge-review paths + # GitHub-hosted: on the self-hosted runners this job ended in 'Set up + # job' with no log on every runner (2026-11-29), while spec trace, on the + # same runners, passes. Unlabelled PRs only echo here, so the hosted + # queue costs little; the merge gate does not wait for it unless the PR + # is labelled. + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Runner free space + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + import shutil + import sys + required = 10_000_000_000 + for path in dict.fromkeys((os.environ["GITHUB_WORKSPACE"], os.environ["RUNNER_TEMP"])): + try: + free = shutil.disk_usage(path).free + except OSError as err: + print(f"runner_disk_check_failed path={path!r} error={err}") + sys.exit(75) + if free < required: + print(f"runner_disk_low path={path!r} free_bytes={free} required_bytes={required}") + sys.exit(75) + print(f"runner_disk_ok path={path!r} free_bytes={free} required_bytes={required}") + PY + + - name: Not labelled + if: ${{ !contains(github.event.pull_request.labels.*.name, 'post-merge-review') }} + working-directory: ${{ github.workspace }} + run: echo "no post-merge-review label; nothing to check" + + - name: Checkout base + if: ${{ contains(github.event.pull_request.labels.*.name, 'post-merge-review') }} + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + with: + ref: ${{ github.event.pull_request.base.sha }} + fetch-depth: 0 + persist-credentials: false + + - name: Check changed paths + if: ${{ contains(github.event.pull_request.labels.*.name, 'post-merge-review') }} + env: + BASE: ${{ github.event.pull_request.base.sha }} + HEAD: ${{ github.event.pull_request.head.sha }} + PR: ${{ github.event.pull_request.number }} + run: | + set -euo pipefail + bash .github/scripts/post-merge-review-check-test.sh + git -c fetch.fsckObjects=true fetch --no-tags origin "+refs/pull/${PR}/head:refs/remotes/pr/head" + bash ../.github/block/scripts/post-merge-review-changed.sh "$BASE" "$HEAD" >changed.bin + # The allow list speaks for the module only: any host file keeps the full review. + git -C .. diff -z --name-only --no-renames "$BASE...$HEAD" -- . ':(exclude)seaweed-block/' \ + ':(exclude).github/workflows/block-*.yml' ':(exclude).github/dockerfiles/block-*.Dockerfile' ':(exclude).github/block/**' >host.bin + host=0 + while IFS= read -r -d '' path; do + printf 'DENY host %q (outside seaweed-block)\n' "$path" + host=1 + done &2 + exit 1 + fi + notes="seaweed-block/docs/releases/${version%%-*}.md" + if [[ ! -s "${notes}" ]]; then + echo "refusing to publish: release notes ${notes} are missing or empty" >&2 + exit 1 + fi + echo "notes=${notes}" >> "$GITHUB_OUTPUT" + stable=false + move_alpha=false + if [[ "${version}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + stable=true + highest="$(git tag -l 'seaweed-block/v*' | sed 's|^seaweed-block/||' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)" + if [[ "${version}" == "${highest}" ]]; then + move_alpha=true + fi + fi + { + echo "block_tags<> "$GITHUB_OUTPUT" + + - name: Build and push block image + id: block + uses: docker/build-push-action@v6 + with: + context: . + file: .github/dockerfiles/block-sw-block.Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ steps.tags.outputs.block_tags }} + + - name: Build and push CSI image + uses: docker/build-push-action@v6 + with: + context: . + file: .github/dockerfiles/block-blockcsi.Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ steps.tags.outputs.csi_tags }} + + - name: Publish matching binary tarball + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BLOCK_DIGEST: ${{ steps.block.outputs.digest }} + NOTES: ${{ steps.tags.outputs.notes }} + shell: bash + run: | + set -euo pipefail + version="${GITHUB_REF_NAME#seaweed-block/}" + out="$RUNNER_TEMP/block-release" + mkdir -p "$out/bin" + docker pull "${BLOCK_IMAGE}@${BLOCK_DIGEST}" + container=$(docker create "${BLOCK_IMAGE}@${BLOCK_DIGEST}") + trap 'docker rm "$container" >/dev/null' EXIT + for binary in blockmaster blockvolume sw-block; do + docker cp "$container:/usr/local/bin/$binary" "$out/bin/$binary" + done + bash seaweed-block/scripts/refuse-lab-binary.sh "$out/bin/"* + asset="sw-block-${version}-linux-amd64.tar.gz" + tar -C "$out/bin" -czf "$out/$asset" blockmaster blockvolume sw-block + (cd "$out" && sha256sum "$asset" >SHA256SUMS) + prerelease=false + if [[ "$version" == *-* ]]; then prerelease=true; fi + # A rerun replaces the assets, then publishes a draft an interrupted run left. + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + gh release upload "$GITHUB_REF_NAME" "$out/$asset" "$out/SHA256SUMS" --repo "$GITHUB_REPOSITORY" --clobber + gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --prerelease="$prerelease" --draft=false --latest=false + else + gh release create "$GITHUB_REF_NAME" "$out/$asset" "$out/SHA256SUMS" --repo "$GITHUB_REPOSITORY" --verify-tag --latest=false \ + --prerelease="$prerelease" --title "Seaweed Block $version" --notes-file "$NOTES" + fi + + - name: Clean job workspace + # Hosted runners are disposable; their setup-go cache upload runs in + # a post action and still needs the checkout. Persistent runners do not + # upload that cache, and must release their checkout/build files here. + if: always() && runner.environment == 'self-hosted' + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + from pathlib import Path + import shutil + import sys + root = Path(os.environ["GITHUB_WORKSPACE"]) + # Refuse aliases rather than resolving them. Open EVERY component without + # following symlinks, then keep cleanup anchored to the verified directory fd. + if not root.is_absolute() or ".." in root.parts or root == Path(root.anchor) or root.name != root.parent.name or root == Path(os.environ["RUNNER_TEMP"]): + print(f"runner_workspace_cleanup_refused path={str(root)!r}") + sys.exit(1) + flags = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW + fd = os.open(root.anchor, flags) + previous = os.open(".", flags) + errors = [] + try: + for part in root.parts[1:]: + child = os.open(part, flags, dir_fd=fd) + os.close(fd) + fd = child + if not shutil.rmtree.avoids_symlink_attacks: + raise OSError("descriptor-safe directory removal is unavailable") + os.fchdir(fd) + for entry in os.scandir("."): + try: + if entry.is_dir(follow_symlinks=False): + shutil.rmtree(entry.name) + else: + os.unlink(entry.name) + except OSError as err: + errors.append(f"{entry.name}: {err}") + except OSError as err: + print(f"runner_workspace_cleanup_refused path={str(root)!r} error={err}") + sys.exit(1) + finally: + os.fchdir(previous) + os.close(previous) + os.close(fd) + if errors: + print("runner_workspace_cleanup_failed " + "; ".join(errors)) + sys.exit(1) + print(f"runner_workspace_clean path={str(root)!r}") + PY diff --git a/.github/workflows/block-spec-trace.yml b/.github/workflows/block-spec-trace.yml new file mode 100644 index 0000000000..43cd2e6581 --- /dev/null +++ b/.github/workflows/block-spec-trace.yml @@ -0,0 +1,164 @@ +name: Block spec trace + +# Every PR description carries the spec trace (see the PR template); this +# check fails a PR whose description does not. +# +# pull_request_target: the workflow and the script come from the base branch, +# so a PR cannot change its own check. The PR's code is never checked out or +# run: only its commit is fetched, for the file list. The description is read +# from the event through an environment variable, never interpolated. +on: + pull_request_target: + paths: + - "seaweed-block/**" + - ".github/workflows/block-*.yml" + - ".github/block/**" + - ".github/dockerfiles/block-*.Dockerfile" + # edited: the check reads the description and the base. + types: [opened, synchronize, reopened, edited] + +defaults: + run: + working-directory: seaweed-block + +permissions: + contents: read + +concurrency: + group: block-spec-trace-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + trace: + name: spec trace + # The base-owned check defaults to a disposable hosted runner. Only a + # same-repository PR may opt into the registered BLOCK_RUNNER_LABEL. + runs-on: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && vars.BLOCK_RUNNER_LABEL || 'ubuntu-latest' }} + timeout-minutes: 5 + steps: + - name: Runner free space + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + import shutil + import sys + required = 10_000_000_000 + for path in dict.fromkeys((os.environ["GITHUB_WORKSPACE"], os.environ["RUNNER_TEMP"])): + try: + free = shutil.disk_usage(path).free + except OSError as err: + print(f"runner_disk_check_failed path={path!r} error={err}") + sys.exit(75) + if free < required: + print(f"runner_disk_low path={path!r} free_bytes={free} required_bytes={required}") + sys.exit(75) + print(f"runner_disk_ok path={path!r} free_bytes={free} required_bytes={required}") + PY + + - name: Checkout base + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + with: + # github.sha is the tip of the base branch when the event fires; the + # PR's base.sha can predate this workflow's own scripts. + ref: ${{ github.sha }} + fetch-depth: 0 + persist-credentials: false + + # spec-trace-check.sh builds the trusted sametokens.go; a self-hosted + # runner has no Go on its PATH unless the job sets it up. + - name: Set up Go + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 + with: + go-version-file: seaweed-block/go.mod + cache: false + + - name: Check spec trace + env: + BASE: ${{ github.event.pull_request.base.sha }} + HEAD: ${{ github.event.pull_request.head.sha }} + PR: ${{ github.event.pull_request.number }} + BODY: ${{ github.event.pull_request.body }} + TITLE: ${{ github.event.pull_request.title }} + run: | + set -euo pipefail + bash .github/scripts/spec-trace-check-test.sh + python3 -B .github/scripts/model-trace-check-test.py + bash .github/scripts/changed-go-blobs-test.sh + # fsckObjects: a PR's objects are checked as they arrive, so a tree + # with a '..' or '.git' entry is refused here. + git -c fetch.fsckObjects=true fetch --no-tags origin "+refs/pull/${PR}/head:refs/remotes/pr/head" + printf '%s' "$BODY" >body.txt + bash ../.github/block/scripts/post-merge-review-changed.sh "$BASE" "$HEAD" >changed.bin + # Old and new blobs of each changed non-test Go file, for kind DOCS + # (objects only; a path that would leave blobs/ is refused). + mb=$(git merge-base "$BASE" "$HEAD") + bash ../.github/block/scripts/changed-go-blobs.sh "$mb" "$HEAD" blobs + # Mapping and validator come from the trusted base checkout above. + bash .github/scripts/spec-trace-check.sh body.txt blobs .github/model-code-trace.tsv title.txt + bash ../.github/block/scripts/public-text-check.sh "$mb" "$HEAD" title.txt body.txt + + - name: Invariants ledger anchors (report only) + # Every code and test anchor of docs/design/invariants.md must exist at + # the PR's commit (git objects only; nothing from the PR is run). It + # reports and does not fail the check while the known imprecise + # anchors are being corrected; then this step becomes gating. + continue-on-error: true + env: + HEAD: ${{ github.event.pull_request.head.sha }} + run: python3 -I ../.github/block/scripts/ledger_check.py "$GITHUB_WORKSPACE" "$HEAD" seaweed-block/docs/design/invariants.md seaweed-block/ || true + + - name: Clean job workspace + # Hosted runners are disposable; their setup-go cache upload runs in + # a post action and still needs the checkout. Persistent runners do not + # upload that cache, and must release their checkout/build files here. + if: always() && runner.environment == 'self-hosted' + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + from pathlib import Path + import shutil + import sys + root = Path(os.environ["GITHUB_WORKSPACE"]) + # Refuse aliases rather than resolving them. Open EVERY component without + # following symlinks, then keep cleanup anchored to the verified directory fd. + if not root.is_absolute() or ".." in root.parts or root == Path(root.anchor) or root.name != root.parent.name or root == Path(os.environ["RUNNER_TEMP"]): + print(f"runner_workspace_cleanup_refused path={str(root)!r}") + sys.exit(1) + flags = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW + fd = os.open(root.anchor, flags) + previous = os.open(".", flags) + errors = [] + try: + for part in root.parts[1:]: + child = os.open(part, flags, dir_fd=fd) + os.close(fd) + fd = child + if not shutil.rmtree.avoids_symlink_attacks: + raise OSError("descriptor-safe directory removal is unavailable") + os.fchdir(fd) + for entry in os.scandir("."): + try: + if entry.is_dir(follow_symlinks=False): + shutil.rmtree(entry.name) + else: + os.unlink(entry.name) + except OSError as err: + errors.append(f"{entry.name}: {err}") + except OSError as err: + print(f"runner_workspace_cleanup_refused path={str(root)!r} error={err}") + sys.exit(1) + finally: + os.fchdir(previous) + os.close(previous) + os.close(fd) + if errors: + print("runner_workspace_cleanup_failed " + "; ".join(errors)) + sys.exit(1) + print(f"runner_workspace_clean path={str(root)!r}") + PY diff --git a/.github/workflows/block-test.yml b/.github/workflows/block-test.yml new file mode 100644 index 0000000000..39c1d55651 --- /dev/null +++ b/.github/workflows/block-test.yml @@ -0,0 +1,445 @@ +name: Block Test + +on: + pull_request: + paths: + - "seaweed-block/**" + - ".github/workflows/block-*.yml" + - ".github/block/**" + - ".github/dockerfiles/block-*.Dockerfile" + # ready_for_review: a Draft runs no Go suite (below); marking it ready starts one. + types: [opened, synchronize, reopened, ready_for_review] + push: + paths: + - "seaweed-block/**" + - ".github/workflows/block-*.yml" + - ".github/block/**" + - ".github/dockerfiles/block-*.Dockerfile" + branches: + - master + +defaults: + run: + working-directory: seaweed-block + +permissions: + contents: read + +# One run per PR (or per commit for pushes). A new push to a PR cancels the +# superseded run; a queued master run would be replaced by a newer one in a +# shared group, so each merge gets its own group and its own result. +concurrency: + group: block-test-${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + test: + # One job, two suites, one runner selection. 'unit' is the Go suite below; + # 'process' runs the process-level tests: real blockmaster, blockvolume and + # sw-block against a pinned SeaweedFS release. Those tests are named in + # .github/process-level-tests.txt, and every one must PASS, so a test that + # skips, fails, never starts or is cut off by the timeout fails the suite. + # Tests that need root or systemd are not in the list (see its header). + strategy: + fail-fast: false + matrix: + suite: [unit, process] + name: ${{ matrix.suite == 'unit' && 'go test (linux)' || 'process-level tests (real binaries)' }} + # The suite writes heavily to the runner disk (real files, fsync), so a + # Draft PR skips it; its author tests locally until the PR is ready. + if: github.event_name == 'push' || !github.event.pull_request.draft + # Hosted by default until this repository has a registered block pool. + # Set BLOCK_RUNNER_LABEL only for an available dedicated label. Forks + # always stay on disposable GitHub-hosted runners. + runs-on: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && vars.BLOCK_RUNNER_LABEL || 'ubuntu-latest' }} + # process: 44 tests in 4 parallel shards of about 13 min each (55 min in sequence). + timeout-minutes: ${{ matrix.suite == 'unit' && 60 || 90 }} + env: + # Pure-Go build: no package in the default build needs cgo, and the + # hosted runner should not depend on a C toolchain being present. + CGO_ENABLED: "0" + steps: + - name: Runner free space + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + import shutil + import sys + required = 10_000_000_000 + for path in dict.fromkeys((os.environ["GITHUB_WORKSPACE"], os.environ["RUNNER_TEMP"])): + try: + free = shutil.disk_usage(path).free + except OSError as err: + print(f"runner_disk_check_failed path={path!r} error={err}") + sys.exit(75) + if free < required: + print(f"runner_disk_low path={path!r} free_bytes={free} required_bytes={required}") + sys.exit(75) + print(f"runner_disk_ok path={path!r} free_bytes={free} required_bytes={required}") + PY + + - name: Checkout + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + with: + persist-credentials: false + # Two commits: the PR merge commit and its base parent, so the test + # step can see which packages the PR touches. + fetch-depth: 2 + + - name: Nested module CI contracts + run: | + python3 -I ../.github/block/scripts/block-ci-port-test.py + python3 -B ../.github/block/scripts/runner-workspace-test.py + + - name: Relative documentation links + if: matrix.suite == 'unit' + run: | + python3 -B ../.github/block/scripts/doc-links-check-test.py + python3 -I ../.github/block/scripts/doc-links-check.py . + + - name: Runner disk is NVMe + # A self-hosted runner whose work, temp or Go cache directory sits on a + # SATA system disk times the process-level tests out under disk load; + # this names the runner and stops the job before it starts. + if: runner.environment == 'self-hosted' + run: | + bash .github/scripts/require-nvme-test.sh + bash .github/scripts/require-nvme.sh "$GITHUB_WORKSPACE" "$RUNNER_TEMP" "${TMPDIR:-/tmp}" "${GOCACHE:-$HOME/.cache/go-build}" + + - name: Start whole-job load evidence + # Begins after checkout, before toolchain setup/build/tests. No host + # installation or privileged reads. A job-sized lifetime also bounds + # the sampler if cancellation prevents the stop step. + continue-on-error: true + env: + CI_EVIDENCE_DIR: ${{ runner.temp }}/ci-${{ matrix.suite }}-${{ github.run_id }}-${{ github.run_attempt }} + run: | + echo "CI_EVIDENCE_DIR=$CI_EVIDENCE_DIR" >>"$GITHUB_ENV" + mkdir -p "$CI_EVIDENCE_DIR" + : >"$CI_EVIDENCE_DIR/go-test.json" + python3 -I .github/scripts/ci-load.py start "$CI_EVIDENCE_DIR/load.tsv" --duration ${{ matrix.suite == 'unit' && 2400 || 5400 }} + + - name: Self-test evidence capture + run: | + python3 -B .github/scripts/ci-load-test.py + bash .github/scripts/record-go-test-test.sh + + - name: Docs-only pull request + id: scope + if: matrix.suite == 'process' && github.event_name == 'pull_request' + # A pull request that changes only files under docs/ runs no product + # code the process-level tests could exercise, so they are skipped and + # the job still reports success. HEAD is the merge commit, HEAD^1 its + # base parent (fetch-depth 2 above). Pushes to main always run them, and + # so does any error of the check (../.github/block/scripts/docs-only-scope.sh). + run: | + set -euo pipefail + bash .github/scripts/docs-only-scope-test.sh + if out=$(bash ../.github/block/scripts/docs-only-scope.sh HEAD^1 HEAD); then + case $out in + "docs_only "*) + echo "skipped: docs only (${out#docs_only } files under docs/); the process-level tests run on the merge to main" + echo "docs_only=1" >>"$GITHUB_OUTPUT" ;; + *) echo "process-level tests run: $out" ;; + esac + else + echo "process-level tests run: the docs-only check failed" + fi + + - name: Set up Go + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 + with: + go-version-file: seaweed-block/go.mod + # The self-hosted runner keeps GOCACHE/GOMODCACHE on its own disk; + # uploading them as an Actions cache (~4 GB) in the post step + # outlasted the job timeout after every test had passed. Only the + # GitHub-hosted (fork PR) runner uses the Actions cache. + cache: ${{ runner.environment == 'github-hosted' }} + cache-dependency-path: seaweed-block/go.sum + + - name: Go version + if: matrix.suite == 'unit' + run: go version + + - name: Build + if: matrix.suite == 'unit' + run: go build ./... + + - name: Vet + if: matrix.suite == 'unit' + run: go vet ./... + + - name: Lab build tags stay out of images and releases + if: matrix.suite == 'unit' + # swblock_lab_bigvol lifts the 1 TiB create cap and the local + # headroom refusal for scale rehearsals only; swblock_v11_format turns + # on the draft v1.1 store format. The default test run pins the + # release cap (TestReleaseBuildKeepsTheCreateCap) and the release + # format. This step checks the tags' allowlist and that every image + # Dockerfile refuses a lab binary (scripts/refuse-lab-binary.sh) after + # its build, with controls, then tests each tag alone and both. + run: | + set -euo pipefail + bash .github/scripts/lab-tag-check.sh . + bash .github/scripts/lab-tag-check-test.sh + for tags in swblock_lab_bigvol swblock_v11_format swblock_lab_bigvol,swblock_v11_format; do + go vet -tags "$tags" ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/ ./core/storage/ + bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'Lab|Headroom|Revision|LegacyBound' ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/ + bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'TestV11FormatFollowsItsOwnTagAlone' ./core/storage/ + done + + - name: Test default configuration + if: matrix.suite == 'unit' + # Preserve the existing scope: main/train omit the four heavy packages; + # ordinary PRs add each only when its direct package files are touched. + # Three subprocesses share this ONE runner: storage, durable plus touched + # master/authority, and the remaining selected packages at -p=4. + env: + EVENT: ${{ github.event_name }} + HEAD_REF: ${{ github.head_ref }} + run: | + set -euo pipefail + python3 -I ../.github/block/scripts/unit-test-shards-test.py + python3 -I ../.github/block/scripts/run-unit-groups-test.py + plan="$RUNNER_TEMP/unit-groups" + mkdir -p "$plan" + go list ./... >"$plan/all.txt" + mod=$(go list -m) + # Main pushes need no changed-path list; a shallow initial push may + # have no parent. Ordinary PRs use the merge commit's base parent. + : >"$plan/changed.txt" + if [ "$EVENT" != push ] && [[ "$HEAD_REF" != train/* ]]; then + git diff --relative --name-only --no-renames HEAD^1 HEAD -- . >"$plan/changed.txt" + fi + python3 -I ../.github/block/scripts/unit-test-shards.py "$mod" "$plan" "$EVENT" "$HEAD_REF" "$plan/changed.txt" <"$plan/all.txt" + python3 -I ../.github/block/scripts/run-unit-groups.py "$plan" "$CI_EVIDENCE_DIR" "$RUNNER_TEMP/unit-group-tmp" \ + bash .github/scripts/record-go-test.sh + + - name: Format v3 tagged tests + if: matrix.suite == 'unit' + # The swblock_format_v3_test tests of the four packages that carry them. + # Five durable tests are skipped by name: each installs a BASE on a chunk + # store, which no production path does (its invariant row is DORMANT); + # they are rewritten at the start of the next release, then this skip + # goes. + run: | + set -euo pipefail + skip='^(TestDurableProviderV3_AttachesCompletedChunkBASE|TestDurableProviderV3_CompletedBASEDoesNotRestoreOlderHEAD|TestDurableProviderV3_DefersBASERetirementUntilLocalPresence|TestDurableProviderV3_FreshMarkerCrashKeepsCompletedBASE|TestDurableProviderV3_FreshMarkerCaptureCrashKeepsCompletedBASE)$' + bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -p=1 -count=1 -timeout 20m -tags swblock_format_v3_test -skip "$skip" \ + ./core/frontend/durable/ ./core/recovery/ ./core/replication/ ./core/transport/ + + - name: Self-test of the required-tests gate + if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1' + # The gate must fail on a skip, a failure, a test that never ran, one + # cut off mid-run, and one that reports PASS and then exits nonzero or + # hangs; this proves it before it judges the real run. + run: | + python3 -I .github/scripts/required-tests-check-test.py + bash .github/scripts/chunkstore-scope-test.sh + bash .github/scripts/run-named-tests-test.sh + python3 -I .github/scripts/shard-named-tests-test.py + + - name: Pinned SeaweedFS + if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1' + # The release archive is checked against its sha256 before every use, + # also when taken from the runner's cache; a mismatch fails the step. + # Nothing else is fetched. + env: + WEED_VERSION: "4.53" + WEED_SHA256: d1a7dec9f48d8b33895a0ea8951971defc2dc5312906dcc76fa5a5f74a6ee90d + run: | + set -euo pipefail + cache="${RUNNER_TOOL_CACHE:-$RUNNER_TEMP}/seaweedfs-weed/$WEED_VERSION" + tgz="$cache/linux_amd64.tar.gz" + mkdir -p "$cache" + if ! echo "$WEED_SHA256 $tgz" | sha256sum -c --status - 2>/dev/null; then + part="$tgz.$$.part" + curl -fsSL --retry 3 -o "$part" "https://github.com/seaweedfs/seaweedfs/releases/download/$WEED_VERSION/linux_amd64.tar.gz" + echo "$WEED_SHA256 $part" | sha256sum -c - || { rm -f "$part"; exit 1; } + mv -f "$part" "$tgz" + fi + bin="$RUNNER_TEMP/weed-$WEED_VERSION" + mkdir -p "$bin" + tar -xzf "$tgz" -C "$bin" weed + echo "CHUNKSTORE_WEED=$bin/weed" >>"$GITHUB_ENV" + + - name: Real-filer integration tests + if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1' + # The chunkstore_integration tests run against the pinned weed above + # (master, volume and filer as real processes): the conditional HEAD + # writes, cut uploads and object deletes of the chunk store, and the + # layout sync crash cases of the durable provider. They fail, never + # skip, without the binary. Pushes to main and train PRs always run + # them; another PR runs them when it touches core/frontend/chunkstore/, + # core/storage/ or core/frontend/durable/. + env: + EVENT: ${{ github.event_name }} + HEAD_REF: ${{ github.head_ref }} + # ../.github/block/scripts/chunkstore-scope.sh decides; an error of that check + # runs the tests. Each filtered run must PASS at least one test, so a + # filter that matches nothing fails instead of passing empty. + run: | + set -euo pipefail + if [ "$EVENT" != push ] && [[ "$HEAD_REF" != train/* ]]; then + if out=$(bash ../.github/block/scripts/chunkstore-scope.sh HEAD^1 HEAD); then + case $out in + "skip "*) echo "skipped: the PR touches neither core/frontend/chunkstore/ nor core/storage/ ($out)"; exit 0 ;; + *) echo "real-filer integration tests run: $out" ;; + esac + else + echo "real-filer integration tests run: the scope check failed" + fi + fi + for spec in "./core/frontend/chunkstore/ ^TestIntegration" "./core/frontend/durable/ ^TestQD1LayoutSync"; do + pkg=${spec%% *}; filter=${spec#* } + log="$RUNNER_TEMP/integration-$(basename "$pkg").log" + bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -v -timeout 20m -tags chunkstore_integration -run "$filter" "$pkg" 2>&1 | tee "$log" + grep -q '^--- PASS: ' "$log" || { echo "no test of $pkg matched $filter"; exit 1; } + done + + - name: Build the binaries and the test binary once + if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1' + run: | + set -euo pipefail + bins="$RUNNER_TEMP/swblock-bins" + mkdir -p "$bins" + for b in blockmaster blockvolume sw-block; do go build -o "$bins/$b" "./cmd/$b"; done + go test -c -tags 'subprocess chunkstore_integration' -o "$bins/blockvolume.test" ./cmd/blockvolume + go test -c -o "$bins/blockcsi.test" ./cmd/blockcsi + # The known-zero acceptance's first-start crash step holds a test-only + # blockvolume (build tag kzhold, never released) at a chosen point. + go build -tags kzhold -o "$RUNNER_TEMP/blockvolume-kzhold" ./cmd/blockvolume + echo "SWBLOCK_TEST_BINS=$bins" >>"$GITHUB_ENV" + echo "KZ_HOLD_BIN=$RUNNER_TEMP/blockvolume-kzhold" >>"$GITHUB_ENV" + + - name: Run the named process-level tests + if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1' + # Each named test in its own process of the one test binary, in + # sequence, so a panic or a hang in one cannot hide the others; each + # is bounded (TEST_TIMEOUT, then killed) and its exit status is kept: + # the gate needs a PASS event AND exit 0 for every named test. The known-zero acceptance + # runs its small shape (1 GiB, user-space client, no device); the + # 1 TiB run is lab only. + env: + KZ_RUN: "1" + KZ_SIZE: 1G + F1_RUN: "1" + TEST_TIMEOUT: 15m + # A failed test copies each daemon's whole log here (keepFullLog); + # the step below keeps them as the run's artifact. + SWBLOCK_TEST_LOG_DIR: ${{ env.CI_EVIDENCE_DIR }}/daemon-logs + run: | + set -euo pipefail + # SHARDS parallel shards, balanced by their last measured times + # (.github/process-level-seconds.txt). Each shard is its own sequence + # of test processes with its own slice of the test port ranges + # (SWBLOCK_TEST_PORT_SHARD) and its own TMPDIR; the gate judges every + # named test from all the shards together. + names=.github/process-level-tests.txt + # The manifest tags CSI entries; every other name uses blockvolume.test. + # The final checker still requires the complete, unsplit manifest. + awk '!/# package=blockcsi/' "$names" > "$RUNNER_TEMP/blockvolume-names.txt" + awk '/# package=blockcsi/ {sub(/#.*/, ""); if ($0 ~ /[^[:space:]]/) print}' "$names" > "$RUNNER_TEMP/blockcsi-names.txt" + test -s "$RUNNER_TEMP/blockcsi-names.txt" + shards=4 + python3 -I .github/scripts/shard-named-tests.py "$RUNNER_TEMP/blockvolume-names.txt" .github/process-level-seconds.txt "$shards" "$RUNNER_TEMP/shard" + pids=() + for k in $(seq 1 "$shards"); do + mkdir -p "$RUNNER_TEMP/tmp-$k" + SWBLOCK_TEST_PORT_SHARD=$k SWBLOCK_TEST_PORT_SHARDS=$shards TMPDIR="$RUNNER_TEMP/tmp-$k" \ + bash .github/scripts/run-named-tests.sh "$SWBLOCK_TEST_BINS/blockvolume.test" "$RUNNER_TEMP/shard/$k.txt" \ + "$RUNNER_TEMP/process-level-$k.json" "$RUNNER_TEMP/process-level-$k.status" "$TEST_TIMEOUT" cmd/blockvolume \ + >"$RUNNER_TEMP/process-level-$k.log" 2>&1 & + pids+=($!) + done + for p in "${pids[@]}"; do wait "$p" || true; done + for k in $(seq 1 "$shards"); do sed "s/^/[shard $k] /" "$RUNNER_TEMP/process-level-$k.log"; done + # CSI uses the same per-case isolation, timeout and verdict as the shards. + TEST_PKG=github.com/seaweedfs/seaweed-block/cmd/blockcsi \ + bash .github/scripts/run-named-tests.sh "$SWBLOCK_TEST_BINS/blockcsi.test" "$RUNNER_TEMP/blockcsi-names.txt" \ + "$RUNNER_TEMP/process-level-csi.json" "$RUNNER_TEMP/process-level-csi.status" "$TEST_TIMEOUT" cmd/blockcsi \ + >"$RUNNER_TEMP/process-level-csi.log" 2>&1 || true + cat "$RUNNER_TEMP/process-level-csi.log" + cat "$RUNNER_TEMP"/process-level-*.status >"$RUNNER_TEMP/process-level.status" + python3 -I .github/scripts/required-tests-check.py --status "$RUNNER_TEMP/process-level.status" \ + "$names" "$RUNNER_TEMP"/process-level-*.json + + - name: Stop load evidence and collect raw process events + if: always() + continue-on-error: true + env: + SUITE: ${{ matrix.suite }} + run: | + if [ -z "${CI_EVIDENCE_DIR:-}" ]; then exit 0; fi + python3 -I .github/scripts/ci-load.py stop "$CI_EVIDENCE_DIR/load.tsv" || true + if [ "$SUITE" = process ]; then + mkdir -p "$CI_EVIDENCE_DIR/shards" + shopt -s nullglob + for file in "$RUNNER_TEMP"/process-level-*.json "$RUNNER_TEMP"/process-level-*.log "$RUNNER_TEMP"/process-level*.status; do + cp "$file" "$CI_EVIDENCE_DIR/shards/" + done + for file in "$CI_EVIDENCE_DIR"/shards/*.json; do cat "$file" >>"$CI_EVIDENCE_DIR/go-test.json"; done + fi + + - name: Keep failed-job tests, load, daemon logs and shard results + # Both suites retain timed events and whole-job load. Process evidence + # also retains the original shard receipts and full daemon logs. + if: failure() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: ci-${{ matrix.suite }}-${{ github.run_id }}-${{ github.run_attempt }} + path: ${{ env.CI_EVIDENCE_DIR }} + retention-days: 14 + if-no-files-found: warn + + - name: Clean job workspace + # Hosted runners are disposable; their setup-go cache upload runs in + # a post action and still needs the checkout. Persistent runners do not + # upload that cache, and must release their checkout/build files here. + if: always() && runner.environment == 'self-hosted' + working-directory: ${{ runner.temp }} + run: | + python3 -I - <<'PY' + import os + from pathlib import Path + import shutil + import sys + root = Path(os.environ["GITHUB_WORKSPACE"]) + # Refuse aliases rather than resolving them. Open EVERY component without + # following symlinks, then keep cleanup anchored to the verified directory fd. + if not root.is_absolute() or ".." in root.parts or root == Path(root.anchor) or root.name != root.parent.name or root == Path(os.environ["RUNNER_TEMP"]): + print(f"runner_workspace_cleanup_refused path={str(root)!r}") + sys.exit(1) + flags = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW + fd = os.open(root.anchor, flags) + previous = os.open(".", flags) + errors = [] + try: + for part in root.parts[1:]: + child = os.open(part, flags, dir_fd=fd) + os.close(fd) + fd = child + if not shutil.rmtree.avoids_symlink_attacks: + raise OSError("descriptor-safe directory removal is unavailable") + os.fchdir(fd) + for entry in os.scandir("."): + try: + if entry.is_dir(follow_symlinks=False): + shutil.rmtree(entry.name) + else: + os.unlink(entry.name) + except OSError as err: + errors.append(f"{entry.name}: {err}") + except OSError as err: + print(f"runner_workspace_cleanup_refused path={str(root)!r} error={err}") + sys.exit(1) + finally: + os.fchdir(previous) + os.close(previous) + os.close(fd) + if errors: + print("runner_workspace_cleanup_failed " + "; ".join(errors)) + sys.exit(1) + print(f"runner_workspace_clean path={str(root)!r}") + PY From d4e1ca4bedb00312fef0176ab70999cdee9ab444 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 12:21:46 -0800 Subject: [PATCH 25/29] release: cut the COSI driver too, and keep the chart on its newest image (#13407) * release: cut the COSI driver too, and keep the chart on its newest image The release job points the chart's cosi.image at the newest COSI driver release whose image is pullable (never backwards), so a driver release no longer needs its own chart PR. The downstream job also dispatches the COSI driver's prepare_release.yaml (on its main branch); that image reaches the chart at the next release. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK * release: bound the COSI release and image lookups A stalled GitHub or GHCR response now fails the lookup and keeps the current cosi.image, instead of holding the release until the job timeout. Co-Authored-By: Claude Opus 5.5 * release: the COSI driver pins seaweedfs without -u Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .github/workflows/release_version_bump.yml | 67 ++++++++++++++++++---- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release_version_bump.yml b/.github/workflows/release_version_bump.yml index 3ad9633fa4..6842b5f9d6 100644 --- a/.github/workflows/release_version_bump.yml +++ b/.github/workflows/release_version_bump.yml @@ -1,17 +1,21 @@ name: "release: bump version and cut the release" # One entry point for a SeaweedFS release: -# 1. bump MAJOR/MINOR in constants.go and the Helm Chart.yaml, commit to master +# 1. bump MAJOR/MINOR in constants.go and the Helm Chart.yaml, point the +# chart's cosi.image at the newest COSI driver release, commit to master # 2. push the tag, which fans out to the workflows that trigger on # `push: tags` (binaries_release*, container_release_unified, helm_manual_release) # 3. create the GitHub release, with GitHub's generated notes -# 4. dispatch "Prepare release" in seaweedfs-csi-driver and seaweedfs-operator, -# which pick up the new master through `go get -u`, and wait for both +# 4. dispatch "Prepare release" in seaweedfs-csi-driver, seaweedfs-operator and +# seaweedfs-cosi-driver, which pick up the new master through `go get`, and +# wait for all three. The COSI driver image cut here reaches the chart at +# the next release, through step 1. # # Events raised by the default GITHUB_TOKEN do not start other workflows, and it -# cannot reach the other two repositories at all. Add a repo secret RELEASE_PAT -# with `contents: write` here and `actions: write` on the csi-driver and operator -# repos. Without it the tag is still pushed, but nothing downstream of it runs. +# cannot reach the other repositories at all. Add a repo secret RELEASE_PAT +# with `contents: write` here and `actions: write` on the csi-driver, operator +# and cosi-driver repos. Without it the tag is still pushed, but nothing +# downstream of it runs. on: workflow_dispatch: @@ -28,7 +32,7 @@ on: type: string required: false downstream: - description: "Also release the CSI driver and the operator" + description: "Also release the CSI driver, the operator and the COSI driver" type: boolean default: true dry_run: @@ -134,6 +138,43 @@ jobs: sed -i -E "s/^version:.*/version: ${CHART_VERSION}/" "$CHART" cat "$CHART" + - name: Point the chart at the newest COSI driver release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: seaweedfs/seaweedfs-cosi-driver + run: | + set -euo pipefail + VALUES=k8s/charts/seaweedfs/values.yaml + IMAGE="ghcr.io/${REPO}" + CUR=$(grep -oP "^ image: \"${IMAGE}:\K[^\"]+" "$VALUES" || true) + if [ -z "$CUR" ]; then + echo "::warning::no ${IMAGE} image line in ${VALUES}; cosi.image is left alone" + exit 0 + fi + # Not worth failing a release over: keep the current image instead. + if ! NEW=$(timeout 60 gh release view -R "$REPO" --json tagName --jq .tagName); then + echo "::warning::could not read the latest ${REPO} release; cosi.image stays ${CUR}" + exit 0 + fi + if [ "$NEW" = "$CUR" ]; then + echo "cosi.image is already ${CUR}" + exit 0 + fi + if [ "$(printf '%s\n%s\n' "${CUR#v}" "${NEW#v}" | sort -V | tail -n1)" != "${NEW#v}" ]; then + echo "::warning::the latest ${REPO} release ${NEW} is older than ${CUR}; cosi.image stays ${CUR}" + exit 0 + fi + # A release without its image would break every chart install with cosi.enabled. + TOKEN=$(curl -sf --connect-timeout 10 --max-time 30 "https://ghcr.io/token?scope=repository:${REPO}:pull" | jq -r .token || true) + if ! curl -sfI -o /dev/null --connect-timeout 10 --max-time 30 -H "Authorization: Bearer ${TOKEN}" \ + -H 'Accept: application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json' \ + "https://ghcr.io/v2/${REPO}/manifests/${NEW}"; then + echo "::warning::${IMAGE}:${NEW} is not pullable; cosi.image stays ${CUR}" + exit 0 + fi + sed -i -E "s|^( image: \"${IMAGE}:)[^\"]+\"|\1${NEW}\"|" "$VALUES" + grep -n "^ image: \"${IMAGE}:" "$VALUES" + - name: Commit, and push the tag id: tag env: @@ -156,7 +197,7 @@ jobs: if git diff --quiet; then echo "::warning::Version files are already at ${TAG}; tagging the current HEAD." else - git add weed/util/version/constants.go k8s/charts/seaweedfs/Chart.yaml + git add weed/util/version/constants.go k8s/charts/seaweedfs/Chart.yaml k8s/charts/seaweedfs/values.yaml git commit -m "${TAG}" git push fi @@ -187,14 +228,20 @@ jobs: include: - repo: seaweedfs/seaweedfs-csi-driver workflow: prepare_release.yaml + ref: master - repo: seaweedfs/seaweedfs-operator workflow: prepare_release.yml + ref: master + - repo: seaweedfs/seaweedfs-cosi-driver + workflow: prepare_release.yaml + ref: main steps: - name: Release ${{ matrix.repo }} env: GH_TOKEN: ${{ secrets.RELEASE_PAT }} REPO: ${{ matrix.repo }} WORKFLOW: ${{ matrix.workflow }} + REF: ${{ matrix.ref }} SHA: ${{ needs.release.outputs.sha }} MODULE: github.com/seaweedfs/seaweedfs run: | @@ -204,7 +251,7 @@ jobs: exit 1 fi - # The dispatched workflow pins seaweedfs with `go get -u ...@latest`, so + # The dispatched workflow pins seaweedfs with `go get ...@latest`, so # wait until the proxy serves the release commit as the tip. Asking for # the commit by name is what makes the proxy fetch it. The proxy can # take longer than five minutes to refresh @latest after a new tag. @@ -231,7 +278,7 @@ jobs: BEFORE=$(released) # A minute early, so runner clock skew cannot hide the run. DISPATCHED_AT=$(date -u -d '1 minute ago' '+%Y-%m-%dT%H:%M:%SZ') - gh workflow run -R "$REPO" "$WORKFLOW" --ref master -f bump=patch -f update_seaweedfs=true + gh workflow run -R "$REPO" "$WORKFLOW" --ref "$REF" -f bump=patch -f update_seaweedfs=true RUN_ID="" for _ in $(seq 12); do From b30537483f16e4cfa72b6dc758a999209de462b5 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 12:25:02 -0800 Subject: [PATCH 26/29] filer: stamp rename stream responses with the move's commit stamp (#13473) * filer: stamp rename stream responses with the move's commit stamp The responses carried time.Now(), but the client applies them against the versions its earlier writes left at their log stamps. Stamps are drawn as max(now, last+1), so on a coarse clock (Windows) they run ahead of the wall clock, and a rename right after a flush of its source was stamped below that flush. The mount's version fence then kept the source in its cache: a renamed-away file still stat'ed and listed. Co-Authored-By: Claude Opus 5.5 * filer: test rename responses stamp above earlier events Co-Authored-By: Claude Opus 5.5 * ci: run the Windows mount on changes to the filer's rename handler Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .github/workflows/mount-windows.yml | 2 + weed/server/filer_grpc_server_rename.go | 6 +- .../filer_grpc_server_rename_stream_test.go | 55 +++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mount-windows.yml b/.github/workflows/mount-windows.yml index 7954176ce7..3d0c14d755 100644 --- a/.github/workflows/mount-windows.yml +++ b/.github/workflows/mount-windows.yml @@ -9,6 +9,7 @@ on: - 'weed/storage/volume_vacuum*.go' - 'weed/storage/volume_loading.go' - 'weed/storage/disk_location.go' + - 'weed/server/filer_grpc_server_rename.go' - 'test/winfsp/**' - '.github/workflows/mount-windows.yml' # No base branch filter: this is the only thing that runs the Windows mount, @@ -20,6 +21,7 @@ on: - 'weed/storage/volume_vacuum*.go' - 'weed/storage/volume_loading.go' - 'weed/storage/disk_location.go' + - 'weed/server/filer_grpc_server_rename.go' - 'test/winfsp/**' - '.github/workflows/mount-windows.yml' diff --git a/weed/server/filer_grpc_server_rename.go b/weed/server/filer_grpc_server_rename.go index 4e0b9c74f4..15cf6afecb 100644 --- a/weed/server/filer_grpc_server_rename.go +++ b/weed/server/filer_grpc_server_rename.go @@ -694,7 +694,9 @@ func (fs *FilerServer) moveSelfEntry(ctx context.Context, stream filer_pb.Seawee IsFromOtherCluster: false, Signatures: nil, }, - TsNs: time.Now().UnixNano(), + // The stamp of the event that covers the move: the wall clock can + // trail the log's stamps, and the client versions its cache by them. + TsNs: newEntry.CommitTsNs, }); err != nil { return err } @@ -754,7 +756,7 @@ func (fs *FilerServer) moveSelfEntry(ctx context.Context, stream filer_pb.Seawee IsFromOtherCluster: false, Signatures: nil, }, - TsNs: time.Now().UnixNano(), + TsNs: newEntry.CommitTsNs, }); err != nil { return err } diff --git a/weed/server/filer_grpc_server_rename_stream_test.go b/weed/server/filer_grpc_server_rename_stream_test.go index 67f487c8fe..cb5047cd15 100644 --- a/weed/server/filer_grpc_server_rename_stream_test.go +++ b/weed/server/filer_grpc_server_rename_stream_test.go @@ -4,6 +4,7 @@ import ( "context" "strings" "testing" + "time" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" @@ -92,3 +93,57 @@ func TestStreamRenameEndsItsTransaction(t *testing.T) { } }) } + +// The client applies each response at its TsNs over versions its own writes +// left at their log stamps. Where the wall clock is coarse (Windows), those +// stamps run ahead of it: a response stamped from the clock lands below the +// source's last write, and the client keeps the name the rename took away. +func TestStreamRenameResponsesStampAboveEarlierEvents(t *testing.T) { + cases := []struct { + name string + store func() *renameTestStore + oldName, newName string + }{ + {"file over a file", func() *renameTestStore { + store := newRenameTestStore() + store.entries["/dir"] = newDirectoryEntry("/dir", 100) + store.entries["/dir/src.txt"] = newFileEntry("/dir/src.txt", 101) + store.entries["/dir/dst.txt"] = newFileEntry("/dir/dst.txt", 102) + return store + }, "src.txt", "dst.txt"}, + {"file over a file in place", func() *renameTestStore { + store := newInPlaceRenameStore() + store.entries["/dir/dst.txt"] = fileEntryWithChunk("/dir/dst.txt", 202, "2,0b02") + return store + }, "src.txt", "dst.txt"}, + {"directory with a child", func() *renameTestStore { + store := newRenameTestStore() + store.entries["/dir"] = newDirectoryEntry("/dir", 100) + store.entries["/dir/a"] = newDirectoryEntry("/dir/a", 101) + store.entries["/dir/a/x.txt"] = newFileEntry("/dir/a/x.txt", 102) + return store + }, "a", "b"}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + f := newRenameTestFiler(t, tc.store()) + earlier := f.LocalDeliveredThroughTsNs(time.Now().Add(time.Hour).UnixNano()) + server := &FilerServer{filer: f, entryLockTable: util.NewLockTable[util.FullPath]()} + stream := &renameTestStream{} + if err := server.StreamRenameEntry(&filer_pb.StreamRenameEntryRequest{ + OldDirectory: "/dir", OldName: tc.oldName, NewDirectory: "/dir", NewName: tc.newName, + }, stream); err != nil { + t.Fatalf("StreamRenameEntry: %v", err) + } + if len(stream.sent) == 0 { + t.Fatal("no responses") + } + for i, resp := range stream.sent { + if resp.TsNs <= earlier { + t.Errorf("response %d (%s -> %s) stamped %d, not above %d stamped before the rename", i, + resp.EventNotification.GetOldEntry().GetName(), resp.EventNotification.GetNewEntry().GetName(), resp.TsNs, earlier) + } + } + }) + } +} From 759b7f3a368b6826f338a0762ebec978d22560f3 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 12:25:46 -0800 Subject: [PATCH 27/29] seaweed-block: test the import syncfs selector and report each store's import mode (on #13458) (#13469) * seaweed-block: preserve unchanged imports and batch durable publication * seaweed-block: name the rejected entry in a startup import error The batch import returned the bare validation error, so a bad cluster-spec node or placement seed stopped startup without saying which entry. The per-entry RegisterNode/ApplyPlan loop named it. Co-Authored-By: Claude Opus 5.5 * seaweed-block: name the import path in the freshness row and registry guard Startup now replays nodes through ImportNodes, not RegisterNode; list it where the freshness invariant and the registry-writer guard name the writers. Drop a doubled blank line in the operations manual. Co-Authored-By: Claude Opus 5.5 * seaweed-block: poison a lifecycle store only on a persistence error A node registration whose SeenAt cannot be encoded failed before any file I/O, but RegisterNode latched the marshal error and every later mutation returned ErrLifecycleRecoveryRequired until reopen. Latch only a RecordPersistenceError, as the volume store already did. Co-Authored-By: Claude Opus 5.5 * seaweed-block: keep a node's SeenAt when its declaration changes registrationLocked kept SeenAt only for an unchanged declaration. A restart that changed a node's declared pools or address stamped the current time, so a silent node passed the stale-observation check. A declaration without an observation time now keeps the stored one; a new node still gets the current time. Co-Authored-By: Claude Opus 5.5 * seaweed-block: use the import syncfs only on filesystems that report its errors The batch path was chosen from the kernel release alone. On overlayfs, syncfs checks the overlay superblock's writeback errors, not the upper file's, and on FUSE it does not send FSYNC to the daemon, so an import could publish records whose data never became durable. Select syncfs only when the records directory is on ext4, xfs, btrfs or tmpfs, and keep per-file fsync elsewhere. The startup line now reports the path for the lifecycle store, after it exists. Co-Authored-By: Claude Opus 5.5 * seaweed-block: assert the imported values before the reopen check The import step control compared the store's snapshot with a reopen, so an import that synced and renamed but committed the old values passed. Check the changed and unchanged values before and after reopen. Co-Authored-By: Claude Opus 5.5 * seaweed-block: check both views after a removal retry present() returned record && snapshot, so a removal that cleared only one view passed the final check. Report both and require both absent. Co-Authored-By: Claude Opus 5.5 * seaweed-block: assert the one-second fail-stop bound The blocked-logger control checked only exit status 1 inside a four-second child timeout, so a longer exit timer still passed. The child now reports when it triggers the failure, and the parent requires exit within the one-second deadline plus one second of scheduler tolerance. Co-Authored-By: Claude Opus 5.5 * seaweed-block: add the lifecycle machine's transition table Every other Part A machine lists its transitions with guard, enforcing code and Part B rows; the lifecycle record I/O machine had only its diagram. Also name DeletePlacement and DeleteVolume beside RemoveNode in the open gap: none of them syncs the directory after removing a record. Co-Authored-By: Claude Opus 5.5 * seaweed-block: scope the manual's lifecycle exit policy to the stores it covers Only the node, placement and volume stores have the fail-stop handler. State that deletion-reservation and workspace-binding write failures return the error without exiting, and that an uncertain binding store needs a restart. Co-Authored-By: Claude Opus 5.5 * seaweed-block: test the import's syncfs selection through the production selector TestSyncfsFilesystemGate checked the filesystem predicate directly and the selector only with an unreadable directory, so a selector that took syncfs after any successful Statfs passed. A test hook now rewrites the filesystem type a successful Statfs reports; an import into a readable directory reported as overlay must sync each file, and its ext4 twin must issue one syncfs. Co-Authored-By: Claude Opus 5.5 * seaweed-block: report import durability for the node and placement store directories Startup probed the lifecycle root, but the node and placement imports select syncfs from their own nodes/ and placements/ directories, so a subdirectory on a separate mount could report one path and use the other. Each store now reports the mode its import selects, startup prints both, and nothing is printed without a lifecycle store. Co-Authored-By: Claude Opus 5.5 * seaweed-block: list the syncfs selector and per-store mode tests in the ledger Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: pingqiu Co-authored-by: Claude Opus 5.5 --- seaweed-block/cmd/blockmaster/main.go | 4 +- .../core/lifecycle/import_syncfs_test.go | 98 +++++++++++++++++++ .../core/lifecycle/node_inventory.go | 3 + .../core/lifecycle/placement_intent.go | 3 + seaweed-block/core/lifecycle/record_file.go | 5 +- .../core/lifecycle/record_syncfs_linux.go | 6 +- seaweed-block/docs/design/invariants.md | 5 +- 7 files changed, 118 insertions(+), 6 deletions(-) diff --git a/seaweed-block/cmd/blockmaster/main.go b/seaweed-block/cmd/blockmaster/main.go index 1018d03ceb..1f6f914d2f 100644 --- a/seaweed-block/cmd/blockmaster/main.go +++ b/seaweed-block/cmd/blockmaster/main.go @@ -340,7 +340,9 @@ func run(f flags) int { fmt.Fprintln(os.Stderr, "blockmaster:", err) return 1 } - fmt.Fprintf(os.Stderr, "blockmaster: lifecycle import durability: %s\n", lifecycle.ImportDurabilityMode(f.lifecycleStore)) + if st := h.Lifecycle(); st != nil { + fmt.Fprintf(os.Stderr, "blockmaster: lifecycle import durability: nodes %s; placements %s\n", st.Nodes.ImportDurabilityMode(), st.Placements.ImportDurabilityMode()) + } // Every promotion decides on the probe round's answers: each candidate // answers a fresh round over its authenticated node stream. h.SetPromotionEvidenceProvider(h.NewRoundPromotionEvidenceProvider(f.launcherReplicationAck, nil)) diff --git a/seaweed-block/core/lifecycle/import_syncfs_test.go b/seaweed-block/core/lifecycle/import_syncfs_test.go index 5f9eaa0162..aea89ff989 100644 --- a/seaweed-block/core/lifecycle/import_syncfs_test.go +++ b/seaweed-block/core/lifecycle/import_syncfs_test.go @@ -10,6 +10,7 @@ import ( "os/exec" "path/filepath" "reflect" + "strings" "testing" "time" @@ -377,3 +378,100 @@ func TestSyncfsFilesystemGate(t *testing.T) { t.Error("an unreadable records directory selected syncfs") } } + +func TestImportBatchSelectsSyncfsByFilesystem(t *testing.T) { + for _, fs := range []string{"overlay", "ext4"} { + t.Run(fs, func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportBatchSelectChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "IMPORT_BATCH_SELECT_FS="+fs) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("selector control: %v context=%v\n%s", err, ctx.Err(), out) + } + }) + } +} + +func TestImportBatchSelectChild(t *testing.T) { + fs := os.Getenv("IMPORT_BATCH_SELECT_FS") + if fs == "" { + t.Skip("isolated filesystem hooks") + } + if !recordKernelSyncfsErrors { + t.Skip("kernel does not report writeback errors through syncfs") + } + magic, wantSyncfs := uint32(unix.OVERLAYFS_SUPER_MAGIC), false + if fs == "ext4" { + magic, wantSyncfs = unix.EXT4_SUPER_MAGIC, true + } + dir := t.TempDir() + s, err := OpenNodeInventoryStore(dir) + if err != nil { + t.Fatal(err) + } + var syncfsCalls, fileSyncs int + durableRecordHooksForTest.Store(&durableRecordHooks{ + statfsType: func(string, uint32) uint32 { return magic }, + fsSync: func(f *os.File) error { + syncfsCalls++ + return syncRecordFilesystem(f) + }, + fileSync: func(f *os.File) error { + fileSyncs++ + return f.Sync() + }, + }) + defer durableRecordHooksForTest.Store(nil) + if mode := s.ImportDurabilityMode(); strings.HasPrefix(mode, "syncfs") != wantSyncfs { + t.Fatalf("%s reports %q", fs, mode) + } + if err := s.ImportNodes([]NodeRegistration{{ServerID: "a", Addr: "127.0.0.1:19001"}, {ServerID: "b", Addr: "127.0.0.1:19002"}}); err != nil { + t.Fatal(err) + } + if wantSyncfs && (syncfsCalls != 1 || fileSyncs != 0) || !wantSyncfs && (syncfsCalls != 0 || fileSyncs != 2) { + t.Fatalf("%s import: %d syncfs, %d file syncs", fs, syncfsCalls, fileSyncs) + } + if len(s.ListNodes()) != 2 { + t.Fatalf("imported %d nodes", len(s.ListNodes())) + } +} + +func TestImportDurabilityModeProbesEachStoreDirectory(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestImportDurabilityModeChild$", "-test.timeout=8s") + cmd.Env = append(os.Environ(), "IMPORT_MODE_CHILD=1") + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("mode control: %v context=%v\n%s", err, ctx.Err(), out) + } +} + +func TestImportDurabilityModeChild(t *testing.T) { + if os.Getenv("IMPORT_MODE_CHILD") == "" { + t.Skip("isolated filesystem hooks") + } + if !recordKernelSyncfsErrors { + t.Skip("kernel does not report writeback errors through syncfs") + } + root := t.TempDir() + nodes, err := OpenNodeInventoryStore(filepath.Join(root, "nodes")) + if err != nil { + t.Fatal(err) + } + placements, err := OpenPlacementIntentStore(filepath.Join(root, "placements")) + if err != nil { + t.Fatal(err) + } + durableRecordHooksForTest.Store(&durableRecordHooks{statfsType: func(dir string, _ uint32) uint32 { + if dir == filepath.Join(root, "nodes") { + return unix.EXT4_SUPER_MAGIC + } + return unix.OVERLAYFS_SUPER_MAGIC + }}) + defer durableRecordHooksForTest.Store(nil) + nodeMode, placementMode := nodes.ImportDurabilityMode(), placements.ImportDurabilityMode() + if !strings.HasPrefix(nodeMode, "syncfs") || strings.HasPrefix(placementMode, "syncfs") { + t.Fatalf("nodes on ext4 report %q, placements on overlay report %q", nodeMode, placementMode) + } +} diff --git a/seaweed-block/core/lifecycle/node_inventory.go b/seaweed-block/core/lifecycle/node_inventory.go index 09db0bc2a9..6d7d9cfc46 100644 --- a/seaweed-block/core/lifecycle/node_inventory.go +++ b/seaweed-block/core/lifecycle/node_inventory.go @@ -352,6 +352,9 @@ func copyStringMap(in map[string]string) map[string]string { return out } +// ImportDurabilityMode reports the persistence path ImportNodes uses. +func (s *NodeInventoryStore) ImportDurabilityMode() string { return importDurabilityMode(s.dir) } + // ImportNodes replays one startup node step. All changed data is durable before // rename; one directory barrier precedes publication of the changed snapshots. func (s *NodeInventoryStore) ImportNodes(nodes []NodeRegistration) error { diff --git a/seaweed-block/core/lifecycle/placement_intent.go b/seaweed-block/core/lifecycle/placement_intent.go index c717579e50..9b6436d89f 100644 --- a/seaweed-block/core/lifecycle/placement_intent.go +++ b/seaweed-block/core/lifecycle/placement_intent.go @@ -271,6 +271,9 @@ func copyPlacementIntent(in PlacementIntent) PlacementIntent { return out } +// ImportDurabilityMode reports the persistence path ImportPlans uses. +func (s *PlacementIntentStore) ImportDurabilityMode() string { return importDurabilityMode(s.dir) } + // ImportPlans replays one startup placement step and publishes only after // the changed files and their shared directory barrier have completed. func (s *PlacementIntentStore) ImportPlans(plans []PlacementPlan) error { diff --git a/seaweed-block/core/lifecycle/record_file.go b/seaweed-block/core/lifecycle/record_file.go index eb47298c64..1aa4033d2e 100644 --- a/seaweed-block/core/lifecycle/record_file.go +++ b/seaweed-block/core/lifecycle/record_file.go @@ -58,6 +58,7 @@ type durableRecordHooks struct { dirSync func(string) error batchSyncfs *bool fsSync func(*os.File) error + statfsType func(dir string, fsType uint32) uint32 } var durableRecordHooksForTest atomic.Pointer[durableRecordHooks] @@ -106,9 +107,9 @@ func writeRecordBatchDurably(dir string, records []recordWrite) error { return nil } -// ImportDurabilityMode reports the batch persistence path for records under dir. +// importDurabilityMode reports the batch persistence path for records under dir. // Single-record mutations always retain their file and directory fsyncs. -func ImportDurabilityMode(dir string) string { +func importDurabilityMode(dir string) string { if recordBatchSyncfsSupported(dir) { return "syncfs (Linux >= 5.8, local filesystem)" } diff --git a/seaweed-block/core/lifecycle/record_syncfs_linux.go b/seaweed-block/core/lifecycle/record_syncfs_linux.go index 5f843056bb..3651947b07 100644 --- a/seaweed-block/core/lifecycle/record_syncfs_linux.go +++ b/seaweed-block/core/lifecycle/record_syncfs_linux.go @@ -23,7 +23,11 @@ func recordBatchSyncfsSupported(dir string) bool { if unix.Statfs(dir, &st) != nil { return false } - return filesystemReportsSyncfsErrors(uint32(st.Type)) + fsType := uint32(st.Type) + if hooks := durableRecordHooksForTest.Load(); hooks != nil && hooks.statfsType != nil { + fsType = hooks.statfsType(dir, fsType) + } + return filesystemReportsSyncfsErrors(fsType) } func filesystemReportsSyncfsErrors(fsType uint32) bool { diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index b7dfe5d590..c473e2386a 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -84,7 +84,8 @@ syncs the directory before publication. A failed `syncfs` is never retried within the step: its writeback error may have been consumed. Recovery writes fresh temps. Older kernels, other filesystems (overlay, FUSE, NFS: syncfs does not reach their backing files) and other platforms retain per-file fsync -before rename; startup reports the chosen path. The filesystem-wide sync can +before rename; startup reports the chosen path for the node and placement +stores, each probed at its own directory. The filesystem-wide sync can also wait for unrelated writeback on that filesystem. The executable arms a one-second process-exit timer before logging and exits immediately after the log returns, rather than waiting for graceful @@ -1023,7 +1024,7 @@ Notes: | `INV-FMT-RETIRE-001` | A host retire, the node registry's only writer after start, is refused, naming the volumes, while the host holds a placement or a live line, and unless confirm repeats the id. A retired id is unregistered; if the host returns it registers again at its reported level. | FormatGate Retire | `core/host/master/format_gate.go` `RetireHost`; `core/host/master/journal_isolation.go` `volumesServedBy` | `TestRetireHostRefusesAHostThatHoldsWork` (`core/host/master/format_gate_test.go`); `TestACleanMoveReleasesTheTopologyHome`, `TestTheTopologyHomeHoldsTheVolumeBeforeAMove`, `TestTheTopologyHomeAloneHoldsTheVolumeBeforeAMove` (`core/host/master/served_topology_move_test.go`); `TestClusterRetireHost` (`cmd/sw-block/cluster_format_test.go`); `TestNodeRegistryIsWrittenOnlyAtStartup` (`cmd/blockmaster/node_registry_guard_test.go`) | `FormatGate` r2 `OneServer` (mutation `retire_holding_host`) | ACTIVE | | `INV-LIFECYCLE-SNAPSHOT-001` | The Volumes and deletion-reservation snapshots read by the renewal path equal the store records after every change of the records, including load, delete and a protective reservation kept in memory on an unknown write outcome; a published snapshot is never mutated. | M2 Bound → Deleting (renewal reads) | `core/lifecycle/store.go` `publishLocked`, `GetVolumeSnapshot`; `core/lifecycle/deletion_reservations.go` `publishLocked`, `ReservedSnapshot` | `TestDeletionReservationSnapshotFollowsRecords`, `TestFileStoreSnapshotFollowsRecords`, `TestLifecycleSnapshotReadsDoNotTakeStoreMutex`, `TestLifecycleSnapshotConcurrentWriters` (`core/lifecycle/renewal_snapshot_test.go`); `TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation` (`core/host/master/workspace_lease_horizon_test.go`) | — | ACTIVE | | `INV-NODE-REGISTRATION-FRESHNESS-001` | Replaying a node registration without an observation time preserves its stored SeenAt; unchanged non-time fields do not rewrite its record. A restart is not a fresh observation, also when the declaration changed; a live heartbeat supplies freshness independently. | M2 lifecycle registration replay (no authority transition) | `core/lifecycle/node_inventory.go` `ImportNodes`, `RegisterNode`, `registrationLocked`; `core/host/master/observation_snapshot.go` `nodeHeartbeat`; `core/lifecycle/verified_placement.go` `VerifyPlacementIntent` | `TestUnchangedNodeRestartDoesNotRefreshAStaleObservation`, `TestChangedNodeImportDoesNotRefreshAStaleObservation` (`core/lifecycle/node_import_freshness_test.go`); `TestObservationNodesReportTheNewestHeartbeat` (`core/host/master/observation_heartbeat_test.go`); live-holder process restart qualification pending | Observation time is evidence, not authority; a declaration is not an observation | STUB | -| `INV-LIFECYCLE-STORE-DURABLE-001` | A successful record put/import publishes only after complete replacement records and their directory are durable. Open syncs the records directory before publication. A possibly-applied failure blocks mutations until reopen; recovery reconciles complete old/new records. | M2 lifecycle record publication | `core/lifecycle/record_file.go` `writeRecordDurably`, `writeRecordBatchDurably`; `node_inventory.go` `ImportNodes`; `placement_intent.go` `ImportPlans`; `node_inventory.go`, `store.go`, `placement_intent.go` `putLocked` | `TestNodeInventoryCrashKeepsCompleteRegistration` (`core/lifecycle/node_inventory_crash_test.go`); `TestFileStoreCrashKeepsCompleteRecord`, `TestPlacementStoreCrashKeepsCompleteRecord`, `TestLifecyclePutSyncOrderAndFailure` (`core/lifecycle/store_crash_test.go`); `TestLifecycleStoreParentSync` (`core/lifecycle/store_parent_sync_test.go`); `TestImportStepSyncsChangedFilesThenOneDirectory` (`core/lifecycle/import_step_sync_test.go`); `TestImportSyncfsFailureAndOrdering`, `TestImportSyncfsReturnedFailurePolicyAndReplay`, `TestImportSyncfsCrashBoundaries`, `TestSyncfsKernelGate`, `TestSyncfsFilesystemGate` (`core/lifecycle/import_syncfs_test.go`); `TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk` (`core/lifecycle/import_recovery_test.go`); `TestVolumeEqualityRequiresRecovery` (`core/lifecycle/volume_recovery_test.go`); `TestNodeMarshalErrorDoesNotRequireRecovery` (`core/lifecycle/remove_retry_test.go`) | Lifecycle record publication, including startup-step durability barrier | ACTIVE | +| `INV-LIFECYCLE-STORE-DURABLE-001` | A successful record put/import publishes only after complete replacement records and their directory are durable. Open syncs the records directory before publication. A possibly-applied failure blocks mutations until reopen; recovery reconciles complete old/new records. | M2 lifecycle record publication | `core/lifecycle/record_file.go` `writeRecordDurably`, `writeRecordBatchDurably`; `node_inventory.go` `ImportNodes`; `placement_intent.go` `ImportPlans`; `node_inventory.go`, `store.go`, `placement_intent.go` `putLocked` | `TestNodeInventoryCrashKeepsCompleteRegistration` (`core/lifecycle/node_inventory_crash_test.go`); `TestFileStoreCrashKeepsCompleteRecord`, `TestPlacementStoreCrashKeepsCompleteRecord`, `TestLifecyclePutSyncOrderAndFailure` (`core/lifecycle/store_crash_test.go`); `TestLifecycleStoreParentSync` (`core/lifecycle/store_parent_sync_test.go`); `TestImportStepSyncsChangedFilesThenOneDirectory` (`core/lifecycle/import_step_sync_test.go`); `TestImportSyncfsFailureAndOrdering`, `TestImportSyncfsReturnedFailurePolicyAndReplay`, `TestImportSyncfsCrashBoundaries`, `TestSyncfsKernelGate`, `TestSyncfsFilesystemGate`, `TestImportBatchSelectsSyncfsByFilesystem`, `TestImportDurabilityModeProbesEachStoreDirectory` (`core/lifecycle/import_syncfs_test.go`); `TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk` (`core/lifecycle/import_recovery_test.go`); `TestVolumeEqualityRequiresRecovery` (`core/lifecycle/volume_recovery_test.go`); `TestNodeMarshalErrorDoesNotRequireRecovery` (`core/lifecycle/remove_retry_test.go`) | Lifecycle record publication, including startup-step durability barrier | ACTIVE | | `INV-LIFECYCLE-FAILSTOP-001` | A supervised master exits nonzero within one second of a lifecycle put/import or open-barrier persistence failure, independently of logging. It attempts one ERROR; restart completes recovery barriers and import before serving. | Lifecycle process ready/recovering → faulted → exited → recovering | `core/host/master/lifecycle_failure.go` `lifecycleFailStop`; `host.go` `New`; `cmd/blockmaster/main.go` `run`; lifecycle store failure handlers | `TestMasterImportPersistenceFailureExitsAndRecovers` (`cmd/blockmaster/persist_exit_test.go`); `TestLifecyclePersistenceFailureStopsTheProcess`, `TestLifecycleFailStopExitsWithBlockedLogger` (`core/host/master/lifecycle_failure_test.go`) | Manual process-fault/recovery projection of lifecycle record durability; no new wire or format state | ACTIVE | | `INV-VOL-ID-NO-REUSE-001` | A deleted volume id is never created or attached again. | M2 Deleting; M6 purging → deleted | `core/host/master/services.go` `MarkVolumeDeleting`; `core/frontend/chunkstore/layout/create.go` `createVolume` | `TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart` (`core/host/master/volume_deleting_test.go`); `TestCreateVolume_OverAnExistingHeadByState` (`core/frontend/chunkstore/layout/create_test.go`) | `ChunkLifecycleFixed` `NoIdReuse` | ACTIVE | | `INV-MASTER-JOURNAL-ISOLATION-001` | Under strict journal isolation, blockmaster gives no new work to a node whose durable root shares the authority store's file system: it refuses that node's heartbeat while it serves no volume, a new placement on it and a move onto it; work the node already has is kept. | M2 workspace move: Acked or Expired → (move refused, nothing written); workspace placement admission; node heartbeat | `core/host/master/journal_isolation.go` `refuseColocatedHeartbeat`, `colocatedTargetRefused`, `reconcilePlacements`, `nodeServesVolumes`; `core/host/master/workspace_service.go` `workspaceMoveCheckLocked`; `core/host/master/workspace_binding.go` `PlaceWorkspace` | `TestColocatedNodeIsAlarmedButAcceptedByDefault`, `TestStrictRefusesColocatedNodeWithoutVolumes`, `TestStrictAcceptsColocatedNodeThatAlreadyServes`, `TestStrictRefusesPlacementAndMoveOntoColocatedNode`, `TestStrictProductLoopSkipsColocatedNodeForNewPlacement` (`core/host/master/journal_isolation_test.go`); `TestStrictReplaysAnIssuedMoveToANowColocatedTarget`, `TestStrictKeepsAnIdempotentPlacementOnANowColocatedNode` (`core/host/master/journal_isolation_fold_test.go`) | — | ACTIVE | From 7d960d01a33fa9bf0f663d115f4b2028fa20f6c6 Mon Sep 17 00:00:00 2001 From: Ping Qiu Date: Sat, 5 Dec 2026 12:26:15 -0800 Subject: [PATCH 28/29] seaweed-block: docs: warn about restart delays on busy state filesystems (#13472) * docs: document blockmaster restart delays on busy filesystems * docs: correct measured startup range and lease safety explanation * docs: explain filesystem-wide import sync wait * docs: clarify import sync applies per changed store * docs: qualify restart continuity and ancestor sync exposure --- seaweed-block/docs/operations-manual.md | 23 +++++++++++++++++++++-- seaweed-block/docs/releases/v1.1.1.md | 6 ++++++ seaweed-block/docs/releases/v1.1.2.md | 9 +++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 seaweed-block/docs/releases/v1.1.2.md diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index 7d74156b15..a2564ac26c 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -117,6 +117,22 @@ systemd and root access. ## 1. Install the binaries and units +**Plan blockmaster's state storage before starting it.** Keep the holders' local data off both the state +directory's filesystem and the filesystem holding its ancestors. In practice, put the holders' data on its own +filesystem, not the root filesystem. With the shipped unit, the state directory is `/var/lib/sw-block-master`, +including the authority and lifecycle stores. A different directory on the same filesystem is not enough. A +dedicated state-directory mount alone does not isolate every startup sync: opening the store also syncs ancestor +directories up to `/`, including `/var/lib` and `/var` with this layout. Keep write load low on those filesystems +when restarting too. Under heavy writes, an `fsync` when blockmaster opens its state directory can wait for the +filesystem journal. In v1.1.2, startup also runs a `syncfs` for each store with changed import records on ext4, XFS, +btrfs or tmpfs (Linux 5.8 or later), which waits for every pending write on that filesystem, including the holders' +data. Starts took from about 20 seconds to over 150 seconds in our tests (one start was not ready after 2 minutes); +this is not an upper bound. A volume whose lease expires stops serving until blockmaster is back; it is then +granted again on the same holder, with its data. A forced move during that time can lose writes after the last +published HEAD (see [forced move](volume-lifecycle.md#after-a-crash)). +Restart blockmaster at low write load, including when the cluster spec has not changed. See the +[restart known issue](releases/v1.1.1.md#known-issue-blockmaster-restart-can-stall-on-a-busy-filesystem). + 1. **Get the repository at the release tag, then the binaries.** The repository holds the units in `deploy/`. The binaries are `blockmaster`, `blockvolume` and `sw-block`, all three from the same release. `TAG` is the release, for example `v1.1.1`. Download the release tarball and check it: @@ -240,7 +256,8 @@ with its size and home placement. A volume's record comes from the cluster spec: ``` blockmaster reads the cluster spec only when it starts. After editing the spec, run -`sudo systemctl restart sw-blockmaster`. Serving volumes keep serving across that restart. +`sudo systemctl restart sw-blockmaster`. A restart that outlasts the running volumes' leases makes them fence; +follow the state-storage and low-write-load guidance in section 1 before restarting. blockmaster must run under systemd or an equivalent restart supervisor. A node, placement or volume lifecycle record write or recovery-directory sync failure attempts one `ERROR` naming the store, @@ -579,7 +596,9 @@ writing the v1.0 format until you finalize. Until then you can go back. sw-block cluster format-level --master 127.0.0.1:9180 # format level 0 ``` - Volumes keep serving. + Volumes keep serving only if the restart completes before their leases expire; otherwise they fence. + Follow the [state-storage and low-write-load restart guidance](#1-install-the-binaries-and-units), including + during upgrades. 4. **Each holder.** Install the new binary once per host, then restart each volume on that host: diff --git a/seaweed-block/docs/releases/v1.1.1.md b/seaweed-block/docs/releases/v1.1.1.md index 1304b45abf..5dd2f7554f 100644 --- a/seaweed-block/docs/releases/v1.1.1.md +++ b/seaweed-block/docs/releases/v1.1.1.md @@ -24,6 +24,12 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo - **Where it starts:** we estimate around 150 declared volumes; it depends on the disk under blockmaster's state directory. - **What to do:** restart blockmaster in a maintenance window if a cluster declares more than about 150 volumes. A fix is planned for v1.1.2; in our test with it, 999 volumes restarted in under 6 s including the stop, and no volume stopped. +## Known issue: blockmaster restart can stall on a busy filesystem + +- **Trigger:** blockmaster's state directory or its ancestors share a filesystem with heavy writes, such as the holders' local data. +- **Effect:** opening the state directory calls `fsync`, which can wait for the filesystem journal. In v1.1.2, when the import has changed records, startup also runs a `syncfs` for each store with changed records on ext4, XFS, btrfs or tmpfs (Linux 5.8 or later), which waits for every pending write on that filesystem, including the holders' data. Starts took from about 20 seconds to over 150 seconds in our tests (one start was not ready after 2 minutes); this is not an upper bound. A volume whose lease expires stops serving until blockmaster is back; it is then granted again on the same holder, with its data. A forced move during that time can lose writes after the last published HEAD (see [forced move](../volume-lifecycle.md#after-a-crash)). +- **What to do:** keep the holders' data off both the state directory's filesystem and the filesystem holding its ancestor directories. In practice, put the holders' data on its own filesystem, not the root filesystem. A different directory on the same filesystem is not enough. A dedicated state-directory mount alone does not isolate every startup sync: opening the store also syncs ancestors up to `/`, including `/var/lib` and `/var` with the shipped layout. Restart blockmaster at low write load on all those filesystems. This limitation also applies when the cluster spec has not changed. + ## Known issue: blockmaster needs its filer to start - blockmaster checks that its SeaweedFS filer answers before it starts. If the filer is unreachable, blockmaster stops with an error after about 60 s instead of starting. diff --git a/seaweed-block/docs/releases/v1.1.2.md b/seaweed-block/docs/releases/v1.1.2.md new file mode 100644 index 0000000000..a9922448da --- /dev/null +++ b/seaweed-block/docs/releases/v1.1.2.md @@ -0,0 +1,9 @@ +# v1.1.2 + +v1.1.2 is not yet released. + +## Known issue: blockmaster restart can stall on a busy filesystem + +- **Trigger:** blockmaster's state directory or its ancestors share a filesystem with heavy writes, such as the holders' local data. +- **Effect:** blockmaster's start syncs its state directories, which can wait for the filesystem journal. When the import has changed records, it also runs a `syncfs` for each store with changed records on ext4, XFS, btrfs or tmpfs (Linux 5.8 or later), which waits for every pending write on that filesystem, including the holders' data. Starts took from about 20 seconds to over 150 seconds in our tests (one start was not ready after 2 minutes); this is not an upper bound. A volume whose lease expires stops serving until blockmaster is back; it is then granted again on the same holder, with its data. A forced move during that time can lose writes after the last published HEAD (see [forced move](../volume-lifecycle.md#after-a-crash)). +- **What to do:** keep the holders' data off both the state directory's filesystem and the filesystem holding its ancestor directories. In practice, put the holders' data on its own filesystem, not the root filesystem. A different directory on the same filesystem is not enough. A dedicated state-directory mount alone does not isolate every startup sync: opening the store also syncs ancestors up to `/`, including `/var/lib` and `/var` with the shipped layout. Restart blockmaster at low write load on all those filesystems. This limitation also applies when the cluster spec has not changed. From 08aeac6b53525a1240743d2c902945d9e67c9387 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 12:26:46 -0800 Subject: [PATCH 29/29] seaweed-block: sw-block metadata writers send the chunk condition; ChunkGuard reports it truthfully (#13471) * seaweed-block: red: a snapshot delete is published over a page whose data was freed Two overlapping runs of one snapshot delete write their intent pages under the same tag. If the first run's stalled page update lands between the second run's read of a page and its adoption (after a cleaning pass deleted and the second run re-staged the page), the second run adopts and publishes an intent whose page data was freed: later snapshot deletes on the volume are refused and its cleaning stops. Co-Authored-By: Claude Opus 5.5 * seaweed-block: a snapshot delete re-reads each intent page after adopting it Publication reads every intent page, adopts it under this run's tag, then publishes. A stalled update from another run of the same delete can land between that read and the adoption and put a deleted page's data reference on the entry. Reading the page again after the adoption, before the transition publishes, refuses that case: once this run's tag is on the entry, no such update passes. No persisted change; a run that hits it stays refused, and a new request id writes new pages. Co-Authored-By: Claude Opus 5.5 * seaweed-block: ledger row for the intent page re-read INV-SNAPSHOT-DELETE-ADOPT-002 names the re-read after adoption, its test and the model row it projects (PublishedReadable; the refused run is the residue a new request id clears). Co-Authored-By: Claude Opus 5.5 * seaweed-block: the intent page re-read: typed refusal, twins and a store witness Review: the re-read test now separates the guard from weaker ones. A page that reads but holds other bytes, and a change to only the later of two pages, are refused as well as a freed page; the refusal is a precondition that writes nothing to HEAD, keeps the snapshot, and comes after the adoption; the same schedule with intact bytes publishes. The test is a consequence-level projection; a store-level witness shows the tag-only metadata update writing a deleted object's chunk over a re-created one, which the re-read does not depend on refusing. The ledger row names the witness and marks the model as checked outside the repository. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the intent page re-read keeps its error's cause The refusal wrapped the re-read's error with %v, so a caller deadline that ended the re-read reached the CLI as a precondition ("page changed during adoption", no_progress) instead of deadline_exceeded, unlike the same deadline on the chain's first read. Wrap both errors. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the intent page re-read sees only data the filer already freed The filer frees a deleted entry's chunks, and the chunks an update drops, from its deletion queue: polled every 1.123 s, and retried after 5 min when a volume server does not answer. A stale update that puts such a reference on an adopted page therefore reads back intact while the deletion is still queued, and the intent publishes over data that is freed moments later. The intact-bytes twin publishes for that reason. State that bound in INV-SNAPSHOT-DELETE-ADOPT-002 and at the guard instead of "changed or vanished ... refuses the publication". Co-Authored-By: Claude Opus 5.5 * seaweed-block: the delete intent publication row and diagram carry the re-read Part C rule 2 moves a changed guard's Part A row and diagram with it. The publication row now names the re-read after adoption and INV-SNAPSHOT-DELETE-ADOPT-002, and the M9 diagram gains the transition's idle and snap self-loops, which it lacked. Co-Authored-By: Claude Opus 5.5 * seaweed-block: red: a stale adoption or mark lands on a re-created object A metadata change writes the looked-up entry back, chunks included, conditional only on its tags: paused between its lookup and its update, it lands on an object deleted and created again with the same tags in between, puts the deleted object's chunk on it, and a cleaner's stale mark then deletes it. The filer's IF_CHUNKS_EQUAL condition refuses such a write. This commit adds the plumbing and the tests, not the guard itself: - the filer protocol subset gains WriteCondition (IF_CHUNKS_EQUAL) on UpdateEntryRequest; SWFS sends it through UpdateEntryIfChunks, and the fakes evaluate it (or drop it, as an older filer does); - a startup probe sends a mismatched conditional update to the disposable probe HEAD; only a definite refusal turns the guard on for the stores the catalog opens. The startup log and /status/chunk (metadata_guard) name it. The two guard tests fail here: changeMeta does not send the condition yet. Co-Authored-By: Claude Opus 5.5 * seaweed-block: metadata changes send the filer's chunk condition With the guard on (the startup probe saw the filer enforce it), an adoption or mark sends IF_CHUNKS_EQUAL with the looked-up entry's chunk fids. A re-created object always has a new chunk, so a stale whole-entry write is refused instead of putting a deleted object's chunk on it; a cleaner's delete expects its own mark and so follows. Without the guard the write is unchanged and the intent page re-read stays the check. Co-Authored-By: Claude Opus 5.5 * seaweed-block: ledger rows for the chunk condition and its probe INV-LAYOUT-META-CHUNKS-001 (adoption and mark under IF_CHUNKS_EQUAL) and INV-WS-CHUNK-CONDITION-PROBE-001 (the startup probe decides it, the log and /status/chunk name it); ADOPT-002 names the renamed store test. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the chunk probe without a definite refusal leaves the guard off; fallback wording Review: the existing failure cases stop at the HEAD gate. New cases pass the gate and then fail only the chunk condition probe (unavailable, lost, deadline, filer error, vanished entry, failed HEAD read): the catalog, its stores, the startup log and the usage all stay on page_reread_only. page_reread_only now reads as enforcement not established, not as a filer without the condition; INV-SNAPSHOT-DELETE-ADOPT-002 cites MetaABA r2's delayed-free counterexample, r1 kept as historical scope. Co-Authored-By: Claude Opus 5.5 * seaweed-block: sw-block metadata writers run the chunk condition probe sw-block opens its catalog with NewBCatalog, and only DialBCatalog ran the probe, so a snapshot-delete, retain, release or volume-delete from the CLI sent its adoptions and marks without the chunk condition even on a filer that enforces it. bCatalog now runs the same probe (checkConditionalHead, via ProbeChunkGuard) for a writing command; a failed probe only leaves the guard off. Read-only commands write nothing. The volume-delete fakes that stall object deletes let the probe's own cleanup through. Co-Authored-By: Claude Opus 5.5 * seaweed-block: ChunkGuard reports only a chunk condition the filer can carry SetChunkGuard(true) on a store whose filer does not implement ChunkConditionFiler made ChunkGuard report true while changeMeta sent a plain UpdateEntry. Both now ask chunkCondition: the guard is on and the filer can carry the condition. Co-Authored-By: Claude Opus 5.5 * seaweed-block: Part A rows for the chunk condition probe and guard Part C rule 2: the M4 table gains the startup probe's guard selection (INV-WS-CHUNK-CONDITION-PROBE-001), and the M9 publication, clean removal and list page retirement rows and diagram carry the chunk condition on adoptions and marks (INV-LAYOUT-META-CHUNKS-001), whose Part B row now names the clean removal as well. Co-Authored-By: Claude Opus 5.5 * seaweed-block: sw-block usage leaves out a metadata guard it never probed The usage command opens a read-only catalog, which runs no chunk condition probe, so its answer always said page_reread_only even over a filer every writer sends the condition to. The field is now omitted there; blockvolume's /status/chunk still reports its probed guard. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the sw-block chunk condition probe runs within --timeout A writing command ran the probe on context.Background(), so after a passing census a stalled disposable HEAD create held it for the probe's own 10 s whatever --timeout said. The probe now runs within the command's filer timeout; its cleanup keeps its own 5 s. Co-Authored-By: Claude Opus 5.5 * seaweed-block: a stale sw-block adoption is refused through the CLI catalog The probe test proved only guard selection. This one composes it: through the store of the catalog bCatalog opens, an adoption paused between its lookup and its update while the object is deleted and created again is refused with the re-created chunk intact. An unchanged object is still adopted, and a catalog that ran no probe lets the stale write through. Co-Authored-By: Claude Opus 5.5 * seaweed-block: the M9 diagram qualifies the chunk condition by the guard The adoption and mark labels read as always chunk-conditioned, while the tables beside them say so only with the guard on; guard off, the page re-read is the only check. Co-Authored-By: Claude Opus 5.5 * seaweed-block: a failed chunk guard probe turns the guard off ProbeChunkGuard set the guard only when checkConditionalHead got as far as the chunk probe, so a second call that failed earlier kept the first call's guard on. It now starts from off. Its comment also says a store takes the guard when it is opened, so the probe goes before the stores. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: pingqiu Co-authored-by: Claude Opus 5.5 --- seaweed-block/cmd/sw-block/chunk_b.go | 14 +- seaweed-block/cmd/sw-block/chunk_b_test.go | 2 +- .../cmd/sw-block/chunk_guard_probe_test.go | 214 ++++++++++++++++++ .../chunk_volume_delete_progress_test.go | 6 + .../core/frontend/chunkstore/catalog_b.go | 5 +- .../chunkstore/chunk_guard_report_test.go | 54 +++++ .../core/frontend/chunkstore/layout_store.go | 14 +- .../frontend/chunkstore/startup_head_probe.go | 14 ++ seaweed-block/docs/design/invariants.md | 17 +- seaweed-block/docs/status-schema.md | 2 +- seaweed-block/docs/time-bounds.tsv | 1 + 11 files changed, 326 insertions(+), 17 deletions(-) create mode 100644 seaweed-block/cmd/sw-block/chunk_guard_probe_test.go create mode 100644 seaweed-block/core/frontend/chunkstore/chunk_guard_report_test.go diff --git a/seaweed-block/cmd/sw-block/chunk_b.go b/seaweed-block/cmd/sw-block/chunk_b.go index 3539f1040f..a0b7bf70b3 100644 --- a/seaweed-block/cmd/sw-block/chunk_b.go +++ b/seaweed-block/cmd/sw-block/chunk_b.go @@ -36,8 +36,9 @@ var restoreCreateRPC = func(ctx context.Context, master string, req *control.Cre } // bCatalog dials the filer and opens the volume catalog; a command that -// writes first passes the single-filer start check. It returns exit -1 on -// success, else the exit code after reporting. +// writes first passes the single-filer start check, then runs the chunk +// condition probe; each runs within timeout. It returns exit -1 on success, +// else the exit code after reporting. func bCatalog(name, filer, base string, writes bool, timeout time.Duration, stdout, stderr io.Writer) (*chunkstore.BCatalog, func() error, int) { if filer == "" { return nil, nil, chunkFail(name, stdout, stderr, ops.VolumeStatusExitInvalid, codeBadRequestCLI, "--chunk-filer is required", false) @@ -67,6 +68,11 @@ func bCatalog(name, filer, base string, writes bool, timeout time.Duration, stdo if err != nil { return fail(err.Error()) } + if writes { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + cat.ProbeChunkGuard(ctx) + cancel() + } return cat, closeFn, -1 } @@ -354,7 +360,9 @@ func chunkUsage(args []string, stdout, stderr io.Writer) int { c.bindVolume(&vol, "volume", "volume") var ref chunkstore.VolumeRef return c.run(args, false, func() (err error) { ref, err = vol.ref("volume"); return err }, func(ctx context.Context, cat *chunkstore.BCatalog) (any, error) { - return cat.Usage(ctx, ref) + u, err := cat.Usage(ctx, ref) + u.MetadataGuard = "" + return u, err }) } diff --git a/seaweed-block/cmd/sw-block/chunk_b_test.go b/seaweed-block/cmd/sw-block/chunk_b_test.go index 84cf85e382..4d8072eab2 100644 --- a/seaweed-block/cmd/sw-block/chunk_b_test.go +++ b/seaweed-block/cmd/sw-block/chunk_b_test.go @@ -176,7 +176,7 @@ func TestOpsChunk_CatalogCommands(t *testing.T) { if code, out, errs := runChunk(cliArgs("restore", volArgs("source", src), volArgs("target", tgt), []string{"--snapshot", "daily"})...); code != 0 || !strings.Contains(out, tgt.Dir()) { t.Fatalf("restore: %d %q %q", code, out, errs) } - if code, out, _ := runChunk(cliArgs("usage", volArgs("volume", tgt))...); code != 0 || !strings.Contains(out, `"foreign_chunks":1`) { + if code, out, _ := runChunk(cliArgs("usage", volArgs("volume", tgt))...); code != 0 || !strings.Contains(out, `"foreign_chunks":1`) || strings.Contains(out, "metadata_guard") { t.Fatalf("target usage: %d %q", code, out) } if code, out, _ := runChunk(cliArgs("snapshot-delete", volArgs("volume", src), []string{"--name", "daily"})...); code != chunkExitFailed || chunkErrorOut(t, out).Code != "snapshot_has_dependents" { diff --git a/seaweed-block/cmd/sw-block/chunk_guard_probe_test.go b/seaweed-block/cmd/sw-block/chunk_guard_probe_test.go new file mode 100644 index 0000000000..ac54644334 --- /dev/null +++ b/seaweed-block/cmd/sw-block/chunk_guard_probe_test.go @@ -0,0 +1,214 @@ +package main + +import ( + "bytes" + "context" + "errors" + "io" + "path" + "strings" + "testing" + "time" + + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore" + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/filerpb" + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/layout" +) + +// A command that changes chunk metadata runs the chunk condition probe on +// the catalog it opens, so its adoptions and marks send the filer's chunk +// condition as blockvolume's do; a read-only command writes nothing. +func TestOpsChunkWritingCatalogRunsTheChunkConditionProbe(t *testing.T) { + mem := newMemChunkStore() + prevDial, prevCheck := dialChunkFiler, checkSingleFiler + t.Cleanup(func() { dialChunkFiler, checkSingleFiler = prevDial, prevCheck }) + dialChunkFiler = func(string) (chunkstore.Filer, func() error, error) { return mem, func() error { return nil }, nil } + checkSingleFiler = func(context.Context, chunkstore.Filer) error { return nil } + for _, tc := range []struct { + writes bool + guard string + }{{true, chunkstore.MetadataGuardChunks}, {false, chunkstore.MetadataGuardReread}} { + cat, closeFn, exit := bCatalog("snapshot-delete", "filer:18888", "/blocks", tc.writes, time.Minute, io.Discard, io.Discard) + if exit >= 0 { + t.Fatalf("writes=%v: catalog open exited %d", tc.writes, exit) + } + _ = closeFn() + if got := cat.MetadataGuard(); got != tc.guard { + t.Fatalf("writes=%v: metadata guard %q, want %q", tc.writes, got, tc.guard) + } + left, err := mem.ListEntries(context.Background(), "/blocks", "", "", 100) + if err != nil || len(left) != 0 { + t.Fatalf("writes=%v: %d entries left under the catalog base (%v)", tc.writes, len(left), err) + } + } +} + +// stalledProbeFiler stalls the probe's disposable HEAD create until its +// context ends. +type stalledProbeFiler struct{ *memChunkStore } + +func (f stalledProbeFiler) CreateEntry(ctx context.Context, dir string, e *filerpb.Entry, oExcl bool) error { + if inStartupProbe(dir, e.GetName()) { + <-ctx.Done() + return ctx.Err() + } + return f.memChunkStore.CreateEntry(ctx, dir, e, oExcl) +} + +// The probe runs within the command's --timeout: after a passing census, a +// probe stalled on its filer ends at the timeout, leaves the guard off and +// refuses nothing. +func TestOpsChunkWritingCatalogProbeIsBoundedByTheTimeout(t *testing.T) { + mem := newMemChunkStore() + prevDial, prevCheck := dialChunkFiler, checkSingleFiler + t.Cleanup(func() { dialChunkFiler, checkSingleFiler = prevDial, prevCheck }) + dialChunkFiler = func(string) (chunkstore.Filer, func() error, error) { + return stalledProbeFiler{mem}, func() error { return nil }, nil + } + checkSingleFiler = func(context.Context, chunkstore.Filer) error { return nil } + start := time.Now() + cat, closeFn, exit := bCatalog("snapshot-delete", "filer:18888", "/blocks", true, 200*time.Millisecond, io.Discard, io.Discard) + if exit >= 0 { + t.Fatalf("a stalled probe refused the command: exit %d", exit) + } + _ = closeFn() + if took := time.Since(start); took > 5*time.Second { + t.Fatalf("a stalled probe held the command %v past its 200ms --timeout", took) + } + if got := cat.MetadataGuard(); got != chunkstore.MetadataGuardReread { + t.Fatalf("metadata guard %q after a stalled probe, want %q", got, chunkstore.MetadataGuardReread) + } +} + +// betweenLookupAndUpdate runs before, once it is set, ahead of the next +// update: what other writers do while a stale one is between its lookup and +// its update. +type betweenLookupAndUpdate struct { + *memChunkStore + before func() +} + +func (f *betweenLookupAndUpdate) runBefore() { + if b := f.before; b != nil { + f.before = nil + b() + } +} + +func (f *betweenLookupAndUpdate) UpdateEntry(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte) error { + f.runBefore() + return f.memChunkStore.UpdateEntry(ctx, dir, e, expected) +} + +func (f *betweenLookupAndUpdate) UpdateEntryIfChunks(ctx context.Context, dir string, e *filerpb.Entry, expected map[string][]byte, fids []string) error { + f.runBefore() + return f.memChunkStore.UpdateEntryIfChunks(ctx, dir, e, expected, fids) +} + +// A writing command's adoption that paused between its lookup and its update +// does not land on an object a cleaner deleted and another executor created +// again in between, through the store of the catalog bCatalog opens. An +// unchanged object is still adopted; a catalog that ran no probe lets the +// stale write through. +func TestOpsChunkStaleCLIAdoptionDoesNotOverwriteARecreatedObject(t *testing.T) { + for _, tc := range []struct { + name string + writes, recreate bool + }{ + {"probed catalog, recreated object", true, true}, + {"probed catalog, unchanged object", true, false}, + {"catalog without the probe, recreated object", false, true}, + } { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + mem := newMemChunkStore() + hooked := &betweenLookupAndUpdate{memChunkStore: mem} + prevDial, prevCheck := dialChunkFiler, checkSingleFiler + t.Cleanup(func() { dialChunkFiler, checkSingleFiler = prevDial, prevCheck }) + dialChunkFiler = func(string) (chunkstore.Filer, func() error, error) { return hooked, func() error { return nil }, nil } + checkSingleFiler = func(context.Context, chunkstore.Filer) error { return nil } + cat, closeFn, exit := bCatalog("snapshot-delete", "filer:18888", "/blocks", tc.writes, time.Minute, io.Discard, io.Discard) + if exit >= 0 { + t.Fatalf("catalog open exited %d", exit) + } + defer closeFn() + id, err := layout.NewVolumeID() + if err != nil { + t.Fatal(err) + } + ref := chunkstore.VolumeRef{Name: "v", ID: id} + stale, err := cat.Store(ref) + if err != nil { + t.Fatal(err) + } + others, err := chunkstore.NewLayoutStore(mem, mem, path.Join("/blocks", ref.Dir()), id) + if err != nil { + t.Fatal(err) + } + data := bytes.Repeat([]byte{0x5a}, 4096) + rel := layout.NameChunk(1, data).Path() + obj := path.Join("/blocks", ref.Dir(), rel) + fid := func() string { + e, err := mem.LookupEntry(ctx, path.Dir(obj), path.Base(obj)) + if err != nil || len(e.Chunks) != 1 { + t.Fatalf("lookup %s: %+v %v", rel, e, err) + } + return e.Chunks[0].FileId + } + if err := others.Create(ctx, rel, data, "producer-1"); err != nil { + t.Fatal(err) + } + first := fid() + meta, found, err := others.Stat(ctx, rel) + if err != nil || !found { + t.Fatalf("stat: %v %v", found, err) + } + second := first + if tc.recreate { + hooked.before = func() { + if err := others.Mark(ctx, rel, meta, "clean-1"); err != nil { + t.Errorf("mark: %v", err) + } + if err := others.DeleteMarked(ctx, rel, "clean-1"); err != nil { + t.Errorf("delete: %v", err) + } + if err := others.Create(ctx, rel, data, "producer-1"); err != nil { + t.Errorf("re-create: %v", err) + } + second = fid() + } + } + err = stale.Reuse(ctx, rel, meta, "writer-1") + if tc.recreate && second == first { + t.Fatalf("fixture: the object was not re-created with a new chunk (%s)", first) + } + switch { + case tc.writes && tc.recreate: + if !errors.Is(err, layout.ErrPrecondition) { + t.Fatalf("the stale CLI adoption over a re-created object answered %v, want ErrPrecondition", err) + } + if got := fid(); got != second { + t.Fatalf("the stale CLI adoption wrote chunk %s over the re-created object's %s", got, second) + } + case tc.recreate: + if err != nil || fid() != first { + t.Fatalf("control: without the probe the stale adoption should land (err %v, chunk %s, first %s)", err, fid(), first) + } + default: + if err != nil { + t.Fatalf("adoption of an unchanged object: %v", err) + } + if m, _, err := others.Stat(ctx, rel); err != nil || m.Session != "writer-1" { + t.Fatalf("after adoption: %+v %v", m, err) + } + } + }) + } +} + +// inStartupProbe reports whether dir/name lies in a catalog probe's +// disposable directory: a fake that stalls object deletes lets the probe's +// own cleanup through, as a real filer deletes its inline HEAD at once. +func inStartupProbe(dir, name string) bool { + return strings.Contains(path.Join(dir, name), "/.startup-head-probe-") +} diff --git a/seaweed-block/cmd/sw-block/chunk_volume_delete_progress_test.go b/seaweed-block/cmd/sw-block/chunk_volume_delete_progress_test.go index 42934994c6..0cd2975f85 100644 --- a/seaweed-block/cmd/sw-block/chunk_volume_delete_progress_test.go +++ b/seaweed-block/cmd/sw-block/chunk_volume_delete_progress_test.go @@ -100,6 +100,9 @@ type waitingDeleteFiler struct { } func (f *waitingDeleteFiler) DeleteEntry(ctx context.Context, dir, name string, expected map[string][]byte) error { + if inStartupProbe(dir, name) { + return f.memChunkStore.DeleteEntry(ctx, dir, name, expected) + } f.calls++ if f.calls == 1 { timer := time.NewTimer(f.bound / 2) @@ -166,6 +169,9 @@ func TestVolumeDeleteRefreshesAnExpiredSweepAndWaitsFromLastRemoval(t *testing.T type blockedDeleteFiler struct{ *memChunkStore } func (f *blockedDeleteFiler) DeleteEntry(ctx context.Context, dir, name string, expected map[string][]byte) error { + if inStartupProbe(dir, name) { + return f.memChunkStore.DeleteEntry(ctx, dir, name, expected) + } <-ctx.Done() return ctx.Err() } diff --git a/seaweed-block/core/frontend/chunkstore/catalog_b.go b/seaweed-block/core/frontend/chunkstore/catalog_b.go index 37a6c472ed..69ee1b7636 100644 --- a/seaweed-block/core/frontend/chunkstore/catalog_b.go +++ b/seaweed-block/core/frontend/chunkstore/catalog_b.go @@ -369,8 +369,9 @@ type Usage struct { // MetadataGuard names the protection of the volume's metadata changes: // filer_chunk_condition (the startup probe saw the filer enforce the // chunk condition) or page_reread_only (enforcement was not established - // at startup; delete intent pages are re-read). - MetadataGuard string `json:"metadata_guard"` + // at startup; delete intent pages are re-read). Absent when the catalog + // ran no probe. + MetadataGuard string `json:"metadata_guard,omitempty"` } // Usage reads the volume's usage from its HEAD and current root. diff --git a/seaweed-block/core/frontend/chunkstore/chunk_guard_report_test.go b/seaweed-block/core/frontend/chunkstore/chunk_guard_report_test.go new file mode 100644 index 0000000000..02c756c6cd --- /dev/null +++ b/seaweed-block/core/frontend/chunkstore/chunk_guard_report_test.go @@ -0,0 +1,54 @@ +package chunkstore + +import ( + "context" + "errors" + "testing" + + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/layout" +) + +// ChunkGuard reports what changeMeta sends: a store over a filer that cannot +// carry the chunk condition reports the guard off even when it was set on. +func TestChunkGuardReportsOnlyAConditionTheFilerCanCarry(t *testing.T) { + id, err := layout.NewVolumeID() + if err != nil { + t.Fatal(err) + } + for _, tc := range []struct { + name string + filer Filer + want bool + }{ + {"a filer that carries it", newFakeFiler(), true}, + {"a client wrapper that cannot send it", hidesChunkCondition{newFakeFiler()}, false}, + } { + st, err := NewLayoutStore(tc.filer, newFakeBlobs(), "/blocks/v1", id) + if err != nil { + t.Fatal(err) + } + st.SetChunkGuard(true) + if got := st.ChunkGuard(); got != tc.want { + t.Fatalf("%s: ChunkGuard()=%v after SetChunkGuard(true), want %v", tc.name, got, tc.want) + } + } +} + +// A probe that fails leaves the guard off even after an earlier probe of the +// same catalog turned it on. +func TestAFailedChunkGuardProbeLeavesTheGuardOff(t *testing.T) { + f := newFakeFiler() + cat, err := NewBCatalog(f, newFakeBlobs(), "/blocks") + if err != nil { + t.Fatal(err) + } + cat.ProbeChunkGuard(context.Background()) + if got := cat.MetadataGuard(); got != MetadataGuardChunks { + t.Fatalf("first probe: guard %q, want %q", got, MetadataGuardChunks) + } + f.failCreate = func(string) error { return errors.New("transport: lost answer") } + cat.ProbeChunkGuard(context.Background()) + if got := cat.MetadataGuard(); got != MetadataGuardReread { + t.Fatalf("failed probe: guard %q, want %q", got, MetadataGuardReread) + } +} diff --git a/seaweed-block/core/frontend/chunkstore/layout_store.go b/seaweed-block/core/frontend/chunkstore/layout_store.go index 05eee901d7..991bd61c6a 100644 --- a/seaweed-block/core/frontend/chunkstore/layout_store.go +++ b/seaweed-block/core/frontend/chunkstore/layout_store.go @@ -374,7 +374,7 @@ func (s *LayoutStore) changeMeta(ctx context.Context, rel string, expect layout. // filer's chunk condition refuses that write. Without it (a filer that // does not enforce the condition), delete intent publication re-reads // each adopted page instead (layout.RunDeleteSnapshotWithIntent). - if cf, ok := s.f.(ChunkConditionFiler); ok && s.chunkGuard { + if cf, ok := s.chunkCondition(); ok { return layoutError(cf.UpdateEntryIfChunks(ctx, dir, e, objectExpected(expect), entryFids(e))) } return layoutError(s.f.UpdateEntry(ctx, dir, e, objectExpected(expect))) @@ -385,7 +385,17 @@ func (s *LayoutStore) changeMeta(ctx context.Context, rel string, expect layout. func (s *LayoutStore) SetChunkGuard(on bool) { s.chunkGuard = on } // ChunkGuard reports whether metadata changes send the chunk condition. -func (s *LayoutStore) ChunkGuard() bool { return s.chunkGuard } +func (s *LayoutStore) ChunkGuard() bool { + _, ok := s.chunkCondition() + return ok +} + +// chunkCondition is the filer metadata changes send the chunk condition +// through: the guard is on and the filer can carry it. +func (s *LayoutStore) chunkCondition() (ChunkConditionFiler, bool) { + cf, ok := s.f.(ChunkConditionFiler) + return cf, ok && s.chunkGuard +} func (s *LayoutStore) Reuse(ctx context.Context, rel string, expect layout.ObjectMeta, session string) error { if session == "" { diff --git a/seaweed-block/core/frontend/chunkstore/startup_head_probe.go b/seaweed-block/core/frontend/chunkstore/startup_head_probe.go index a02fdfec26..b4482cb0d8 100644 --- a/seaweed-block/core/frontend/chunkstore/startup_head_probe.go +++ b/seaweed-block/core/frontend/chunkstore/startup_head_probe.go @@ -157,6 +157,20 @@ func (c *BCatalog) checkConditionalHead(ctx context.Context) error { return nil } +// ProbeChunkGuard runs the startup probe for a catalog NewBCatalog opened +// (the sw-block commands that change metadata), so the stores it opens next +// send the chunk condition as DialBCatalog's do; a store takes the guard when +// it is opened. A failed probe leaves the guard off; it refuses nothing. +func (c *BCatalog) ProbeChunkGuard(ctx context.Context) { + c.chunkGuard = false + if _, ok := c.f.(ChunkConditionFiler); !ok { + return + } + if err := c.checkConditionalHead(ctx); err != nil { + log.Printf("chunkstore: WARNING %v; metadata change guard: %s", err, c.MetadataGuard()) + } +} + // probeChunkCondition asks the filer to rewrite the disposable probe HEAD // only if it holds a chunk it does not have. A filer that enforces // IF_CHUNKS_EQUAL refuses; one that predates it drops the unknown field and diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index c473e2386a..be06cb365c 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -395,6 +395,7 @@ stateDiagram-v2 | (start) | Attaching, Refused | the volume's host lock `/run/sw-block/locks/.lock` is taken before the store opens; held by another live process, or its directory or file cannot be created or opened, refuses (`storage.ErrWALStoreLocked`, `ErrVolumeLockDirUnavailable`) | `core/frontend/durable/provider.go` `DurableProvider.lockVolumeOnHost` (from `ensureHandle`) | `INV-WS-ONE-PROCESS-PER-HOST-001` | | Attaching | Refused | a local root from another claim or behind HEAD's position (`layout.ErrStaleLocalRoot`): final typed refusal with a cure, no serving or retry | `core/frontend/durable/provider_layout.go` `startLayoutRoot`; `provider_chunk.go` `recoverChunk`, `chunkAuthorityWait` | `INV-WS-STALE-LOCAL-ROOT-001` | | (startup) | Refused | The agreed leader lists another filer or several; or all configured masters cannot agree and confirm exactly the target within 60 s (`ErrNotSingleFiler`) | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring` | `INV-WS-SINGLE-FILER-001` | +| (startup) | (startup), chunk guard on or off | on only if the filer definitely refuses the probe's mismatched chunk-condition update of a disposable HEAD; then every store the catalog opens sends the chunk condition. Any other answer leaves it off (page re-read only) and refuses nothing. sw-block metadata writers run the same probe within their --timeout | `core/frontend/chunkstore/startup_head_probe.go` `checkConditionalHead`, `probeChunkCondition`, `ProbeChunkGuard`; `cmd/sw-block/chunk_b.go` `bCatalog` | `INV-WS-CHUNK-CONDITION-PROBE-001` | | Claiming | Holder | Start validates the local root against the HEAD it conditionally updates; a fresh root seeds before claim, an ordinary reopen keeps its acknowledged local WAL and HEAD identity; guest I/O waits for assignment and claim | `core/frontend/chunkstore/layout/start.go` `Start`; `core/frontend/chunkstore/layout/claim.go` `RunClaim`; `core/frontend/durable/provider_layout.go` `startLayoutRoot` | `INV-WS-CLAIM-BEFORE-SERVE-001`, `INV-SNAPK-HEAD-WRITE-001` | | Claiming | Detached (non-serving) | a same-epoch detached HEAD refuses Start without changing its sealed image; a higher-epoch claimant retains that image | `core/frontend/chunkstore/layout/start.go` `Start`; `core/frontend/chunkstore/layout/claim.go` `Claim` | `INV-WS-SEALED-REOPEN-001` | | Claiming | Holder, or not installed | an unknown transition outcome is resolved by its claim/session identity and the current HEAD; no unverified local success | `core/frontend/chunkstore/layout/claim.go` `RunClaim`; `core/frontend/chunkstore/layout_remote.go` `LayoutRemote.CASHead` | `INV-WS-CAS-UNKNOWN-001` | @@ -642,10 +643,10 @@ stateDiagram-v2 idle --> clean: BeginClean(c) clean --> idle: EndClean(c) snap --> snap: PublishList (durable session pages, base CAS) - idle --> idle: DeleteSnapshotWithIntent (adopted pages read again, one CAS) - snap --> snap: DeleteSnapshotWithIntent (adopted pages read again, one CAS) + idle --> idle: DeleteSnapshotWithIntent (adoption chunk-conditioned when the guard is on, pages read again, one CAS) + snap --> snap: DeleteSnapshotWithIntent (adoption chunk-conditioned when the guard is on, pages read again, one CAS) clean --> clean: AdvanceList (effects then cursor CAS) - clean --> clean: roots, segments, chunk shards and unreached list pages (conditional removal) + clean --> clean: roots, segments, chunk shards and unreached list pages (mark chunk-conditioned when the guard is on, conditional removal) idle --> deleting: MarkDeleting (no holder, no dependents) deleting --> deleted: MarkDeleted (after release and pool) ``` @@ -657,8 +658,8 @@ stateDiagram-v2 | any version-1 HEAD with reserved lists | same reserved lists after any existing HEAD transition | at most three additional checked cursors, no repeated Ref across list/lists; deep clone and exact preservation; never consumed or a reason to refuse serving | `head.go` `check`, `clone`, `runTransition`; `remove.go` `Cleaner.Page` retains list metadata | `INV-LIST-RESERVED-001` | | snap(s), list slot empty | snap(s), list cursor published | same full holder, open session and original base generation; every page durable; full slot returns queue_full without replacing work; unknown reply retains protection | `list_chain.go` `StageListPage`, `RunPublishList` | `INV-LIST-PUBLISH-001` | | clean(c), current list page | clean(c), next continuation or none | exact observed cursor CAS only after authenticated page effects succeed; failed reads and failed effects leave cursor unchanged | `list_chain.go` `RunAdvanceList` | `INV-LIST-CURSOR-001` | -| clean(c), stored list page | clean(c), unreached page removed | tags before HEAD; current clean session; spare all current-chain pages; conditional mark then delete | `remove.go` `Cleaner.Page` | `INV-LIST-RETIRE-001` | -| idle/snap, retained snapshot | same activity, row removed and intent published | one CAS removes only captured name/gen and names its durable chain; each page present, this attempt's tag, unmarked, then read and authenticated again after adoption; clean activity refuses | `delete_intent.go` `RunDeleteSnapshotWithIntent` | `INV-SNAPSHOT-DELETE-INTENT-001`, `INV-SNAPSHOT-DELETE-ADOPT-001`, `INV-SNAPSHOT-DELETE-ADOPT-002` | +| clean(c), stored list page | clean(c), unreached page removed | tags before HEAD; current clean session; spare all current-chain pages; conditional mark (with the chunk guard on, also on unchanged chunk fids) then delete | `remove.go` `Cleaner.Page`; `layout_store.go` `changeMeta` | `INV-LIST-RETIRE-001`, `INV-LAYOUT-META-CHUNKS-001` | +| idle/snap, retained snapshot | same activity, row removed and intent published | one CAS removes only captured name/gen and names its durable chain; each page present, this attempt's tag, unmarked, then read and authenticated again after adoption; with the chunk guard on, an adoption also needs the page's looked-up chunk fids unchanged; clean activity refuses | `delete_intent.go` `RunDeleteSnapshotWithIntent`; `layout_store.go` `changeMeta` | `INV-SNAPSHOT-DELETE-INTENT-001`, `INV-SNAPSHOT-DELETE-ADOPT-001`, `INV-SNAPSHOT-DELETE-ADOPT-002`, `INV-LAYOUT-META-CHUNKS-001` | | idle live/detached, persisted delete intent | idle live/detached, next intent page or none | receipt-independent continuation from current HEAD; live-root and conditional effect guards; cursor follows completed effects | `delete_intent.go` `RunConsumeSnapshotDeleteIntent`; `BCatalog.CleanSnapshotDeletePage`; `LayoutRemote.Clean` | `INV-SNAPSHOT-DELETE-CONSUME-001` | | idle | snap(s) | caller is the holder at HEAD's epoch (epoch, server and claim id); HEAD present; snap(s) again is a replay, any other activity is refused | head.go `Head.Begin`, `runTransition` | `INV-SNAPK-HEAD-WRITE-001`, `INV-SNAPK-BEGIN-001` | | snap(s) | idle | holder at HEAD's epoch (epoch, server and claim id); activity is snap(s); over idle it succeeds without a write and means only that no activity remains; before resuming a failed stop, abort its still-open session and re-read HEAD: only matching live/idle resumes, detached goes Down, absent/unknown stays stopped | head.go `Head.Abort`; durable/provider_layout.go `settleLayoutStop` | `INV-SNAPK-ABORT-001` | @@ -668,7 +669,7 @@ stateDiagram-v2 | any (Start) | idle at epoch e, claim id k | Start only: at HEAD's epoch it continues on the root carrying HEAD's claim id at or above HEAD's position, else refuses; above, a fresh root or the continuing lineage claims, validated against the HEAD the claim updates | start.go `Start`; claim.go `RunClaim` | `INV-SNAPK-START-ROOT-001`, `INV-SNAPK-START-LINEAGE-001`, `INV-SNAPK-START-POSITION-001`, `INV-SNAPK-START-ACTIVITY-001` | | idle | clean(c) | holder at HEAD's epoch (epoch, server and claim id); activity idle (clean(c) again is a replay) | clean.go `Head.BeginClean` | `INV-SNAPK-CLEAN-EXCL-001` | | clean(c) | idle | holder at HEAD's epoch (epoch, server and claim id); activity clean(c); over idle it succeeds without a write | clean.go `Head.EndClean` | `INV-SNAPK-CLEAN-EXCL-001` | -| clean(c) | clean(c), names removed | holder at HEAD's epoch, server and claim id with clean(c) open; candidate tags precede each HEAD validation; unreachable roots, then segments, then chunks; mark conditional on the planned tag, delete conditional on its own mark | remove.go `Cleaner.removePlanned` | `INV-SNAPK-REMOVE-MARK-001`, `INV-CLEAN-METADATA-001`, `INV-CLEAN-CURSOR-001` | +| clean(c) | clean(c), names removed | holder at HEAD's epoch, server and claim id with clean(c) open; candidate tags precede each HEAD validation; unreachable roots, then segments, then chunks; mark conditional on the planned tag (with the chunk guard on, also on unchanged chunk fids), delete conditional on its own mark | remove.go `Cleaner.removePlanned`; layout_store.go `changeMeta` | `INV-SNAPK-REMOVE-MARK-001`, `INV-CLEAN-METADATA-001`, `INV-CLEAN-CURSOR-001`, `INV-LAYOUT-META-CHUNKS-001` | | idle (live or detached) | deleting | the master reserved the volume for delete (no line granted after), then no line holds a live lease, checked between the HEAD read and the update; no open activity, no snapshot with dependents; deleting again is a replay | delete.go `Head.MarkDeleting`, `RunMarkDeleting` (`DeleteAuthority`) | `INV-SNAPK-DELETE-ORDER-001` | | absent | deleted (tombstone) | the operator's remove-dependent, for a restore target without HEAD (never created, or a restore died between its two creates); one exclusive create, so a later HEAD create of the restore fails; a HEAD appearing first refuses | delete.go `OperatorReleaseDependent` (`TargetStore.CreateDeletedHead`) | `INV-SNAPK-TOMBSTONE-001`, `INV-SNAPK-HEAD-WRITE-001` | | source: any live | source: target released | by the target's volume id, from every snapshot: from DeleteVolume once the target's HEAD is deleting, or from the operator's command once the target is deleted, of another id, no longer naming the source, or tombstoned; an absent target writes nothing | delete.go `Head.ReleaseDependent`, `RunReleaseDependent`, `OperatorReleaseDependent` | `INV-SNAPK-RELEASE-001`, `INV-SNAPK-RELEASE-CALLERS-001`, `INV-SNAPK-RELEASE-OPERATOR-001` | @@ -1098,7 +1099,7 @@ Notes: | `INV-WS-ONE-PROCESS-PER-HOST-001` | One host runs at most one live blockvolume per volume: each takes the volume's exclusive host lock before its store opens and holds it until the store closes; a second is refused before it opens anything, whatever its `--durable-root`. | M4 (start) → Attaching, Refused | `core/frontend/durable/provider.go` `DurableProvider.lockVolumeOnHost` | `TestOneLiveProcessPerVolumePerHost`, `TestHostVolumeLockDirectoryCreatedOrRefused`, `TestHostVolumeLockRefusesNonDirectoryLockPath`, `TestHostVolumeLockTakesReadOnlyLockFile` (`core/frontend/durable/one_process_per_volume_test.go`); `TestHostVolumeLockCreatesParent0755AndLocks0700`, `TestHostVolumeLockKeepsExistingDirectoryModes` (`core/frontend/durable/volume_lock_parent_mode_test.go`); `TestVolumeLockDirTestOnlyRefusedUnderSystemd` (`cmd/blockvolume/volume_lock_flag_test.go`) | — | ACTIVE | | `INV-CHUNK-LEASE-REQUIRED-001` | Blockvolume refuses walstore-chunk startup without --workspace-lease before any host or store is opened. The refusal names concurrent acknowledging writers and acknowledged-write loss after a forced move; plain walstore startup is unchanged. | M4 startup → Refused | `cmd/blockvolume/main.go` `parseFlags` | `TestChunkVolumeRequiresWorkspaceLeaseBeforeStart` | — | ACTIVE | | `INV-WS-CONDITIONAL-HEAD-001` | Catalog startup requires a wrong-generation conditional update of a disposable HEAD to be definitely refused and leave its bytes and generation unchanged. Unknown probe outcomes refuse admission; cleanup failures only warn with the leftover path. No volume HEAD is used. | M4 startup → Refused | `core/frontend/chunkstore/swfs_catalog.go` `DialBCatalog`; `startup_head_probe.go` `checkConditionalHead` | `TestCatalogStartupRequiresWrongGenerationHeadRefusal`, `TestConditionalHeadNextStartCleansCrashLeftovers`, `TestConditionalHeadSweepWaitsAndLeavesNewProbes`, `TestCatalogStartupDoesNotWaitForUndeletableProbe`, `TestLayoutIdentityWriterAndReaders` | — | ACTIVE | -| `INV-WS-CHUNK-CONDITION-PROBE-001` | Catalog startup turns the chunk guard on only if the filer definitely refuses a mismatched chunk-condition update of the disposable HEAD; any other answer leaves the page re-read as the only check. No version string is read; the startup log and /status/chunk name the guard. | M4 startup | `core/frontend/chunkstore/startup_head_probe.go` `probeChunkCondition`; `catalog_b.go` `Store`, `MetadataGuard`, `Usage` | `TestTheStartupProbeTurnsTheChunkGuardOnOnlyForAFilerThatEnforcesIt` (`core/frontend/chunkstore/startup_chunk_condition_probe_test.go`), `TestCatalogStartupRequiresWrongGenerationHeadRefusal` (`core/frontend/chunkstore/startup_head_probe_test.go`), `TestStatusServer_StatusChunkUsage` (`core/host/volume/status_chunk_test.go`) | MetaABA r2, checked outside the repository: guard on = `safe_chunks_equal`; the fallback is the re-read, which a chunk still queued for deletion defeats (`mut_reread_delayed`) | ACTIVE | +| `INV-WS-CHUNK-CONDITION-PROBE-001` | Catalog startup and sw-block metadata writers turn the chunk guard on only if the filer definitely refuses a mismatched chunk-condition update of a disposable HEAD; any other answer leaves the page re-read as the only check. No version string is read; the startup log and /status/chunk name it. | M4 startup | `core/frontend/chunkstore/startup_head_probe.go` `probeChunkCondition`, `ProbeChunkGuard`; `catalog_b.go` `Store`, `MetadataGuard`, `Usage`; `cmd/sw-block/chunk_b.go` `bCatalog` | `TestTheStartupProbeTurnsTheChunkGuardOnOnlyForAFilerThatEnforcesIt` (`core/frontend/chunkstore/startup_chunk_condition_probe_test.go`), `TestAFailedChunkGuardProbeLeavesTheGuardOff` (`core/frontend/chunkstore/chunk_guard_report_test.go`), `TestCatalogStartupRequiresWrongGenerationHeadRefusal` (`core/frontend/chunkstore/startup_head_probe_test.go`), `TestStatusServer_StatusChunkUsage` (`core/host/volume/status_chunk_test.go`), `TestOpsChunkWritingCatalogRunsTheChunkConditionProbe`, `TestOpsChunkWritingCatalogProbeIsBoundedByTheTimeout` (`cmd/sw-block/chunk_guard_probe_test.go`) | MetaABA r2, checked outside the repository: guard on = `safe_chunks_equal`; the fallback is the re-read, which a chunk still queued for deletion defeats (`mut_reread_delayed`) | ACTIVE | | `INV-WS-SINGLE-FILER-001` | Startup requires all configured masters to answer and agree on a leader; only that leader listing exactly the target filer and confirming leadership afterward admits. Followers' lists do not decide. Unknown views retry within 60 s. This census does not fence later filer registration. | M4 (startup) → Refused | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring`; `cmd/sw-block/chunk.go` `refuseUnlessSingleFiler` | `TestSingleFilerCensusUsesTheAgreedLeader`; `TestCheckSingleFilerRefusesAnotherOrSeveralFilers`, `TestCheckSingleFilerFailsClosed`, `TestCheckSingleFilerNeedsEveryMasterToAnswer`, `TestIsTargetComparesScopedAddresses`, `TestCheckSingleFilerPasses` (`core/frontend/chunkstore/single_filer_test.go`), `TestChunkWiringRefusesAMultiFilerGroup` (`cmd/blockvolume/single_filer_test.go`), `TestOpsChunk_WritingCommandsRunTheSingleFilerCheck` (`cmd/sw-block/chunk_start_check_test.go`), `TestOpsChunk_VerifyRunsTheSingleFilerCheck` (`cmd/sw-block/chunk_verify_test.go`) | — | ACTIVE | | `INV-CLI-SINGLE-FILER-CLIENT-001` | Chunk metadata commands refuse missing, typed-nil and non-SWFS clients before catalog access; only a live SWFS client can run the census. | M4 startup client admission | `cmd/sw-block/chunk.go` `checkSingleFiler`, `refuseUnlessSingleFiler` | `TestSingleFilerCheckRefusesUnsupportedClients`, `TestOpsChunkWritingRefusesUnsupportedFilerBeforeCatalogAccess` | — (client capability guard) | ACTIVE | | `INV-WS-LEASE-REGRANT-001` | Re-grant after expiry keeps the same holder and epoch, with no pending move or revocation, a certain store, and one durable write after the horizon/deadline plus skew barrier. Restart begins a new session and voids the old; ordinary reopen keeps HEAD identity (epoch, holder, claim) unchanged. | M2 Expired → Granted; M9 Start | `core/authority/workspace_lease_view.go` `regrantWorkspaceLease`; `core/authority/workspace.go` `forcedMoveBarrierLocked`; `core/frontend/chunkstore/layout/start.go` `Start` | `TestWorkspaceLeaseExpiredSameHolderRegrantIsDurable`, `TestWorkspaceLeaseRegrantWaitsForFullSkew`, `TestWorkspaceLeaseRegrantDefeatsAlreadyPassedForcedPreflight`, `TestWorkspaceLeaseForcedIssueDefeatsOldHolderRegrant`, `TestWorkspaceLeaseRegrantWaitsForDurabilityAndLatchesFailure` (`core/authority/workspace_regrant_test.go`); `TestWorkspaceLeaseRegrantPreservesLocalLogThroughFirstCut` (`core/authority/workspace_regrant_storage_test.go`); `TestStart_OwnEpochFreshRootRefusedBeforeClaim`, `TestStart_OwnEpochSameRootContinues` (`core/frontend/chunkstore/layout/start_test.go`); `TestClaim_WritesItsClaimID`, `TestRunClaim_VoidsTheOldSession` (`core/frontend/chunkstore/layout/claim_test.go`); `TestLocalReopenClaimsBeforeServing` (`core/frontend/durable/provider_reopen_belt_test.go`) | `WorkspaceRegrant` `NoDualServingInc`, `RegrantNoLoss`, `DiskCoversMemory`; `INV-SNAPK-START-ROOT-001` | ACTIVE | @@ -1552,7 +1553,7 @@ Notes: | `INV-SNAPSHOT-DELETE-CONSUME-001` | Only current persisted delete intent authorizes offline reclamation; live roots remain protected, failed effects retain the cursor, and receipt retirement cannot erase work. | M9 idle intent continuation | `core/frontend/chunkstore/layout/delete_intent.go` `RunConsumeSnapshotDeleteIntent`; `core/frontend/chunkstore/layout/remove.go` `Cleaner.removePlanned`; `core/frontend/chunkstore/layout_remote.go` `LayoutRemote.Clean` | `TestConsumeSnapshotDeleteIntent_Closure`, `TestDeleteIntentOfflineAndReplacementPreserved`, `TestDeleteIntentMarkConflictKeepsUnfinishedPage`, `TestLayoutSnapshotDeleteIntentResumesWithoutReceipt`, `TestCatalogDeleteIntentResumesOnePageWithoutNamespaceScan`, `TestCatalogIntentCursorInterruptAndLostReply`, `TestHolderMaintenanceResumesThePersistedDeleteIntent`, `TestHolderMaintenanceIntentIsCancelledBeforeTheCutJoins` | PageChain r2 246,251-253 (az1 13/13); StaleClean 159-161 | ACTIVE | | `INV-SNAPSHOT-DELETE-ADOPT-001` | Publication adopts every intent page with a fresh CAS-base tag and checks it is present, this attempt's and unmarked; stale cleaners/adopters cannot remove or retag a published page, and staging never restores old tags. | M9 delete intent publication | `delete_intent.go` `adoptDeleteIntentPage`, `RunDeleteSnapshotWithIntent`, `StageSnapshotDeletePage` | `TestDeleteIntentRefreshedBaseFencesDelayedCleanerMark`, `TestDeleteIntentRefreshedBaseFencesDelayedCleanerDelete`, `TestDeleteIntentAdoptionCannotRestoreStaleTags`, `TestDeleteIntentStagingNeverRevertsPublishedTags`, `TestDeleteIntentPublicationChecksAdoptedPageMetadata`, `TestGenericIntentStagingCannotUndoRefreshedPublication` | StaleClean 159-161; exact-head refinement read required | DORMANT | | `INV-SNAPSHOT-DELETE-ADOPT-002` | After adopting an intent page under its own tag, publication reads the page again and authenticates it; a page that no longer reads or holds other bytes refuses the publication. The filer frees chunks from a deletion queue, so a reference whose chunk is still queued reads intact and publishes. | M9 delete intent publication | `delete_intent.go` `RunDeleteSnapshotWithIntent`, `readListPage` | `TestASnapshotDeleteIsNotPublishedOverAPageWhoseDataWasFreed` (`core/frontend/chunkstore/layout/delete_intent_reread_test.go`); store witness `TestWithoutTheChunkGuardAStaleMetadataChangeOverwritesARecreatedObject` (`core/frontend/chunkstore/layout_change_meta_recreated_test.go`) | MetaABA r2, checked outside the repository: the re-read alone does not hold `PublishedReadable` once the filer frees chunks later from a queue (`mut_reread_delayed`); with the chunk guard it holds (`safe_chunks_equal`). r1's `safe_reread_only` held only for immediate frees (historical scope) | ACTIVE | -| `INV-LAYOUT-META-CHUNKS-001` | With the chunk guard on, an adoption or mark writes its looked-up entry back only while the entry's chunk fids are unchanged, so it cannot land on an object deleted and created again since its lookup; a cleaner's delete expects its own mark, so it follows. | M9 delete intent publication | `core/frontend/chunkstore/layout_store.go` `changeMeta`; `swfs.go` `UpdateEntryIfChunks` | `TestAStaleMetadataChangeDoesNotOverwriteARecreatedObject`, `TestAStaleCleanerMarkDoesNotDeleteARecreatedObject`, `TestWithTheChunkGuardAnUnchangedObjectIsStillAdoptedMarkedAndDeleted` (`core/frontend/chunkstore/layout_change_meta_recreated_test.go`) | MetaABA r2, checked outside the repository: `PublishedReadable` (`safe_chunks_equal`, `safe_legacy_chunks_equal`) | ACTIVE | +| `INV-LAYOUT-META-CHUNKS-001` | With the chunk guard on, an adoption or mark writes its looked-up entry back only while the entry's chunk fids are unchanged, so it cannot land on an object deleted and created again since its lookup; a cleaner's delete expects its own mark, so it follows. | M9 delete intent publication; M9 clean(c) removal | `core/frontend/chunkstore/layout_store.go` `changeMeta`, `chunkCondition`; `swfs.go` `UpdateEntryIfChunks` | `TestAStaleMetadataChangeDoesNotOverwriteARecreatedObject`, `TestAStaleCleanerMarkDoesNotDeleteARecreatedObject`, `TestWithTheChunkGuardAnUnchangedObjectIsStillAdoptedMarkedAndDeleted` (`core/frontend/chunkstore/layout_change_meta_recreated_test.go`); `TestChunkGuardReportsOnlyAConditionTheFilerCanCarry` (`core/frontend/chunkstore/chunk_guard_report_test.go`); `TestOpsChunkStaleCLIAdoptionDoesNotOverwriteARecreatedObject` (`cmd/sw-block/chunk_guard_probe_test.go`) | MetaABA r2, checked outside the repository: `PublishedReadable` (`safe_chunks_equal`, `safe_legacy_chunks_equal`) | ACTIVE | The snapshot-delete consumer and list-page retirement above are reachable through holder maintenance and covered by Go assertions. Their ACTIVE status describes that reachability and test coverage, not fresh Linux, composed-operation or release qualification. Cut and upload-intent producers remain deferred; their dormant publication rows are not activated by this consumer slice. diff --git a/seaweed-block/docs/status-schema.md b/seaweed-block/docs/status-schema.md index 68624489d6..c292c87be4 100644 --- a/seaweed-block/docs/status-schema.md +++ b/seaweed-block/docs/status-schema.md @@ -468,7 +468,7 @@ Chunk store usage of a walstore-chunk volume (only with --chunk-control-endpoint | `dependents` | int | — | | `own_chunks` | int | — | | `foreign_chunks` | int | — | -| `metadata_guard` | string | MetadataGuard names the protection of the volume's metadata changes: filer_chunk_condition (the startup probe saw the filer enforce the chunk condition) or page_reread_only (enforcement was not established at startup; delete intent pages are re-read). | +| `metadata_guard` | string | MetadataGuard names the protection of the volume's metadata changes: filer_chunk_condition (the startup probe saw the filer enforce the chunk condition) or page_reread_only (enforcement was not established at startup; delete intent pages are re-read). Absent when the catalog ran no probe. (omitted when empty) | ### `GET /status/nvme` diff --git a/seaweed-block/docs/time-bounds.tsv b/seaweed-block/docs/time-bounds.tsv index f6bf33e297..d85228656c 100644 --- a/seaweed-block/docs/time-bounds.tsv +++ b/seaweed-block/docs/time-bounds.tsv @@ -40,6 +40,7 @@ cmd/sw-block/chunk.go refuseUnlessSingleFilerWithin context.WithTimeoutCause 1 p cmd/sw-block/chunk.go chunkPost time.Now().Add 1 pending-fix CutTime.Poll remaining snapshot/detach HTTP waiter bound; fix #979 (manual cuts use chunkObserveCut) cmd/sw-block/chunk.go chunkPostUntil context.WithDeadline 1 pending-fix CutTime.Poll remaining snapshot/detach HTTP waiter bound; fix #979 (manual cuts use chunkObserveCut) cmd/sw-block/chunk.go chunkSnapshot time.Now().Add 1 control-timer CutTime.Poll snapshot expiry: a timestamp (validity, expiry or due time), not a wait +cmd/sw-block/chunk_b.go bCatalog context.WithTimeout 1 per-call NONE: no model row maps this file yet the chunk condition probe of a writing command (operator --timeout; the probe's own 10 s and cleanup 5 s still apply) cmd/sw-block/chunk_b.go volumeFlags.ref context.WithTimeout 1 per-call NONE: no model row maps this file yet one CLI request (operator --timeout) cmd/sw-block/chunk_b.go bCommand.run context.WithTimeout 1 pending-fix NONE: no model row maps this file yet unmeasured: applies each catalog command's own budget (its newBCommand row); open while snapshot delete and retain are unmeasured cmd/sw-block/chunk_b.go chunkSnapshots newBCommand 1 per-call NONE: no model row maps this file yet lists one volume's snapshot names from one HEAD read (30 s)