Skip to content

fix: handle planner_version and planner-version correctly#10534

Merged
systay merged 2 commits intovitessio:mainfrom
planetscale:planner-version-again
Jun 17, 2022
Merged

fix: handle planner_version and planner-version correctly#10534
systay merged 2 commits intovitessio:mainfrom
planetscale:planner-version-again

Conversation

@systay
Copy link
Copy Markdown
Collaborator

@systay systay commented Jun 17, 2022

Description

I recently tried fixing this situation, and I think I made it worse in that PR. 🤦

So here we go again.

Some applications were using planner-version, and some were using planner_version. This change makes it possible to use either, but either they have to agree, or only one of them set.

If the user is using planner_version, which is the deprecated form, they will get a log message saying they shouldn't use that anymore.

Related Issue(s)

Original attempt: #10453

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay requested a review from ajm188 as a code owner June 17, 2022 05:54
@systay systay requested a review from GuptaManan100 June 17, 2022 05:54
@github-actions
Copy link
Copy Markdown
Contributor

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • If this is a change that users need to know about, please apply the release notes (needs details) label so that merging is blocked unless the summary release notes document is included.
  • If a new flag is being introduced, review whether it is really needed. The flag names should be clear and intuitive (as far as possible), and the flag's help should be descriptive.
  • If a workflow is added or modified, each items in Jobs should be named in order to mark it as required. If the workflow should be required, the GitHub Admin should be notified.

Bug fixes

  • There should be at least one unit or end-to-end test.
  • The Pull Request description should either include a link to an issue that describes the bug OR an actual description of the bug and how to reproduce, along with a description of the fix.

Non-trivial changes

  • There should be some code comments as to why things are implemented the way they are.

New/Existing features

  • Should be documented, either by modifying the existing documentation or creating new documentation.
  • New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • vtctl command output order should be stable and awk-able.

mysqlPort = flag.Int("mysql_port", 3306, "mysql port")
externalTopoServer = flag.Bool("external_topo_server", false, "Should vtcombo use an external topology server instead of starting its own in-memory topology server. "+
"If true, vtcombo will use the flags defined in topo/server.go to open topo server")
plannerVersion = flag.String("planner-version", "gen4", "Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes a lot of sense. Otherwise users would have provided the old flag, and it would have conflicted with the default in this flag!

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay merged commit 7a666e9 into vitessio:main Jun 17, 2022
@systay systay deleted the planner-version-again branch June 17, 2022 13:18
frouioui pushed a commit to planetscale/vitess that referenced this pull request Jun 28, 2022
…0534)

* fix: handle planner_version and planner-version correctly

Signed-off-by: Andres Taylor <andres@planetscale.com>

* test: clean up test and remove the '(default gen4)'

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
deepthi pushed a commit that referenced this pull request Jun 28, 2022
)

* fix: handle planner_version and planner-version correctly (#10534)

* fix: handle planner_version and planner-version correctly

Signed-off-by: Andres Taylor <andres@planetscale.com>

* test: clean up test and remove the '(default gen4)'

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Updated expected output for vtgate and vttablet flags

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Co-authored-by: Andres Taylor <andres@planetscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants