topo

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentStatusGC

func AgentStatusGC(ctx context.Context, m connect.Client) error

AgentStatusGC cleans up stale agent statuses

func CheckTopoForBackup

func CheckTopoForBackup(ctx context.Context, m connect.Client, type_ defs.BackupType) error

func ClusterTimeFromNodeInfo

func ClusterTimeFromNodeInfo(info *NodeInfo) (primitive.Timestamp, error)

func ConfSvrConn

func ConfSvrConn(ctx context.Context, cn *mongo.Client) (string, error)

func GetClusterTime

func GetClusterTime(ctx context.Context, m connect.Client) (primitive.Timestamp, error)

ClusterTime returns mongo's current cluster time

func GetLastWrite

func GetLastWrite(ctx context.Context, m *mongo.Client, majority bool) (primitive.Timestamp, error)

func HasConfigShard

func HasConfigShard(ctx context.Context, conn connect.Client) (bool, error)

HasConfigShard return true if configsvr is listened in shards list

func IsWriteMajorityRequested

func IsWriteMajorityRequested(
	ctx context.Context,
	m *mongo.Client,
	writeConcern *writeconcern.WriteConcern,
) (bool, error)

IsWriteMajorityRequested compares cluster wide majority (replSetGetStatus.writeMajorityCount) with WriteConcern requested in connection string and determinates if majority is requested or not

func ListShardedTimeseries

func ListShardedTimeseries(ctx context.Context, conn connect.Client) ([]string, error)

func NodeSuits

func NodeSuits(ctx context.Context, m *mongo.Client, inf *NodeInfo) (bool, error)

NodeSuits checks if node can perform backup

func NodeSuitsExt

func NodeSuitsExt(ctx context.Context, m *mongo.Client, inf *NodeInfo, t defs.BackupType) (bool, error)

func OpTimeFromNodeInfo

func OpTimeFromNodeInfo(inf *NodeInfo, majority bool) (primitive.Timestamp, error)

func RemoveAgentStatus

func RemoveAgentStatus(ctx context.Context, m connect.Client, stat AgentStat) error

func ReplicationLag

func ReplicationLag(ctx context.Context, m *mongo.Client, self string) (int, error)

ReplicationLag returns node replication lag in seconds

func SetAgentStatus

func SetAgentStatus(ctx context.Context, m connect.Client, stat *AgentStat) error

func SetBalancerStatus

func SetBalancerStatus(ctx context.Context, m connect.Client, mode BalancerMode) error

SetBalancerStatus sets balancer status

Types

type AgentStat

type AgentStat struct {
	// Node is like agent ID. Looks like `rs00:27017` (host:port of direct mongod).
	Node string `bson:"n"`

	// RS is the direct node replset name.
	RS string `bson:"rs"`

	// State is the mongod state code.
	State defs.NodeState `bson:"s"`

	// StateStr is the mongod state string (e.g. PRIMARY, SECONDARY, ARBITER)
	StateStr string `bson:"str"`

	// Hidden is set for hidden node.
	Hidden bool `bson:"hdn"`

	// Passive is set when node cannot be primary (priority 0).
	//
	// Hidden and delayed nodes are always passive.
	// Arbiter cannot be primary because it is not a data-bearing member (non-writable)
	// but it is not passive (has 1 election vote).
	Passive bool `bson:"psv"`

	// Arbiter is true for argiter node.
	Arbiter bool `bson:"arb"`

	// DelaySecs is the node configured replication delay (lag).
	DelaySecs int32 `bson:"delay"`

	// Replication lag for mongod.
	ReplicationLag int `bson:"repl_lag"`

	// AgentVer has the PBM Agent version (looks like `v2.3.4`)
	AgentVer string `bson:"v"`

	// MongoVer is the mongod version (looks like `v7.0.0`)
	MongoVer string `bson:"mv"`

	// PerconaVer is the PSMDB version (looks like `v7.0.0-1`).
	//
	// Empty for non-PSMDB (e.i MongoDB CE).
	PerconaVer string `bson:"pv,omitempty"`

	// PBMStatus is the agent status.
	PBMStatus SubsysStatus `bson:"pbms"`

	// NodeStatus is the mongod/connection status.
	NodeStatus SubsysStatus `bson:"nodes"`

	// StorageStatus is the remote storage status.
	StorageStatus SubsysStatus `bson:"stors"`

	// Heartbeat is agent's last seen cluster time.
	Heartbeat primitive.Timestamp `bson:"hb"`

	// Err can be any error.
	Err string `bson:"e"`
}

func GetAgentStatus

func GetAgentStatus(ctx context.Context, m connect.Client, rs, node string) (AgentStat, error)

GetAgentStatus returns agent status by given node and rs it's up to user how to handle ErrNoDocuments

func ListAgentStatuses

func ListAgentStatuses(ctx context.Context, m connect.Client) ([]AgentStat, error)

ListAgentStatuses returns list of registered agents

func ListAgents

func ListAgents(ctx context.Context, m connect.Client) ([]AgentStat, error)

func ListSteadyAgents

func ListSteadyAgents(ctx context.Context, m connect.Client) ([]AgentStat, error)

ListSteadyAgents returns agents which are in steady state for backup or PITR.

func (*AgentStat) IsStale

func (s *AgentStat) IsStale(t primitive.Timestamp) bool

IsStale returns true if agent's heartbeat is steal for the give `t` cluster time.

func (*AgentStat) MongoVersion

func (s *AgentStat) MongoVersion() version.MongoVersion

func (*AgentStat) OK

func (s *AgentStat) OK() (bool, []error)

type AuthInfo

type AuthInfo struct {
	Users     []AuthUser      `bson:"authenticatedUsers" json:"authenticatedUsers"`
	UserRoles []AuthUserRoles `bson:"authenticatedUserRoles" json:"authenticatedUserRoles"`
}

func CurrentUser

func CurrentUser(ctx context.Context, m *mongo.Client) (*AuthInfo, error)

type AuthUser

type AuthUser struct {
	User string `bson:"user" json:"user"`
	DB   string `bson:"db" json:"db"`
}

type AuthUserRoles

type AuthUserRoles struct {
	Role string `bson:"role" json:"role"`
	DB   string `bson:"db" json:"db"`
}

type BalancerMode

type BalancerMode string
const (
	BalancerModeOn  BalancerMode = "full"
	BalancerModeOff BalancerMode = "off"
)

func (BalancerMode) String

func (m BalancerMode) String() string

type BalancerStatus

type BalancerStatus struct {
	Mode              BalancerMode `bson:"mode" json:"mode"`
	InBalancerRound   bool         `bson:"inBalancerRound" json:"inBalancerRound"`
	NumBalancerRounds int64        `bson:"numBalancerRounds" json:"numBalancerRounds"`
	Ok                int          `bson:"ok" json:"ok"`
}

func GetBalancerStatus

func GetBalancerStatus(ctx context.Context, m connect.Client) (*BalancerStatus, error)

GetBalancerStatus returns balancer status

func (*BalancerStatus) IsOn

func (b *BalancerStatus) IsOn() bool

type ClusterTime

type ClusterTime struct {
	ClusterTime primitive.Timestamp `bson:"clusterTime"`
	Signature   struct {
		Hash  primitive.Binary `bson:"hash"`
		KeyID int64            `bson:"keyId"`
	} `bson:"signature"`
}

type ConfigServerState

type ConfigServerState struct {
	OpTime *OpTime `bson:"opTime"`
}

type ConnectionStatus

type ConnectionStatus struct {
	AuthInfo AuthInfo `bson:"authInfo" json:"authInfo"`
}

type ExternOpts

type ExternOpts map[string]MongodOpts

type MongoLastWrite

type MongoLastWrite struct {
	OpTime            OpTime    `bson:"opTime"`
	LastWriteDate     time.Time `bson:"lastWriteDate"`
	MajorityOpTime    OpTime    `bson:"majorityOpTime"`
	MajorityWriteDate time.Time `bson:"majorityWriteDate"`
}

MongoLastWrite represents the last write to the MongoDB server

type MongodOpts

type MongodOpts struct {
	Net struct {
		BindIP string `bson:"bindIp" json:"bindIp" yaml:"bindIp"`
		Port   int    `bson:"port" json:"port" yaml:"port"`
	} `bson:"net" json:"net"`
	Sharding struct {
		ClusterRole string `bson:"clusterRole" json:"clusterRole" yaml:"-"`
	} `bson:"sharding" json:"sharding" yaml:"-"`
	Storage  MongodOptsStorage `bson:"storage" json:"storage" yaml:"storage"`
	Security *MongodOptsSec    `bson:"security,omitempty" json:"security,omitempty" yaml:"security,omitempty"`
}

func GetMongodOpts

func GetMongodOpts(ctx context.Context, m *mongo.Client, defaults *MongodOpts) (*MongodOpts, error)

type MongodOptsSec

type MongodOptsSec struct {
	EnableEncryption     *bool   `bson:"enableEncryption,omitempty" json:"enableEncryption,omitempty" yaml:"enableEncryption,omitempty"`
	EncryptionCipherMode *string `bson:"encryptionCipherMode,omitempty" json:"encryptionCipherMode,omitempty" yaml:"encryptionCipherMode,omitempty"`
	EncryptionKeyFile    *string `bson:"encryptionKeyFile,omitempty" json:"encryptionKeyFile,omitempty" yaml:"encryptionKeyFile,omitempty"`
	RelaxPermChecks      *bool   `bson:"relaxPermChecks,omitempty" json:"relaxPermChecks,omitempty" yaml:"relaxPermChecks,omitempty"`
	Vault                *struct {
		ServerName           *string `bson:"serverName,omitempty" json:"serverName,omitempty" yaml:"serverName,omitempty"`
		Port                 *int    `bson:"port,omitempty" json:"port,omitempty" yaml:"port,omitempty"`
		TokenFile            *string `bson:"tokenFile,omitempty" json:"tokenFile,omitempty" yaml:"tokenFile,omitempty"`
		Secret               *string `bson:"secret,omitempty" json:"secret,omitempty" yaml:"secret,omitempty"`
		ServerCAFile         *string `bson:"serverCAFile,omitempty" json:"serverCAFile,omitempty" yaml:"serverCAFile,omitempty"`
		SecretVersion        *uint32 `bson:"secretVersion,omitempty" json:"secretVersion,omitempty" yaml:"secretVersion,omitempty"`
		DisableTLSForTesting *bool   `bson:"disableTLSForTesting,omitempty" json:"disableTLSForTesting,omitempty" yaml:"disableTLSForTesting,omitempty"`
	} `bson:"vault,omitempty" json:"vault,omitempty" yaml:"vault,omitempty"`
	KMIP *struct {
		ServerName                *string `bson:"serverName,omitempty" json:"serverName,omitempty" yaml:"serverName,omitempty"`
		Port                      *int    `bson:"port,omitempty" json:"port,omitempty" yaml:"port,omitempty"`
		ClientCertificateFile     *string `bson:"clientCertificateFile,omitempty" json:"clientCertificateFile,omitempty" yaml:"clientCertificateFile,omitempty"`
		ClientKeyFile             *string `bson:"clientKeyFile,omitempty" json:"clientKeyFile,omitempty" yaml:"clientKeyFile,omitempty"`
		ServerCAFile              *string `bson:"serverCAFile,omitempty" json:"serverCAFile,omitempty" yaml:"serverCAFile,omitempty"`
		KeyIdentifier             *string `bson:"keyIdentifier,omitempty" json:"keyIdentifier,omitempty" yaml:"keyIdentifier,omitempty"`
		ClientCertificatePassword *string `bson:"clientCertificatePassword,omitempty" json:"-" yaml:"clientCertificatePassword,omitempty"`
	} `bson:"kmip,omitempty" json:"kmip,omitempty" yaml:"kmip,omitempty"`
}

type MongodOptsStorage

type MongodOptsStorage struct {
	DirectoryPerDB bool   `bson:"directoryPerDB" json:"directoryPerDB" yaml:"directoryPerDB"`
	DBpath         string `bson:"dbPath" json:"dbPath" yaml:"dbPath"`
	WiredTiger     struct {
		EngineConfig struct {
			JournalCompressor   string `bson:"journalCompressor" json:"journalCompressor" yaml:"journalCompressor"`
			DirectoryForIndexes bool   `bson:"directoryForIndexes" json:"directoryForIndexes" yaml:"directoryForIndexes"`
		} `bson:"engineConfig" json:"engineConfig" yaml:"engineConfig"`
		CollectionConfig struct {
			BlockCompressor string `bson:"blockCompressor" json:"blockCompressor" yaml:"blockCompressor"`
		} `bson:"collectionConfig" json:"collectionConfig" yaml:"collectionConfig"`
		IndexConfig struct {
			PrefixCompression bool `bson:"prefixCompression" json:"prefixCompression" yaml:"prefixCompression"`
		} `bson:"indexConfig" json:"indexConfig" yaml:"indexConfig"`
	} `bson:"wiredTiger" json:"wiredTiger" yaml:"wiredTiger"`
}

func NewMongodOptsStorage

func NewMongodOptsStorage() *MongodOptsStorage

NewMongodOptsStorage return MongodOptsStorage with default settings

func (*MongodOptsStorage) UnmarshalYAML

func (stg *MongodOptsStorage) UnmarshalYAML(unmarshal func(interface{}) error) error

type NodeBrief

type NodeBrief struct {
	URI       string
	SetName   string
	Me        string
	Sharded   bool
	ConfigSvr bool
	Version   version.MongoVersion
}

type NodeInfo

type NodeInfo struct {
	Hosts                        []string             `bson:"hosts,omitempty"`
	Msg                          string               `bson:"msg"`
	MaxBsonObjectSise            int64                `bson:"maxBsonObjectSize"`
	MaxMessageSizeBytes          int64                `bson:"maxMessageSizeBytes"`
	MaxWriteBatchSize            int64                `bson:"maxWriteBatchSize"`
	LocalTime                    time.Time            `bson:"localTime"`
	LogicalSessionTimeoutMinutes int64                `bson:"logicalSessionTimeoutMinutes"`
	MaxWireVersion               int64                `bson:"maxWireVersion"`
	MinWireVersion               int64                `bson:"minWireVersion"`
	OK                           int                  `bson:"ok"`
	SetName                      string               `bson:"setName,omitempty"`
	Primary                      string               `bson:"primary,omitempty"`
	SetVersion                   int32                `bson:"setVersion,omitempty"`
	IsPrimary                    bool                 `bson:"ismaster"`
	Secondary                    bool                 `bson:"secondary,omitempty"`
	Hidden                       bool                 `bson:"hidden,omitempty"`
	Passive                      bool                 `bson:"passive,omitempty"`
	ArbiterOnly                  bool                 `bson:"arbiterOnly"`
	SecondaryDelayOld            int32                `bson:"slaveDelay"`
	SecondaryDelaySecs           int32                `bson:"secondaryDelaySecs"`
	ConfigSvr                    int                  `bson:"configsvr,omitempty"`
	Me                           string               `bson:"me"`
	LastWrite                    MongoLastWrite       `bson:"lastWrite"`
	ClusterTime                  *ClusterTime         `bson:"$clusterTime,omitempty"`
	ConfigServerState            *ConfigServerState   `bson:"$configServerState,omitempty"`
	OperationTime                *primitive.Timestamp `bson:"operationTime,omitempty"`
	Opts                         MongodOpts           `bson:"-"`
}

NodeInfo represents the mongo's node info

func GetNodeInfo

func GetNodeInfo(ctx context.Context, m *mongo.Client) (*NodeInfo, error)

func GetNodeInfoExt

func GetNodeInfoExt(ctx context.Context, m *mongo.Client) (*NodeInfo, error)

GetNodeInfoExt returns mongo node info with mongod options

func (*NodeInfo) IsClusterLeader

func (i *NodeInfo) IsClusterLeader() bool

IsClusterLeader - cluster leader is a primary node on configsrv or just primary node in non-sharded replicaset

func (*NodeInfo) IsConfigSrv

func (i *NodeInfo) IsConfigSrv() bool

IsConfigSrv returns true if node belongs to the CSRS in a sharded cluster

func (*NodeInfo) IsDelayed

func (i *NodeInfo) IsDelayed() bool

func (*NodeInfo) IsLeader

func (i *NodeInfo) IsLeader() bool

IsLeader returns true if node can act as backup leader (it's configsrv or non shareded rs)

func (*NodeInfo) IsMongos

func (i *NodeInfo) IsMongos() bool

IsSharded returns true is replset is part sharded cluster

func (*NodeInfo) IsSharded

func (i *NodeInfo) IsSharded() bool

IsSharded returns true is replset is part sharded cluster

func (*NodeInfo) IsStandalone

func (i *NodeInfo) IsStandalone() bool

IsStandalone returns true if node is not a part of replica set

func (*NodeInfo) ReplsetRole

func (i *NodeInfo) ReplsetRole() ReplsetRole

ReplsetRole returns replset role in sharded clister

type NodeRole

type NodeRole string
const (
	RolePrimary   NodeRole = "P"
	RoleSecondary NodeRole = "S"
	RoleArbiter   NodeRole = "A"
	RoleHidden    NodeRole = "H"
	RoleDelayed   NodeRole = "D"
)

type NodeStatus

type NodeStatus struct {
	ID     int             `bson:"_id" json:"_id"`
	Name   string          `bson:"name" json:"name"`
	Health defs.NodeHealth `bson:"health" json:"health"`

	// https://github.com/mongodb/mongo/blob/v8.0/src/mongo/db/repl/member_state.h#L52-L109
	State defs.NodeState `bson:"state" json:"state"`
	// https://github.com/mongodb/mongo/blob/v8.0/src/mongo/db/repl/member_state.h#L170-L193
	StateStr string `bson:"stateStr" json:"stateStr"`

	Uptime            int64               `bson:"uptime" json:"uptime"`
	Optime            *OpTime             `bson:"optime" json:"optime"`
	OptimeDate        time.Time           `bson:"optimeDate" json:"optimeDate"`
	ConfigVersion     int                 `bson:"configVersion" json:"configVersion"`
	ElectionTime      primitive.Timestamp `bson:"electionTime,omitempty" json:"electionTime,omitempty"`
	ElectionDate      time.Time           `bson:"electionDate,omitempty" json:"electionDate,omitempty"`
	InfoMessage       string              `bson:"infoMessage,omitempty" json:"infoMessage,omitempty"`
	OptimeDurable     *OpTime             `bson:"optimeDurable,omitempty" json:"optimeDurable,omitempty"`
	OptimeDurableDate time.Time           `bson:"optimeDurableDate,omitempty" json:"optimeDurableDate,omitempty"`
	LastHeartbeat     time.Time           `bson:"lastHeartbeat,omitempty" json:"lastHeartbeat,omitempty"`
	LastHeartbeatRecv time.Time           `bson:"lastHeartbeatRecv,omitempty" json:"lastHeartbeatRecv,omitempty"`
	PingMs            int64               `bson:"pingMs,omitempty" json:"pingMs,omitempty"`
	Self              bool                `bson:"self,omitempty" json:"self,omitempty"`
	SyncingTo         string              `bson:"syncingTo,omitempty" json:"syncingTo,omitempty"`
}

func GetNodeStatus

func GetNodeStatus(ctx context.Context, m *mongo.Client, name string) (*NodeStatus, error)

func (*NodeStatus) IsArbiter

func (s *NodeStatus) IsArbiter() bool

type NodeURI

type NodeURI = string

type OpTime

type OpTime struct {
	TS   primitive.Timestamp `bson:"ts" json:"ts"`
	Term int64               `bson:"t" json:"t"`
}

type RSConfig

type RSConfig struct {
	ID                      string     `bson:"_id" json:"_id"`
	CSRS                    bool       `bson:"configsvr,omitempty" json:"configsvr"`
	Protocol                int64      `bson:"protocolVersion,omitempty" json:"protocolVersion"`
	Version                 int        `bson:"version" json:"version"`
	Members                 []RSMember `bson:"members" json:"members"`
	WConcernMajorityJournal bool       `bson:"writeConcernMajorityJournalDefault,omitempty" json:"writeConcernMajorityJournalDefault"`
	Settings                struct {
		ChainingAllowed         bool `bson:"chainingAllowed,omitempty" json:"chainingAllowed"`
		HeartbeatIntervalMillis int  `bson:"heartbeatIntervalMillis,omitempty" json:"heartbeatIntervalMillis"`
		HeartbeatTimeoutSecs    int  `bson:"heartbeatTimeoutSecs,omitempty" json:"heartbeatTimeoutSecs"`
		ElectionTimeoutMillis   int  `bson:"electionTimeoutMillis,omitempty" json:"electionTimeoutMillis"`
		CatchUpTimeoutMillis    int  `bson:"catchUpTimeoutMillis,omitempty" json:"catchUpTimeoutMillis"`
	} `bson:"settings,omitempty" json:"settings"`
}

func GetReplSetConfig

func GetReplSetConfig(ctx context.Context, m *mongo.Client) (*RSConfig, error)

type RSMember

type RSMember struct {
	ID                 int               `bson:"_id" json:"_id"`
	Host               string            `bson:"host" json:"host"`
	ArbiterOnly        bool              `bson:"arbiterOnly" json:"arbiterOnly"`
	BuildIndexes       bool              `bson:"buildIndexes" json:"buildIndexes"`
	Hidden             bool              `bson:"hidden" json:"hidden"`
	Priority           float64           `bson:"priority" json:"priority"`
	Tags               map[string]string `bson:"tags,omitempty" json:"tags"`
	SecondaryDelayOld  int64             `bson:"slaveDelay,omitempty"`
	SecondaryDelaySecs int64             `bson:"secondaryDelaySecs,omitempty"`
	Votes              int               `bson:"votes" json:"votes"`
}

func (*RSMember) IsDelayed

func (m *RSMember) IsDelayed() bool

func (*RSMember) Role

func (m *RSMember) Role() NodeRole

type ReplsetName

type ReplsetName = string

type ReplsetRole

type ReplsetRole string

ReplsetRole is a replicaset role in sharded cluster

const (
	RoleUnknown   ReplsetRole = "unknown"
	RoleShard     ReplsetRole = "shard"
	RoleConfigSrv ReplsetRole = "configsrv"
)

type ReplsetStatus

type ReplsetStatus struct {
	Set                     string               `bson:"set" json:"set"`
	Date                    time.Time            `bson:"date" json:"date"`
	MyState                 defs.NodeState       `bson:"myState" json:"myState"`
	Members                 []NodeStatus         `bson:"members" json:"members"`
	Term                    int64                `bson:"term,omitempty" json:"term,omitempty"`
	HeartbeatIntervalMillis int64                `bson:"heartbeatIntervalMillis,omitempty" json:"heartbeatIntervalMillis,omitempty"` //nolint:lll
	Optimes                 *StatusOpTimes       `bson:"optimes,omitempty" json:"optimes,omitempty"`
	Errmsg                  string               `bson:"errmsg,omitempty" json:"errmsg,omitempty"`
	Ok                      int                  `bson:"ok" json:"ok"`
	ClusterTime             *ClusterTime         `bson:"$clusterTime,omitempty" json:"$clusterTime,omitempty"`
	ConfigServerState       *ConfigServerState   `bson:"$configServerState,omitempty" json:"$configServerState,omitempty"`
	OperationTime           *primitive.Timestamp `bson:"operationTime,omitempty" json:"operationTime,omitempty"`
	WriteMajorityCount      int                  `bson:"writeMajorityCount,omitempty" json:"writeMajorityCount,omitempty"`
}

func GetReplsetStatus

func GetReplsetStatus(ctx context.Context, m *mongo.Client) (*ReplsetStatus, error)

GetReplsetStatus returns `replSetGetStatus` for the given connection

type Shard

type Shard struct {
	// ID is the shard ID.
	//
	// Usual it is the same as replset name. Except for configsvr - it is always `config`.
	// Can be customized by name param in `addShard` command.
	//
	// https://www.mongodb.com/docs/manual/reference/command/addShard/
	ID string `bson:"_id"`

	// RS is the replset name.
	RS string `bson:"-"`

	// Host is a node URI.
	//
	// Looks like `rs0/rs00:27018` where
	// - `rs0` is a replset name
	// - `rs00` is a hostname or IP
	// - `27018` is a port
	Host string `bson:"host"`
}

Shard represent a config.shard document.

https://docs.mongodb.com/manual/reference/config-database/#config.shards

func ClusterMembers

func ClusterMembers(ctx context.Context, m *mongo.Client) ([]Shard, error)

ClusterMembers returns list of replsets in the cluster.

For sharded cluster: configsvr (with `config` id) and all shards. For non-sharded cluster: the replset.

type ShardName

type ShardName = string

type StatusOpTimes

type StatusOpTimes struct {
	LastCommittedOpTime       *OpTime `bson:"lastCommittedOpTime" json:"lastCommittedOpTime"`
	ReadConcernMajorityOpTime *OpTime `bson:"readConcernMajorityOpTime" json:"readConcernMajorityOpTime"`
	AppliedOpTime             *OpTime `bson:"appliedOpTime" json:"appliedOpTime"`
	DurableOptime             *OpTime `bson:"durableOpTime" json:"durableOpTime"`
}

type SubsysStatus

type SubsysStatus struct {
	// OK is false if there is an error. Otherwise true.
	OK bool `bson:"ok"`

	// Err is error string.
	Err string `bson:"e"`
}

SubsysStatus is generic status.

Jump to

Keyboard shortcuts

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