replicasetcmd

package
v3.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimeout is a default timeout for all operations in seconds.
	DefaultTimeout = 3
)
View Source
const (
	// VShardBootstrapDefaultTimeout is a default timeout for vshard bootstrapping.
	VShardBootstrapDefaultTimeout = 10
)

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(ctx BootstrapCtx) error

Bootstrap bootstraps an instance or application.

func BootstrapVShard

func BootstrapVShard(ctx VShardCmdCtx) error

BootstrapVShard bootstraps vshard in the cluster.

func Demote

func Demote(ctx DemoteCtx) error

Demote demotes an instance.

func DiscoverInstance

func DiscoverInstance(conn connector.Connector) (replicaset.Replicasets, error)

DiscoverInstance reads the live topology through the instance's orchestrator. Backup planning uses the same discovery implementation as replicaset commands.

func Downgrade

func Downgrade(discoveryCtx DiscoveryCtx, opts DowngradeOpts,
	connOpts connector.ConnectOpts,
) error

Downgrade downgrades tarantool schema.

func Expel

func Expel(expelCtx ExpelCtx) error

Expel expels an instance from a replicaset.

func Promote

func Promote(ctx PromoteCtx) error

Promote promotes an instance.

func RolesChange

func RolesChange(ctx RolesChangeCtx, changeRoleAction replicaset.RolesChangerAction) error

RolesChange adds/removes role with provided path target to config.

func Status

func Status(discoveryCtx DiscoveryCtx) error

Status shows a replicaset status.

func Upgrade

func Upgrade(discoveryCtx DiscoveryCtx, opts UpgradeOpts, connOpts connector.ConnectOpts) error

Upgrade upgrades tarantool schema.

Types

type BootstrapCtx

type BootstrapCtx struct {
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Timeout describes a timeout in seconds.
	// We keep int as it can be passed to the target instance.
	Timeout int
	// BootstrapVShard is true when the vshard must be bootstrapped.
	BootstrapVShard bool
	// Instance is an instance name to bootstrap.
	Instance string
	// Replicaset is a replicaset name for an instance bootstrapping.
	Replicaset string
}

BootstrapCtx describes context to bootstrap an instance or application.

type DemoteCtx

type DemoteCtx struct {
	// InstName is an instance name to demote.
	InstName string
	// Publishers is data publisher factory.
	Publishers sdkcluster.Factory
	// Collectors is data collector factory.
	Collectors sdkcluster.Factory
	// Integrity is the integrity context for cluster reads.
	Integrity integrity.IntegrityCtx
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
	// Conn is an active connection to a passed instance.
	Conn connector.Connector
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Force true if unavailable instances can be skipped.
	Force bool
	// Timeout describes a timeout in seconds.
	// We keep int as it can be passed to the target instance.
	Timeout int
}

DemoteCtx describes the context to demote an instance.

type DiscoveryCtx

type DiscoveryCtx struct {
	// IsApplication true if an application passed.
	IsApplication bool
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Conn is an active connection to a passed instance.
	Conn connector.Connector
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
}

DiscoveryCtx contains information about replicaset discovery.

type DowngradeOpts

type DowngradeOpts struct {
	// ChosenReplicasetAliases is a list of replicaset names specified by
	// the user for the downgrade.
	ChosenReplicasetAliases []string
	// Timeout period (in seconds) for waiting on LSN synchronization.
	Timeout int
	// DowngradeVersion is a version to downgrade the schema to.
	DowngradeVersion string
}

DowngradeOpts contains options used for the downgrade process.

type ExpelCtx

type ExpelCtx struct {
	// Instance is a target instance name.
	Instance string
	// Publishers is data publisher factory.
	Publishers sdkcluster.Factory
	// Collectors is data collector factory.
	Collectors sdkcluster.Factory
	// Integrity is the integrity context for cluster reads.
	Integrity integrity.IntegrityCtx
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Force true if unavailable instances can be skipped.
	Force bool
	// Timeout describes a timeout in seconds.
	// We keep int as it can be passed to the target instance.
	Timeout int
}

ExpelCtx contains information about replicaset expel command execution context.

type PromoteCtx

type PromoteCtx struct {
	// InstName is an instance name to promote.
	InstName string
	// Publishers is data publisher factory.
	Publishers sdkcluster.Factory
	// Collectors is data collector factory.
	Collectors sdkcluster.Factory
	// Integrity is the integrity context for cluster reads.
	Integrity integrity.IntegrityCtx
	// IsApplication true if an application passed.
	IsApplication bool
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
	// Conn is an active connection to a passed instance.
	Conn connector.Connector
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Force true if unavailable instances can be skipped.
	Force bool
	// Timeout describes a timeout in seconds.
	// We keep int as it can be passed to the target instance.
	Timeout int
}

PromoteCtx describes the context to promote an instance.

type RolesChangeCtx

type RolesChangeCtx struct {
	// InstName is an instance name in which add or remove role.
	InstName string
	// GroupName is a replicaset name in which add or remove role.
	GroupName string
	// ReplicasetName is a replicaset name in which add or remove role.
	ReplicasetName string
	// IsGlobal is a boolean value if role needs to add in global scope.
	IsGlobal bool
	// RoleName is a name of role to add.
	RoleName string
	// Publishers is a data publisher factory.
	Publishers sdkcluster.Factory
	// Collectors is a data collector factory.
	Collectors sdkcluster.Factory
	// Integrity is the integrity context for cluster reads.
	Integrity integrity.IntegrityCtx
	// IsApplication is true if an application passed.
	IsApplication bool
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
	// Conn is an active connection to a passed instance.
	Conn connector.Connector
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Force is true if unavailable instances can be skipped.
	Force bool
	// Timeout describes a timeout in seconds.
	// We keep int as it can be passed to the target instance.
	Timeout int
}

RolesChangeCtx describes the context to add/remove role for provided config scope.

type UpgradeOpts

type UpgradeOpts struct {
	// List of replicaset names specified by the user for the upgrade.
	ChosenReplicasetAliases []string
	// Timeout period (in seconds) for waiting on LSN synchronization.
	LsnTimeout int
}

UpgradeOpts contains options used for the upgrade process.

type VShardCmdCtx

type VShardCmdCtx struct {
	// IsApplication true if an application passed.
	IsApplication bool
	// RunningCtx is an application running context.
	RunningCtx running.RunningCtx
	// Conn is an active connection to a passed instance.
	Conn connector.Connector
	// Orchestrator is the orchestrator to use.
	Orchestrator replicaset.Orchestrator
	// Publishers is data publisher factory.
	Publishers sdkcluster.Factory
	// Collectors is data collector factory.
	Collectors sdkcluster.Factory
	// Integrity is the integrity context for cluster reads.
	Integrity integrity.IntegrityCtx
	// Timeout describes a timeout in seconds.
	// We keep int as it can be passed to the target instance.
	Timeout int
}

VShardCmdCtx describes context for vshard commands.

Jump to

Keyboard shortcuts

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