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>
65 lines
1.5 KiB
Go
65 lines
1.5 KiB
Go
package replication
|
|
|
|
// Command is one side-effect-free decision emitted by the Phase 14 core skeleton.
|
|
// Adapters execute commands later; the core only decides them.
|
|
type Command interface {
|
|
commandName() string
|
|
}
|
|
|
|
type ApplyRoleCommand struct {
|
|
VolumeID string
|
|
Epoch uint64
|
|
Role VolumeRole
|
|
}
|
|
|
|
func (ApplyRoleCommand) commandName() string { return "apply_role" }
|
|
|
|
type StartReceiverCommand struct {
|
|
VolumeID string
|
|
}
|
|
|
|
func (StartReceiverCommand) commandName() string { return "start_receiver" }
|
|
|
|
type ConfigureShipperCommand struct {
|
|
VolumeID string
|
|
Replicas []ReplicaAssignment
|
|
}
|
|
|
|
func (ConfigureShipperCommand) commandName() string { return "configure_shipper" }
|
|
|
|
type StartRecoveryTaskCommand struct {
|
|
VolumeID string
|
|
ReplicaID string
|
|
Kind SessionKind
|
|
}
|
|
|
|
func (StartRecoveryTaskCommand) commandName() string { return "start_recovery_task" }
|
|
|
|
type StartCatchUpCommand struct {
|
|
VolumeID string
|
|
TargetLSN uint64
|
|
}
|
|
|
|
func (StartCatchUpCommand) commandName() string { return "start_catchup" }
|
|
|
|
type StartRebuildCommand struct {
|
|
VolumeID string
|
|
TargetLSN uint64
|
|
}
|
|
|
|
func (StartRebuildCommand) commandName() string { return "start_rebuild" }
|
|
|
|
type InvalidateSessionCommand struct {
|
|
VolumeID string
|
|
Reason string
|
|
}
|
|
|
|
func (InvalidateSessionCommand) commandName() string { return "invalidate_session" }
|
|
|
|
type PublishProjectionCommand struct {
|
|
VolumeID string
|
|
Projection PublicationProjection
|
|
}
|
|
|
|
func (PublishProjectionCommand) commandName() string { return "publish_projection" }
|