package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Packages
Package admissionpb contains the base types for the admission package.
# Functions
ContextWithElasticCPUWorkHandle returns a Context wrapping the supplied elastic CPU handle, if any.
ElasticCPUWorkHandleFromContext returns the elastic CPU handle contained in the Context, if any.
NewGrantCoordinators constructs GrantCoordinators and WorkQueues for a regular cluster node.
NewGrantCoordinatorSQL constructs a GrantCoordinator and WorkQueues for a single-tenant SQL node in a multi-tenant cluster.
TestingNewElasticCPUHandle exports the ElasticCPUWorkHandle constructor for testing purposes.
TestingNewElasticCPUHandleWithCallback constructs an ElasticCPUWorkHandle with a testing override for the behaviour of OverLimit().
# Constants
KVWork represents requests submitted to the KV layer, from the same node or a different node.
MaxElasticCPUDuration is the maximum on-CPU time elastic requests can ask when seeking admission.
MinElasticCPUDuration is the minimum on-CPU time elastic requests can ask when seeking admission.
1MB.
SQLKVResponseWork is response processing in SQL for a KV response from a local or remote node.
SQLSQLResponseWork is response processing in SQL, for DistSQL RPC responses.
SQLStatementLeafStartWork represents the start of leaf-level processing for a SQL statement.
SQLStatementRootStartWork represents the start of root-level processing for a SQL statement.
# Variables
DefaultOptions are the default settings for various admission control knobs.
DiskBandwidthForSnapshotIngest determines whether range snapshot ingests will be subject to disk write control tokens in Admission Control.
DiskBandwidthTokensForElasticEnabled controls whether the disk bandwidth resource is considered as a possible bottleneck resource.
ElasticBandwidthMaxUtil sets the max utilization for disk bandwidth for elastic traffic.
EpochLIFOEnabled controls whether the adaptive epoch-LIFO scheme is enabled for admission control.
KVAdmissionControlEnabled controls whether KV server-side admission control is enabled.
KVBulkOnlyAdmissionControlEnabled controls whether user (normal and above priority) work is subject to admission control.
KVSlotAdjusterOverloadThreshold sets a goroutine runnable threshold at which the CPU will be considered overloaded, when running in a node that executes KV operations.
KVStoresTenantWeightsEnabled controls whether tenant weights are enabled for KV-stores admission control.
KVTenantWeightsEnabled controls whether tenant weights are enabled for KV admission control.
L0FileCountOverloadThreshold sets a file count threshold that signals an overloaded store.
L0MinimumSizePerSubLevel is a minimum size threshold per sub-level, to avoid over reliance on the sub-level count as a signal of overload.
L0SubLevelCountOverloadThreshold sets a sub-level count threshold that signals an overloaded store.
MinFlushUtilizationFraction is a lower-bound on the dynamically adjusted flush utilization target fraction that attempts to reduce write stalls.
SQLKVResponseAdmissionControlEnabled controls whether response processing in SQL, for KV requests, is enabled.
SQLSQLResponseAdmissionControlEnabled controls whether response processing in SQL, for DistSQL requests, is enabled.
# Structs
DiskStats provide low-level stats about the disk resources used for a store.
ElasticCPUGrantCoordinator coordinates grants for elastic CPU tokens, it has a single granter-requester pair.
ElasticCPUWorkHandle groups relevant data for admitted elastic CPU work, specifically how much on-CPU time a request is allowed to make use of (used for cooperative scheduling with elastic CPU granters).
ElasticCPUWorkQueue maintains a queue of elastic work waiting to be admitted.
GrantCoordinator is the top-level object that coordinates grants across different WorkKinds (for more context see the comment in admission.go, and the comment where WorkKind is declared).
GrantCoordinatorMetrics are metrics associated with a GrantCoordinator.
GrantCoordinators holds {regular,elastic} GrantCoordinators for {regular,elastic} work, and a StoreGrantCoordinators that allows for per-store GrantCoordinators for KVWork that involves writes.
LogEntryAdmittedCallbackState is passed to AdmittedLogEntry.
LogPosition is a point on the raft log, identified by a term and an index.
Options for constructing GrantCoordinators.
Pacer is used in tight loops (CPU-bound) for non-premptible elastic work.
ReplicatedWorkInfo groups everything needed to admit replicated writes, done so asynchronously below-raft as part of replication admission control.
SnapshotQueue implements the requester interface.
StoreGrantCoordinators is a container for GrantCoordinators for each store, that is used for KV work admission that takes into account store health.
StoreMetrics are the metrics and some config information for a store.
StoreWorkDoneInfo provides information about the work size after the work is done.
StoreWorkHandle is returned by StoreWorkQueue.Admit, and contains state needed by the caller (see StoreWorkHandle.UseAdmittedWorkDone) and by StoreWorkQueue.AdmittedWorkDone.
StoreWorkQueue is responsible for admission to a store.
StoreWriteWorkInfo is the information that needs to be provided for work seeking admission from a StoreWorkQueue.
TestingKnobs provide fine-grained control over the various admission control components for testing.
WorkInfo provides information that is used to order work within an WorkQueue.
WorkQueue maintains a queue of work waiting to be admitted.
WorkQueueMetrics are metrics associated with a WorkQueue.
# Interfaces
CPULoadListener listens to the latest CPU load information.
IOThresholdConsumer is informed about updated IOThresholds.
MetricsRegistryProvider provides the store metric.Registry for a given store.
OnLogEntryAdmitted is used to observe the specific entries that were admitted.
PacerFactory is used to construct a new admission.Pacer.
PebbleMetricsProvider provides the pebble.Metrics for all stores.
# Type aliases
QueueKind is used to track the specific WorkQueue an item of KVWork is in.
SchedulerLatencyListener listens to the latest scheduler latency data.
WorkKind represents various types of work that are subject to admission control.