Skip to content

Commit

Permalink
rename warming reads pool to channel, use concurrency for flag name
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>
  • Loading branch information
Olga Shestopalova committed Sep 29, 2023
1 parent 5892603 commit 96067a1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtcombo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtgate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vtgate/engine/fake_vcursor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions go/vt/vtgate/engine/primitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/engine/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vtgate/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ type Executor struct {
queryLogger *streamlog.StreamLogger[*logstats.LogStats]

warmingReadsPercent int
warmingReadsPool chan bool
warmingReadsChannel chan bool
}

var executorOnce sync.Once
Expand Down Expand Up @@ -167,7 +167,7 @@ func NewExecutor(
pv: pv,
plans: plans,
warmingReadsPercent: warmingReadsPercent,
warmingReadsPool: make(chan bool, warmingReadsPoolSize),
warmingReadsChannel: make(chan bool, warmingReadsConcurrency),
}

vschemaacl.Init()
Expand Down
12 changes: 6 additions & 6 deletions go/vt/vtgate/vcursor_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -182,7 +182,7 @@ func newVCursorImpl(
warnShardedOnly: warnShardedOnly,
pv: pv,
warmingReadsPercent: warmingReadsPct,
warmingReadsPool: warmingReadsPool,
warmingReadsChannel: warmingReadsChan,
}, nil
}

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vtgate/vtgate.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var (

warmingReadsPercent = 0
warmingReadsQueryTimeout = 5 * time.Second
warmingReadsPoolSize = 500
warmingReadsConcurrency = 500
)

func registerFlags(fs *pflag.FlagSet) {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 96067a1

Please sign in to comment.