mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-20 13:30:46 +02:00
Batch 7: Command dispatch binding extraction - New weed/server/blockcmd package: CommandHandler interface + DispatchCommands - volume_server_block.go applyCoreCommandsWithAssignment delegates to dispatcher - weed/server still owns RecordCommand, EmitCoreEvent, PublishProjection - v2bridge NOT given command-switch or event-emission semantics Phase 16C: Rebuilding assignment enters core command path Phase 16D: Rebuild recovery-task startup is command-driven Phase 16E: Catch-up recovery-task startup is command-driven Engine refinements: - RecoveryTarget on AssignmentDelivered event - shouldStartRecoveryTask / shouldStartReceiver guards - bootstrapReason: awaiting_rebuild_start Bridge/contract updates: - control_adapter.go: refined translation helpers - contract.go: executor port alignment Migration design docs (Batch 1-3 delivered, design artifacts): - v2-first/second/third-migration-batch.md + task-pack.md - v2-assignment-translation-unification.md - v2-execution-muscles-inventory.md - v2-separation-port-layer-audit.md - v2-legacy-runtime-exit-criteria.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.0 KiB
3.0 KiB
V2 First Migration Batch
Date: 2026-04-04 Status: delivered
Purpose
This note defines the first migration batch for the sw-block separation work.
The batch must:
- move code toward
sw-block - keep
sw-blockfree of directweed/imports - avoid moving
BlockServiceorRecoveryManagerwhole
Batch Goal
Establish one clean execution-muscle layer behind sw-block ports, while
keeping weed/ as a thin adapter shell.
Batch Scope
In scope
sw-block/bridge/blockvolcontract cleanup- canonical helper extraction for identity and recovery-target mapping
- reader / pinner / executor migration target design
- tests that prove those contracts and helpers
Out of scope
- moving
weed/server/volume_server_block.go - moving
weed/server/block_recovery.go - moving the full
blockvolbackend - broad master/heartbeat refactor
Target Package Shape
Keep as long-term owner
sw-block/engine/replicationsw-block/bridge/blockvol
Future landing zone for execution muscles
Recommended target inside sw-block:
- keep contracts in
sw-block/bridge/blockvol - add a future execution-oriented package only after ports are stable, for
example:
sw-block/bridge/blockvol/runtime- or
sw-block/runtime/blockvol
For the first batch, do NOT create that new package yet unless the existing contracts prove insufficient.
Keep as thin adapter implementations
weed/storage/blockvol/v2bridgeweed/server/*
Concrete Batch Steps
- normalize
sw-block/bridge/blockvolcontracts so they match the engine's real IO surfaces - make canonical helper functions in
sw-blockfor:- replica identity
- recovery-target mapping
- switch duplicate adapter-side mapping sites to consume those helpers
- leave real
BlockVol-backed implementations inweed/for now - only after steps 1-4 are stable, start moving implementation files
Execution Form
This batch is executed through the validate-able tasks in:
sw-block/design/v2-first-migration-task-pack.md
That task pack turns the batch into four parallelizable work items:
- canonical assignment translation
- reader port separation
- pinner port separation
- executor muscle separation
Why This Batch Is First
This batch is first because it creates a safe migration destination:
- without stable ports, code movement just relocates coupling
- without canonical helpers, control translation will drift during migration
- moving execution muscles before shrinking
weed/serverkeeps product risk low
Exit Condition
This batch is complete when:
sw-blockowns the canonical contract layerweed/implements that layer without redefining semantics- future code moves become mechanical implementation relocation, not architecture redesign
Delivery Note
This batch is now delivered:
- Task A was completed by code change in
a38e04c03 - Tasks B/C/D were confirmed already clean by review against the task-pack acceptance bar