package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Functions

CountLeases returns the number of unexpired leases for a number of descriptors each at a particular version at a particular time.
NameMatchesDescriptor returns true if the provided name and IDs match this descriptor.
NewIDVersionPrev returns an initialized IDVersion with the previous version of the descriptor.
NewLeaseManager creates a new Manager.
TestingDisableTableLeases disables table leases and returns a function that can be used to enable it.
TestingTableLeasesAreDisabled returns true if table leases have been disabled.

# Constants

AcquireBackground happens due to periodic background refreshes.
AcquireBlock denotes the LeaseAcquireResultBlockEvent is coming from descriptorState.acquire().
AcquireFreshestBlock denotes the LeaseAcquireResultBlockEvent is from descriptorState.acquireFreshestFromStore().
GaugeWaitForInitialVersion gauge for WaitForInitialVersion.
GaugeWaitForNoVersion gauge for WaitForNoVersion.
GaugeWaitForOneVersion gauge for WaitForOneVersion.
GaugeWaitForTwoVersionViolation gauge for CheckTwoVersionInvariant.
SessionBasedDrain expiry based leases will not be granted or renewed.
SessionBasedDualWrite expiry based and session based leasing are active concurrently, and both tables must be consulted schema changes.
SessionBasedLeasingAuto automatically pick a leasing mode based on the current version.
SessionBasedLeasingOff expiry based leasing is being used.
SessionBasedOnly session based leases are only active, and schema changes only need to consult this table.

# Variables

LeaseDuration controls the duration of sql descriptor leases.
LeaseEnableSessionBasedLeasing used to enable / disable support for session based leasing.
LeaseJitterFraction controls the percent jitter around sql lease durations.
LeaseRenewalCrossValidate controls if cross validation should be done during lease renewal.
LeaseRenewalDuration controls the default time before a lease expires when acquisition to renew the lease begins.
SessionBasedLeasingModeByName maps session based leasing modes from name to enum values.

# Structs

IDVersion represents a descriptor ID, version pair that are meant to map to a single immutable descriptor.
Manager manages acquiring and releasing per-descriptor leases.
ManagerTestingKnobs contains test knobs.
Metrics contains a pointer to all relevant lease.Manager metrics, for registration.
StorageTestingKnobs contains testing knobs.

# Interfaces

LeasedDescriptor tracks and manages leasing related information for a descriptor.

# Type aliases

AcquireType is the type of blocking result event when calling LeaseAcquireResultBlockEvent.
AfterLeaseDurationGauge metric to increment after a long wait.
go:generate stringer -type=SessionBasedLeasingMode.