Documentation ¶
Index ¶
Constants ¶
View Source
const ( NotSlave = iota // Not a normal slave (also not a migration slave) SlaveInit // Just receive slave or migration command SlaveNeedClear // Slave has old data, need to clear old data SlaveClear // Slave clearing(deleting) old data SlaveFullSync // Doing full sync right now SlaveIncrSync // Doing incremental sync right now SlaveReady // Slave is up to date with master )
Slave/Migration status
View Source
const (
TotalUnitNum = 8192
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PkgDelUnit ¶ added in v1.0.3
type PkgDelUnit struct { UnitId uint16 // The unit to delete ErrMsg string // error msg, nil means no error }
Delete unit data
type PkgMigrate ¶
type PkgMigrate struct { ClientReq bool // true: from client api; false: from slave to master MasterAddr string // ip:host, stop migration if empty SlaveAddr string // ip:host UnitId uint16 // The unit to be migrated ErrMsg string // error msg, nil means no error }
Migrate command pkg. When stop migration: If all data migrated, switch client requests to new servers. If migration failed, wait for delete unit command. Steps in cluster mode when migration succeeds: 1. new servers switch to normal status (but still hold the master/slave connection) 2. switch proxy and client requests routed to new servers 3. wait for 10 seconds, and close the master/slave connection 4. delete the unit data from old servers
Click to show internal directories.
Click to hide internal directories.