Documentation
¶
Overview ¶
Package migration moves a single (org, namespace) shard between nodes. The protocol is:
- Lock the source shard via a consensus barrier (Replicator Propose with Op="lock"). Until the lock-frame is accepted on every replica, the shard remains writable.
- WAL-checkpoint and copy the SQLite file to the destination.
- Replay any frames whose Seq is >= the last sequence captured at barrier time. (No-op for the local driver, since Propose is synchronous.)
- Release the lock with another Propose (Op="unlock"); the destination becomes the live shard owner.
CLI: tasksd migrate --org <id> --namespace <name> --to <node>
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator runs migrations against a Manager + Replicator pair.
func NewCoordinator ¶
func NewCoordinator(mgr *store.Manager, rep replication.Replicator) *Coordinator
NewCoordinator wires a fresh coordinator.
func (*Coordinator) Get ¶
func (c *Coordinator) Get(id string) *Job
Get returns a job by id, or nil if unknown.
func (*Coordinator) List ¶
func (c *Coordinator) List() []Job
List returns every job the coordinator has seen.
type Job ¶
type Job struct {
ID string `json:"id"`
OrgID string `json:"org"`
Namespace string `json:"ns"`
From string `json:"from"`
To string `json:"to"`
Status Status `json:"status"`
Error string `json:"error,omitempty"`
Bytes int64 `json:"bytes"`
StartedAt time.Time `json:"startedAt"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
}
Job is a single migration unit.
Click to show internal directories.
Click to hide internal directories.