vtgr

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VTGR

type VTGR struct {
	// Shards are all the shards that a VTGR is monitoring.
	// Caller can choose to iterate the shards to scan and repair for more granular control (e.g., stats report)
	// instead of calling ScanAndRepair() directly.
	Shards []*controller.GRShard
	// contains filtered or unexported fields
}

VTGR is the interface to manage the component to set up group replication with Vitess. The main goal of it is to reconcile MySQL group and the Vitess topology. Caller should use OpenTabletDiscovery to create the VTGR instance.

func OpenTabletDiscovery

func OpenTabletDiscovery(ctx context.Context, cellsToWatch, clustersToWatch []string) *VTGR

OpenTabletDiscovery calls OpenTabletDiscoveryWithAcitve and set the shard to be active it opens connection with topo server and triggers the first round of controller based on specified cells and keyspace/shards.

func OpenTabletDiscoveryWithAcitve

func OpenTabletDiscoveryWithAcitve(ctx context.Context, cellsToWatch, clustersToWatch []string, active bool) *VTGR

OpenTabletDiscoveryWithAcitve opens connection with topo server and triggers the first round of controller based on parameter

func (*VTGR) Diagnose

func (vtgr *VTGR) Diagnose(ctx context.Context, shard *controller.GRShard) (controller.DiagnoseType, error)

Diagnose exposes the endpoint to diagnose a particular shard

func (*VTGR) GetCurrentShardStatuses

func (vtgr *VTGR) GetCurrentShardStatuses() []controller.ShardStatus

GetCurrentShardStatuses is used when we want to know what VTGR observes it contains information about a list of instances and primary tablet

func (*VTGR) RefreshCluster

func (vtgr *VTGR) RefreshCluster()

RefreshCluster get the latest tablets from topo server

func (*VTGR) Repair

Repair exposes the endpoint to repair a particular shard

func (*VTGR) ScanAndRepair

func (vtgr *VTGR) ScanAndRepair()

ScanAndRepair starts the scanAndFix routine

Directories

Path Synopsis
Package mock_controller is a generated GoMock package.
Package mock_controller is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL