github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/protectedts/settings.go (about)

     1  // Copyright 2019 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  package protectedts
    12  
    13  import (
    14  	"time"
    15  
    16  	"github.com/cockroachdb/cockroach/pkg/settings"
    17  )
    18  
    19  // Records and their spans are stored in memory on every host so it's best
    20  // not to let this data size be unbounded.
    21  
    22  // MaxBytes controls the maximum number of bytes worth of spans and metadata
    23  // which can be protected by all protected timestamp records.
    24  var MaxBytes = settings.RegisterNonNegativeIntSetting(
    25  	"kv.protectedts.max_bytes",
    26  	"if non-zero the limit of the number of bytes of spans and metadata which can be protected",
    27  	1<<20, // 1 MiB
    28  )
    29  
    30  // MaxSpans controls the maximum number of spans which can be protected
    31  // by all protected timestamp records.
    32  var MaxSpans = settings.RegisterNonNegativeIntSetting(
    33  	"kv.protectedts.max_spans",
    34  	"if non-zero the limit of the number of spans which can be protected",
    35  	4096)
    36  
    37  // PollInterval defines how frequently the protectedts state is polled by the
    38  // Tracker.
    39  var PollInterval = settings.RegisterNonNegativeDurationSetting(
    40  	"kv.protectedts.poll_interval",
    41  	// TODO(ajwerner): better description.
    42  	"the interval at which the protectedts subsystem state is polled",
    43  	2*time.Minute)
    44  
    45  func init() {
    46  	MaxBytes.SetVisibility(settings.Reserved)
    47  	MaxSpans.SetVisibility(settings.Reserved)
    48  }