# Packages

Package engine provides low-level storage.
Package storagebase is a generated protocol buffer package.

# Functions

ComputeStatsForRange computes the stats for a given range by iterating over all key ranges for the given range that should be accounted for in its stats.
DecodeRaftCommand splits a raftpb.Entry.Data into its commandID and command portions.
DefaultDeclareKeys is the default implementation of Command.DeclareKeys.
EnableLeaseHistory turns on the lease history for testing purposes.
GossipAddressResolver is a thin wrapper around gossip's GetNodeIDAddress that allows its return value to be used as the net.Addr interface.
HasRaftLeader returns true if the raft group has a raft leader currently.
IsSnapshotError returns true iff the error indicates a preemptive snapshot failed.
IterateRangeDescriptors calls the provided function with each descriptor from the provided Engine.
MakeAllocator creates a new allocator using the specified StorePool.
MakeServer returns a new instance of Server.
MakeStorePoolNodeLivenessFunc returns a function which determines the status of a node based on information provided by the specified NodeLiveness.
NewAbortCache returns a new abort cache.
NewCommandQueue returns a new command queue.
No description provided by the author
NewDummyRaftTransport returns a dummy raft transport for use in tests which need a non-nil raft transport that need not function.
No description provided by the author
NewNodeLiveness returns a new instance of NodeLiveness configured with the specified gossip instance.
NewRaftTransport creates a new RaftTransport.
NewReplica initializes the replica using the given metadata.
NewReplicaCorruptionError creates a new error indicating a corrupt replica, with the supplied list of errors given as history.
NewReplicaDataIterator creates a ReplicaDataIterator for the given replica.
NewStore returns a new instance of a store.
NewStorePool creates a StorePool and registers the store updating callback with gossip.
NewStores returns a local-only sender which directly accesses a collection of stores.
ReadClusterVersion reads the the cluster version from the store-local version key.
ReadStoreIdent reads the StoreIdent from the store.
ReadVersionFromEngineOrDefault reads the persisted cluster version from the engine, falling back to v1.0 if no version is specified on the engine.
No description provided by the author
No description provided by the author
RunGC runs garbage collection for the specified descriptor on the provided Engine (which is not mutated).
SetAddSSTableCmd allows setting the function that will be called as the implementation of the AddSSTable command.
SetExportCmd allows setting the function that will be called as the implementation of the Export command.
SetImportCmd allows setting the function that will be called as the implementation of the Import command.
SetWriteBatchCmd allows setting the function that will be called as the implementation of the WriteBatch command.
SynthesizeClusterVersionFromEngines implements the core of (*Stores).SynthesizeClusterVersion.
TestingRelocateRange relocates a given range to a given set of stores.
TestStoreConfig has some fields initialized with values relevant in tests.
TrackRaftProtos instruments proto marshalling to track protos which are marshalled downstream of raft.
WriteClusterVersion writes the given cluster version to the store-local cluster version key.
WriteClusterVersionToEngines writes the given version to the given engines, without any sanity checks.

# Constants

These are the possible allocator actions.
These are the possible allocator actions.
These are the possible allocator actions.
These are the possible allocator actions.
These are the possible allocator actions.
These are the possible allocator actions.
IntersectingSnapshotMsg is part of the error message returned from canApplySnapshotLocked and is exposed here so testing can rely on it.
ERROR indicates that the lease can't be used or acquired.
EXPIRED indicates that the lease can't be used.
PROSCRIBED indicates that the lease's proposed timestamp is earlier than allowed.
STASIS indicates that the lease has not expired, but can't be used.
VALID indicates that the lease can be used.
4MB.
MinStatsDuration defines a lower bound on how long users of replica stats should wait before using those stats for anything.
MinTSCacheWindow specifies the minimum duration to hold entries in the cache before allowing eviction.
RaftLogQueueStaleSize is the minimum size of the Raft log that we'll truncate even if there are fewer than RaftLogQueueStaleThreshold entries to truncate.
RaftLogQueueStaleThreshold is the minimum threshold for stale raft log entries.
RaftLogQueueTimerDuration is the duration between truncations.
Add is the event type recorded when a range adds a new replica.
Remove is the event type recorded when a range removed an existing replica.
These are lower case to maintain compatibility with how they were originally stored.
The set of possible reasons for range events to happen.
The set of possible reasons for range events to happen.
The set of possible reasons for range events to happen.
The set of possible reasons for range events to happen.
The set of possible reasons for range events to happen.
The set of possible reasons for range events to happen.
The set of possible reasons for range events to happen.
ReplicaGCQueueCandidateTimeout is the duration after which a range in candidate Raft state (which is a typical sign of having been removed from the group) will be considered for garbage collection.
10 days.
REBALANCE is used for snapshots involved in rebalancing.
RECOVERY is used for a Raft-initiated snapshots and for up-replication snapshots (i.e.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants for SpanAccess.
Constants for SpanAccess.
TestTimeUntilStoreDead is the test value for TimeUntilStoreDead to quickly mark stores as dead.
TestTimeUntilStoreDeadOff is the test value for TimeUntilStoreDead that prevents the store pool from marking stores as dead.
daily.

# Variables

EnableStatsBasedRebalancing controls whether range rebalancing takes additional variables such as write load and disk usage into account.
ErrEpochIncremented is returned when a heartbeat request fails because the underlying liveness record has had its epoch incremented.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrNoLivenessRecord is returned when asking for liveness information about a node for which nothing is known.
No description provided by the author
No description provided by the author
MaxCommandSize wraps "kv.raft.command.max_size".
MinLeaseTransferStatsDuration configures the minimum amount of time a replica must wait for stats about request counts to accumulate before making decisions based on them.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TimeUntilStoreDead wraps "server.time_until_store_dead".

# Structs

The AbortCache sets markers for aborted transactions to provide protection against an aborted but active transaction not reading values it wrote (due to its intents having been removed).
Allocator tries to spread replicas as evenly as possible across the stores in the cluster.
A CollectChecksumRequest asks the addressed replica for the result of a roachpb.ComputeChecksumRequest.
No description provided by the author
A Command is the implementation of a single request within a BatchRequest.
CommandArgs contains all the arguments to a command.
A CommandQueue maintains an interval tree of keys or key ranges for executing commands.
CommandQueueMetrics holds the metrics for a the command queue that are included in range metrics.
ConfChangeContext is encoded in the raftpb.ConfChange.Context field.
EvalResult is the result of evaluating a KV request.
GCInfo contains statistics and insights from a GC run.
IncomingSnapshot contains the data for an incoming streaming snapshot message.
LeaseStatus holds the lease state, the timestamp at which the state is accurate, the lease and optionally the liveness if the lease is epoch-based.
Liveness holds information about a node's latest heartbeat and epoch.
LivenessMetrics holds metrics for use with node liveness activity.
LocalEvalResult is data belonging to an evaluated command that is only used on the node on which the command was proposed.
NodeLiveness encapsulates information on node liveness and provides an API for querying, updating, and invalidating node liveness.
A NotBootstrappedError indicates that an engine has not yet been bootstrapped due to a store identifier not being present.
OutgoingSnapshot contains the data required to stream a snapshot to a recipient.
ProposalData is data about a command which allows it to be evaluated, proposed to raft, and for the result of the command to be returned to the caller.
RaftHeartbeat is a request that contains the barebones information for a raftpb.MsgHeartbeat raftpb.Message.
RaftMessageRequest is the request used to send raft messages using our protobuf-based RPC codec.
No description provided by the author
RaftMessageResponse may be sent to the sender of a RaftMessageRequest.
No description provided by the author
RaftTransport handles the rpc messages for raft.
RangeInfo contains the information needed by the allocator to make rebalancing decisions for a given range.
No description provided by the author
No description provided by the author
A Replica is a contiguous keyspace with writes managed via an instance of the Raft consensus algorithm.
ReplicaDataIterator provides a complete iteration over all key / value rows in a range, including all system-local metadata and user data.
ReplicaEvalContext is the interface through which command evaluation accesses the in-memory state of a Replica.
ReplicaGCQueueMetrics is the set of metrics for the replica GC queue.
ReplicaMetrics contains details on the current status of the replica.
ReplicaPlaceholder is created by a Store in anticipation of replacing it at some point in the future with a Replica.
ReplicaSnapshotDiff is a part of a []ReplicaSnapshotDiff which represents a diff between two replica snapshots.
ReplicateQueueMetrics is the set of metrics for the replicate queue.
ResolveOptions is used during intent resolution.
Server implements ConsistencyServer.
SnapshotRequest is the request used to send streaming snapshot requests.
No description provided by the author
No description provided by the author
SpanSet tracks the set of key spans touched by a command.
SpanSetIterator wraps an engine.Iterator and ensures that it can only be used to access spans in a SpanSet.
A Store maintains a map of ranges by start key.
A StoreConfig encompasses the auxiliary objects and configuration required to create a store.
StoreList holds a list of store descriptors and associated count and used stats for those stores.
StoreMetrics is the set of metrics for a given store.
StorePool maintains a list of all known stores in the cluster and information on their health.
StoreRequestHeader locates a Store on a Node.
Stores provides methods to access a collection of stores.
StoreTestingKnobs is a part of the context used to control parts of the system.

# Interfaces

No description provided by the author
No description provided by the author
KeyRange is an interface type for the replicasByKey BTree, to compare Replica and ReplicaPlaceholder.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OutgoingSnapshotStream is the minimal interface on a GRPC stream required to send a snapshot over the network.
RaftMessageHandler is the interface that must be implemented by arguments to RaftTransport.Listen.
RaftMessageResponseStream is the subset of the MultiRaft_RaftMessageServer interface that is needed for sending responses.
SnapshotResponseStream is the subset of the MultiRaft_RaftSnapshotServer interface that is needed for sending responses.
SnapshotStorePool narrows StorePool to make sendSnapshot easier to test.
TimeSeriesDataStore is an interface defined in the storage package that can be implemented by the higher-level time series system.

# Type aliases

AllocatorAction enumerates the various replication adjustments that may be recommended by the allocator.
HeartbeatCallback is invoked whenever this node updates its own liveness status, indicating that it is alive.
ImportCmdFunc is the type of the function that will be called as the implementation of the Import command.
IsLiveCallback is invoked when a node's IsLive state changes to true.
No description provided by the author
NodeAddressResolver is the function used by RaftTransport to map node IDs to network addresses.
A NodeLivenessFunc accepts a node ID, current time and threshold before a node is considered dead and returns whether or not the node is live.
RangeLogEventReason specifies the reason why a range-log event happened.
No description provided by the author
ReplicaSnapshotDiffSlice groups multiple ReplicaSnapshotDiff records and exposes a formatting helper.
No description provided by the author
No description provided by the author
SpanAccess records the intended mode of access in SpanSet.