Documentation
¶
Index ¶
- Variables
- type DatasetReplicator
- type Stats
- type T
- func (t *T) CopyWithStats(ctx context.Context, dst io.Writer, src io.Reader, stats *Stats) (uint64, error)
- func (t *T) GetMaxDelay(lastSync time.Time) time.Duration
- func (t *T) GetTargetNodenames(target, nodes, drpNodes []string) []string
- func (t *T) GetTargetPeernames(target, nodes, drpNodes []string) []string
- func (t *T) IsInstanceSufficientlyStarted(ctx context.Context) (bool, string)
- func (t *T) MaxDelayOrigin() string
- func (t *T) RunDir() runfiles.Dir
- func (t *T) Running() (resource.RunningInfoList, error)
- func (t *T) SelectPeernames(target, configured, nodes, drpNodes []string) ([]string, error)
- func (t *T) StartRun() (func(), error)
- func (t *T) StatusLastSync(nodenames []string, receiving bool) status.T
- func (t *T) WriteLastSync(nodename string) error
- func (t *T) WritePeerLastSync(ctx context.Context, peer string) error
Constants ¶
This section is empty.
Variables ¶
var ( KWMaxDelay = keywords.Keyword{ Aliases: []string{"sync_max_delay"}, Attr: "MaxDelay", Converter: converters.Duration, DefaultOption: "sync_max_delay", Option: "max_delay", Text: keywords.NewText(fs, "text/kw/max_delay"), } KWSchedule = keywords.Keyword{ Attr: "Schedule", DefaultOption: "sync_schedule", Example: "00:00-01:00 mon", Option: "schedule", Scopable: true, Text: keywords.NewText(fs, "text/kw/schedule"), } BaseKeywords = []*keywords.Keyword{ &KWMaxDelay, &KWSchedule, } )
Functions ¶
This section is empty.
Types ¶
type DatasetReplicator ¶
type DatasetReplicator interface {
RID() string
ReplicatesDataset(dataset string) bool
GetMaxDelay(lastSync time.Time) time.Duration
MaxDelayOrigin() string
}
DatasetReplicator is a sync resource replicating zfs datasets to its peers, as sync.zfs does. It tells the snapshot resources of the object which of their datasets reach the peers, and how fresh the replicas are expected to be.
type Stats ¶
type T ¶
type T struct {
resource.T
MaxDelay *time.Duration `json:"max_delay"`
Schedule string `json:"schedule"`
Path naming.Path `json:"path"`
}
func (*T) CopyWithStats ¶
func (*T) GetMaxDelay ¶
GetMaxDelay is how long after lastSync the copy is stale: max_delay when set, or else derived from the schedule, 0 meaning neither is.
func (*T) GetTargetNodenames ¶
func (*T) GetTargetPeernames ¶
func (*T) IsInstanceSufficientlyStarted ¶
IsInstanceSufficientlyStarted reports whether this node holds the instance the data is replicated from, and why not when it does not. See instance.IsReplicationSource for the rules.
A node where its reference resources are not up is a passive one, which must not send: its copy would replace the one of the active node.
func (*T) MaxDelayOrigin ¶
MaxDelayOrigin says where GetMaxDelay takes its value from, for the messages to say why a copy is stale.
func (*T) RunDir ¶
RunDir holds a file per sync in progress, as the one of a task: the daemon watches it, and marks the resource and its instance running while a file is there.
func (*T) Running ¶
func (t *T) Running() (resource.RunningInfoList, error)
Running implements resource.Runninger: the syncs in progress, from their run files.
func (*T) SelectPeernames ¶
SelectPeernames is the peers a run asked to sync to target reaches, among the peers of configured, the target of the configuration. An empty target asks all of them. A target is "nodes", "drpnodes", "local", or a node selector expression, so a peer that needs syncing on its own is named.
func (*T) StatusLastSync ¶
StatusLastSync judges the freshness of the copies of nodenames. receiving says this node is one of them, a node the data is replicated to, whose copy has a recovery point objective: its max delay.
func (*T) WriteLastSync ¶
func (*T) WritePeerLastSync ¶
WritePeerLastSync records that peer was synced now, and sends it the records it reads: its own last sync, which its status tells the freshness of its copy from, the last sync of this node, and the last run of the schedule, which keeps its scheduler from syncing again too soon if it becomes the source.
The records of the other peers are not sent: a node reads them only once it is the source, and its first sync writes them.