Skip to content

Commit

Permalink
Merge pull request #559 from vitessio/fix-flag-usage-below-v20
Browse files Browse the repository at this point in the history
Fix flag issues with v19 benchmarks
  • Loading branch information
frouioui authored Jun 25, 2024
2 parents 11384c8 + 7aec68a commit a2fabb9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 46 deletions.
10 changes: 5 additions & 5 deletions ansible/roles/vttablet/templates/vttablet.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ EXTRA_VTTABLET_FLAGS="--alsologtostderr \
--queryserver-config-pool-size={{ tablet.connection_pool_size | default(vttablet_connection_pool_size) }} \
--queryserver-config-stream-pool-size={{ tablet.stream_pool_size | default(vttablet_stream_pool_size) }} \
--queryserver-config-transaction-cap={{ tablet.transaction_cap | default(vttablet_transaction_cap) }} \
{% if vitess_version_name == "latest" %}
--queryserver-config-query-timeout=900s \
--queryserver-config-schema-reload-time=60s \
--queryserver-config-transaction-timeout=300s \
{% else %}
{% if vitess_major_version <= 18 %}
--queryserver-config-query-timeout=900 \
--queryserver-config-schema-reload-time=60 \
--queryserver-config-transaction-timeout=300 \
{% else %}
--queryserver-config-query-timeout=900s \
--queryserver-config-schema-reload-time=60s \
--queryserver-config-transaction-timeout=300s \
{% endif %}
--grpc_max_message_size=67108864 \
--db_charset=utf8 \
Expand Down
39 changes: 7 additions & 32 deletions go/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ const (
)

type Exec struct {
UUID uuid.UUID
RawUUID string
AnsibleConfig ansible.Config
Source string
GitRef string
VitessVersion git.Version
VitessVersionName string
UUID uuid.UUID
RawUUID string
AnsibleConfig ansible.Config
Source string
GitRef string
VitessVersion git.Version

// NextBenchmarkIsTheSame is set to true if the next benchmark has the same config
// as the current one. This allows us to do some optimization in Ansible and speed
Expand Down Expand Up @@ -161,9 +160,6 @@ const (
SourcePullRequestBase = "cron_pr_base"
SourceTag = "cron_tags_"
SourceReleaseBranch = "cron_"

VitessLatestVersion = "latest"
VitessPreviousVersion = "v_"
)

// NewExec creates a new *Exec given the string representation of an uuid.UUID.
Expand Down Expand Up @@ -308,11 +304,6 @@ func (e *Exec) Prepare() error {
return err
}

err = e.defineVersionNameOfVitess()
if err != nil {
return err
}

err = prepareVitessConfiguration(e.rawVitessConfig, e.VitessVersion, &e.vitessConfig)
if err != nil {
return err
Expand Down Expand Up @@ -400,7 +391,7 @@ func (e *Exec) prepareAnsibleForExecution() error {
e.AnsibleConfig.AddExtraVar(ansible.KeyVitessVersionPRNumber, e.PullNB)
}
e.AnsibleConfig.AddExtraVar(ansible.KeyVtgatePlanner, e.VtgatePlannerVersion)
e.AnsibleConfig.AddExtraVar(ansible.KeyVitessVersionName, e.VitessVersionName)
e.AnsibleConfig.AddExtraVar(ansible.KeyVitessMajorVersion, e.VitessVersion.Major)
e.AnsibleConfig.AddExtraVar(ansible.KeyVitessSchema, e.vitessSchemaPath)
e.vitessConfig.addToAnsible(&e.AnsibleConfig)

Expand Down Expand Up @@ -432,22 +423,6 @@ func (e *Exec) handleStepEnd(err error) {
}
}

func (e *Exec) defineVersionNameOfVitess() error {
release, err := git.GetLastReleaseAndCommitHash(e.RepoDir)
if err != nil {
return err
}

// Main branch
if e.Source == SourceCron || release.Version.Major <= e.VitessVersion.Major {
e.VitessVersionName = VitessLatestVersion
return nil
}

e.VitessVersionName = fmt.Sprintf("%s%d", VitessPreviousVersion, e.VitessVersion.Major)
return nil
}

func GetRecentExecutions(client storage.SQLClient) ([]*Exec, error) {
var res []*Exec
query := "SELECT uuid, status, git_ref, started_at, finished_at, source, type, pull_nb, go_version FROM execution ORDER BY started_at DESC LIMIT 50"
Expand Down
7 changes: 3 additions & 4 deletions go/infra/ansible/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ const (
// number that the execution will benchmark.
KeyVitessVersionPRNumber = "vitess_git_version_pr_nb"

// KeyVitessVersionName corresponding value in the map is the name of the vitess
// version on which the benchmarks will be executed. For instance: 'latest', '14',
// '13', ...
KeyVitessVersionName = "vitess_version_name"
// KeyVitessMajorVersion corresponding value in the map is an int set to the major
// release increment of Vitess.
KeyVitessMajorVersion = "vitess_major_version"

// KeyVtgatePlanner corresponding value in the map is the query planner version
// that will be used to execute the benchmark.
Expand Down
7 changes: 2 additions & 5 deletions go/tools/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ func GetLatestVitessReleaseCommitHash(repoDir string) ([]*Release, error) {
}
var latestReleases []*Release

// We take the 2 latest major release
// TODO: @Florent: use the three latest major releases once v17 is out
minimumRelease := allReleases[0].Version.Major - 1
minimumRelease := allReleases[0].Version.Major - 2
for _, release := range allReleases {
if release.Version.Major >= minimumRelease {
latestReleases = append(latestReleases, release)
Expand Down Expand Up @@ -205,8 +203,7 @@ func GetLatestVitessReleaseBranchCommitHash(repoDir string) ([]*Release, error)
}
var latestReleaseBranches []*Release
// We take the 2 latest major release
// TODO: @Florent: use the three latest major releases once v17 is out
minimumRelease := res[0].Version.Major - 1
minimumRelease := res[0].Version.Major - 2
for _, release := range res {
if release.Version.Major >= minimumRelease {
latestReleaseBranches = append(latestReleaseBranches, release)
Expand Down

0 comments on commit a2fabb9

Please sign in to comment.