Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ var (
const (
DefaultHealthCheckRetryDelay = 5 * time.Second
DefaultHealthCheckTimeout = 1 * time.Minute
)

const (
// DefaultTopoReadConcurrency can be used as default value for the topoReadConcurrency parameter of a TopologyWatcher.
DefaultTopoReadConcurrency int = 5
// DefaultTopologyWatcherRefreshInterval can be used as the default value for
Expand Down
6 changes: 3 additions & 3 deletions go/vt/mysqlctl/builtinbackupengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ import (
)

const (
builtin = "builtin"
writerBufferSize = 2 * 1024 * 1024
builtin = "builtin"
writerBufferSize = 2 * 1024 * 1024
dataDictionaryFile = "mysql.ibd"
)

// BuiltinBackupEngine encapsulates the logic of the builtin engine
Expand Down Expand Up @@ -180,7 +181,6 @@ func addDirectory(fes []FileEntry, base string, baseDir string, subDir string) (
// and adds it to the backup manifest if it does
// https://dev.mysql.com/doc/refman/8.0/en/data-dictionary-transactional-storage.html
func addMySQL8DataDictionary(fes []FileEntry, base string, baseDir string) ([]FileEntry, error) {
const dataDictionaryFile = "mysql.ibd"
filePath := path.Join(baseDir, dataDictionaryFile)

// no-op if this file doesn't exist
Expand Down
6 changes: 4 additions & 2 deletions go/vt/mysqlctl/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ func (mysqld *Mysqld) fetchVariables(ctx context.Context, pattern string) (map[s
return varMap, nil
}

const masterPasswordStart = " MASTER_PASSWORD = '"
const masterPasswordEnd = "',\n"
const (
masterPasswordStart = " MASTER_PASSWORD = '"
masterPasswordEnd = "',\n"
)

func redactMasterPassword(input string) string {
i := strings.Index(input, masterPasswordStart)
Expand Down
8 changes: 5 additions & 3 deletions go/vt/vtctl/throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ import (
throttlerdatapb "vitess.io/vitess/go/vt/proto/throttlerdata"
)

const (
throttlerGroupName = "Resharding Throttler"
shortTimeout = 15 * time.Second
)

// This file contains the commands to control the throttler which is used during
// resharding (vtworker) and by filtered replication (vttablet).

const throttlerGroupName = "Resharding Throttler"
const shortTimeout = 15 * time.Second

func init() {
addCommandGroup(throttlerGroupName)

Expand Down
24 changes: 12 additions & 12 deletions go/vt/vtctld/tablet_stats_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ import (
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
)

const (
// tabletMissing represents a missing/non-existent tablet for any metric.
tabletMissing = -1
// These values represent the threshold for replication lag.
lagThresholdDegraded = 60
lagThresholdUnhealthy = 120
// These values represent the health of the tablet - 1 is healthy, 2 is degraded, 3 is unhealthy
tabletHealthy = 0
tabletDegraded = 1
tabletUnhealthy = 2
)

// yLabel is used to keep track of the cell and type labels of the heatmap.
type yLabel struct {
CellLabel label
Expand Down Expand Up @@ -60,18 +72,6 @@ func (a byTabletUID) Len() int { return len(a) }
func (a byTabletUID) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byTabletUID) Less(i, j int) bool { return a[i].Tablet.Alias.Uid < a[j].Tablet.Alias.Uid }

// tabletMissing represents a missing/non-existent tablet for any metric.
const tabletMissing = -1

// These values represent the threshold for replication lag.
const lagThresholdDegraded = 60
const lagThresholdUnhealthy = 120

// These values represent the health of the tablet - 1 is healthy, 2 is degraded, 3 is unhealthy
const tabletHealthy = 0
const tabletDegraded = 1
const tabletUnhealthy = 2

// availableTabletTypes is an array of tabletTypes that are being considered to display on the heatmap.
// Note: this list must always be sorted by the order they should appear (i.e. MASTER first, then REPLICA, then RDONLY)
var availableTabletTypes = []topodatapb.TabletType{topodatapb.TabletType_MASTER, topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY}
Expand Down
6 changes: 2 additions & 4 deletions go/vt/vtexplain/vtexplain.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ var (
type ExecutorMode string

const (
vtexplainCell = "explainCell"

// ModeMulti is the default mode with autocommit implemented at vtgate
ModeMulti = "multi"

Expand Down Expand Up @@ -141,10 +143,6 @@ type Explain struct {
TabletActions map[string]*TabletActions
}

const (
vtexplainCell = "explainCell"
)

// Init sets up the fake execution environment
func Init(vSchemaStr, sqlSchema string, opts *Options) error {
// Verify options
Expand Down
15 changes: 8 additions & 7 deletions go/vt/vtgate/engine/primitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ import (
querypb "vitess.io/vitess/go/vt/proto/query"
)

// SeqVarName is a reserved bind var name for sequence values.
const SeqVarName = "__seq"

// ListVarName is a reserved bind var name for list vars.
// This is used for sending different IN clause values
// to different shards.
const ListVarName = "__vals"
const (
// SeqVarName is a reserved bind var name for sequence values.
SeqVarName = "__seq"
// ListVarName is a reserved bind var name for list vars.
// This is used for sending different IN clause values
// to different shards.
ListVarName = "__vals"
)

// VCursor defines the interface the engine will use
// to execute routes.
Expand Down
8 changes: 5 additions & 3 deletions go/vt/vtgate/executor_framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ var unshardedVSchema = `
}
`

const (
testBufferSize = 10
testCacheSize = int64(10)
)

type DestinationAnyShardPickerFirstShard struct{}

func (dp DestinationAnyShardPickerFirstShard) PickShard(shardCount int) int {
Expand Down Expand Up @@ -328,9 +333,6 @@ func init() {
vindexes.Register("keyrange_lookuper_unique", newKeyRangeLookuperUnique)
}

const testBufferSize = 10
const testCacheSize = int64(10)

func createExecutorEnv() (executor *Executor, sbc1, sbc2, sbclookup *sandboxconn.SandboxConn) {
cell := "aa"
hc := discovery.NewFakeHealthCheck()
Expand Down