replication

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReplicater

type FileReplicater interface {
	GetMembers() ([]*pdpb.Member, error)
	ReplicateFileToMember(ctx context.Context, member *pdpb.Member, name string, data []byte) error
}

FileReplicater is the interface that can save important data to all cluster nodes.

type HTTPReplicationStatus

type HTTPReplicationStatus struct {
	Mode       string `json:"mode"`
	DrAutoSync struct {
		LabelKey        string  `json:"label_key"`
		State           string  `json:"state"`
		StateID         uint64  `json:"state_id,omitempty"`
		ACIDConsistent  bool    `json:"acid_consistent"`
		TotalRegions    int     `json:"total_regions,omitempty"`
		SyncedRegions   int     `json:"synced_regions,omitempty"`
		RecoverProgress float32 `json:"recover_progress,omitempty"`
	} `json:"dr-auto-sync,omitempty"`
}

HTTPReplicationStatus is for query status from HTTP API.

type ModeManager

type ModeManager struct {
	syncutil.RWMutex
	// contains filtered or unexported fields
}

ModeManager is used to control how raft logs are synchronized between different tikv nodes.

func NewReplicationModeManager

func NewReplicationModeManager(config config.ReplicationModeConfig, storage endpoint.ReplicationStatusStorage, cluster schedule.Cluster, fileReplicater FileReplicater) (*ModeManager, error)

NewReplicationModeManager creates the replicate mode manager.

func (*ModeManager) GetReplicationStatus

func (m *ModeManager) GetReplicationStatus() *pb.ReplicationStatus

GetReplicationStatus returns the status to sync with tikv servers.

func (*ModeManager) GetReplicationStatusHTTP

func (m *ModeManager) GetReplicationStatusHTTP() *HTTPReplicationStatus

GetReplicationStatusHTTP returns status for HTTP API.

func (*ModeManager) IsRegionSplitPaused

func (m *ModeManager) IsRegionSplitPaused() bool

IsRegionSplitPaused returns true if region split need be paused.

func (*ModeManager) Run

func (m *ModeManager) Run(ctx context.Context)

Run starts the background job.

func (*ModeManager) UpdateConfig

func (m *ModeManager) UpdateConfig(config config.ReplicationModeConfig) error

UpdateConfig updates configuration online and updates internal state.

func (*ModeManager) UpdateStoreDRStatus

func (m *ModeManager) UpdateStoreDRStatus(id uint64, status *pb.StoreDRAutoSyncStatus)

UpdateStoreDRStatus saves the dr-autosync status of a store.

Jump to

Keyboard shortcuts

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