package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
ContextWithMeta returns a Context wrapping the supplied raft admission meta, if any.
GetV2EnabledWhenLeaderLevel returns the level at which RACV2 is enabled when this replica is the leader.
MetaFromContext returns the raft admission meta embedded in the Context, if any.
# Constants
ApplyToAll uses flow control for both elastic and regular traffic, i.e.
ApplyToElastic uses flow control for only elastic traffic, i.e.
# Variables
ElasticTokensPerStream determines the flow tokens available for elastic work on a per-stream basis.
Enabled determines whether we use flow control for replication traffic in KV.
Mode determines the 'mode' of flow control we use for replication traffic in KV, if enabled.
RegularTokensPerStream determines the flow tokens available for regular work on a per-stream basis.
TokenCounterResetEpoch is an escape hatch for administrators that should never be needed.
# Structs
Stream models the stream over which we replicate data traffic, the transmission for which we regulate using flow control.
TestingKnobs provide fine-grained control over the various kvflowcontrol components for testing.
TestingKnobsV1 are the testing knobs that appply to replication flow control v1, which is mostly contained in the kvflowcontroller, kvflowdispatch, kvflowhandle and kvflowtokentracker packages.
# Interfaces
ConnectedStream models a stream over which we're actively replicating data traffic.
Controller provides flow control for replication traffic in KV, held at the node-level.
Dispatch is used (i) to dispatch information about admitted raft log entries to specific nodes, and (ii) to read pending dispatches.
DispatchReader is used to read pending dispatches.
DispatchWriter is used to dispatch information about admitted raft log entries to specific nodes (typically where said entries originated, where flow tokens were deducted and waiting to be returned).
Handle is used to interface with replication flow control; it's typically backed by a node-level kvflowcontrol.Controller.
HandleFactory is used to construct new Handles.
Handles represent a set of flow control handles.
ReplicationAdmissionHandle abstracts waiting for admission across RACv1 and RACv2.
# Type aliases
ModeT represents the various modes of flow control for replication traffic.
Tokens represent the finite capacity of a given stream, expressed in bytes for data we're looking to replicate.
V2EnabledWhenLeaderLevel captures the level at which RACv2 is enabled when this replica is the leader.