package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Packages
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
# Functions
DefaultHandleFailedRun is a default implementation for handling failed run (either system.job failure, or perhaps error processing the schedule itself).
FractionUpdater returns a FractionProgressedFn that returns its argument.
GetJobTraceID returns the current trace ID of the job from the job progress.
GetLegacyPayloadKey returns the info_key whose value is the jobspb.Payload of the job.
GetLegacyProgressKey returns the info_key whose value is the jobspb.Progress of the job.
GetScheduledJobExecutor returns a singleton instance of ScheduledJobExecutor and a flag indicating if that instance was just created.
HasErrJobCanceled returns true if the error contains the error set as the job's FinalResumeError when it has been canceled.
HasJobNotFoundError returns true if the error contains a JobNotFoundError.
HasScheduledJobNotFoundError returns true if the error contains a scheduledJobNotFoundError.
InfoStorageForJob returns a new InfoStorage with the passed in job ID and txn.
IsLeaseRelocationError returns true if the error indicates lease relocation.
IsPauseSelfError checks whether the given error is a PauseRequestError.
IsPermanentJobError checks whether the given error is a permanent error.
IsRetryJobError checks whether the given error is a job retry error.
JobCoordinatorID returns the coordinator node ID of the job.
JobExists returns true if there is a row corresponding to jobID in the system.jobs table.
ListExecutionDetailFiles lists all the files that have been generated as part of a job's execution details.
LoadJobProgress returns the job progress from the info table.
LogStatusChangeStructured job state change using structured logging, if job is not nil.
MakeExecutorMetrics creates metrics for scheduled job executor.
MakeExecutorPTSMetrics creates PTS metrics.
MakeRegistry creates a new Registry.
MakeSchedulerMetrics returns metrics for scheduled job daemon.
MarkAsPermanentJobError marks an error as a permanent job error, which indicates Registry to not retry the job when it fails due to this error.
MarkAsRetryJobError marks an error as a retriable job error which indicates that the registry should retry the job.
MarkPauseRequestError marks an error as a pause request job error, which indicates to the Registry that the job would like to be paused rather than failing.
NewChunkProgressLogger returns a ChunkProgressLogger.
No description provided by the author
No description provided by the author
NewScheduledJob creates and initializes ScheduledJob.
NewTestingKnobsWithIntervals return a TestingKnobs structure with overrides for adopt and cancel intervals.
NewTestingKnobsWithShortIntervals return a TestingKnobs structure with overrides for short adopt, cancel, and retry intervals.
NotifyJobTermination is invoked when the job triggered by specified schedule completes
The 'txn' transaction argument is the transaction the job will use to update its state (e.g.
ReadChunkedFileToJobInfo will stitch together all the chunks corresponding to the filename and return the uncompressed data of the file.
ReadExecutionDetailFile will stitch together all the chunks corresponding to the filename and return the uncompressed data of the file.
RegisterConstructor registers a Resumer constructor for a certain job type.
RegisterExecutorsMetrics registered the metrics updated by each executor.
RegisterScheduledJobExecutorFactory registers callback for creating ScheduledJobExecutor with the specified name.
ResetConstructors resets the registered Resumer constructors.
RunningJobExists checks that whether there are any job of the given types in the pending, running, or paused status, optionally ignoring the job with the ID specified by ignoreJobID as well as any jobs created after it, if the passed ID is not InvalidJobID.
RunningJobs returns the IDs of all jobs of the given types in the pending, running, or paused status, optionally ignoring the job with the ID specified by ignoreJobID as well as any jobs created after it, if the passed ID is not InvalidJobID.
No description provided by the author
No description provided by the author
SimplifyInvalidStatusError unwraps an *InvalidStatusError into an error message suitable for users.
StartJobSchedulerDaemon starts a daemon responsible for periodically scanning system.scheduled_jobs table to find and executing eligible scheduled jobs.
TestingClearConstructors clears all previously registered constructors.
TestingCreateAndStartJob creates and asynchronously starts a job from record.
TestingRegisterConstructor is like RegisterConstructor but returns a cleanup function resets the registration for the given type.
TestingSetIDsToIgnore is a test-only knob to set a list of job IDs that will not be executed even after being claimed.
TestingSetProgressThresholds overrides batching limits to update more often.
UnmarshalPayload unmarshals and returns the Payload encoded in the input datum, which should be a tree.DBytes.
UnmarshalProgress unmarshals and returns the Progress encoded in the input datum, which should be a tree.DBytes.
ValidateDescriptorReferencesInJob checks a job for inconsistencies relative to system.descriptor and passes any validation failures in the form of errors to an accumulator function.
ValidateJobReferencesInDescriptor checks a catalog.Descriptor for inconsistencies relative to system.jobs and passes any validation failures in the form of errors to an accumulator function.
WithJobID is used to inject an existing JobID to TestingCreateAndStartJob.
WithJobMetrics returns a RegisterOption which Will configure jobs of this type to use specified metrics.
WithResolvedMetric registers a gauge metric that the poller will update to reflect the minimum resolved timestamp of all the jobs of this type.
WriteChunkedFileToJobInfo will break up data into chunks of a fixed size, and gzip compress them before writing them to the job_info table.
WriteExecutionDetailFile will chunk and write to the job_info table under the `~profiler/` prefix.
WriteProtobinExecutionDetailFile writes a `binpb` file of the form `~profiler/filename~<proto.MessageName>.binpb` to the system.job_info table, with the contents of the passed in protobuf message.
# Constants
AbandonedJobInfoRowsCleanupQuery is used by the CLI command job-cleanup-job-info to delete jobs that were abandoned because of previous CRDB bugs.
CreatedByScheduledJobs identifies the job that was created by scheduled jobs system.
InlineExecutorName is the name associated with scheduled job executor which runs jobs "inline" -- that is, it doesn't spawn external system.job to do its work.
JobMetricsPollerJobID A static job ID is used for the job metrics polling job.
KeyVisualizerJobID A static job ID is used to easily check if the Key Visualizer job already exists.
No description provided by the author
No description provided by the author
MVCCStatisticsJobID A static job ID used for the MVCC statistics update job.
NonTerminalStatusTupleString is a sql tuple corresponding to statuses of non-terminal jobs.
PauseRequestExplained is a prose used to wrap and explain a pause-request error.
PreventAdoptionFile is the name of the file which, if present in the first on-disk store, will prevent the adoption of background jobs by that node.
SqlActivityUpdaterJobID A static job ID is used for the SQL activity tables.
StatusCanceled is for jobs that were explicitly canceled by the user and cannot be resumed.
StatusCancelRequested is for jobs that were requested to be canceled by the user but may be still running Resume.
StatusFailed is for jobs that failed.
StatusPaused is for jobs that are not currently performing work, but have saved their state and can be resumed by the user later.
StatusPauseRequested is for jobs that were requested to be paused by the user but may be still resuming or reverting.
StatusPending is `for jobs that have been created but on which work has not yet started.
StatusRevertFailed is for jobs that encountered an non-retryable error when reverting their changes.
StatusReverting is for jobs that failed or were canceled and their changes are being being reverted.
StatusRunning is for jobs that are currently in progress.
StatusSucceeded is for jobs that have successfully completed.
A static Job ID must be sufficiently small to avoid collisions with IDs generated by MakeJobID.
# Variables
AbandonedInfoRowsFound is how many times our cleanup routine found abandoned rows.
No description provided by the author
BulkJobExecutionResultHeader is the header for various job commands (BACKUP, RESTORE, IMPORT, etc) stmt results.
DetachedJobExecutionResultHeader is the header for various job commands when job executes in detached mode (i.e.
DisablesTenantCostControl allows job implementors to exclude their job's Storage I/O costs (i.e.
MakeBackupMetricsHook allows for registration of backup metrics.
MakeChangefeedMemoryMetricsHook allows for registration of changefeed memory metrics from ccl code.
MakeChangefeedMetricsHook allows for registration of changefeed metrics from ccl code.
MakeRowLevelTTLMetricsHook allows for registration of row-level TTL metrics.
MakeStreamIngestMetricsHook allows for registration of streaming metrics from ccl code.
MetaRunningNonIdleJobs is the count of currently running jobs that are not reporting as being idle.
OnlineRestoreJobExecutionResultHeader is the header for an online restore job, which provides a header different from the usual bulk job execution.
PollJobsMetricsInterval is the interval at which a tenant in the cluster will poll the jobs table for metrics.
ProgressUpdateOnly is for use with NewChunkProgressLogger to just update job progress fraction (ie.
RetentionTimeSetting wraps "jobs.retention_timehelpers_test.go".
TelemetryMetrics contains telemetry metrics for different job types.
UsesTenantCostControl indicates that resumed jobs should include their Storage I/O costs in tenant accounting.
# Structs
ChunkProgressLogger is a helper for managing the progress state on a job.
CreatedByInfo encapsulates the type and the ID of the system which created this job.
ExecutorMetrics describes metrics related to scheduled job executor operations.
ExecutorPTSMetrics describes metrics related to protected timestamp system for executors that maintain PTS records.
InfoStorage can be used to read and write rows to system.job_info table.
InvalidStatusError is the error returned when the desired operation is invalid given the job's current status.
Job manages logging the progress of long-running system processes, like backups and restores, to the system.jobs table.
No description provided by the author
JobMetadata groups the job metadata values passed to UpdateFn.
JobNotFoundError is returned from load when the job does not exist.
JobTelemetryMetrics is a telemetry metrics for individual job types.
JobTypeMetrics is a metric.Struct containing metrics for each type of job.
JobUpdater accumulates changes to job metadata that are to be persisted.
Metrics are for production monitoring of each job type.
ProgressUpdateBatcher is a helper for tracking progress as it is made and calling a progress update function when it has meaningfully advanced (e.g.
Record bundles together the user-managed fields in jobspb.Payload.
Registry creates Jobs and manages their leases and cancelation.
ScheduledJob is a representation of the scheduled job.
SchedulerMetrics are metrics specific to job scheduler daemon.
StartableJob is a job created with a transaction to be started later.
TestingIntervalOverrides contains variables to override the intervals and settings of periodic tasks.
TestingKnobs are base.ModuleTestingKnobs for testing jobs related infra.
No description provided by the author
# Interfaces
JobMetadataGetter is an interface used during job validation.
JobResultsReporter is an interface for reporting the results of the job execution.
ProtobinExecutionDetailFile interface encapsulates the methods that must be implemented by protobuf messages that are collected as part of a job's execution details.
PTSMetrics is a marker interface indicating that executor metrics also keep track of PTS related metrics.
Resumer is a resumable job, and is associated with a Job object.
ScheduledJobController is an interface describing hooks that will execute when controlling a scheduled job.
ScheduledJobExecutor is an interface describing execution of the scheduled job.
No description provided by the author
TraceableJob is associated with a Job object, and can be used to configure the root tracing span that will be tied to the jobs' execution.
# Type aliases
Constructor creates a resumable job of a certain type.
FractionProgressedFn is a callback that computes a job's completion fraction given its details.
MessageStorage stores human-readable messages emitted by the execution of a job, including when it changes states in the job system, when it wishes to communicate its own custom status, or additional messages it wishes to surface to the user.
NonCancelableUpdateFn is a callback that computes a job's non-cancelable status given its current one.
ProgressStorage reads and writes progress rows.
RegisterOption is the template for options passed to the RegisterConstructor function.
RunningStatus represents the more detailed status of a running job in the system.jobs table.
ScheduledJobExecutorFactory is a callback to create a ScheduledJobExecutor.
Status represents the status of a job in the system.jobs table.
StatusStorage reads and writes the "status" row for a job.
TestCreateAndStartJobOption optionally modifies TestingCreateAndStartJob.
UpdateFn is the callback passed to Job.Update.