Engine execution layer for V2 replication protocol: - RebuildInstaller: full state handoff (dirty map, WAL, superblock, flusher) - TruncateToLSN: exact safety predicate (checkpointLSN == truncateLSN), ErrTruncationUnsafe escalation to NeedsRebuild - SyncReceiverProgress: unconditional Store for post-rebuild alignment - V2StatusSnapshot: CommittedLSN = nextLSN-1 for sync_all V2 bridge real I/O executors: - TransferFullBase: TCP streaming + RebuildInstaller + second catch-up - TransferSnapshot: SHA-256 verified streaming to disk - TruncateWAL: ErrTruncationUnsafe detection + escalation - StreamWALEntries: rebuild-mode TCP apply Engine executor interfaces: - CatchUpIO.TruncateWAL, RebuildIO.TransferFullBase returns achievedLSN - CatchUpExecutor truncation-only skip, NeedsRebuild escalation - RebuildExecutor uses achievedLSN for progress tracking Design docs reorganized: superseded planning docs removed, protocol truths and closure map added. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 KiB
V2 Phase Development Plan
Date: 2026-04-02 Status: active Purpose: define the execution-oriented phase plan after the current candidate-path work, with explicit module status and target phase ownership
Why This Document Exists
The project now needs a development plan that is:
- phase-oriented
- execution-oriented
- large enough to avoid overhead-heavy micro-slices
- explicit about which module belongs to which future phase
This document is the planning bridge between:
v2-product-completion-overview.md../.private/phase/phase-08.md- future implementation phases
Planning Rules
Use these rules for all later phases:
- one phase should close one meaningful product/engineering outcome
- every phase must have a clear delivery object and a clear closed-loop validation mechanism
- every slice inside a phase should also name:
- what is delivered
- what loop is proven closed
- what reject shapes remain insufficient
- phases should prefer real code/test/evidence over wording-only progress
- later phases may reuse V1 engineering reality, but must not inherit V1 recovery semantics as truth
- a phase is too small if it does not move the overall product-completion state clearly
Current Baseline
Current accepted path through Phase 09:
- protocol/algo truth set is strong
- engine recovery core is strong
- real control delivery exists on the chosen path
- real one-chain catch-up and rebuild closure exist on the chosen path
- production-grade execution closure is accepted on the chosen path:
- real
TransferFullBase - real
TransferSnapshot - real
TruncateWAL - stronger live runtime ownership on the volume-server path
- unified hardening validation exists on the chosen path
- one bounded accepted path exists for:
RF=2sync_all- existing master / volume-server heartbeat path
Phase-accounting note:
Phase 08is closedPhase 09is also closed- this roadmap should now be read from the post-
Phase 09state, not the post-Phase 08state
This means the next phases should focus mainly on:
- stronger control-plane closure
- later product-surface rebinding
- production hardening
- bounded cleanup of low-severity residuals without reopening accepted execution semantics
Phase Roadmap
Phase 09: Production Execution Closure
Goal:
- turn validation-grade backend execution into production-grade backend execution
Must prove:
- full-base rebuild performs real data transfer
- snapshot rebuild performs real image transfer
- replica-ahead path is physically executable, not only detected
- runtime execution ownership is stronger than the current bounded candidate path
Typical outputs:
- real
TransferFullBase - real
TransferSnapshot - real
TruncateWAL - stronger executor/runtime integration in the live volume-server path
Verification mechanism:
- one-chain execution tests on real backend paths
- cleanup assertions after success/failure/cancel
- focused adversarial tests for truncation and rebuild execution
Workload:
- large
- this is likely the single biggest remaining engineering phase
Status:
- complete
- accepted closeout exists in
../.private/phase/phase-09.md
Phase 10: Real Control-Plane Closure
Goal:
- strengthen from accepted assignment-entry closure to fuller end-to-end control-plane closure
Why this is next:
Phase 09already closed the main backend execution gaps- the most important remaining product risk is no longer storage execution itself
- it is now control-path completeness:
- heartbeat / gRPC delivery
- reassignment / result convergence
- cleaner local identity than transport-shaped
listenAddr
Phase 10can also absorb bounded low-severity cleanup discovered duringPhase 09if it is directly relevant to live control/runtime ownership
Current accepted progress inside Phase 10:
P1accepted:- stable identity and control-truth closure on the chosen block assignment wire
P2accepted:- reassignment/result convergence through the accepted volume-server-side chosen-path ingress
P3accepted:- bounded repeated-assignment / idempotence cleanup on the chosen live path
P4accepted:- master-driven heartbeat / gRPC control-loop closure on the chosen path
Phase 10is now closed:- bounded end-to-end control-plane closure for the chosen path is accepted
Must prove:
- heartbeat/gRPC-level delivery is real for the chosen path
- failover / reassignment state converges through the real control path
- local and remote identity are consistent enough for product use
Typical outputs:
- stronger heartbeat/gRPC delivery proof
- stronger result/reporting convergence
- cleaner local identity than transport-shaped
listenAddr
Verification mechanism:
- real failover/reassignment tests at the fuller control-plane level
- identity/fencing assertions through the end-to-end path
Suggested first targets:
- keep accepted
Phase 10control-plane closure closed - start
Phase 11with one bounded product-surface rebinding slice - prefer selected surface proofs over broad surface explosion
- keep any residual control-path cleanup narrow; do not reopen accepted
Phase 10closure casually
Workload:
- medium-large
Phase 11: Product Surface Rebinding
Goal:
- bind product-facing surfaces onto the V2-backed block path after backend closure is strong enough
Must prove:
- the V2-backed backend can support selected product surfaces without semantic drift
- reuse of V1 surfaces does not reintroduce V1 recovery truth
Candidate areas:
- snapshot product path
CSINVMeiSCSI
Recommended first slice:
- start with bounded
snapshot product pathrebinding - defer
CSIandNVMe/iSCSIuntil one simpler product-visible surface is already accepted
Suggested slice order:
P1snapshot product-path rebindingP2CSIrebindingP3NVMe/iSCSIfront-end rebindingP4broader workflow closure such as snapshot restore/clone if still needed
Verification mechanism:
- selected surface integration tests
- product-surface contract checks
- no-overclaim review that the surface does not imply unsupported backend capability
Workload:
- medium-large
- can be split by product surface if needed, but only after backend closure is strong
Phase 12: Production Hardening
Goal:
- move from candidate-safe to production-safe
Must prove:
- restart/recovery stability under repeated disturbance
- long-run/soak viability
- operational diagnosability
- acceptable production blockers list or production-ready gate
Verification mechanism:
- soak/adversarial runs
- failover/restart under disturbance
- runbook/debug validation
Workload:
- large
Recommended initial planning cut:
- treat
P0as hardening-plan freeze - first hardening slice should likely target restart / recovery disturbance before soak or perf
Current slice order:
P0hardening-plan freezeP1restart / recovery disturbance hardeningP2soak / long-run stability hardeningP3diagnosability / blocker accounting / runbook hardeningP4performance floor / rollout-gate hardening
Slice delivery / closed-loop bar:
- every
Phase 12slice must end with:- one bounded delivery object
- one bounded closed-loop validation object
- one explicit no-overclaim boundary
- “tests exist” is not enough:
- the tests must close the loop from disturbance/input to visible accepted truth
- “code changed” is also not required:
- a hardening slice may legitimately close by proving existing production code is already correct under the targeted disturbance class
Current status:
P0accepted:- hardening object frozen as the accepted chosen path from
Phase 09+Phase 10+Phase 11 - slice order frozen as
P1/P2/P3/P4 - evidence ladder frozen as disturbance correctness, soak, diagnosability, then perf/rollout gates
- hardening object frozen as the accepted chosen path from
P1accepted:- acceptance object = correctness under restart/disturbance on the chosen path
- not soak, not diagnosability, not performance, not rollout readiness
P2accepted:- acceptance object = bounded soak / long-run stability on the chosen path
- repeated-cycle coherence and bounded runtime-state hygiene are accepted inside a bounded test envelope
P3accepted:- acceptance object = bounded diagnosability / blocker accounting / runbook hardening on the chosen path
- bounded operator-visible diagnosis surfaces and finite blocker accounting are accepted
P4active:- acceptance object = bounded performance floor / rollout-gate hardening on the chosen path
- not broad rollout readiness beyond the named launch envelope
Current P4 first delivery shape:
- proof-first hardening slice with explicit measured floor and launch-gate artifacts
- one bounded performance package:
- named workload envelope
- repeatable measurement harness
- explicit floor values
- one explicit rollout-gate artifact:
- finite supported launch envelope
- cleared blockers/gates
- remaining blockers/gates
- current evidence shape:
- measured floor values are tied to one named accepted workload envelope
- cost/resource trade-offs are explicit
- rollout discussion is bounded by an explicit finite gate package
- current reuse boundary:
- accepted chosen-path runtime/control/product surfaces remain stable unless perf-floor work exposes a real bug or measurement gap
- focused benchmarks/tests and bounded launch-gate artifacts carry the main delivery burden
Closed-loop expectation for P4 review:
- one bounded workload envelope runs on the accepted chosen path
- measured floor values and cost characteristics are explicit
- launch claims map back to accepted prior slices plus the measured envelope
- remaining rollout blockers are explicit and finite
- claims remain bounded to measured floor / named launch envelope only
After Phase 12:
- move to a productionization program, not more protocol-discovery phases
- freeze production blockers and the supported launch envelope
- run a limited internal pilot with incident-driven hardening
- perform controlled rollout only after explicit launch-gate review
Module Status Map
| Module area | Current status | Current owner phase | Next target phase | Notes |
|---|---|---|---|---|
sw-block/engine/replication core FSM/orchestrator/driver |
Strong | Phase 09 accepted |
Phase 10-12 |
Main later work is control-plane/runtime integration and hardening, not new core semantics. |
Engine executor real I/O boundary (CatchUpIO / RebuildIO) |
Strong on chosen path | Phase 09 accepted |
Phase 10/12 |
Keep the boundary stable; later work is orchestration/control proof and hardening. |
weed/storage/blockvol/v2bridge/control.go |
Strong on chosen path | Phase 08/09/10 accepted |
Phase 12 |
Chosen-path control mapping is accepted; later work is hardening, not new mapping semantics. |
weed/storage/blockvol/v2bridge/reader.go |
Strong | Phase 09 accepted |
Phase 12 |
Mostly stable; later work is verification/hardening, not new semantics. |
weed/storage/blockvol/v2bridge/pinner.go |
Strong | Phase 09 accepted |
Phase 12 |
Retention safety proven; later work is hardening under disturbance. |
weed/storage/blockvol/v2bridge/executor.go WAL scan |
Strong | Phase 09 accepted |
Phase 12 |
Real execution path closed on chosen path; later work is hardening. |
v2bridge TransferFullBase |
Strong on chosen path | Phase 09 P1 accepted |
Phase 12 |
Execution closure accepted; do not reopen casually. |
v2bridge TransferSnapshot |
Strong on chosen path | Phase 09 P2 accepted |
Phase 12 |
Execution closure accepted; do not reopen casually. |
v2bridge TruncateWAL |
Strong on chosen path | Phase 09 P3 accepted |
Phase 12 |
Narrow Option A contract accepted; later work is hardening/planning improvement. |
weed/server/volume_server_block.go V2 assignment intake |
Strong on chosen path | Phase 10 P4 accepted |
Phase 11/12 |
VS-side ingress, convergence, idempotence, and bounded master-driven closure are accepted; later work is product-surface integration and hardening. |
weed/server/block_recovery.go live runtime ownership |
Strong on chosen path | Phase 09/10 accepted |
Phase 11/12 |
Serialized ownership and bounded control-plane integration are accepted; later work is product-surface integration and hardening. |
blockvol WAL/flusher/checkpoint runtime |
Reuse reality | Existing production code | Phase 12 |
Reuse implementation; later work is disturbance/restart hardening. |
blockvol rebuild transport/server reality |
Reuse with redesign boundary | Existing production code | Phase 12 |
Bounded chosen-path integration is accepted; later work is hardening under disturbance. |
local server identity (localServerID) |
Strong on chosen path | Phase 10 P1 accepted |
Phase 12 |
Canonical volumeServerId now backs chosen-path local identity; later work is hardening only. |
| Snapshot product path | Strong on chosen path | Phase 11 accepted |
Phase 12 |
Product-visible snapshot create/list/delete closure and restore workflow closure are accepted; later work is hardening, not rebinding. |
CSI integration |
Strong on chosen path | Phase 11 accepted |
Phase 12 |
Bounded controller/node lifecycle rebinding accepted; later work is hardening. |
NVMe / iSCSI front-ends |
Strong on chosen path | Phase 11 accepted |
Phase 12 |
Publication/address truth rebinding accepted; later work is runtime/perf hardening. |
| Testrunner / infra / metrics | Strong support layer | existing | Phase 11-12 |
Reuse to validate later product-surface and hardening phases. |
Completion-State Targets
Use these rough targets to judge whether a phase is moving the product meaningfully.
| Phase | Expected completion move |
|---|---|
Phase 09 |
from validation-grade backend execution to accepted execution closure on the chosen path |
Phase 10 |
from bounded control-entry proof to stronger end-to-end control-plane closure |
Phase 11 |
from backend-ready path to selected product-surface readiness |
Phase 12 |
from candidate-safe to production-safe |
Near-Term Execution Direction
If the goal is to maximize product completion efficiently, the recommended order is:
- keep
Phase 09closed and do not reopen accepted execution semantics casually - keep
Phase 10closed and do not reopen accepted bounded control-plane closure casually - move next to
Phase 11product surface rebinding - then
Phase 12production hardening
The most important near-term engineering weight should now go to Phase 12.
Short Summary
The V2 line now has accepted execution closure on one bounded chosen path. The next development plan should treat later work as control/product completion phases, not more protocol discovery.
The main heavy engineering work still ahead is:
- stronger end-to-end control-plane closure
- later product-surface rebinding
- production hardening
- bounded cleanup of residual operational rough edges without reopening accepted semantics