Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigEqual(a, b *Config) bool
- func DropNode(nodename string)
- func InitData()
- func InstanceString(p naming.Path, nodename string) string
- func IsReferenceResource(group driver.Group, name string) bool
- func IsReplicationSource(refs []ReferenceStatus, force bool) (ok bool, reason string, forced bool)
- func ResourceFlagsString(rid string, states States, rstatus resource.Status) string
- type ActorConfig
- type Config
- type Data
- func (c *Data[T]) DropNode(nodename string)
- func (c *Data[T]) GetAll() []DataElement[T]
- func (c *Data[T]) GetByNode(nodename string) map[naming.Path]*T
- func (c *Data[T]) GetByPath(p naming.Path) map[string]*T
- func (c *Data[T]) GetByPathAndNode(p naming.Path, nodename string) *T
- func (c *Data[T]) GetPathsByNode(nodename string) []naming.Path
- func (c *Data[T]) Set(p naming.Path, nodename string, v *T)
- func (c *Data[T]) Unset(p naming.Path, nodename string)
- type DataElement
- type Dataer
- type EncapMap
- type EncapStatus
- type FlexConfig
- type Instance
- type Monitor
- type MonitorAction
- type MonitorGlobalExpect
- type MonitorGlobalExpectOptionsCapped
- type MonitorGlobalExpectOptionsPlacedAt
- type MonitorGlobalExpectOptionsProvisioned
- type MonitorGlobalExpectOptionsResized
- type MonitorGlobalExpectOptionsRestarted
- type MonitorGlobalExpectOptionsStopped
- type MonitorLocalExpect
- type MonitorState
- type MonitorUpdate
- type Node
- type ReferenceStatus
- type ResourceConfig
- type ResourceConfigs
- type ResourceMonitor
- type ResourceMonitorRestart
- type ResourceMonitors
- type ResourceOrder
- type ResourceStatuses
- type States
- type StatesList
- type Status
- func (t Status) DeepCopy() *Status
- func (t Status) IsFrozen() bool
- func (t Status) IsStopped() bool
- func (t Status) IsUnfrozen() bool
- func (t Status) ReplicationSource() (bool, string)
- func (t *Status) SortedResources() []resource.Status
- func (t Status) StoppedResources() []string
- func (t Status) Unstructured() map[string]any
- type SubsetConfig
- type SubsetConfigs
- type VolConfig
- type VolumeUsage
Constants ¶
const MaxResizeStages = 3
MaxResizeStages is how many stages a resize orchestration grows a chain in. A chain crossing more replicated resources than that is grown by hand, one stage at a time.
Variables ¶
var ( ErrInvalidGlobalExpect = errors.New("invalid instance monitor global expect") ErrInvalidLocalExpect = errors.New("invalid instance monitor local expect") ErrInvalidState = errors.New("invalid instance monitor state") ErrSameGlobalExpect = errors.New("instance monitor global expect is already set to the same value") )
var ( MonitorGlobalExpectStrings map[MonitorGlobalExpect]string MonitorGlobalExpectValues map[string]MonitorGlobalExpect )
var ( MonitorStateToString map[MonitorState]string StringToMonitorState map[string]MonitorState MonitorStatesFailure = []MonitorState{ MonitorStateCapFailure, MonitorStateDeleteFailure, MonitorStatePrepareFailure, MonitorStateWaitDestinationFailure, MonitorStateFreezeFailure, MonitorStateProvisionFailure, MonitorStatePurgeFailed, MonitorStateResizeFailure, MonitorStateShutdownFailure, MonitorStateStartFailure, MonitorStateStopFailure, MonitorStateUnfreezeFailure, MonitorStateUnprovisionFailure, } )
Functions ¶
func ConfigEqual ¶
ConfigEqual returns a boolean reporting whether a == b
Nodename and Path are not compared
func IsReferenceResource ¶
IsReferenceResource reports whether a resource of the group and driver name tells the active instance: the ones holding what the data lives on or is reached by, that is every resource but the app, sync and task ones, and the disk.scsireserv and disk.drbd ones, which are up on the passive nodes too.
func IsReplicationSource ¶
func IsReplicationSource(refs []ReferenceStatus, force bool) (ok bool, reason string, forced bool)
IsReplicationSource decides from the status of the reference resources of an instance whether it is the one the data is replicated from.
As v2 did, their aggregated availability must be up, or not applicable with their overall status up. An instance with no reference resource gives no way to tell the active one from the others, so none is. force makes an instance whose reference resources are neither down nor not applicable the source anyway, forced saying so, and reason why it would not be otherwise.
func ResourceFlagsString ¶
ResourceFlagsString formats resource flags as a vector of characters.
R Running M Monitored D Disabled O Optional E Encap P Provisioned S Standby <n> Restart remaining, + More than 9 remaining, X UserStopped
Types ¶
type ActorConfig ¶
type ActorConfig struct {
App string `json:"app,omitempty"`
Children naming.Relations `json:"children,omitempty"`
DRP bool `json:"drp,omitempty"`
Env string `json:"env,omitempty"`
MonitorAction []MonitorAction `json:"monitor_action,omitempty"`
PreMonitorAction string `json:"pre_monitor_action,omitempty"`
Orchestrate string `json:"orchestrate"`
Parents naming.Relations `json:"parents,omitempty"`
PlacementPolicy placement.Policy `json:"placement_policy"`
Resources ResourceConfigs `json:"resources"`
Schedules []schedule.Config `json:"schedules"`
Stonith bool `json:"stonith"`
// ProvisionDisabled and UnprovisionDisabled say provision=false and
// unprovision=false, as the node evaluates them: the resources are
// the sysadmin's to make, or to free, which an orchestration asking
// for it is refused for upfront.
ProvisionDisabled bool `json:"provision_disabled,omitempty"`
UnprovisionDisabled bool `json:"unprovision_disabled,omitempty"`
Subsets SubsetConfigs `json:"subsets"`
Topology topology.T `json:"topology,omitempty"`
Flex *FlexConfig `json:"flex,omitempty"`
// Claims is what the object claims of each compute type of its
// namespace, cluster-wide: thousandths of a cpu, and bytes of memory,
// -1 for a type its processes are not capped on.
//
// It is published with the configuration because that is where a
// claim reads what a namespace holds, and a claim is weighed when a
// configuration is written, before anything runs.
Claims map[string]int64 `json:"claims,omitempty"`
// IsDisabled is true when DEFAULT.disable is true
IsDisabled bool `json:"is_disabled"`
// WaitSyncsTimeout is how long a stop or a switch waits for the
// syncs running on the instance to end: DEFAULT.wait_syncs_timeout.
WaitSyncsTimeout time.Duration `json:"wait_syncs_timeout,omitempty"`
// HardAffinity and HardAntiAffinity are the objects whose instance
// must be up, or must not be, on a node for the object to start
// there. SoftAffinity and SoftAntiAffinity rank the nodes the
// same way, without excluding any.
HardAffinity naming.Paths `json:"hard_affinity,omitempty"`
HardAntiAffinity naming.Paths `json:"hard_anti_affinity,omitempty"`
SoftAffinity naming.Paths `json:"soft_affinity,omitempty"`
SoftAntiAffinity naming.Paths `json:"soft_anti_affinity,omitempty"`
// Uses are the cfg, sec and vol objects the resources of the object
// use, as the node evaluates its configuration, sorted: the
// datastores they read keys of, and the vol objects their volume
// resources are. A datastore named by a pattern of its name, as
// "ns1/sec/web-*", is the pattern. An object leaving its unprovision
// to the sysadmin keeps the ones it uses from a purge or a delete.
Uses []string `json:"uses,omitempty"`
// StartTimeout is how long a start may take, DEFAULT.start_timeout
// or else DEFAULT.timeout: a switch waits that long for the
// destination to be ready to start before it stops the source.
StartTimeout time.Duration `json:"start_timeout,omitempty"`
}
func (*ActorConfig) DeepCopy ¶
func (cfg *ActorConfig) DeepCopy() *ActorConfig
func (*ActorConfig) UsesObject ¶
func (cfg *ActorConfig) UsesObject(p naming.Path) bool
UsesObject says whether the object uses the object at p, as named or by a pattern of its name.
type Config ¶
type Config struct {
Path naming.Path `json:"-"`
Checksum string `json:"csum"`
Priority priority.T `json:"priority"`
Scope []string `json:"scope"`
UpdatedAt time.Time `json:"updated_at"`
Labels label.M `json:"labels,omitempty"`
*ActorConfig
*VolConfig
}
Config describes a configuration file content checksum, timestamp of last change and the nodes it should be installed on.
func (Config) Unstructured ¶
type Data ¶
Data defines a shared holder for all instances Dataer
func (*Data[T]) DropNode ¶
func (c *Data[T]) DropNode(nodename string)
DropNode removes node instances
func (*Data[T]) GetAll ¶
func (c *Data[T]) GetAll() []DataElement[T]
GetAll returns all instance data as a list of DataElements
func (*Data[T]) GetByPath ¶
GetByPath returns a map (indexed by nodename) of instance data for path p
func (*Data[T]) GetByPathAndNode ¶
GetByPathAndNode returns an instance data or nil if data is not found
func (*Data[T]) GetPathsByNode ¶
GetPathsByNode returns the paths of the instance data held for nodename
type EncapMap ¶
type EncapMap map[string]EncapStatus
type EncapStatus ¶
func (EncapStatus) DeepCopy ¶
func (t EncapStatus) DeepCopy() *EncapStatus
func (EncapStatus) Unstructured ¶
func (t EncapStatus) Unstructured() map[string]any
type FlexConfig ¶
type Instance ¶
type Instance struct {
Config *Config `json:"config"`
Monitor *Monitor `json:"monitor"`
Status *Status `json:"status"`
}
type Monitor ¶
type Monitor struct {
GlobalExpect MonitorGlobalExpect `json:"global_expect"`
GlobalExpectUpdatedAt time.Time `json:"global_expect_updated_at"`
GlobalExpectOptions any `json:"global_expect_options"`
// IsLeader flags the instance as the one where to provision as leader.
// The provisioning leader is responsible for preparing the shared resources.
// There can be only one leader, whatever the topology.
IsLeader bool `json:"is_leader"`
// IsHALeader flags the instances to start automatically if orchestrate=ha
// or when the admin posted a start orchestration.
// There can be one leader on a failover object, or many leaders with a flex topology.
IsHALeader bool `json:"is_ha_leader"`
LocalExpect MonitorLocalExpect `json:"local_expect"`
LocalExpectUpdatedAt time.Time `json:"local_expect_updated_at"`
// OrchestrationID is the accepted orchestration id that will be unset
// when orchestration is reached on local node
OrchestrationID uuid.UUID `json:"orchestration_id"`
// OrchestrationIsDone is set by the orchestration when it decides the instance state has reached its target.
// It is used to clear orchestration and orchestration id up when all instance monitors have
// OrchestrationIsDone set.
OrchestrationIsDone bool `json:"orchestration_is_done"`
SessionID xsession.ID `json:"session_id"`
State MonitorState `json:"state"`
StateUpdatedAt time.Time `json:"state_updated_at"`
MonitorActionExecutedAt time.Time `json:"monitor_action_executed_at"`
IsPreserved bool `json:"preserved"`
Resources ResourceMonitors `json:"resources,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
Parents map[string]status.T `json:"parents,omitempty"`
Children map[string]status.T `json:"children,omitempty"`
}
Monitor describes the in-daemon states of an instance
func (*Monitor) UnmarshalJSON ¶
func (Monitor) Unstructured ¶
type MonitorAction ¶
type MonitorAction string
var ( // MonitorActionNone: represents the no-operation monitor action MonitorActionNone MonitorAction = "none" // MonitorActionCrash represents the monitor action that will try system crash/panic MonitorActionCrash MonitorAction = "crash" // MonitorActionFreezeStop represents the monitor action that will try freeze and subsequently stop // the monitored instance. MonitorActionFreezeStop MonitorAction = "freezestop" // MonitorActionReboot represents the monitor action that will reboot the system. MonitorActionReboot MonitorAction = "reboot" // MonitorActionSwitch represents the monitor action that will stop instance stop to allow // any other cluster nodes to takeover instance. MonitorActionSwitch MonitorAction = "switch" )
type MonitorGlobalExpect ¶
type MonitorGlobalExpect int
const ( MonitorGlobalExpectInit MonitorGlobalExpect = iota MonitorGlobalExpectAborted MonitorGlobalExpectDeleted MonitorGlobalExpectFrozen MonitorGlobalExpectNone MonitorGlobalExpectPlaced MonitorGlobalExpectPlacedAt MonitorGlobalExpectProvisioned MonitorGlobalExpectPurged MonitorGlobalExpectResized MonitorGlobalExpectRestarted MonitorGlobalExpectStarted MonitorGlobalExpectStopped MonitorGlobalExpectUnfrozen MonitorGlobalExpectUnprovisioned MonitorGlobalExpectCapped // MonitorGlobalExpectUnknown is what a value this agent does not know decodes to: // a peer running a later version publishes values this one has no // name for, and failing to decode them failed the whole heartbeat // message the peer sent, which is how a peer is found dead. MonitorGlobalExpectUnknown )
func (MonitorGlobalExpect) MarshalText ¶
func (t MonitorGlobalExpect) MarshalText() ([]byte, error)
func (MonitorGlobalExpect) String ¶
func (t MonitorGlobalExpect) String() string
func (*MonitorGlobalExpect) UnmarshalText ¶
func (t *MonitorGlobalExpect) UnmarshalText(b []byte) error
type MonitorGlobalExpectOptionsCapped ¶
type MonitorGlobalExpectOptionsCapped struct {
ConfigUpdatedAt time.Time `json:"config_updated_at"`
}
MonitorGlobalExpectOptionsCapped carries the configuration a cap orchestration applies, so a node does not apply the caps it held before the request.
type MonitorGlobalExpectOptionsProvisioned ¶
type MonitorGlobalExpectOptionsProvisioned struct {
Adopt bool `json:"adopt,omitempty"`
}
MonitorGlobalExpectOptionsProvisioned carries how a provision treats the system resources it finds on the nodes: with Adopt, a provision takes over the ones there already, as replicated storage a restored object finds, rather than checking first that nothing holds them.
type MonitorGlobalExpectOptionsResized ¶
type MonitorGlobalExpectOptionsResized struct {
ConfigUpdatedAt time.Time `json:"config_updated_at"`
}
MonitorGlobalExpectOptionsResized carries the configuration a resize is for, so a node does not grow to the size it held before the request.
type MonitorGlobalExpectOptionsRestarted ¶
type MonitorGlobalExpectOptionsRestarted struct {
Force bool `json:"force"`
}
type MonitorGlobalExpectOptionsStopped ¶
type MonitorGlobalExpectOptionsStopped struct {
InterruptSyncs bool `json:"interrupt_syncs,omitempty"`
}
MonitorGlobalExpectOptionsStopped carries how a stop treats the syncs running on the instance: it waits for them to end, or it interrupts them when InterruptSyncs is set.
type MonitorLocalExpect ¶
type MonitorLocalExpect int
const ( MonitorLocalExpectInit MonitorLocalExpect = iota MonitorLocalExpectNone MonitorLocalExpectStarted MonitorLocalExpectShutdown MonitorLocalExpectEvicted // MonitorLocalExpectUnknown is what a value this agent does not know decodes to: // a peer running a later version publishes values this one has no // name for, and failing to decode them failed the whole heartbeat // message the peer sent, which is how a peer is found dead. MonitorLocalExpectUnknown )
func (MonitorLocalExpect) MarshalText ¶
func (t MonitorLocalExpect) MarshalText() ([]byte, error)
func (MonitorLocalExpect) String ¶
func (t MonitorLocalExpect) String() string
func (*MonitorLocalExpect) UnmarshalText ¶
func (t *MonitorLocalExpect) UnmarshalText(b []byte) error
type MonitorState ¶
type MonitorState int
const ( // General States MonitorStateInit MonitorState = iota MonitorStateIdle MonitorStateBootSuccess MonitorStateBootFailed MonitorStateBootProgress MonitorStateShutdownProgress MonitorStateShutdownFailure MonitorStateShutdownSuccess MonitorStateStartProgress MonitorStateStartFailure MonitorStateStartSuccess MonitorStateStopProgress MonitorStateStopFailure MonitorStateStopSuccess MonitorStateFreezeProgress MonitorStateFreezeFailure MonitorStateFreezeSuccess MonitorStateUnfreezeProgress MonitorStateUnfreezeFailure MonitorStateUnfreezeSuccess MonitorStateProvisionProgress MonitorStateProvisionFailure MonitorStateProvisionSuccess MonitorStateUnprovisionProgress MonitorStateUnprovisionFailure MonitorStateUnprovisionSuccess MonitorStateDeleteProgress MonitorStateDeleteFailure MonitorStateDeleteSuccess MonitorStateResizeProgress MonitorStateResizeFailure MonitorStateResizeSuccess // MonitorStateResizeStage0 and its siblings are the states an instance // takes between the stages of a resize. A chain is grown in at most // MaxResizeStages stages, so they are named rather than counted. MonitorStateResizeStage0 MonitorStateResizeStage1 MonitorStateResizeStage2 MonitorStateCapProgress MonitorStateCapFailure MonitorStateCapSuccess // the destination of a switch preparing to start, as reconnecting a // replicated disk left behind for it to resync before the source stops MonitorStatePrepareProgress MonitorStatePrepareFailure // wait states MonitorStateWaitChildren MonitorStateWaitParents MonitorStateWaitPriors MonitorStateWaitLeader MonitorStateWaitNonLeader MonitorStateWaitSyncs MonitorStateWaitDestination MonitorStateWaitDestinationFailure // MonitorStateWaitFiles is the destination of a placement waiting, before // it starts, for the resource files the source it took over from lists. MonitorStateWaitFiles // Miscellaneous MonitorStateRunning MonitorStateSyncing MonitorStatePurgeFailed MonitorStateReady MonitorStateRestarted // MonitorStatePreflightProgress and MonitorStatePreflightSuccess are // the states of an instance checking, before any node provisions an // object provisioned nowhere, that nothing on its node holds what the // object would take. A conflict ends on MonitorStateProvisionFailure, // as a provision nothing was done of. MonitorStatePreflightProgress MonitorStatePreflightSuccess // MonitorStateUnknown is what a value this agent does not know decodes to: // a peer running a later version publishes values this one has no // name for, and failing to decode them failed the whole heartbeat // message the peer sent, which is how a peer is found dead. MonitorStateUnknown )
func NewMonitorStateResizeStage ¶
func NewMonitorStateResizeStage(stage int) (MonitorState, bool)
NewMonitorStateResizeStage is the state of an instance that finished a stage of a resize, and whether there is one to name.
func (MonitorState) IsDoing ¶
func (t MonitorState) IsDoing() bool
func (MonitorState) IsOneOf ¶
func (t MonitorState) IsOneOf(states ...MonitorState) bool
func (MonitorState) MarshalText ¶
func (t MonitorState) MarshalText() ([]byte, error)
func (MonitorState) ResizeStage ¶
func (t MonitorState) ResizeStage() (int, bool)
ResizeStage is the stage an instance finished, and whether it is between stages at all.
func (MonitorState) String ¶
func (t MonitorState) String() string
func (*MonitorState) UnmarshalText ¶
func (t *MonitorState) UnmarshalText(b []byte) error
type MonitorUpdate ¶
type MonitorUpdate struct {
GlobalExpect *MonitorGlobalExpect `json:"global_expect"`
GlobalExpectOptions any `json:"global_expect_options"`
LocalExpect *MonitorLocalExpect `json:"local_expect"`
State *MonitorState `json:"state"`
// CandidateOrchestrationID is a candidate orchestration id for a new imon orchestration.
CandidateOrchestrationID uuid.UUID `json:"orchestration_id"`
}
MonitorUpdate is embedded in the SetInstanceMonitor message to change some Monitor values. A nil value does not change the current value.
func (MonitorUpdate) String ¶
func (t MonitorUpdate) String() string
type ReferenceStatus ¶
ReferenceStatus is the status of a reference resource of an instance, one of the resources telling the active instance of an object.
type ResourceConfig ¶
type ResourceConfig struct {
IsDisabled bool `json:"is_disabled"`
IsMonitored bool `json:"is_monitored"`
IsStandby bool `json:"is_standby"`
Restart int `json:"restart,omitempty"`
RestartDelay *time.Duration `json:"restart_delay,omitempty"`
// reachable from every cluster node, and held on every one.
IsShared bool `json:"is_shared,omitempty"`
// Holds are the values the resource holds on the node publishing
// the configuration, or on every cluster node when shared: mount
// points, block devices, volume group names, addresses. A
// configuration written is refused when it holds one of them on
// the same node.
Holds resource.Holds `json:"holds,omitempty"`
}
func (ResourceConfig) Unstructured ¶
func (t ResourceConfig) Unstructured() map[string]any
type ResourceConfigs ¶
type ResourceConfigs map[string]ResourceConfig
func (ResourceConfigs) DeepCopy ¶
func (m ResourceConfigs) DeepCopy() ResourceConfigs
func (ResourceConfigs) Get ¶
func (rcfgs ResourceConfigs) Get(rid string) *ResourceConfig
func (ResourceConfigs) Unstructured ¶
func (t ResourceConfigs) Unstructured() map[string]map[string]any
type ResourceMonitor ¶
type ResourceMonitor struct {
Restart *ResourceMonitorRestart `json:"restart,omitempty"`
}
ResourceMonitor describes the restart states maintained by the daemon for an object instance.
func (*ResourceMonitor) DecRestartRemaining ¶
func (m *ResourceMonitor) DecRestartRemaining()
func (*ResourceMonitor) Unstructured ¶
func (t *ResourceMonitor) Unstructured() map[string]any
type ResourceMonitorRestart ¶
type ResourceMonitorRestart struct {
Remaining int `json:"remaining,omitempty"`
LastAt time.Time `json:"last_at,omitempty"`
}
func (*ResourceMonitorRestart) DeepCopy ¶
func (t *ResourceMonitorRestart) DeepCopy() *ResourceMonitorRestart
func (*ResourceMonitorRestart) Unstructured ¶
func (t *ResourceMonitorRestart) Unstructured() map[string]any
type ResourceMonitors ¶
type ResourceMonitors map[string]ResourceMonitor
func (ResourceMonitors) DeepCopy ¶
func (m ResourceMonitors) DeepCopy() ResourceMonitors
func (ResourceMonitors) Get ¶
func (m ResourceMonitors) Get(rid string) *ResourceMonitor
func (ResourceMonitors) Set ¶
func (m ResourceMonitors) Set(rid string, rmon ResourceMonitor)
func (ResourceMonitors) Unstructured ¶
func (t ResourceMonitors) Unstructured() map[string]map[string]any
type ResourceOrder ¶
ResourceOrder is a sortable list representation of the instance status resources map.
func (ResourceOrder) Len ¶
func (a ResourceOrder) Len() int
func (ResourceOrder) Less ¶
func (a ResourceOrder) Less(i, j int) bool
func (ResourceOrder) Swap ¶
func (a ResourceOrder) Swap(i, j int)
type ResourceStatuses ¶
func (ResourceStatuses) DeepCopy ¶
func (m ResourceStatuses) DeepCopy() ResourceStatuses
func (ResourceStatuses) Unstructured ¶
func (t ResourceStatuses) Unstructured() map[string]map[string]any
type States ¶
type States struct {
Path naming.Path `json:"path"`
Node Node `json:"node,omitempty"`
Config Config `json:"config,omitempty"`
Status Status `json:"status,omitempty"`
Monitor Monitor `json:"monitor,omitempty"`
}
States groups config and status of the object instance as seen by the daemon.
func (States) LoadTreeNode ¶
LoadTreeNode add the tree nodes representing the type instance into another tree, at the specified node.
func (States) LoadTreeNodeFolded ¶
LoadTreeNodeFolded add the tree nodes representing the type instance into another tree, at the specified node. TODO: probable bug, LoadTreeNodeFolded duplicate code of LoadTreeNode
type StatesList ¶
type StatesList []States
func (StatesList) ByNode ¶
func (t StatesList) ByNode() map[string]States
type Status ¶
type Status struct {
Avail status.T `json:"avail"`
Encap EncapMap `json:"encap,omitempty"`
FrozenAt time.Time `json:"frozen_at,omitempty"`
LastStartedAt time.Time `json:"last_started_at"`
Optional status.T `json:"optional,omitempty"`
Overall status.T `json:"overall"`
Provisioned provisioned.T `json:"provisioned"`
Resources ResourceStatuses `json:"resources,omitempty"`
Running resource.RunningInfoList `json:"running,omitempty"`
// StoppedAt is when the instance was stopped on purpose, and zero
// when it was not. It says the daemon must not start the instance
// back on its own, and is cleared when the object is wanted up
// again. It is what a stop uses instead of freezing, so the frozen
// flag keeps saying what the operator decided, and only that.
StoppedAt time.Time `json:"stopped_at,omitempty"`
// FrozenScope is "object" when the instance was frozen by a freeze
// of the object, "instance" when it was frozen alone, and empty
// when it is not frozen.
FrozenScope freeze.Scope `json:"frozen_scope,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
// ConfigCsum is the checksum of the configuration the status was
// computed from, as the instance config says it: a status computed
// before the configuration last changed says what the former one
// has, and is not one to decide on. Empty from an agent that does
// not say it.
ConfigCsum string `json:"config_csum,omitempty"`
// OutdatedAt is the earliest OutdatedAt of the resources: when
// the status changes with no event to tell, for the daemon to
// evaluate it again then. Zero if it does not.
OutdatedAt time.Time `json:"outdated_at,omitzero"`
// Usage is what a volume holds on this node, nil for another kind of
// object, a volume not up, or one with no filesystem.
Usage *VolumeUsage `json:"usage,omitempty"`
// RPOBreachedAt is the earliest RPOBreachedAt of the resources:
// past it, this node taking over would lose more data than one
// of the resources allows. Each resource has its own contract,
// so the instance breaches when any of them does. Zero when no
// resource keeps a copy here.
RPOBreachedAt time.Time `json:"rpo_breached_at,omitzero"`
}
Status describes the instance status.
func (Status) IsStopped ¶
IsStopped says the instance was stopped on purpose, so the daemon must not start it back on its own.
func (Status) IsUnfrozen ¶
func (Status) ReplicationSource ¶
ReplicationSource says whether the instance is the one the data is replicated from, reading its reference resources from its status, and why not when it is not.
func (*Status) SortedResources ¶
SortedResources returns a list of resource identifiers sorted by: 1/ driver group 2/ subset 3/ resource name
func (Status) StoppedResources ¶
StoppedResources returns, sorted, the resources a stop of their own flagged stopped on purpose, which the daemon must not start back on its own, a start of the instance included.
func (Status) Unstructured ¶
type SubsetConfig ¶
type SubsetConfig struct {
Parallel bool `json:"parallel,omitempty"`
}
func (SubsetConfig) Unstructured ¶
func (t SubsetConfig) Unstructured() map[string]any
type SubsetConfigs ¶
type SubsetConfigs map[string]SubsetConfig
func (SubsetConfigs) DeepCopy ¶
func (m SubsetConfigs) DeepCopy() SubsetConfigs
func (SubsetConfigs) Unstructured ¶
func (t SubsetConfigs) Unstructured() map[string]map[string]any
type VolConfig ¶
type VolConfig struct {
Pool string `json:"pool"`
Size int64 `json:"size"`
// Charges is what the volume takes of pools other than the one that
// served it, by pool name.
//
// A volume is counted against the claim its namespace holds on the
// pool it was served by, which is what it was asked of that pool.
// A volume whose resources take their storage elsewhere costs those
// pools too, and nothing else says so: a volume served by a virtual
// pool is a copy of a template, and what that template builds is
// only known by reading what it built.
Charges map[string]int64 `json:"charges,omitempty"`
}
type VolumeUsage ¶
type VolumeUsage struct {
Used int64 `json:"used"`
Size int64 `json:"size"`
MeasuredAt time.Time `json:"measured_at"`
}
VolumeUsage is what a volume holds, and may hold, in bytes, as measured at MeasuredAt. A directory of a pool with no filesystem of its own is measured by walking it, which is done again an hour later only.