vtctlbackup

package
v0.15.10 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XtraBackup = iota
	BuiltinBackup
	Mysqlctld
)

constants for test variants

Variables

View Source
var (
	SetupReplica3Tablet func(extraArgs []string) (*cluster.Vttablet, error)
)

Functions

func ExecTestIncrementalBackupAndRestoreToPos

func ExecTestIncrementalBackupAndRestoreToPos(t *testing.T, tcase *PITRTestCase)

ExecTestIncrementalBackupAndRestoreToPos runs a series of backups: a full backup and multiple incremental backups. in between, it makes writes to the database, and takes notes: what data was available in what backup. It then restores each and every one of those backups, in random order, and expects to find the specific data associated with the backup.

func ExecTestIncrementalBackupAndRestoreToTimestamp

func ExecTestIncrementalBackupAndRestoreToTimestamp(t *testing.T, tcase *PITRTestCase)

ExecTestIncrementalBackupAndRestoreToPos

func ExecTestIncrementalBackupOnTwoTablets

func ExecTestIncrementalBackupOnTwoTablets(t *testing.T, tcase *PITRTestCase)

ExecTestIncrementalBackupOnTwoTablets runs a series of interleaved backups on two different replicas: full and incremental. Specifically, it's designed to test how incremental backups are taken by interleaved replicas, so that they successfully build on one another.

func FlushAndPurgeBinaryLogsOnReplica

func FlushAndPurgeBinaryLogsOnReplica(t *testing.T, replicaIndex int) (lastBinlog string)

FlushAndPurgeBinaryLogsOnReplica intentionally loses all existing binary logs. It flushes into a new binary log and immediately purges all previous logs. This is used to lose information.

func FlushBinaryLogsOnReplica

func FlushBinaryLogsOnReplica(t *testing.T, replicaIndex int, count int)

FlushBinaryLogsOnReplica issues `FLUSH BINARY LOGS` <count> times

func GetReplicaGtidPurged

func GetReplicaGtidPurged(t *testing.T, replicaIndex int) string

func GetReplicaPosition

func GetReplicaPosition(t *testing.T, replicaIndex int) string

func InitTestTable

func InitTestTable(t *testing.T)

func InsertRowOnPrimary

func InsertRowOnPrimary(t *testing.T, hint string)

func LaunchCluster

func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *CompressionDetails) (int, error)

LaunchCluster : starts the cluster as per given params.

func ReadRowsFromPrimary

func ReadRowsFromPrimary(t *testing.T) (msgs []string)

func ReadRowsFromReplica

func ReadRowsFromReplica(t *testing.T, replicaIndex int) (msgs []string)

func ReadRowsFromTablet

func ReadRowsFromTablet(t *testing.T, tablet *cluster.Vttablet) (msgs []string)

func RemoveBackup

func RemoveBackup(t *testing.T, backupName string)

func TearDownCluster

func TearDownCluster()

TearDownCluster shuts down all cluster processes

func TestBackup

func TestBackup(t *testing.T, setupType int, streamMode string, stripes int, cDetails *CompressionDetails, runSpecific []string) error

TestBackup runs all the backup tests

func TestReplicaFullBackup

func TestReplicaFullBackup(t *testing.T, replicaIndex int) (manifest *mysqlctl.BackupManifest)

func TestReplicaFullRestore

func TestReplicaFullRestore(t *testing.T, replicaIndex int, expectError string)

func TestReplicaIncrementalBackup

func TestReplicaIncrementalBackup(t *testing.T, replicaIndex int, incrementalFromPos string, expectEmpty bool, expectError string) (manifest *mysqlctl.BackupManifest, backupName string)

func TestReplicaRestoreToPos

func TestReplicaRestoreToPos(t *testing.T, replicaIndex int, restoreToPos replication.Position, expectError string)

func TestReplicaRestoreToTimestamp

func TestReplicaRestoreToTimestamp(t *testing.T, restoreToTimestamp time.Time, expectError string)

Types

type CompressionDetails

type CompressionDetails struct {
	CompressorEngineName            string
	ExternalCompressorCmd           string
	ExternalCompressorExt           string
	ExternalDecompressorCmd         string
	ManifestExternalDecompressorCmd string
}

type PITRTestCase

type PITRTestCase struct {
	Name           string
	SetupType      int
	ComprssDetails *CompressionDetails
}

Jump to

Keyboard shortcuts

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