endpoint

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package endpoint implements replication endpoints for use with package replication.

Index

Constants

View Source
const (
	ClientIdentityKey contextKey = iota
)
View Source
const (
	LastReceivedHoldTagNamePrefix = "zrepl_last_received_J_"
)

Variables

View Source
var ErrV1ReplicationCursor = fmt.Errorf("bookmark name is a v1-replication cursor")

Functions

func AbstractionEquals added in v0.3.0

func AbstractionEquals(a, b Abstraction) bool

func AbstractionsCacheInvalidate added in v0.3.0

func AbstractionsCacheInvalidate(fs string)

func BatchDestroy added in v0.3.0

func BatchDestroy(ctx context.Context, abs []Abstraction) <-chan BatchDestroyResult

func GetMostRecentReplicationCursorOfJob added in v0.3.0

func GetMostRecentReplicationCursorOfJob(ctx context.Context, fs string, jobID JobID) (*zfs.FilesystemVersion, error)

may return nil for both values, indicating there is no cursor

func GetReplicationCursors added in v0.3.0

func GetReplicationCursors(ctx context.Context, dp *zfs.DatasetPath, jobID JobID) ([]zfs.FilesystemVersion, error)

func LastReceivedHoldTag added in v0.3.0

func LastReceivedHoldTag(jobID JobID) (string, error)

func ListAbstractions added in v0.3.0

func ListAbstractions(ctx context.Context, query ListZFSHoldsAndBookmarksQuery) (out []Abstraction, outErrs []ListAbstractionsError, err error)

func ListAbstractionsStreamed added in v0.3.0

func ListAbstractionsStreamed(ctx context.Context, query ListZFSHoldsAndBookmarksQuery) (_ <-chan Abstraction, _ <-chan ListAbstractionsError, drainDone func(), _ error)

if err != nil, the returned channels are both nil if err == nil, both channels must be fully drained by the caller to avoid leaking goroutines. After draining is done, the caller must call the returned drainDone func.

func RegisterMetrics added in v0.3.0

func RegisterMetrics(r prometheus.Registerer)

func ReplicationCursorBookmarkName added in v0.3.0

func ReplicationCursorBookmarkName(fs string, guid uint64, id JobID) (string, error)

func StepHoldTag added in v0.3.0

func StepHoldTag(jobid JobID) (string, error)

func TentativeReplicationCursorBookmarkName added in v0.3.0

func TentativeReplicationCursorBookmarkName(fs string, guid uint64, id JobID) (string, error)

v must be validated by caller

func TestClientIdentity

func TestClientIdentity(rootFS *zfs.DatasetPath, clientIdentity string) error

Types

type Abstraction added in v0.3.0

type Abstraction interface {
	GetType() AbstractionType
	GetFS() string
	GetName() string
	GetFullPath() string
	GetJobID() *JobID // may return nil if the abstraction does not have a JobID
	GetCreateTXG() uint64
	GetFilesystemVersion() zfs.FilesystemVersion
	String() string
	// destroy the abstraction: either releases the hold or destroys the bookmark
	Destroy(context.Context) error
	json.Marshaler
}

Implementation Note: Whenever you add a new accessor, adjust AbstractionJSON.MarshalJSON accordingly

func CreateLastReceivedHold added in v0.3.0

func CreateLastReceivedHold(ctx context.Context, fs string, to zfs.FilesystemVersion, jobID JobID) (Abstraction, error)

func CreateReplicationCursor added in v0.3.0

func CreateReplicationCursor(ctx context.Context, fs string, target zfs.FilesystemVersion, jobID JobID) (a Abstraction, err error)

idempotently create a replication cursor targeting `target`

returns ErrBookmarkCloningNotSupported if version is a bookmark and bookmarking bookmarks is not supported by ZFS

func CreateTentativeReplicationCursor added in v0.3.0

func CreateTentativeReplicationCursor(ctx context.Context, fs string, target zfs.FilesystemVersion, jobID JobID) (a Abstraction, err error)

func HoldStep added in v0.3.0

func HoldStep(ctx context.Context, fs string, v zfs.FilesystemVersion, jobID JobID) (Abstraction, error)

idempotently hold `version`

func LastReceivedHoldExtractor added in v0.3.0

func LastReceivedHoldExtractor(fs *zfs.DatasetPath, v zfs.FilesystemVersion, holdTag string) Abstraction

func ReplicationCursorV1Extractor added in v0.3.0

func ReplicationCursorV1Extractor(fs *zfs.DatasetPath, v zfs.FilesystemVersion) (_ Abstraction)

func ReplicationCursorV2Extractor added in v0.3.0

func ReplicationCursorV2Extractor(fs *zfs.DatasetPath, v zfs.FilesystemVersion) (_ Abstraction)

func StepHoldExtractor added in v0.3.0

func StepHoldExtractor(fs *zfs.DatasetPath, v zfs.FilesystemVersion, holdTag string) Abstraction

func TentativeReplicationCursorExtractor added in v0.3.0

func TentativeReplicationCursorExtractor(fs *zfs.DatasetPath, v zfs.FilesystemVersion) (_ Abstraction)

type AbstractionJSON added in v0.3.0

type AbstractionJSON struct{ Abstraction }

func (AbstractionJSON) MarshalJSON added in v0.3.0

func (a AbstractionJSON) MarshalJSON() ([]byte, error)

type AbstractionType added in v0.3.0

type AbstractionType string
const (
	AbstractionStepHold                           AbstractionType = "step-hold"
	AbstractionLastReceivedHold                   AbstractionType = "last-received-hold"
	AbstractionTentativeReplicationCursorBookmark AbstractionType = "tentative-replication-cursor-bookmark-v2"
	AbstractionReplicationCursorBookmarkV1        AbstractionType = "replication-cursor-bookmark-v1"
	AbstractionReplicationCursorBookmarkV2        AbstractionType = "replication-cursor-bookmark-v2"
)

Implementation note: There are a lot of exhaustive switches on AbstractionType in the code base. When adding a new abstraction type, make sure to search and update them!

func (AbstractionType) BookmarkExtractor added in v0.3.0

func (t AbstractionType) BookmarkExtractor() BookmarkExtractor

returns nil if the abstraction type is not bookmark-based

func (AbstractionType) BookmarkNamer added in v0.3.0

func (t AbstractionType) BookmarkNamer() func(fs string, guid uint64, jobId JobID) (string, error)

func (AbstractionType) HoldExtractor added in v0.3.0

func (t AbstractionType) HoldExtractor() HoldExtractor

returns nil if the abstraction type is not hold-based

func (AbstractionType) IsSnapshotOrBookmark added in v0.6.1

func (t AbstractionType) IsSnapshotOrBookmark() bool

func (AbstractionType) MustValidate added in v0.3.0

func (t AbstractionType) MustValidate() error

func (AbstractionType) Validate added in v0.3.0

func (t AbstractionType) Validate() error

type AbstractionTypeSet added in v0.3.0

type AbstractionTypeSet map[AbstractionType]bool

func AbstractionTypeSetFromStrings added in v0.3.0

func AbstractionTypeSetFromStrings(sts []string) (AbstractionTypeSet, error)

func (AbstractionTypeSet) ContainsAll added in v0.3.0

func (s AbstractionTypeSet) ContainsAll(q AbstractionTypeSet) bool

func (AbstractionTypeSet) ContainsAnyOf added in v0.3.0

func (s AbstractionTypeSet) ContainsAnyOf(q AbstractionTypeSet) bool

func (AbstractionTypeSet) ExtractBookmark added in v0.6.1

Use the `BookmarkExtractor()` method of each abstraction type in this set to try extract an abstraction from the given FilesystemVersion.

Abstraction types in this set that don't have a bookmark extractor are skipped.

Panics if more than one abstraction type matches.

func (AbstractionTypeSet) String added in v0.3.0

func (s AbstractionTypeSet) String() string

func (AbstractionTypeSet) Validate added in v0.3.0

func (s AbstractionTypeSet) Validate() error

type BatchDestroyResult added in v0.3.0

type BatchDestroyResult struct {
	Abstraction
	DestroyErr error
}

func (BatchDestroyResult) MarshalJSON added in v0.3.0

func (r BatchDestroyResult) MarshalJSON() ([]byte, error)

type BookmarkExtractor added in v0.3.0

type BookmarkExtractor func(fs *zfs.DatasetPath, v zfs.FilesystemVersion) Abstraction

type CreateTXGRange added in v0.3.0

type CreateTXGRange struct {
	// if not nil: The hold's snapshot or the bookmark's createtxg must be greater than (or equal) Since
	// else: CreateTXG of the hold or bookmark can be any value accepted by Until
	Since *CreateTXGRangeBound
	// if not nil: The hold's snapshot or the bookmark's createtxg must be less than (or equal) Until
	// else: CreateTXG of the hold or bookmark can be any value accepted by Since
	Until *CreateTXGRangeBound
}

A non-empty range of CreateTXGs

If both Since and Until are nil, any CreateTXG is acceptable

func (*CreateTXGRange) Contains added in v0.3.0

func (r *CreateTXGRange) Contains(qCreateTxg uint64) bool

panics if not .Validate()

func (*CreateTXGRange) IsUnbounded added in v0.3.0

func (r *CreateTXGRange) IsUnbounded() bool

panics if not .Validate()

func (*CreateTXGRange) String added in v0.3.0

func (r *CreateTXGRange) String() string

func (*CreateTXGRange) Validate added in v0.3.0

func (r *CreateTXGRange) Validate() error

type CreateTXGRangeBound added in v0.3.0

type CreateTXGRangeBound struct {
	CreateTXG uint64
	Inclusive *nodefault.Bool // must not be nil
}

func (*CreateTXGRangeBound) Validate added in v0.3.0

func (i *CreateTXGRangeBound) Validate() error

type FSFilter

type FSFilter interface {
	Filter(path *zfs.DatasetPath) (pass bool, err error)
	UserSpecifiedDatasets() zfs.UserSpecifiedDatasetsSet
}

type FSMap

type FSMap interface {
	FSFilter
	Map(path *zfs.DatasetPath) (*zfs.DatasetPath, error)
	Invert() (FSMap, error)
	AsFilter() FSFilter
}

FIXME: can we get away without error types here?

type HoldExtractor added in v0.3.0

type HoldExtractor = func(fs *zfs.DatasetPath, v zfs.FilesystemVersion, tag string) Abstraction

type JobID added in v0.3.0

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

JobID instances returned by MakeJobID() guarantee their JobID.String() can be used in ZFS dataset names and hold tags.

func MakeJobID added in v0.3.0

func MakeJobID(s string) (JobID, error)

func MustMakeJobID added in v0.3.0

func MustMakeJobID(s string) JobID

func ParseLastReceivedHoldTag added in v0.3.0

func ParseLastReceivedHoldTag(tag string) (JobID, error)

err != nil always means that the bookmark is not a step bookmark

func ParseReplicationCursorBookmarkName added in v0.3.0

func ParseReplicationCursorBookmarkName(fullname string) (uint64, JobID, error)

err != nil always means that the bookmark is not a valid replication bookmark

Returns ErrV1ReplicationCursor as error if the bookmark is a v1 replication cursor

func ParseStepHoldTag added in v0.3.0

func ParseStepHoldTag(tag string) (JobID, error)

err != nil always means that the bookmark is not a step bookmark

func ParseTentativeReplicationCursorBookmarkName added in v0.3.0

func ParseTentativeReplicationCursorBookmarkName(fullname string) (guid uint64, jobID JobID, err error)

name is the full bookmark name, including dataset path

err != nil always means that the bookmark is not a step bookmark

func (JobID) MarshalJSON added in v0.3.0

func (j JobID) MarshalJSON() ([]byte, error)

func (JobID) MustValidate added in v0.3.0

func (j JobID) MustValidate()

func (JobID) String added in v0.3.0

func (j JobID) String() string

func (*JobID) UnmarshalJSON added in v0.3.0

func (j *JobID) UnmarshalJSON(b []byte) error

type ListAbstractionsError added in v0.3.0

type ListAbstractionsError struct {
	FS   string
	Snap string
	What string
	Err  error
}

func (ListAbstractionsError) Error added in v0.3.0

func (e ListAbstractionsError) Error() string

type ListAbstractionsErrors added in v0.3.0

type ListAbstractionsErrors []ListAbstractionsError

func (ListAbstractionsErrors) Error added in v0.3.0

func (e ListAbstractionsErrors) Error() string

type ListStaleQueryError added in v0.3.0

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

type ListZFSHoldsAndBookmarksQuery added in v0.3.0

type ListZFSHoldsAndBookmarksQuery struct {
	FS ListZFSHoldsAndBookmarksQueryFilesystemFilter
	// What abstraction types should match (any contained in the set)
	What AbstractionTypeSet

	// if not nil: JobID of the hold or bookmark in question must be equal
	// else: JobID of the hold or bookmark can be any value
	JobID *JobID

	// zero-value means any CreateTXG is acceptable
	CreateTXG CreateTXGRange

	// Number of concurrently queried filesystems. Must be >= 1
	Concurrency int64
}

func (*ListZFSHoldsAndBookmarksQuery) Validate added in v0.3.0

func (q *ListZFSHoldsAndBookmarksQuery) Validate() error

type ListZFSHoldsAndBookmarksQueryFilesystemFilter added in v0.3.0

type ListZFSHoldsAndBookmarksQueryFilesystemFilter struct {
	FS     *string
	Filter zfs.DatasetFilter
}

FS == nil XOR Filter == nil

func (*ListZFSHoldsAndBookmarksQueryFilesystemFilter) Filesystems added in v0.3.0

func (*ListZFSHoldsAndBookmarksQueryFilesystemFilter) Validate added in v0.3.0

type Logger

type Logger = logger.Logger

type PlaceholderCreationEncryptionProperty added in v0.5.0

type PlaceholderCreationEncryptionProperty int
const (
	PlaceholderCreationEncryptionPropertyUnspecified PlaceholderCreationEncryptionProperty = 1 << iota
	PlaceholderCreationEncryptionPropertyInherit
	PlaceholderCreationEncryptionPropertyOff
)

Note: the constant names, transformed through enumer, are part of the config format!

func PlaceholderCreationEncryptionPropertyString added in v0.5.0

func PlaceholderCreationEncryptionPropertyString(s string) (PlaceholderCreationEncryptionProperty, error)

PlaceholderCreationEncryptionPropertyString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func PlaceholderCreationEncryptionPropertyValues added in v0.5.0

func PlaceholderCreationEncryptionPropertyValues() []PlaceholderCreationEncryptionProperty

PlaceholderCreationEncryptionPropertyValues returns all values of the enum

func (PlaceholderCreationEncryptionProperty) IsAPlaceholderCreationEncryptionProperty added in v0.5.0

func (i PlaceholderCreationEncryptionProperty) IsAPlaceholderCreationEncryptionProperty() bool

IsAPlaceholderCreationEncryptionProperty returns "true" if the value is listed in the enum definition. "false" otherwise

func (PlaceholderCreationEncryptionProperty) String added in v0.5.0

type Receiver

type Receiver struct {
	pdu.UnsafeReplicationServer // prefer compilation errors over default 'method X not implemented' impl

	Test_OverrideClientIdentityFunc func() string // for use by platformtest
	// contains filtered or unexported fields
}

Receiver implements replication.ReplicationEndpoint for a receiving side

func NewReceiver

func NewReceiver(config ReceiverConfig) *Receiver

func (*Receiver) DestroySnapshots

func (s *Receiver) DestroySnapshots(ctx context.Context, req *pdu.DestroySnapshotsReq) (*pdu.DestroySnapshotsRes, error)

func (*Receiver) ListFilesystemVersions

func (s *Receiver) ListFilesystemVersions(ctx context.Context, req *pdu.ListFilesystemVersionsReq) (*pdu.ListFilesystemVersionsRes, error)

func (*Receiver) ListFilesystems

func (s *Receiver) ListFilesystems(ctx context.Context, req *pdu.ListFilesystemReq) (*pdu.ListFilesystemRes, error)

func (*Receiver) Ping

func (s *Receiver) Ping(ctx context.Context, req *pdu.PingReq) (*pdu.PingRes, error)

func (*Receiver) PingDataconn

func (s *Receiver) PingDataconn(ctx context.Context, req *pdu.PingReq) (*pdu.PingRes, error)

func (*Receiver) Receive

func (s *Receiver) Receive(ctx context.Context, req *pdu.ReceiveReq, receive io.ReadCloser) (*pdu.ReceiveRes, error)

func (*Receiver) ReplicationCursor

func (s *Receiver) ReplicationCursor(ctx context.Context, _ *pdu.ReplicationCursorReq) (*pdu.ReplicationCursorRes, error)

func (*Receiver) Send

func (s *Receiver) Send(ctx context.Context, req *pdu.SendReq) (*pdu.SendRes, io.ReadCloser, error)

func (*Receiver) SendCompleted added in v0.3.0

func (p *Receiver) SendCompleted(ctx context.Context, _ *pdu.SendCompletedReq) (*pdu.SendCompletedRes, error)

func (*Receiver) SendDry added in v0.5.0

func (s *Receiver) SendDry(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, error)

func (*Receiver) WaitForConnectivity

func (s *Receiver) WaitForConnectivity(ctx context.Context) error

type ReceiverConfig added in v0.3.0

type ReceiverConfig struct {
	JobID JobID

	RootWithoutClientComponent *zfs.DatasetPath
	AppendClientIdentity       bool

	InheritProperties  []zfsprop.Property
	OverrideProperties map[zfsprop.Property]string

	BandwidthLimit bandwidthlimit.Config

	PlaceholderEncryption PlaceholderCreationEncryptionProperty
}

NOTE: when adding members to this struct, remember to add them to `ReceiverConfig.copyIn()`

func (*ReceiverConfig) Validate added in v0.3.0

func (c *ReceiverConfig) Validate() error

type ReplicationCursorV1 added in v0.3.0

type ReplicationCursorV1 struct {
	Type AbstractionType
	FS   string
	zfs.FilesystemVersion
}

func (ReplicationCursorV1) Destroy added in v0.3.0

func (c ReplicationCursorV1) Destroy(ctx context.Context) error

func (ReplicationCursorV1) GetFS added in v0.3.0

func (c ReplicationCursorV1) GetFS() string

func (ReplicationCursorV1) GetFilesystemVersion added in v0.3.0

func (c ReplicationCursorV1) GetFilesystemVersion() zfs.FilesystemVersion

func (ReplicationCursorV1) GetFullPath added in v0.3.0

func (c ReplicationCursorV1) GetFullPath() string

func (ReplicationCursorV1) GetJobID added in v0.3.0

func (c ReplicationCursorV1) GetJobID() *JobID

func (ReplicationCursorV1) GetType added in v0.3.0

func (ReplicationCursorV1) MarshalJSON added in v0.3.0

func (c ReplicationCursorV1) MarshalJSON() ([]byte, error)

func (ReplicationCursorV1) String added in v0.3.0

func (c ReplicationCursorV1) String() string

type ReplicationGuaranteeIncremental added in v0.3.0

type ReplicationGuaranteeIncremental struct{}

func (ReplicationGuaranteeIncremental) Kind added in v0.3.0

func (ReplicationGuaranteeIncremental) ReceiverPostRecv added in v0.3.0

func (g ReplicationGuaranteeIncremental) ReceiverPostRecv(ctx context.Context, jid JobID, fs string, toRecvd zfs.FilesystemVersion) (keep []Abstraction, err error)

func (ReplicationGuaranteeIncremental) SenderPostRecvConfirmed added in v0.3.0

func (g ReplicationGuaranteeIncremental) SenderPostRecvConfirmed(ctx context.Context, jid JobID, fs string, to zfs.FilesystemVersion) (keep []Abstraction, err error)

func (ReplicationGuaranteeIncremental) SenderPreSend added in v0.3.0

func (g ReplicationGuaranteeIncremental) SenderPreSend(ctx context.Context, jid JobID, sendArgs *zfs.ZFSSendArgsValidated) (keep []Abstraction, err error)

func (ReplicationGuaranteeIncremental) String added in v0.6.1

type ReplicationGuaranteeKind added in v0.3.0

type ReplicationGuaranteeKind int
const (
	ReplicationGuaranteeKindResumability ReplicationGuaranteeKind = 1 << iota
	ReplicationGuaranteeKindIncremental
	ReplicationGuaranteeKindNone
)

func ReplicationGuaranteeKindString added in v0.3.0

func ReplicationGuaranteeKindString(s string) (ReplicationGuaranteeKind, error)

ReplicationGuaranteeKindString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ReplicationGuaranteeKindValues added in v0.3.0

func ReplicationGuaranteeKindValues() []ReplicationGuaranteeKind

ReplicationGuaranteeKindValues returns all values of the enum

func (ReplicationGuaranteeKind) IsAReplicationGuaranteeKind added in v0.3.0

func (i ReplicationGuaranteeKind) IsAReplicationGuaranteeKind() bool

IsAReplicationGuaranteeKind returns "true" if the value is listed in the enum definition. "false" otherwise

func (ReplicationGuaranteeKind) MarshalJSON added in v0.3.0

func (i ReplicationGuaranteeKind) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ReplicationGuaranteeKind

func (ReplicationGuaranteeKind) String added in v0.3.0

func (i ReplicationGuaranteeKind) String() string

func (*ReplicationGuaranteeKind) UnmarshalJSON added in v0.3.0

func (i *ReplicationGuaranteeKind) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReplicationGuaranteeKind

type ReplicationGuaranteeNone added in v0.3.0

type ReplicationGuaranteeNone struct{}

func (ReplicationGuaranteeNone) Kind added in v0.3.0

func (ReplicationGuaranteeNone) ReceiverPostRecv added in v0.3.0

func (g ReplicationGuaranteeNone) ReceiverPostRecv(ctx context.Context, jid JobID, fs string, toRecvd zfs.FilesystemVersion) (keep []Abstraction, err error)

func (ReplicationGuaranteeNone) SenderPostRecvConfirmed added in v0.3.0

func (g ReplicationGuaranteeNone) SenderPostRecvConfirmed(ctx context.Context, jid JobID, fs string, to zfs.FilesystemVersion) (keep []Abstraction, err error)

func (ReplicationGuaranteeNone) SenderPreSend added in v0.3.0

func (g ReplicationGuaranteeNone) SenderPreSend(ctx context.Context, jid JobID, sendArgs *zfs.ZFSSendArgsValidated) (keep []Abstraction, err error)

func (ReplicationGuaranteeNone) String added in v0.6.1

func (g ReplicationGuaranteeNone) String() string

type ReplicationGuaranteeOptions added in v0.3.0

type ReplicationGuaranteeOptions struct {
	Initial     ReplicationGuaranteeKind
	Incremental ReplicationGuaranteeKind
}

func (ReplicationGuaranteeOptions) Strategy added in v0.3.0

type ReplicationGuaranteeResumability added in v0.3.0

type ReplicationGuaranteeResumability struct{}

func (ReplicationGuaranteeResumability) Kind added in v0.3.0

func (ReplicationGuaranteeResumability) ReceiverPostRecv added in v0.3.0

func (g ReplicationGuaranteeResumability) ReceiverPostRecv(ctx context.Context, jid JobID, fs string, toRecvd zfs.FilesystemVersion) (keep []Abstraction, err error)

func (ReplicationGuaranteeResumability) SenderPostRecvConfirmed added in v0.3.0

func (g ReplicationGuaranteeResumability) SenderPostRecvConfirmed(ctx context.Context, jid JobID, fs string, to zfs.FilesystemVersion) (keep []Abstraction, err error)

func (ReplicationGuaranteeResumability) SenderPreSend added in v0.3.0

func (g ReplicationGuaranteeResumability) SenderPreSend(ctx context.Context, jid JobID, sendArgs *zfs.ZFSSendArgsValidated) (keep []Abstraction, err error)

func (ReplicationGuaranteeResumability) String added in v0.6.1

type ReplicationGuaranteeStrategy added in v0.3.0

type ReplicationGuaranteeStrategy interface {
	Kind() ReplicationGuaranteeKind
	SenderPreSend(ctx context.Context, jid JobID, sendArgs *zfs.ZFSSendArgsValidated) (keep []Abstraction, err error)
	ReceiverPostRecv(ctx context.Context, jid JobID, fs string, toRecvd zfs.FilesystemVersion) (keep []Abstraction, err error)
	SenderPostRecvConfirmed(ctx context.Context, jid JobID, fs string, to zfs.FilesystemVersion) (keep []Abstraction, err error)
}

func ReplicationGuaranteeFromKind added in v0.3.0

func ReplicationGuaranteeFromKind(k ReplicationGuaranteeKind) ReplicationGuaranteeStrategy

type Sender

type Sender struct {
	pdu.UnsafeReplicationServer // prefer compilation errors over default 'method X not implemented' impl

	FSFilter zfs.DatasetFilter
	// contains filtered or unexported fields
}

Sender implements replication.ReplicationEndpoint for a sending side

func NewSender

func NewSender(conf SenderConfig) *Sender

func (*Sender) DestroySnapshots

func (p *Sender) DestroySnapshots(ctx context.Context, req *pdu.DestroySnapshotsReq) (*pdu.DestroySnapshotsRes, error)

func (*Sender) ListFilesystemVersions

func (s *Sender) ListFilesystemVersions(ctx context.Context, r *pdu.ListFilesystemVersionsReq) (*pdu.ListFilesystemVersionsRes, error)

func (*Sender) ListFilesystems

func (s *Sender) ListFilesystems(ctx context.Context, r *pdu.ListFilesystemReq) (*pdu.ListFilesystemRes, error)

func (*Sender) Ping

func (p *Sender) Ping(ctx context.Context, req *pdu.PingReq) (*pdu.PingRes, error)

func (*Sender) PingDataconn

func (p *Sender) PingDataconn(ctx context.Context, req *pdu.PingReq) (*pdu.PingRes, error)

func (*Sender) Receive

func (p *Sender) Receive(ctx context.Context, r *pdu.ReceiveReq, _ io.ReadCloser) (*pdu.ReceiveRes, error)

func (*Sender) ReplicationCursor

func (p *Sender) ReplicationCursor(ctx context.Context, req *pdu.ReplicationCursorReq) (*pdu.ReplicationCursorRes, error)

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, io.ReadCloser, error)

func (*Sender) SendCompleted added in v0.3.0

func (p *Sender) SendCompleted(ctx context.Context, r *pdu.SendCompletedReq) (*pdu.SendCompletedRes, error)

func (*Sender) SendDry added in v0.5.0

func (s *Sender) SendDry(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, error)

func (*Sender) WaitForConnectivity

func (p *Sender) WaitForConnectivity(ctx context.Context) error

type SenderConfig added in v0.3.0

type SenderConfig struct {
	FSF   zfs.DatasetFilter
	JobID JobID

	Encrypt              *nodefault.Bool
	SendRaw              bool
	SendProperties       bool
	SendBackupProperties bool
	SendLargeBlocks      bool
	SendCompressed       bool
	SendEmbeddedData     bool
	SendSaved            bool

	BandwidthLimit bandwidthlimit.Config
}

func (*SenderConfig) Validate added in v0.3.0

func (c *SenderConfig) Validate() error

type StalenessInfo added in v0.3.0

type StalenessInfo struct {
	ConstructedWithQuery ListZFSHoldsAndBookmarksQuery
	Live                 []Abstraction
	Stale                []Abstraction
}

func ListStale added in v0.3.0

returns *ListStaleQueryError if the given query cannot be used for determining staleness info

Jump to

Keyboard shortcuts

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