Skip to content

fix: change planner_version to planner-version everywhere#10453

Merged
systay merged 7 commits intovitessio:mainfrom
planetscale:planner-version
Jun 8, 2022
Merged

fix: change planner_version to planner-version everywhere#10453
systay merged 7 commits intovitessio:mainfrom
planetscale:planner-version

Conversation

@systay
Copy link
Copy Markdown
Collaborator

@systay systay commented Jun 7, 2022

Description

The new default for our flags will use hyphens instead of underscore, so this PR changes planner_version to planner-version everywhere.

Should be backported to r14

Related Issue(s)

Docs change: vitessio/website#1047
#10420

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: Query Serving release notes labels Jun 7, 2022
@systay systay marked this pull request as ready for review June 7, 2022 07:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 7, 2022

Review Checklist

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

General

  • Ensure that the Pull Request has the correct release notes label. release notes none should only be used for PRs that are so trivial that they need not be 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.

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.

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Copy link
Copy Markdown
Member

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

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

TestHelpOutput is failing and needs to be fixed for the new flags. @systay

@rohit-nayak-ps
Copy link
Copy Markdown
Member

I presume this will also fix the current panic in main?

rohit@rohit-ubuntu:~/vitess-ps$ vtexplain
vtexplain flag redefined: planner_version
panic: vtexplain flag redefined: planner_version

goroutine 1 [running]:
flag.(*FlagSet).Var(0xc000116120, {0x1872fe8, 0xc000486310}, {0x13e0f63, 0xf}, {0x1437603, 0x66})
	flag/flag.go:879 +0x2f4
flag.(*FlagSet).StringVar(...)
	flag/flag.go:762
flag.(*FlagSet).String(0x58?, {0x13e0f63, 0xf}, {0x13d207f, 0x4}, {0x1437603, 0x66})
	flag/flag.go:775 +0xac
flag.String(...)
	flag/flag.go:782
main.init()
	vitess.io/vitess/go/cmd/vtexplain/vtexplain.go:54 +0x4aa

@ajm188
Copy link
Copy Markdown
Contributor

ajm188 commented Jun 7, 2022

No, because it's defined twice (still) here. We should remove the one in cmd/vtexplain since it imports that package and will still show up in the help (post v14, we'll be able to tidy this up in a more sane way)

…ink global, act local, yo

Signed-off-by: Andres Taylor <andres@planetscale.com>
Copy link
Copy Markdown
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

hero

n := 0
for n < 15 {
n++
for n := 0; n < 15; n++ {
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.

so strange

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay requested a review from rohit-nayak-ps June 7, 2022 15:14
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay merged commit 7b51d62 into vitessio:main Jun 8, 2022
@systay systay deleted the planner-version branch June 8, 2022 09:15
systay added a commit to planetscale/vitess that referenced this pull request Jun 8, 2022
…0453)

* fix: change planner_version to planner-version everywhere

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

* fix: actually change the planner version on vtgate after checking

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

* fix: move CheckPlannerVersionFlag out from vtgate

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

* fix: move the global plannerVersion to be a field on the executor. think global, act local, yo

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

* fix: use the planner in the session first

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

* test: use DEFAULT instead of 0

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

* fix: re-add the planner-version flag to vtcombo

Signed-off-by: Andres Taylor <andres@planetscale.com>
@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Jun 8, 2022

@ajm188 we have support for both forms for some flags like this:

	flagutil.DualFormatBoolVar(&enableConsolidator, "enable_consolidator", true, "This option enables the query consolidator.")

https://github.com/vitessio/vitess/blob/main/go/vt/vttablet/tabletserver/tabletenv/config.go#L158
Is that an option we should consider as part of flag migration? Then we won't care whether users use - or _ and avoid a whole class of issues.

@ajm188
Copy link
Copy Markdown
Contributor

ajm188 commented Jun 8, 2022

So, I'm actually against that convention, because it increases the matrix of possible ways you can "configure" vitess (e.g. "oh you said --some-flag but i'm using --some_flag, does that matter?" or "is --query_server-some-flag allowed? what about --query-server_some-flag? --query_server_some_flag?") better for there to be exactly one way to do things; avoids unnecessary complexity / opportunities for confusion/miscommunications

systay added a commit that referenced this pull request Jun 9, 2022
…10466)

* fix: change planner_version to planner-version everywhere

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

* fix: actually change the planner version on vtgate after checking

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

* fix: move CheckPlannerVersionFlag out from vtgate

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

* fix: move the global plannerVersion to be a field on the executor. think global, act local, yo

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

* fix: use the planner in the session first

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

* test: use DEFAULT instead of 0

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

* fix: re-add the planner-version flag to vtcombo

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

Labels

Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants