Documentation
¶
Index ¶
Constants ¶
View Source
const ( // StateUpgrading represents the cluster global state is upgrading. It is exports for testing. StateUpgrading = "upgrading" // StateNormalRunning represents the cluster global state is normal running. It is exports for testing. StateNormalRunning = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateInfo ¶
type StateInfo struct {
State string `json:"state"`
}
StateInfo is the tidb cluster state. It will not be updated when the tidb cluster upgrading.
type Syncer ¶
type Syncer interface {
// Init sets the global schema version path to etcd if it isn't exist,
// then watch this path, and initializes the self schema version to etcd.
Init(ctx context.Context) error
// UpdateGlobalState updates the latest version to the global path on etcd until updating is successful or the ctx is done.
UpdateGlobalState(ctx context.Context, stateInfo *StateInfo) error
// GetGlobalState gets the global state from etcd.
GetGlobalState(ctx context.Context) (*StateInfo, error)
// IsUpgradingState returns whether the cluster state is upgrading.
IsUpgradingState() bool
WatchChan() clientv3.WatchChan
Rewatch(ctx context.Context)
}
Syncer is used to synchronize server state. currently there are only 2 states: running/upgrading, and is only used for the 'smooth upgrade' feature.
func NewEtcdSyncer ¶
NewEtcdSyncer creates a new Syncer.
Click to show internal directories.
Click to hide internal directories.