defs

package
v1.8.1-0...-0157f87 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DB is a name of the PBM database
	DB = "admin"
	// LogCollection is the name of the mongo collection that contains PBM logs
	LogCollection = "pbmLog"
	// ConfigCollection is the name of the mongo collection that contains PBM configs
	ConfigCollection = "pbmConfig"
	// LockCollection is the name of the mongo collection that is used
	// by agents to coordinate mutually exclusive operations (e.g. backup/restore)
	LockCollection = "pbmLock"
	// LockOpCollection is the name of the mongo collection that is used
	// by agents to coordinate operations that don't need to be
	// mutually exclusive to other operation types (e.g. backup-delete)
	LockOpCollection = "pbmLockOp"
	// BcpCollection is a collection for backups metadata
	BcpCollection = "pbmBackups"
	// RestoresCollection is a collection for restores metadata
	RestoresCollection = "pbmRestores"
	// CmdStreamCollection is the name of the mongo collection that contains backup/restore commands stream
	CmdStreamCollection = "pbmCmd"
	// PITRChunksCollection contains index metadata of PITR chunks
	PITRChunksCollection = "pbmPITRChunks"
	// pbmPITR is a collection for PITR operational data
	PITRCollection = "pbmPITR"
	// PBMOpLogCollection contains log of acquired locks (hence run ops)
	PBMOpLogCollection = "pbmOpLog"
	// AgentsStatusCollection is an agents registry with its status/health checks
	AgentsStatusCollection = "pbmAgents"
)
View Source
const (
	// TmpUsersCollection and TmpRoles are tmp collections used to avoid
	// user related issues while resoring on new cluster and preserving UUID
	// See https://jira.percona.com/browse/PBM-425, https://jira.percona.com/browse/PBM-636
	TmpUsersCollection = `pbmRUsers`
	TmpRolesCollection = `pbmRRoles`
)
View Source
const (
	PITRcheckRange       = time.Second * 15
	AgentsStatCheckRange = time.Second * 5
)
View Source
const (
	// MetadataFileSuffix is a suffix for the metadata file on a storage
	MetadataFileSuffix = ".pbm.json"

	ExternalRsMetaFile = "pbm.rsmeta.%s.json"

	StorInitFile    = ".pbm.init"
	PhysRestoresDir = ".pbm.restore"
)
View Source
const (
	// DefaultPITRInterval oplog slicing time span
	DefaultPITRInterval = time.Minute * 10
	// PITRfsPrefix is a prefix (folder) for PITR chunks on the storage
	PITRfsPrefix = "pbmPitr"
)
View Source
const DefaultCompression = compress.CompressionTypeS2
View Source
const MaxReplicationLagTimeSec = 21
View Source
const StaleFrameSec uint32 = 30

Variables

View Source
var (
	WaitActionStart = time.Second * 15
	WaitBackupStart = WaitActionStart + PITRcheckRange*12/10 // 33 seconds
)

Functions

This section is empty.

Types

type BackupType

type BackupType string
const (
	PhysicalBackup    BackupType = "physical"
	ExternalBackup    BackupType = "external"
	IncrementalBackup BackupType = "incremental"
	LogicalBackup     BackupType = "logical"
)

type NodeHealth

type NodeHealth int
const (
	NodeHealthDown NodeHealth = iota
	NodeHealthUp
)

type NodeState

type NodeState int
const (
	NodeStateStartup NodeState = iota
	NodeStatePrimary
	NodeStateSecondary
	NodeStateRecovering

	NodeStateStartup2
	NodeStateUnknown
	NodeStateArbiter
	NodeStateDown
	NodeStateRollback
	NodeStateRemoved
)

https://github.com/mongodb/mongo/blob/v8.0/src/mongo/db/repl/member_state.h#L52-L109

type Operation

type Operation string
const (
	OperationInsert  Operation = "i"
	OperationNoop    Operation = "n"
	OperationUpdate  Operation = "u"
	OperationDelete  Operation = "d"
	OperationCommand Operation = "c"
)

type Status

type Status string

Status is a backup current status

const (
	StatusInit  Status = "init"
	StatusReady Status = "ready"

	// for phys restore, to indicate shards have been stopped
	StatusDown Status = "down"

	StatusStarting   Status = "starting"
	StatusRunning    Status = "running"
	StatusDumpDone   Status = "dumpDone"
	StatusCopyReady  Status = "copyReady"
	StatusCopyDone   Status = "copyDone"
	StatusPartlyDone Status = "partlyDone"
	StatusDone       Status = "done"
	StatusCancelled  Status = "canceled"
	StatusError      Status = "error"

	// status to communicate last op timestamp if it's not set
	// during external restore
	StatusExtTS Status = "lastTS"
)

func (Status) IsRunning

func (s Status) IsRunning() bool

Jump to

Keyboard shortcuts

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