diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index 410a41b12cb..6a165bc46a8 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -421,8 +421,8 @@ Flags: --vtgate_grpc_server_name string the server name to use to validate server certificate --vttablet_skip_buildinfo_tags string comma-separated list of buildinfo tags to skip from merging with --init_tags. each tag is either an exact match or a regular expression of the form '/regexp/'. (default "/.*/") --wait_for_backup_interval duration (init restore parameter) if this is greater than 0, instead of starting up empty when no backups are found, keep checking at this interval for a backup to appear + --warming-reads-concurrency int Number of concurrent warming reads allowed (default 500) --warming-reads-percent int Percentage of reads on the primary to forward to replicas. Useful for keeping buffer pools warm (default 0) - --warming-reads-pool-size int Size of goroutine pool for warming reads (default 500) --warming-reads-query-timeout duration Timeout of warming read queries (default 5s) --warn_memory_rows int Warning threshold for in-memory results. A row count higher than this amount will cause the VtGateWarnings.ResultsExceeded counter to be incremented. (default 30000) --warn_payload_size int The warning threshold for query payloads in bytes. A payload greater than this threshold will cause the VtGateWarnings.WarnPayloadSizeExceeded counter to be incremented. diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index 3a494fb835a..fed90fe42a0 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -229,8 +229,8 @@ Flags: --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging --vschema_ddl_authorized_users string List of users authorized to execute vschema ddl operations, or '%' to allow all users. --vtgate-config-terse-errors prevent bind vars from escaping in returned errors + --warming-reads-concurrency int Number of concurrent warming reads allowed (default 500) --warming-reads-percent int Percentage of reads on the primary to forward to replicas. Useful for keeping buffer pools warm (default 0) - --warming-reads-pool-size int Size of goroutine pool for warming reads (default 500) --warming-reads-query-timeout duration Timeout of warming read queries (default 5s) --warn_memory_rows int Warning threshold for in-memory results. A row count higher than this amount will cause the VtGateWarnings.ResultsExceeded counter to be incremented. (default 30000) --warn_payload_size int The warning threshold for query payloads in bytes. A payload greater than this threshold will cause the VtGateWarnings.WarnPayloadSizeExceeded counter to be incremented. diff --git a/go/vt/vtgate/engine/fake_vcursor_test.go b/go/vt/vtgate/engine/fake_vcursor_test.go index 6b1ac7d96ab..79e7c7979c2 100644 --- a/go/vt/vtgate/engine/fake_vcursor_test.go +++ b/go/vt/vtgate/engine/fake_vcursor_test.go @@ -93,7 +93,7 @@ func (t *noopVCursor) GetWarmingReadsPercent() int { panic("implement me") } -func (t *noopVCursor) GetWarmingReadsPool() chan bool { +func (t *noopVCursor) GetWarmingReadsChannel() chan bool { panic("implement me") } @@ -497,7 +497,7 @@ func (f *loggingVCursor) GetWarmingReadsPercent() int { return 0 } -func (f *loggingVCursor) GetWarmingReadsPool() chan bool { +func (f *loggingVCursor) GetWarmingReadsChannel() chan bool { return make(chan bool) } diff --git a/go/vt/vtgate/engine/primitive.go b/go/vt/vtgate/engine/primitive.go index c3781aefc31..1721f1ea063 100644 --- a/go/vt/vtgate/engine/primitive.go +++ b/go/vt/vtgate/engine/primitive.go @@ -123,8 +123,8 @@ type ( // GetWarmingReadsPercent gets the percentage of queries to clone to replicas for bufferpool warming GetWarmingReadsPercent() int - // GetWarmingReadsPool returns the pool for executing warming reads against replicas - GetWarmingReadsPool() chan bool + // GetWarmingReadsChannel returns the channel for executing warming reads against replicas + GetWarmingReadsChannel() chan bool // CloneForReplicaWarming clones the VCursor for re-use in warming queries to replicas CloneForReplicaWarming(ctx context.Context) VCursor diff --git a/go/vt/vtgate/engine/route.go b/go/vt/vtgate/engine/route.go index 5759d1004ac..669137c471a 100644 --- a/go/vt/vtgate/engine/route.go +++ b/go/vt/vtgate/engine/route.go @@ -606,7 +606,7 @@ func (route *Route) executeWarmingReplicaRead(ctx context.Context, vcursor VCurs } replicaVCursor := vcursor.CloneForReplicaWarming(ctx) - pool := vcursor.GetWarmingReadsPool() + pool := vcursor.GetWarmingReadsChannel() select { // if there's no more room in the pool, drop the warming read diff --git a/go/vt/vtgate/executor.go b/go/vt/vtgate/executor.go index 37e79eafc30..8c06220b422 100644 --- a/go/vt/vtgate/executor.go +++ b/go/vt/vtgate/executor.go @@ -121,7 +121,7 @@ type Executor struct { queryLogger *streamlog.StreamLogger[*logstats.LogStats] warmingReadsPercent int - warmingReadsPool chan bool + warmingReadsChannel chan bool } var executorOnce sync.Once @@ -167,7 +167,7 @@ func NewExecutor( pv: pv, plans: plans, warmingReadsPercent: warmingReadsPercent, - warmingReadsPool: make(chan bool, warmingReadsPoolSize), + warmingReadsChannel: make(chan bool, warmingReadsConcurrency), } vschemaacl.Init() diff --git a/go/vt/vtgate/vcursor_impl.go b/go/vt/vtgate/vcursor_impl.go index 3a856b0c132..d4c48a990a2 100644 --- a/go/vt/vtgate/vcursor_impl.go +++ b/go/vt/vtgate/vcursor_impl.go @@ -115,7 +115,7 @@ type vcursorImpl struct { pv plancontext.PlannerVersion warmingReadsPercent int - warmingReadsPool chan bool + warmingReadsChannel chan bool } // newVcursorImpl creates a vcursorImpl. Before creating this object, you have to separate out any marginComments that came with @@ -161,10 +161,10 @@ func newVCursorImpl( } warmingReadsPct := 0 - var warmingReadsPool chan bool + var warmingReadsChan chan bool if executor != nil { warmingReadsPct = executor.warmingReadsPercent - warmingReadsPool = executor.warmingReadsPool + warmingReadsChan = executor.warmingReadsChannel } return &vcursorImpl{ safeSession: safeSession, @@ -182,7 +182,7 @@ func newVCursorImpl( warnShardedOnly: warnShardedOnly, pv: pv, warmingReadsPercent: warmingReadsPct, - warmingReadsPool: warmingReadsPool, + warmingReadsChannel: warmingReadsChan, }, nil } @@ -1284,8 +1284,8 @@ func (vc *vcursorImpl) GetWarmingReadsPercent() int { return vc.warmingReadsPercent } -func (vc *vcursorImpl) GetWarmingReadsPool() chan bool { - return vc.warmingReadsPool +func (vc *vcursorImpl) GetWarmingReadsChannel() chan bool { + return vc.warmingReadsChannel } func (vc *vcursorImpl) CloneForReplicaWarming(ctx context.Context) engine.VCursor { diff --git a/go/vt/vtgate/vtgate.go b/go/vt/vtgate/vtgate.go index 14706f6455e..b66ea93226e 100644 --- a/go/vt/vtgate/vtgate.go +++ b/go/vt/vtgate/vtgate.go @@ -114,7 +114,7 @@ var ( warmingReadsPercent = 0 warmingReadsQueryTimeout = 5 * time.Second - warmingReadsPoolSize = 500 + warmingReadsConcurrency = 500 ) func registerFlags(fs *pflag.FlagSet) { @@ -149,7 +149,7 @@ func registerFlags(fs *pflag.FlagSet) { fs.BoolVar(&enableViews, "enable-views", enableViews, "Enable views support in vtgate.") fs.BoolVar(&allowKillStmt, "allow-kill-statement", allowKillStmt, "Allows the execution of kill statement") fs.IntVar(&warmingReadsPercent, "warming-reads-percent", 0, "Percentage of reads on the primary to forward to replicas. Useful for keeping buffer pools warm") - fs.IntVar(&warmingReadsPoolSize, "warming-reads-pool-size", 500, "Size of goroutine pool for warming reads") + fs.IntVar(&warmingReadsConcurrency, "warming-reads-concurrency", 500, "Number of concurrent warming reads allowed") fs.DurationVar(&warmingReadsQueryTimeout, "warming-reads-query-timeout", 5*time.Second, "Timeout of warming read queries") _ = fs.String("schema_change_signal_user", "", "User to be used to send down query to vttablet to retrieve schema changes")