slave

package
v0.0.0-...-0ce2e87 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DKVService

A DKVService represents a service for serving key value data.

func NewService

func NewService(store storage.KVStore, ca storage.ChangeApplier, regionInfo *serverpb.RegionInfo,
	replConf *ReplicationConfig, clusterInfo discovery.ClusterInfoGetter,
	serveropts *opts.ServerOpts) (DKVService, error)

NewService creates a slave DKVService that periodically polls for changes from master node and replicates them onto its local storage. As a result, it forbids changes to this local storage through any of the other key value mutators.

type ReplicationConfig

type ReplicationConfig struct {
	// Max num changes to poll from master in a single replication call
	MaxNumChngs uint32
	// Interval to periodically poll changes from master
	ReplPollInterval time.Duration
	// Maximum allowed replication lag from master for the slave to be considered valid
	MaxActiveReplLag uint64
	// Maximum allowed replication time elapsed from master for the slave to be considered valid
	// Applicable when replication requests are erroring out due to an issue with master / slave
	MaxActiveReplElapsed uint64
	// Listener address of the master node
	ReplMasterAddr string
}

Jump to

Keyboard shortcuts

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