backup

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 27 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancelled = errors.New("backup canceled")

ErrCancelled means backup was canceled

Functions

func Compress added in v1.1.0

func Compress(w io.Writer, compression pbm.CompressionType) io.WriteCloser

Compress makes a compressed writer from the given one

func NodeSuits

func NodeSuits(node *pbm.Node, inf *pbm.NodeInfo) (bool, error)

NodeSuits checks if node can perform backup

func Upload added in v1.2.0

func Upload(ctx context.Context, src Source, dst storage.Storage, compression pbm.CompressionType, fname string, sizeb int) (int64, error)

Upload writes data to dst from given src and returns an amount of written bytes

Types

type Backup

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

func New

func New(cn *pbm.PBM, node *pbm.Node) *Backup

func (*Backup) Init added in v1.5.0

func (b *Backup) Init(bcp pbm.BackupCmd, opid pbm.OPID, balancer pbm.BalancerMode) error

func (*Backup) Run

func (b *Backup) Run(ctx context.Context, bcp pbm.BackupCmd, opid pbm.OPID, l *plog.Event) (err error)

Run runs the backup

type ErrInsuffRange added in v1.3.2

type ErrInsuffRange struct {
	primitive.Timestamp
}

func (ErrInsuffRange) Error added in v1.3.2

func (e ErrInsuffRange) Error() string

type NopCloser added in v1.1.0

type NopCloser struct {
	io.Writer
}

NopCloser wraps an io.Witer as io.WriteCloser with noop Close

func (NopCloser) Close added in v1.1.0

func (NopCloser) Close() error

Close to satisfy io.WriteCloser interface

type Oplog added in v1.1.0

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

Oplog is used for reading the Mongodb oplog

func NewOplog added in v1.1.0

func NewOplog(node *pbm.Node) *Oplog

NewOplog creates a new Oplog instance

func (*Oplog) IsSufficient added in v1.6.0

func (ot *Oplog) IsSufficient(from primitive.Timestamp) (bool, error)

IsSufficient check is oplog is sufficient back from the given date

func (*Oplog) LastWrite added in v1.1.0

func (ot *Oplog) LastWrite() (primitive.Timestamp, error)

LastWrite returns a timestamp of the last write operation readable by majority reads

func (*Oplog) SetTailingSpan added in v1.2.0

func (ot *Oplog) SetTailingSpan(start, end primitive.Timestamp)

SetTailingSpan sets oplog tailing window

func (*Oplog) WriteTo added in v1.2.0

func (ot *Oplog) WriteTo(w io.Writer) (int64, error)

WriteTo writes an oplog slice between start and end timestamps into the given io.Writer

To be sure we have read ALL records up to the specified cluster time. Specifically, to be sure that no operations from the past gonna came after we finished the slicing, we have to tail until some record with ts > endTS. And it might be a noop.

type Source added in v1.2.0

type Source interface {
	io.WriterTo
}

Jump to

Keyboard shortcuts

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