From 464e6e801a8fa4b0a52b35cbde5a96a13e7df9e5 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Tue, 18 Feb 2025 16:33:28 +0100 Subject: [PATCH] set uint later Signed-off-by: Tim Vaillancourt --- go/flags/endtoend/vtorc.txt | 2 +- go/vt/vtorc/config/config.go | 40 ++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go/flags/endtoend/vtorc.txt b/go/flags/endtoend/vtorc.txt index 587e9b06035..18c08ac1ee2 100644 --- a/go/flags/endtoend/vtorc.txt +++ b/go/flags/endtoend/vtorc.txt @@ -35,7 +35,7 @@ Flags: --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s) --config-type string Config file type (omit to infer config type from file extension). --consul_auth_static_file string JSON File to read the topos/tokens from. - --discovery-max-concurrency uint Number of goroutines dedicated to doing hosts discovery (default 300) + --discovery-max-concurrency int Number of goroutines dedicated to doing hosts discovery (default 300) --emit_stats If set, emit stats to push-based monitoring and stats backends --grpc_auth_static_client_creds string When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server. --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy diff --git a/go/vt/vtorc/config/config.go b/go/vt/vtorc/config/config.go index 8db60829433..d1c10d8793f 100644 --- a/go/vt/vtorc/config/config.go +++ b/go/vt/vtorc/config/config.go @@ -47,24 +47,24 @@ const ( ) var ( - discoveryMaxConcurrency uint = 300 - sqliteDataFile = "file::memory:?mode=memory&cache=shared" - instancePollTime = 5 * time.Second - snapshotTopologyInterval = 0 * time.Hour - reasonableReplicationLag = 10 * time.Second - auditFileLocation = "" - auditToBackend = false - auditToSyslog = false - auditPurgeDuration = 7 * 24 * time.Hour // Equivalent of 7 days - allowRecovery = true - recoveryPeriodBlockDuration = 30 * time.Second - preventCrossCellFailover = false - waitReplicasTimeout = 30 * time.Second - tolerableReplicationLag = 0 * time.Second - topoInformationRefreshDuration = 15 * time.Second - recoveryPollDuration = 1 * time.Second - ersEnabled = true - convertTabletsWithErrantGTIDs = false + discoveryMaxConcurrency = 300 + sqliteDataFile = "file::memory:?mode=memory&cache=shared" + instancePollTime = 5 * time.Second + snapshotTopologyInterval = 0 * time.Hour + reasonableReplicationLag = 10 * time.Second + auditFileLocation = "" + auditToBackend = false + auditToSyslog = false + auditPurgeDuration = 7 * 24 * time.Hour // Equivalent of 7 days + allowRecovery = true + recoveryPeriodBlockDuration = 30 * time.Second + preventCrossCellFailover = false + waitReplicasTimeout = 30 * time.Second + tolerableReplicationLag = 0 * time.Second + topoInformationRefreshDuration = 15 * time.Second + recoveryPollDuration = 1 * time.Second + ersEnabled = true + convertTabletsWithErrantGTIDs = false ) // RegisterFlags registers the flags required by VTOrc @@ -86,7 +86,7 @@ func RegisterFlags(fs *pflag.FlagSet) { fs.DurationVar(&recoveryPollDuration, "recovery-poll-duration", recoveryPollDuration, "Timer duration on which VTOrc polls its database to run a recovery") fs.BoolVar(&ersEnabled, "allow-emergency-reparent", ersEnabled, "Whether VTOrc should be allowed to run emergency reparent operation when it detects a dead primary") fs.BoolVar(&convertTabletsWithErrantGTIDs, "change-tablets-with-errant-gtid-to-drained", convertTabletsWithErrantGTIDs, "Whether VTOrc should be changing the type of tablets with errant GTIDs to DRAINED") - fs.UintVar(&discoveryMaxConcurrency, "discovery-max-concurrency", discoveryMaxConcurrency, "Number of goroutines dedicated to doing hosts discovery") + fs.IntVar(&discoveryMaxConcurrency, "discovery-max-concurrency", discoveryMaxConcurrency, "Number of goroutines dedicated to doing hosts discovery") } // Configuration makes for vtorc configuration input, which can be provided by user via JSON formatted file. @@ -125,7 +125,7 @@ var readFileNames []string // UpdateConfigValuesFromFlags is used to update the config values from the flags defined. // This is done before we read any configuration files from the user. So the config files take precedence. func UpdateConfigValuesFromFlags() { - Config.DiscoveryMaxConcurrency = discoveryMaxConcurrency + Config.DiscoveryMaxConcurrency = uint(discoveryMaxConcurrency) Config.SQLite3DataFile = sqliteDataFile Config.InstancePollSeconds = uint(instancePollTime / time.Second) Config.InstancePollSeconds = uint(instancePollTime / time.Second)