Documentation ¶
Index ¶
- Constants
- Variables
- func AuditTopologyRecovery(topologyRecovery *TopologyRecovery, message string) error
- func CheckAndRecover()
- func ContinuousDiscovery()
- func DisableRecovery() error
- func DiscoverInstance(tabletAlias string, forceDiscovery bool)
- func EnableRecovery() error
- func ExpireRecoveryDetectionHistory() error
- func ExpireTopologyRecoveryHistory() error
- func ExpireTopologyRecoveryStepsHistory() error
- func InsertRecoveryDetection(analysisEntry *inst.ReplicationAnalysis) error
- func IsRecoveryDisabled() (disabled bool, err error)
- func LockShard(ctx context.Context, tabletAlias string, lockAction string) (context.Context, func(*error), error)
- func OpenTabletDiscovery() <-chan time.Time
- func RefreshAllKeyspacesAndShards()
- func RefreshKeyspaceAndShard(keyspaceName string, shardName string) error
- func RegisterFlags(fs *pflag.FlagSet)
- type TopologyRecovery
- func AttemptRecoveryRegistration(analysisEntry *inst.ReplicationAnalysis) (*TopologyRecovery, error)
- func NewTopologyRecovery(replicationAnalysis inst.ReplicationAnalysis) *TopologyRecovery
- func ReadActiveClusterRecoveries(keyspace string, shard string) ([]*TopologyRecovery, error)
- func ReadRecentRecoveries(page int) ([]*TopologyRecovery, error)
- type TopologyRecoveryStep
Constants ¶
const ( CheckAndRecoverGenericProblemRecoveryName string = "CheckAndRecoverGenericProblem" RecoverDeadPrimaryRecoveryName string = "RecoverDeadPrimary" RecoverPrimaryTabletDeletedRecoveryName string = "RecoverPrimaryTabletDeleted" RecoverPrimaryHasPrimaryRecoveryName string = "RecoverPrimaryHasPrimary" CheckAndRecoverLockedSemiSyncPrimaryRecoveryName string = "CheckAndRecoverLockedSemiSyncPrimary" ElectNewPrimaryRecoveryName string = "ElectNewPrimary" FixPrimaryRecoveryName string = "FixPrimary" FixReplicaRecoveryName string = "FixReplica" RecoverErrantGTIDDetectedName string = "RecoverErrantGTIDDetected" )
const (
DiscoveryMetricsName = "DISCOVERY_METRICS"
)
const TopologyRecoveriesTemplate = `` /* 576-byte string literal not displayed */
TopologyRecoveriesTemplate is the HTML to use to display the topology recovery steps list object
Variables ¶
var ( // ErrNoPrimaryTablet is a fixed error message. ErrNoPrimaryTablet = errors.New("no primary tablet found") )
Functions ¶
func AuditTopologyRecovery ¶
func AuditTopologyRecovery(topologyRecovery *TopologyRecovery, message string) error
AuditTopologyRecovery audits a single step in a topology recovery process.
func CheckAndRecover ¶
func CheckAndRecover()
CheckAndRecover is the main entry point for the recovery mechanism
func ContinuousDiscovery ¶
func ContinuousDiscovery()
ContinuousDiscovery starts an asynchronous infinite discovery process where instances are periodically investigated and their status captured, and long since unseen instances are purged and forgotten. nolint SA1015: using time.Tick leaks the underlying ticker
func DisableRecovery ¶
func DisableRecovery() error
DisableRecovery ensures recoveries are disabled globally
func DiscoverInstance ¶
DiscoverInstance will attempt to discover (poll) an instance (unless it is already up-to-date) and will also ensure that its primary and replicas (if any) are also checked.
func EnableRecovery ¶
func EnableRecovery() error
EnableRecovery ensures recoveries are enabled globally
func ExpireRecoveryDetectionHistory ¶ added in v0.20.0
func ExpireRecoveryDetectionHistory() error
ExpireRecoveryDetectionHistory removes old rows from the recovery_detection table
func ExpireTopologyRecoveryHistory ¶
func ExpireTopologyRecoveryHistory() error
ExpireTopologyRecoveryHistory removes old rows from the topology_recovery table
func ExpireTopologyRecoveryStepsHistory ¶
func ExpireTopologyRecoveryStepsHistory() error
ExpireTopologyRecoveryStepsHistory removes old rows from the topology_recovery_steps table
func InsertRecoveryDetection ¶ added in v0.20.0
func InsertRecoveryDetection(analysisEntry *inst.ReplicationAnalysis) error
InsertRecoveryDetection inserts the recovery analysis that has been detected.
func IsRecoveryDisabled ¶
IsRecoveryDisabled returns true if Recoveries are disabled globally
func LockShard ¶
func LockShard(ctx context.Context, tabletAlias string, lockAction string) (context.Context, func(*error), error)
LockShard locks the keyspace-shard preventing others from performing conflicting actions.
func OpenTabletDiscovery ¶
OpenTabletDiscovery opens the vitess topo if enables and returns a ticker channel for polling.
func RefreshAllKeyspacesAndShards ¶ added in v0.18.0
func RefreshAllKeyspacesAndShards()
RefreshAllKeyspacesAndShards reloads the keyspace and shard information for the keyspaces that vtorc is concerned with.
func RefreshKeyspaceAndShard ¶ added in v0.18.0
RefreshKeyspaceAndShard refreshes the keyspace record and shard record for the given keyspace and shard.
func RegisterFlags ¶
RegisterFlags registers the flags required by VTOrc
Types ¶
type TopologyRecovery ¶
type TopologyRecovery struct { ID int64 AnalysisEntry inst.ReplicationAnalysis SuccessorAlias string IsSuccessful bool AllErrors []string RecoveryStartTimestamp string RecoveryEndTimestamp string DetectionID int64 }
TopologyRecovery represents an entry in the topology_recovery table
func AttemptRecoveryRegistration ¶
func AttemptRecoveryRegistration(analysisEntry *inst.ReplicationAnalysis) (*TopologyRecovery, error)
AttemptRecoveryRegistration tries to add a recovery entry; if this fails that means recovery is already in place.
func NewTopologyRecovery ¶
func NewTopologyRecovery(replicationAnalysis inst.ReplicationAnalysis) *TopologyRecovery
func ReadActiveClusterRecoveries ¶ added in v0.20.0
func ReadActiveClusterRecoveries(keyspace string, shard string) ([]*TopologyRecovery, error)
ReadActiveClusterRecoveries reads recoveries that are ongoing for the given cluster.
func ReadRecentRecoveries ¶
func ReadRecentRecoveries(page int) ([]*TopologyRecovery, error)
ReadRecentRecoveries reads latest recovery entries from topology_recovery
func (*TopologyRecovery) AddError ¶
func (topologyRecovery *TopologyRecovery) AddError(err error) error
func (*TopologyRecovery) AddErrors ¶
func (topologyRecovery *TopologyRecovery) AddErrors(errs []error)
type TopologyRecoveryStep ¶
func NewTopologyRecoveryStep ¶
func NewTopologyRecoveryStep(id int64, message string) *TopologyRecoveryStep