cockroach: Index | Files

package ptreconcile

import ""

Package ptreconcile provides logic to reconcile protected timestamp records with state associated with their metadata.


Package Files

metrics.go reconciler.go


var ReconcileInterval = settings.RegisterPublicNonNegativeDurationSetting(
    "the frequency for reconciling jobs with protected timestamp records",

ReconcileInterval is the interval between two generations of the reports. When set to zero - disables the report generation.

type Config Uses

type Config struct {
    Settings *cluster.Settings
    // Stores is used to ensure that we only run the reconciliation loop on
    Stores  *kvserver.Stores
    DB      *kv.DB
    Storage protectedts.Storage
    Cache   protectedts.Cache

    // We want a map from metaType to a function which determines whether we
    // should clean it up.
    StatusFuncs StatusFuncs

Config configures a Reconciler.

type Metrics Uses

type Metrics struct {
    ReconcilationRuns    *metric.Counter
    RecordsProcessed     *metric.Counter
    RecordsRemoved       *metric.Counter
    ReconciliationErrors *metric.Counter

Metrics encapsulates the metrics exported by the Reconciler.

func (*Metrics) MetricStruct Uses

func (m *Metrics) MetricStruct()

MetricStruct makes Metrics a metric.Struct.

type Reconciler Uses

type Reconciler struct {
    // contains filtered or unexported fields

Reconciler runs an a loop to reconcile the protected timestamps with external state. Each record's status is determined using the record's meta type and meta in conjunction with the configured StatusFunc.

func NewReconciler Uses

func NewReconciler(cfg Config) *Reconciler

NewReconciler constructs a Reconciler.

func (*Reconciler) Metrics Uses

func (r *Reconciler) Metrics() *Metrics

Metrics returns the Reconciler's metrics.

func (*Reconciler) Start Uses

func (r *Reconciler) Start(ctx context.Context, stopper *stop.Stopper) error

Start will start the Reconciler.

type StatusFunc Uses

type StatusFunc func(
    ctx context.Context, txn *kv.Txn, meta []byte,
) (shouldRemove bool, _ error)

StatusFunc is used to check on the status of a Record based on its Meta field.

type StatusFuncs Uses

type StatusFuncs map[string]StatusFunc

StatusFuncs maps from MetaType to a StatusFunc.

Package ptreconcile imports 17 packages (graph) and is imported by 7 packages. Updated 2020-08-12. Refresh now. Tools for package owners.