replication

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultAllowTxDiscarding = false
View Source
const DefaultChunkSize int = 64 * 1024 // 64 * 1024 64 KiB
View Source
const DefaultPrefetchTxBufferSize int = 100
View Source
const DefaultReplicationCommitConcurrency int = 10
View Source
const DefaultSkipIntegrityCheck = false
View Source
const DefaultWaitForIndexing = false

Variables

View Source
var ErrAlreadyRunning = errors.New("already running")
View Source
var ErrAlreadyStopped = errors.New("already stopped")
View Source
var ErrIllegalArguments = errors.New("illegal arguments")
View Source
var ErrInvalidOptions = fmt.Errorf("%w: invalid options", ErrIllegalArguments)
View Source
var ErrInvalidReplicationMetadata = errors.New("invalid replication metadata retrieved")
View Source
var ErrNoSynchronousReplicationOnPrimary = errors.New("primary is not running with synchronous replication")
View Source
var ErrReplicaDivergedFromPrimary = errors.New("replica diverged from primary")

Functions

This section is empty.

Types

type Delayer

type Delayer interface {
	DelayAfter(retries int) time.Duration
}

type Options

type Options struct {
	// contains filtered or unexported fields
}

func DefaultOptions

func DefaultOptions() *Options

func (*Options) Validate added in v1.5.0

func (opts *Options) Validate() error

func (*Options) WithAllowTxDiscarding added in v1.4.0

func (o *Options) WithAllowTxDiscarding(allowTxDiscarding bool) *Options

WithAllowTxDiscarding enable auto discarding of precommitted transactions

func (*Options) WithDelayer

func (o *Options) WithDelayer(delayer Delayer) *Options

WithDelayer sets delayer used to pause re-attempts

func (*Options) WithPrefetchTxBufferSize added in v1.4.0

func (o *Options) WithPrefetchTxBufferSize(prefetchTxBufferSize int) *Options

WithPrefetchTxBufferSize sets tx buffer size

func (*Options) WithPrimaryDatabase added in v1.4.1

func (o *Options) WithPrimaryDatabase(primaryDatabase string) *Options

WithPrimaryDatabase sets the source database name

func (*Options) WithPrimaryHost added in v1.4.1

func (o *Options) WithPrimaryHost(primaryHost string) *Options

WithPrimaryHost sets the source database address

func (*Options) WithPrimaryPassword added in v1.4.1

func (o *Options) WithPrimaryPassword(primaryPassword string) *Options

WithPrimaryPassword sets password used for replication

func (*Options) WithPrimaryPort added in v1.4.1

func (o *Options) WithPrimaryPort(primaryPort int) *Options

WithPrimaryPort sets the source database port

func (*Options) WithPrimaryUsername added in v1.4.1

func (o *Options) WithPrimaryUsername(primaryUsername string) *Options

WithPrimaryUsername sets username used for replication

func (*Options) WithReplicationCommitConcurrency added in v1.4.0

func (o *Options) WithReplicationCommitConcurrency(replicationCommitConcurrency int) *Options

WithReplicationCommitConcurrency sets the number of goroutines doing replication

func (*Options) WithSkipIntegrityCheck added in v1.5.0

func (o *Options) WithSkipIntegrityCheck(skipIntegrityCheck bool) *Options

WithSkipIntegrityCheck disable integrity checks when reading data during replication

func (*Options) WithStreamChunkSize

func (o *Options) WithStreamChunkSize(streamChunkSize int) *Options

WithStreamChunkSize sets streaming chunk size

func (*Options) WithWaitForIndexing added in v1.5.0

func (o *Options) WithWaitForIndexing(waitForIndexing bool) *Options

WithWaitForIndexing wait for indexing to be up to date during replication

type TxReplicator

type TxReplicator struct {
	// contains filtered or unexported fields
}

func NewTxReplicator

func NewTxReplicator(uuid xid.ID, db database.DB, opts *Options, logger logger.Logger) (*TxReplicator, error)

func (*TxReplicator) Start

func (txr *TxReplicator) Start() error

func (*TxReplicator) Stop

func (txr *TxReplicator) Stop() error

Jump to

Keyboard shortcuts

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