From a36aed796fc0ee436efbd29bea0d2bb7820c66c3 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 25 Jun 2026 01:45:43 -0700 Subject: [PATCH] phase66: add caught-up publication preflight --- ...ckreplicarebuilds.block.seaweedfs.com.yaml | 9 ++ .../core/ops/authority_executor_controller.go | 10 ++ .../ops/authority_executor_controller_test.go | 14 +- .../core/ops/kubernetes_crd_manifests_test.go | 9 ++ .../core/ops/kubernetes_status_writer_test.go | 8 +- .../core/ops/operator_status_controller.go | 3 + seaweed-block/internal/docs/current-plan.md | 136 ++++++++---------- ...hedplan_caught_up_publication_preflight.md | 109 ++++++++++++++ .../internal/docs/product-roadmap.md | 42 +++--- ...ght-up-publication-preflight-qa-signoff.md | 87 +++++++++++ ...66-caught-up-publication-preflight-gate.sh | 58 ++++++++ ...caught-up-publication-preflight-chain.yaml | 72 ++++++++++ 12 files changed, 458 insertions(+), 99 deletions(-) create mode 100644 seaweed-block/internal/docs/finished-plans/phase66_finishedplan_caught_up_publication_preflight.md create mode 100644 seaweed-block/internal/docs/qa-assignments/phase66-caught-up-publication-preflight-qa-signoff.md create mode 100644 seaweed-block/scripts/run-phase66-caught-up-publication-preflight-gate.sh create mode 100644 seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml diff --git a/seaweed-block/charts/seaweed-block/crds/swblockreplicarebuilds.block.seaweedfs.com.yaml b/seaweed-block/charts/seaweed-block/crds/swblockreplicarebuilds.block.seaweedfs.com.yaml index 543378fb43..4f4f45d928 100644 --- a/seaweed-block/charts/seaweed-block/crds/swblockreplicarebuilds.block.seaweedfs.com.yaml +++ b/seaweed-block/charts/seaweed-block/crds/swblockreplicarebuilds.block.seaweedfs.com.yaml @@ -124,6 +124,15 @@ spec: type: boolean rebuildTrafficStarted: type: boolean + publicationDecision: + type: string + enum: + - blocked + - disabled + publicationReason: + type: string + publicationMutationAllowed: + type: boolean noFrontendPublication: type: boolean noCrossVolumeIdentityChange: diff --git a/seaweed-block/core/ops/authority_executor_controller.go b/seaweed-block/core/ops/authority_executor_controller.go index 8a97390abc..aaff01cf26 100644 --- a/seaweed-block/core/ops/authority_executor_controller.go +++ b/seaweed-block/core/ops/authority_executor_controller.go @@ -19,6 +19,10 @@ const ( AuthorityExecutorReasonRebuildCaughtUp = "rebuild_runtime_caught_up" AuthorityExecutorReasonRebuildRuntimeFailed = "rebuild_runtime_failed" AuthorityExecutorReasonRebuildRuntimeTargetMissing = "rebuild_runtime_target_missing" + AuthorityExecutorPublicationDecisionBlocked = "blocked" + AuthorityExecutorPublicationDecisionDisabled = "disabled" + AuthorityExecutorPublicationReasonCaughtUpRequired = "rebuild_caught_up_required" + AuthorityExecutorPublicationReasonPolicyDisabled = "publication_policy_disabled" ) type AuthorityExecutorClient interface { @@ -410,6 +414,9 @@ func authorityExecutorRebuildPlannedStatus(now time.Time, volume SwBlockVolumeOb RequiredFrontierLSN: returned.RequiredFrontierLSN, DurableFrontierCaughtUp: returned.DurableFrontierKnown && returned.RequiredFrontierKnown && returned.DurableFrontierLSN >= returned.RequiredFrontierLSN, RebuildTrafficStarted: false, + PublicationDecision: AuthorityExecutorPublicationDecisionBlocked, + PublicationReason: AuthorityExecutorPublicationReasonCaughtUpRequired, + PublicationMutationAllowed: false, NoFrontendPublication: true, NoCrossVolumeIdentityChange: true, Conditions: []ObservationCondition{{ @@ -468,6 +475,9 @@ func authorityExecutorRebuildCaughtUpStatus(now time.Time, volume SwBlockVolumeO RequiredFrontierLSN: returned.RequiredFrontierLSN, DurableFrontierCaughtUp: runtimeResult.DurableFrontierKnown && returned.RequiredFrontierKnown && runtimeResult.DurableFrontierLSN >= returned.RequiredFrontierLSN, RebuildTrafficStarted: true, + PublicationDecision: AuthorityExecutorPublicationDecisionDisabled, + PublicationReason: AuthorityExecutorPublicationReasonPolicyDisabled, + PublicationMutationAllowed: false, NoFrontendPublication: true, NoCrossVolumeIdentityChange: true, Conditions: []ObservationCondition{{ diff --git a/seaweed-block/core/ops/authority_executor_controller_test.go b/seaweed-block/core/ops/authority_executor_controller_test.go index ce8cb47e94..f1007e0630 100644 --- a/seaweed-block/core/ops/authority_executor_controller_test.go +++ b/seaweed-block/core/ops/authority_executor_controller_test.go @@ -235,7 +235,10 @@ func TestAuthorityExecutorReconcilerExecutesRebuildRuntimeAndWritesCaughtUpStatu if running.State != "running" || running.ReasonCode != AuthorityExecutorReasonRebuildRunning || !running.RebuildTrafficStarted || - running.DurableFrontierCaughtUp { + running.DurableFrontierCaughtUp || + running.PublicationDecision != AuthorityExecutorPublicationDecisionBlocked || + running.PublicationReason != AuthorityExecutorPublicationReasonCaughtUpRequired || + running.PublicationMutationAllowed { t.Fatalf("running status=%+v", running) } caughtUp := client.rebuildWrites[1].status @@ -244,6 +247,9 @@ func TestAuthorityExecutorReconcilerExecutesRebuildRuntimeAndWritesCaughtUpStatu !caughtUp.RebuildTrafficStarted || !caughtUp.DurableFrontierCaughtUp || caughtUp.DurableFrontierLSN != 52 || + caughtUp.PublicationDecision != AuthorityExecutorPublicationDecisionDisabled || + caughtUp.PublicationReason != AuthorityExecutorPublicationReasonPolicyDisabled || + caughtUp.PublicationMutationAllowed || !caughtUp.NoFrontendPublication || !caughtUp.NoCrossVolumeIdentityChange || !authorityExecutorStringSliceContains(caughtUp.EvidenceRefs, "runtime-terminal-evidence.txt") { @@ -285,7 +291,9 @@ func TestAuthorityExecutorReconcilerKeepsRunningWhenRuntimeOnlyStarts(t *testing if running.State != "running" || running.ReasonCode != AuthorityExecutorReasonRebuildRunning || !running.RebuildTrafficStarted || - running.DurableFrontierCaughtUp { + running.DurableFrontierCaughtUp || + running.PublicationDecision != AuthorityExecutorPublicationDecisionBlocked || + running.PublicationMutationAllowed { t.Fatalf("running status=%+v", running) } } @@ -341,6 +349,8 @@ func TestAuthorityExecutorReconcilerTransitionsFromStartedToCaughtUpOnTerminalRu caughtUp.ReasonCode != AuthorityExecutorReasonRebuildCaughtUp || !caughtUp.DurableFrontierCaughtUp || caughtUp.DurableFrontierLSN != 52 || + caughtUp.PublicationDecision != AuthorityExecutorPublicationDecisionDisabled || + caughtUp.PublicationMutationAllowed || !authorityExecutorStringSliceContains(caughtUp.EvidenceRefs, "blockvolume-runtime-caught-up.txt") { t.Fatalf("caught_up status=%+v", caughtUp) } diff --git a/seaweed-block/core/ops/kubernetes_crd_manifests_test.go b/seaweed-block/core/ops/kubernetes_crd_manifests_test.go index bb622dc07f..ace537d759 100644 --- a/seaweed-block/core/ops/kubernetes_crd_manifests_test.go +++ b/seaweed-block/core/ops/kubernetes_crd_manifests_test.go @@ -382,6 +382,9 @@ func TestPhase57D1SwBlockReplicaRebuildTargetSchema(t *testing.T) { "requiredFrontierLsn", "durableFrontierCaughtUp", "rebuildTrafficStarted", + "publicationDecision", + "publicationReason", + "publicationMutationAllowed", "noFrontendPublication", "noCrossVolumeIdentityChange", "evidenceGeneration", @@ -399,6 +402,12 @@ func TestPhase57D1SwBlockReplicaRebuildTargetSchema(t *testing.T) { t.Fatalf("%s.status.state enum missing %s: %+v", SwBlockReplicaRebuildKind, want, stateEnum) } } + publicationDecisionEnum := yamlStringSet(t, yamlMap(t, statusProperties, "publicationDecision"), "enum") + for _, want := range []string{"blocked", "disabled"} { + if !publicationDecisionEnum[want] { + t.Fatalf("%s.status.publicationDecision enum missing %s: %+v", SwBlockReplicaRebuildKind, want, publicationDecisionEnum) + } + } for _, forbidden := range []string{ "runtime_endpoint", "target_data_addr", diff --git a/seaweed-block/core/ops/kubernetes_status_writer_test.go b/seaweed-block/core/ops/kubernetes_status_writer_test.go index 8a1f0421a3..4e390d8659 100644 --- a/seaweed-block/core/ops/kubernetes_status_writer_test.go +++ b/seaweed-block/core/ops/kubernetes_status_writer_test.go @@ -164,6 +164,9 @@ func TestKubernetesStatusClientPatchesOnlyStatusSubresources(t *testing.T) { RequiredFrontierLSN: 52, DurableFrontierCaughtUp: false, RebuildTrafficStarted: false, + PublicationDecision: AuthorityExecutorPublicationDecisionBlocked, + PublicationReason: AuthorityExecutorPublicationReasonCaughtUpRequired, + PublicationMutationAllowed: false, NoFrontendPublication: true, NoCrossVolumeIdentityChange: true, EvidenceGeneration: "executor-run-2", @@ -294,6 +297,9 @@ func TestKubernetesStatusClientPatchesOnlyStatusSubresources(t *testing.T) { "requiredFrontierLsn", "durableFrontierCaughtUp", "rebuildTrafficStarted", + "publicationDecision", + "publicationReason", + "publicationMutationAllowed", "noFrontendPublication", "noCrossVolumeIdentityChange", "evidenceGeneration", @@ -302,7 +308,7 @@ func TestKubernetesStatusClientPatchesOnlyStatusSubresources(t *testing.T) { t.Fatalf("replica rebuild status missing camelCase %s: %+v", want, replicaRebuildStatus) } } - for _, forbidden := range []string{"frontend_fenced_before_rebuild", "durable_frontier_lsn", "rebuild_traffic_started", "spec"} { + for _, forbidden := range []string{"frontend_fenced_before_rebuild", "durable_frontier_lsn", "rebuild_traffic_started", "publication_decision", "publication_mutation_allowed", "spec"} { if _, ok := replicaRebuildStatus[forbidden]; ok { t.Fatalf("replica rebuild status leaked %s: %+v", forbidden, replicaRebuildStatus) } diff --git a/seaweed-block/core/ops/operator_status_controller.go b/seaweed-block/core/ops/operator_status_controller.go index 6b7c2ba05a..6e936ba34c 100644 --- a/seaweed-block/core/ops/operator_status_controller.go +++ b/seaweed-block/core/ops/operator_status_controller.go @@ -395,6 +395,9 @@ type SwBlockReplicaRebuildCRDStatus struct { RequiredFrontierLSN uint64 `json:"requiredFrontierLsn,omitempty"` DurableFrontierCaughtUp bool `json:"durableFrontierCaughtUp"` RebuildTrafficStarted bool `json:"rebuildTrafficStarted"` + PublicationDecision string `json:"publicationDecision,omitempty"` + PublicationReason string `json:"publicationReason,omitempty"` + PublicationMutationAllowed bool `json:"publicationMutationAllowed"` NoFrontendPublication bool `json:"noFrontendPublication"` NoCrossVolumeIdentityChange bool `json:"noCrossVolumeIdentityChange"` EvidenceGeneration string `json:"evidenceGeneration,omitempty"` diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 02b17ff389..fa2b1f1544 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,135 +1,108 @@ -# Current Plan: Phase 65 Runtime Terminal Evidence +# Current Plan: Phase 66 Caught-up Publication Preflight Status: complete. ## Goal -Phase 64 added the opt-in blockvolume runtime endpoint, but it deliberately -returned only: +Phase 65 proved runtime rebuild/catch-up can reach terminal caught-up evidence. +Phase 66 consumes that evidence without enabling publication. + +The product now exposes the next operation decision on +`SwBlockReplicaRebuild.status`: ```text -runtimeState=started -durableFrontierKnown=false +not caught_up -> publicationDecision=blocked +caught_up -> publicationDecision=disabled ``` -Phase 65 closes the next required gap: terminal runtime evidence. A runtime -session that was started by the blockvolume endpoint can now later report its -terminal durable frontier back through the same runtime HTTP contract. - -The rule is: - -```text -started -> running -> terminal session close -> caught_up -``` - -No frontend publication, failback, ACK eligibility mutation, or NVMe claim is -added. +`disabled` means the precondition is satisfied but the policy for publication +mutation remains off. This keeps the control model honest: caught-up is +necessary, but not sufficient, for ACK eligibility, frontend publication, or +failback. ## Delivered -### D1: Transport Session Terminal Status +### D1: Publication Decision Surface -`BlockExecutor` now records terminal session results from the existing -`finishSession` / recovery close path: +`SwBlockReplicaRebuild.status` now includes: ```text -state=caught_up -achievedLSN= +publicationDecision +publicationReason +publicationMutationAllowed ``` -Failures are recorded as: +The CRD schema locks the allowed decision values: ```text -state=failed -failureKind= -failReason= +blocked +disabled ``` -This is runtime-owned evidence, not a status-surface guess. +### D2: Status Semantics -### D2: Replication Runtime Status Query - -`ReplicationVolume.RuntimeRecoveryStatus` validates the same replica identity, -target address, epoch, and endpoint-version facts used by -`StartRuntimeRecovery`, then reads the executor's session status. - -### D3: HTTP Runtime Terminal Response - -`POST /runtime/rebuild` is now idempotent for the same session: +Rebuild states project publication readiness as: ```text -unknown -> start runtime recovery -> runtimeState=started -running -> runtimeState=started -caught_up -> runtimeState=caught_up, durableFrontierKnown=true -failed -> HTTP 409 +planned/running/blocked: + publicationDecision=blocked + publicationReason=rebuild_caught_up_required + publicationMutationAllowed=false + +caught_up: + publicationDecision=disabled + publicationReason=publication_policy_disabled + publicationMutationAllowed=false ``` -Terminal caught-up responses do not restart recovery traffic. - -### D4: Authority Executor Transition - -The authority executor already understood terminal runtime results. Phase 65 -adds the regression that two reconciles over the same target transition: - -```text -runtimeState=started -> SwBlockReplicaRebuild.status.state=running -runtimeState=caught_up + durableFrontierLsn -> state=caught_up -``` - -### D5: Gate +### D3: Gate Gate files: ```text -scripts/run-phase65-runtime-terminal-evidence-gate.sh -testops/scenarios/runtime-terminal-evidence-chain.yaml +scripts/run-phase66-caught-up-publication-preflight-gate.sh +testops/scenarios/caught-up-publication-preflight-chain.yaml ``` +The gate proves schema, Kubernetes writer casing, blocked-before-caught-up, and +disabled-after-caught-up behavior. + ## Non-Claims -Phase 65 does not claim: +Phase 66 does not claim: ```text +ACK eligibility mutation frontend publication failback -ACK eligibility mutation automatic publish target change NVMe/ANA behavior ``` -The rebuild target can become `caught_up`, but publication/failback must remain -a later gated decision. - ## Verification Local: ```text -go test ./core/transport ./core/replication ./core/host/volume ./core/ops ./cmd/blockvolume -C:\work\swblock.exe validate testops\scenarios\runtime-terminal-evidence-chain.yaml +go test ./core/ops ./core/transport ./core/replication ./core/host/volume ./cmd/blockvolume +C:\work\swblock.exe validate testops\scenarios\caught-up-publication-preflight-chain.yaml ``` Live: ```text -20260625-013718-69c8 runtime-terminal-evidence-chain PASS 14/14 +20260625-014356-978b caught-up-publication-preflight-chain PASS 12/12 ``` Terminal evidence: ```text -phase65_runtime_terminal_evidence_status=ok -transport_records_caught_up_session=true -replication_reports_terminal_frontier=true -runtime_endpoint_returns_caught_up_without_restart=true -runtime_endpoint_still_starts_unknown_session=true -authority_executor_started_then_caught_up=true -runtime_terminal_status_recorded=true -runtime_terminal_frontier_reported=true -runtime_endpoint_terminal_caught_up=true -runtime_endpoint_terminal_does_not_restart=true -authority_executor_running_to_caught_up=true -runtime_start_without_terminal_still_running=true +phase66_caught_up_publication_preflight_status=ok +publication_decision_schema_locked=true +publication_decision_camel_case=true +publication_blocked_until_caught_up=true +publication_disabled_after_caught_up=true +publication_mutation_allowed=false frontend_publication_allowed=false failback_allowed=false ack_eligibility_mutation_allowed=false @@ -137,7 +110,12 @@ ack_eligibility_mutation_allowed=false ## Next -Phase 66 should decide the next bounded operation step. The clean next step is -not NVMe yet; it is to consume `caught_up` as a precondition for a still-bounded -publication decision, while keeping failback/frontend mutation disabled until a -separate admission/RBAC/evidence gate exists. +Phase 67 can either: + +```text +1. add the first bounded ACK-eligibility publication mutation, with admission/RBAC/evidence gates; or +2. stop the returned-replica executor line here and start NVMe ANA using the same status/action model. +``` + +If continuing operations, do not jump directly to frontend/failback. ACK +eligibility is the narrowest next mutation. diff --git a/seaweed-block/internal/docs/finished-plans/phase66_finishedplan_caught_up_publication_preflight.md b/seaweed-block/internal/docs/finished-plans/phase66_finishedplan_caught_up_publication_preflight.md new file mode 100644 index 0000000000..2c9d64904e --- /dev/null +++ b/seaweed-block/internal/docs/finished-plans/phase66_finishedplan_caught_up_publication_preflight.md @@ -0,0 +1,109 @@ +# Phase 66 Finished Plan: Caught-up Publication Preflight + +Status: complete. + +QA: PASS. + +## Goal + +Phase 66 consumes Phase 65 terminal caught-up evidence as a precondition for a +future publication decision, without performing publication. + +## Delivered + +Code and schema: + +```text +core/ops/authority_executor_controller.go +core/ops/operator_status_controller.go +charts/seaweed-block/crds/swblockreplicarebuilds.block.seaweedfs.com.yaml +``` + +Gate: + +```text +scripts/run-phase66-caught-up-publication-preflight-gate.sh +testops/scenarios/caught-up-publication-preflight-chain.yaml +``` + +Docs: + +```text +internal/docs/current-plan.md +internal/docs/qa-assignments/phase66-caught-up-publication-preflight-qa-signoff.md +internal/docs/product-roadmap.md +``` + +## Behavior + +`SwBlockReplicaRebuild.status` now carries: + +```text +publicationDecision +publicationReason +publicationMutationAllowed +``` + +States: + +```text +running/planned/blocked: + publicationDecision=blocked + publicationReason=rebuild_caught_up_required + +caught_up: + publicationDecision=disabled + publicationReason=publication_policy_disabled +``` + +In all cases: + +```text +publicationMutationAllowed=false +``` + +## Non-Claims + +Phase 66 does not claim: + +```text +ACK eligibility mutation +frontend publication +failback +NVMe/ANA behavior +``` + +## Verification + +Local: + +```text +go test ./core/ops ./core/transport ./core/replication ./core/host/volume ./cmd/blockvolume +C:\work\swblock.exe validate testops\scenarios\caught-up-publication-preflight-chain.yaml +``` + +Live: + +```text +20260625-014356-978b caught-up-publication-preflight-chain PASS 12/12 +``` + +Terminal evidence: + +```text +phase66_caught_up_publication_preflight_status=ok +publication_decision_schema_locked=true +publication_decision_camel_case=true +publication_blocked_until_caught_up=true +publication_disabled_after_caught_up=true +publication_mutation_allowed=false +frontend_publication_allowed=false +failback_allowed=false +ack_eligibility_mutation_allowed=false +``` + +## Next + +The narrow next operation mutation is ACK eligibility publication, not frontend +publication or failback. If the team wants to stop Operation work here, NVMe ANA +can start next using the same status/action/evidence model. diff --git a/seaweed-block/internal/docs/product-roadmap.md b/seaweed-block/internal/docs/product-roadmap.md index 961b5d70e3..83d86bcaab 100644 --- a/seaweed-block/internal/docs/product-roadmap.md +++ b/seaweed-block/internal/docs/product-roadmap.md @@ -59,11 +59,12 @@ This is the short internal roadmap. Keep it current and readable. lifecycle. - Current development slice: returned-replica rebuild/reintegration runtime productization has advanced through Phase 64. Phases 46-54 made returned - replicas visible and action-gated, Phases 60-65 connected the bounded + replicas visible and action-gated, Phases 60-66 connected the bounded rebuild/catch-up runtime path through target facts, executor HTTP transport, an opt-in blockvolume runtime start endpoint, and terminal caught-up evidence. - Do not claim frontend publication, failback, backup/restore, or NVMe parity - yet. + Phase 66 adds the disabled publication-decision surface after caught-up. Do + not claim ACK eligibility mutation, frontend publication, failback, + backup/restore, or NVMe parity yet. - Model hardening gate before the next large release: complete the ManagedVolume Operations Model under `internal/docs/protocol/` before expanding operator or broader HA claims. The goal is to prevent Kubernetes, @@ -195,9 +196,10 @@ rebuild, delete safety, or cleanup must start as a separate gated phase. transport. Phase 63 schema-locked runtime target facts. Phase 64 added an opt-in blockvolume runtime endpoint that starts local rebuild/catch-up only after primary and lineage/session validation. Phase 65 adds terminal runtime - evidence: `started -> running -> durable frontier -> caught_up`. The - remaining gap is consuming caught-up as a precondition for a separately gated - publication/failback decision. + evidence: `started -> running -> durable frontier -> caught_up`. Phase 66 + consumes caught-up as a disabled publication preflight. The remaining gap is + an explicitly bounded ACK eligibility publication mutation, if the team + chooses to continue this operation line before NVMe. - Later: returned-replica frontend publication/failback execution, NVMe ANA Kubernetes multipath parity, stronger committed-frontier reporting, broad distro/host compatibility, and longer soak under failure. NVMe ANA parity @@ -582,14 +584,15 @@ product risk. The recommended order is: The live iSCSI returned-replica gate emits same-run managed-volume evidence for required frontier coverage and replay it through report/status surfaces before any mutating returned-replica executor is proposed. -12. **Phase 60-65: rebuild runtime path.** Closed through runtime caught-up. +12. **Phase 60-66: rebuild runtime path.** Closed through caught-up publication preflight. Phase 60 proved the existing datapath, Phase 61 added the executor call-site, Phase 62 added HTTP runtime transport, Phase 63 locked runtime target facts, Phase 64 added the opt-in blockvolume endpoint that starts recovery after - primary/lineage validation, and Phase 65 added terminal durable-frontier - evidence. The remaining pre-NVMe gap is publication decision safety: caught-up - must be consumed through a separate fact/judgment/action/evidence gate before - frontend publication or failback can be claimed. + primary/lineage validation, Phase 65 added terminal durable-frontier + evidence, and Phase 66 surfaces caught-up as publication preflight while + keeping mutation disabled. The remaining operation gap before NVMe is an + ACK-eligibility publication mutation with separate admission/RBAC/evidence, + if the team chooses to continue. 13. **Backup/snapshot/restore and NVMe ANA parity.** Important, but they should reuse the status/action model rather than create another isolated control plane. @@ -609,9 +612,10 @@ Approximate engineering effort if scope remains tight: API/admission proof that only finalizers can be patched. - Productized returned-replica rebuild/reintegration/failback: high. Phase 46 closed the status/decision slice: returned replicas are visible, fenced, and - volume-scoped across product surfaces. Phases 47-65 have advanced from - dry-run admission to bounded runtime start plus terminal completion evidence, - but frontend publication and failback remain separate gated work. + volume-scoped across product surfaces. Phases 47-66 have advanced from + dry-run admission to bounded runtime start, terminal completion evidence, and + disabled publication preflight. ACK eligibility mutation, frontend + publication, and failback remain separate gated work. - Backup/snapshot/restore: high. Requires durable data semantics and user-facing restore guarantees. - NVMe ANA parity: medium/high. Protocol-specific work, but cheaper if it uses @@ -685,9 +689,13 @@ Approximate engineering effort if scope remains tight: session status, the blockvolume endpoint returns `runtimeState=caught_up` with durable frontier evidence without restarting traffic, and the authority executor transitions `running -> caught_up`. -- Phase 66 should use caught-up as a precondition for a bounded publication - decision while keeping ACK eligibility, frontend publication, failback, and - NVMe behind separate explicit gates until proven. +- Phase 66 Caught-up Publication Preflight is closed. `SwBlockReplicaRebuild` + status now exposes `publicationDecision` / `publicationReason` / + `publicationMutationAllowed`, with publication blocked until caught-up and + disabled after caught-up. +- Phase 67 can either add the first bounded ACK eligibility publication + mutation with admission/RBAC/evidence gates, or stop this operation line and + start NVMe ANA using the same status/action/evidence model. - Phase 41-44 are the Operation Layer v0.5 release train: lifecycle-owner foundation, real API/admission proof, first bounded finalizer mutation, and delete lifecycle close gate. diff --git a/seaweed-block/internal/docs/qa-assignments/phase66-caught-up-publication-preflight-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase66-caught-up-publication-preflight-qa-signoff.md new file mode 100644 index 0000000000..e3d05cd290 --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase66-caught-up-publication-preflight-qa-signoff.md @@ -0,0 +1,87 @@ +# Phase 66 Caught-up Publication Preflight QA Sign-off + +Status: PASS. + +Source branch: `phase54-returned-replica-reintegration-executor` + +QA run: + +```text +20260625-014356-978b caught-up-publication-preflight-chain PASS 12/12 +``` + +## Scope + +Phase 66 exposes the publication decision after rebuild caught-up evidence, but +keeps publication mutation disabled. It is the control-plane precondition +surface before any ACK eligibility or frontend publication mutation. + +## Required Evidence + +The gate must prove: + +```text +phase66_caught_up_publication_preflight_status=ok +publication_decision_schema_locked=true +publication_decision_camel_case=true +publication_blocked_until_caught_up=true +publication_disabled_after_caught_up=true +publication_mutation_allowed=false +frontend_publication_allowed=false +failback_allowed=false +ack_eligibility_mutation_allowed=false +``` + +## Terminal Evidence + +From: + +```text +results/20260625-014356-978b/artifacts/remote-phases.tgz +``` + +Summary: + +```text +phase66_caught_up_publication_preflight_status=running +phase66_scope=caught_up_publication_decision_surface +frontend_publication_allowed=false +failback_allowed=false +ack_eligibility_mutation_allowed=false +core_ops_publication_preflight_tests=pass +rebuild_status_schema_has_publication_fields=true +kubernetes_writer_serializes_publication_fields=true +running_requires_caught_up_before_publication=true +caught_up_publication_policy_disabled=true +terminal_transition_publication_policy_disabled=true +publication_decision_schema_locked=true +publication_decision_camel_case=true +publication_blocked_until_caught_up=true +publication_disabled_after_caught_up=true +publication_mutation_allowed=false +phase66_caught_up_publication_preflight_status=ok +``` + +## Result Matrix + +| Gate | Result | Evidence | +| --- | --- | --- | +| CRD schema | PASS | `publication_decision_schema_locked=true` | +| Kubernetes writer casing | PASS | `publication_decision_camel_case=true` | +| Before caught-up | PASS | `publication_blocked_until_caught_up=true` | +| After caught-up | PASS | `publication_disabled_after_caught_up=true` | +| Mutation boundary | PASS | `publication_mutation_allowed=false`, `frontend_publication_allowed=false`, `failback_allowed=false`, `ack_eligibility_mutation_allowed=false` | + +## Findings + +Blocking: none. + +Non-blocking: + +- This phase intentionally stops at a disabled decision surface. The next + mutating phase must prove its own RBAC/admission boundary. + +## Verdict + +Phase 66 PASS. Caught-up rebuild targets now expose an explicit publication +preflight decision, but no publication mutation is enabled or implied. diff --git a/seaweed-block/scripts/run-phase66-caught-up-publication-preflight-gate.sh b/seaweed-block/scripts/run-phase66-caught-up-publication-preflight-gate.sh new file mode 100644 index 0000000000..d792f6763d --- /dev/null +++ b/seaweed-block/scripts/run-phase66-caught-up-publication-preflight-gate.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail + +PRODUCT_ROOT="${1:-$(pwd)}" +ARTIFACT_DIR="${SW_BLOCK_ARTIFACT_DIR:-${PRODUCT_ROOT}/results/phase66-caught-up-publication-preflight-gate}" +SUMMARY="${ARTIFACT_DIR}/phase66-caught-up-publication-preflight-summary.txt" +OPS_LOG="${ARTIFACT_DIR}/core-ops-go-test.log" + +mkdir -p "${ARTIFACT_DIR}" +: >"${SUMMARY}" + +write_summary() { + echo "$*" | tee -a "${SUMMARY}" >/dev/null +} + +require_log() { + local name="$1" + local pattern="$2" + local file="$3" + local found="false" + if grep -Eq -- "${pattern}" "${file}"; then + found="true" + fi + write_summary "${name}=${found}" + if [ "${found}" != "true" ]; then + echo "missing evidence ${name}: pattern ${pattern}" >&2 + return 1 + fi +} + +write_summary "phase66_caught_up_publication_preflight_status=running" +write_summary "phase66_scope=caught_up_publication_decision_surface" +write_summary "frontend_publication_allowed=false" +write_summary "failback_allowed=false" +write_summary "ack_eligibility_mutation_allowed=false" + +OPS_PATTERN="TestPhase57D1SwBlockReplicaRebuildTargetSchema|TestKubernetesStatusClientPatchesOnlyStatusSubresources|TestAuthorityExecutorReconcilerTransitionsFromStartedToCaughtUpOnTerminalRuntimeEvidence|TestAuthorityExecutorReconcilerExecutesRebuildRuntimeAndWritesCaughtUpStatus|TestAuthorityExecutorReconcilerKeepsRunningWhenRuntimeOnlyStarts" + +if (cd "${PRODUCT_ROOT}" && go test ./core/ops -run "${OPS_PATTERN}" -count=1 -v) >"${OPS_LOG}" 2>&1; then + write_summary "core_ops_publication_preflight_tests=pass" +else + write_summary "core_ops_publication_preflight_tests=fail" + cat "${OPS_LOG}" >&2 || true + exit 1 +fi + +require_log "rebuild_status_schema_has_publication_fields" "^--- PASS: TestPhase57D1SwBlockReplicaRebuildTargetSchema" "${OPS_LOG}" +require_log "kubernetes_writer_serializes_publication_fields" "^--- PASS: TestKubernetesStatusClientPatchesOnlyStatusSubresources" "${OPS_LOG}" +require_log "running_requires_caught_up_before_publication" "^--- PASS: TestAuthorityExecutorReconcilerKeepsRunningWhenRuntimeOnlyStarts" "${OPS_LOG}" +require_log "caught_up_publication_policy_disabled" "^--- PASS: TestAuthorityExecutorReconcilerExecutesRebuildRuntimeAndWritesCaughtUpStatus" "${OPS_LOG}" +require_log "terminal_transition_publication_policy_disabled" "^--- PASS: TestAuthorityExecutorReconcilerTransitionsFromStartedToCaughtUpOnTerminalRuntimeEvidence" "${OPS_LOG}" + +write_summary "publication_decision_schema_locked=true" +write_summary "publication_decision_camel_case=true" +write_summary "publication_blocked_until_caught_up=true" +write_summary "publication_disabled_after_caught_up=true" +write_summary "publication_mutation_allowed=false" +write_summary "phase66_caught_up_publication_preflight_status=ok" diff --git a/seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml b/seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml new file mode 100644 index 0000000000..1fb074fb12 --- /dev/null +++ b/seaweed-block/testops/scenarios/caught-up-publication-preflight-chain.yaml @@ -0,0 +1,72 @@ +# 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