Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cluster bootstrapping in vtctldclient #14315

Merged
merged 10 commits into from
Nov 16, 2023

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Oct 19, 2023

Description

This meets the one use case that remained for the vtctl client — which was a combination of vtctlclient and vtctld — bootstrapping a new cluster by creating the first cell that you can then start a vtctld server in.

More generally, this PR adds support to vtctldclient so that you can execute any command w/o requiring a running vtctld server by specifying --server internal. When that value is specified, vtctldclient acts as the legacy vtctl client in that it uses an internal VtctldServer implementation — interfacing with the topology server(s) directly.

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

@mattlord mattlord added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: vtctldclient labels Oct 19, 2023
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Oct 19, 2023

Review Checklist

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

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Oct 19, 2023
@github-actions github-actions bot added this to the v19.0.0 milestone Oct 19, 2023
@mattlord mattlord force-pushed the vtctldclient_bootstrap_cluster branch 2 times, most recently from fc91e79 to ef98b8c Compare October 19, 2023 18:28
@mattlord mattlord removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Oct 19, 2023
@mattlord mattlord force-pushed the vtctldclient_bootstrap_cluster branch from ef98b8c to 421739d Compare October 19, 2023 18:49
@mattlord mattlord force-pushed the vtctldclient_bootstrap_cluster branch from 421739d to ceadf8e Compare October 19, 2023 19:57
@mattlord mattlord force-pushed the vtctldclient_bootstrap_cluster branch from 8267a1b to 2afb160 Compare October 20, 2023 20:50
@mattlord mattlord marked this pull request as ready for review October 20, 2023 20:52
@mattlord mattlord force-pushed the vtctldclient_bootstrap_cluster branch 2 times, most recently from 0edbd83 to 2cba508 Compare October 21, 2023 17:01
Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord force-pushed the vtctldclient_bootstrap_cluster branch from 2cba508 to 91fb502 Compare October 22, 2023 05:33
@ajm188
Copy link
Contributor

ajm188 commented Oct 23, 2023

This PR adds support to vtctldclient so that you can execute any command w/o requiring a running vtctld server by specifying --server internal

My thinking instead is that if a vtctld starts, it first attempts to create the root CellInfo object if it doesn't already exist (and so there's no need to do this separately in the client)

@mattlord
Copy link
Contributor Author

This PR adds support to vtctldclient so that you can execute any command w/o requiring a running vtctld server by specifying --server internal

My thinking instead is that if a vtctld starts, it first attempts to create the root CellInfo object if it doesn't already exist (and so there's no need to do this separately in the client)

I don't know that I'm against this idea... but the current implementation here also generally provides a nice replacement for thevtctl client/binary as a whole.

@ajm188
Copy link
Contributor

ajm188 commented Oct 23, 2023

right but if we can put this in vtctld we can drop the vtctl binary entirely

@mattlord
Copy link
Contributor Author

right but if we can put this in vtctld we can drop the vtctl binary entirely

I'm not sure I understand. If we merged this PR as-is, we would be able to drop the vtctl binary entirely -- w/o losing any functionality -- as vtctldclient --server internal would be the equivalent.

@ajm188
Copy link
Contributor

ajm188 commented Oct 23, 2023

as vtctldclient --server internal would be the equivalent.

you're completely right! ignore me ... 🙈

Copy link
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.

one help text change but lgtm

go/flags/endtoend/vtctldclient.txt Outdated Show resolved Hide resolved
go/cmd/vtctldclient/command/root.go Outdated Show resolved Hide resolved
Signed-off-by: Matt Lord <[email protected]>
@frouioui
Copy link
Member

Hey @mattlord do we still want to merge this?

@ajm188
Copy link
Contributor

ajm188 commented Nov 15, 2023

Hey @mattlord do we still want to merge this?

yes, we do!

@mattlord
Copy link
Contributor Author

I will get this fixed up and merged soon. I will add a commit here to address this non-behavior changing discussion as well before merging: #14467 (review)

@mattlord mattlord merged commit 4fb9120 into vitessio:main Nov 16, 2023
115 checks passed
@mattlord mattlord deleted the vtctldclient_bootstrap_cluster branch November 16, 2023 12:37
ejortegau pushed a commit to slackhq/vitess that referenced this pull request Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: vtctldclient Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Feature Request: vtctldclient cannot be used to bootstrap a Vitess cluster
3 participants