Expand description
Peer state migration for seamless node handoff in P2P networks.
This module provides the infrastructure to migrate peer state (routing tables, provider records, connection metadata, etc.) from one node to another during planned handoffs or failover scenarios.
§Overview
When a node needs to leave the network gracefully (maintenance, scaling, etc.),
its state must be transferred to one or more successor nodes to preserve
network continuity. The PeerMigrationManager orchestrates this process
through a structured state machine:
Idle -> Preparing -> Transferring -> Verifying -> Completed
\ \ \
`--------> Failed <------'§Key Features
- Chunked transfer: Large state sets are broken into configurable chunks
- Checksum verification: Integrity verification after transfer completion
- Concurrent migration limits: Prevent resource exhaustion during bulk migrations
- Progress tracking: Real-time progress reporting per migration
- Statistics: Aggregate stats across all migrations for monitoring
- Cleanup: Automatic pruning of completed migration records
Structs§
- Migration
Item - A single item being migrated between peers.
- Peer
Migration Config - Configuration for the migration manager.
- Peer
Migration Manager - Manages peer state migrations for seamless node handoff.
- Peer
Migration Record - Record tracking a single migration between two peers.
- Peer
Migration Stats - Aggregate statistics across all migrations managed by a
PeerMigrationManager.
Enums§
- Peer
Migration State - State machine for a single peer migration operation.