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

Initial implementation of vtctld service #7128

Merged
merged 18 commits into from
Dec 10, 2020

Commits on Dec 5, 2020

  1. First stab at a typed vtctld interface

    I've only added some simple keyspace-related getters for now.
    No documentation or tests or anything yet, this is just a
    proof-of-concept / example implementation.
    
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    d0547a0 View commit details
    Browse the repository at this point in the history
  2. Very quick example refactor of the original functionality

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    741f876 View commit details
    Browse the repository at this point in the history
  3. Move new vtctld to a new package

    I very quickly ran into circular imports trying to keep things
    colocated.
    
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    9358bf9 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2020

  1. Add ability to install vtctld gRPC server, update local example, fix …

    …typo
    
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    4fc2514 View commit details
    Browse the repository at this point in the history
  2. Rough WIP of the vtctld clients

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    a09056c View commit details
    Browse the repository at this point in the history
  3. Install vtctldclient with the rest of the client binaries

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    3b5f21e View commit details
    Browse the repository at this point in the history
  4. Add client command line implementation

    We bring in cobra to manage the CLI for us; it's the most structured one
    Vitess has had yet. This also forces us to do _something_ about the
    various project-global flags, but it's a compromise - essentially we
    just blindly apply all of them to the root of our command tree.
    
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    7c3d438 View commit details
    Browse the repository at this point in the history
  5. Add tests

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    639d2f7 View commit details
    Browse the repository at this point in the history
  6. Add docs to the proto service and regenerate

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    3c7fdf3 View commit details
    Browse the repository at this point in the history
  7. Do not swap out the already-populated flagset for the parse hack

    It turns out that some vitess packages make calls to `flag.Lookup` to
    find flag values, and if we swap out the original flagset, these all
    fail, and in some cases, panic. I encountered this while attempting to
    move vttablet to cobra in a separate branch, and the panic came from
    `logutil.PurgeLogs()` needing a `log_dir` flag ([ref][logutil_ref]).
    
    [logutil_ref]: https://github.com/vitessio/vitess/blob/20a545533bc94d6f85e1682a6539e93c32a82486/go/vt/logutil/purge.go#L106-L109
    
    While this appears to actually not matter for the vtctldclient, since
    the code with the potential bug is able to run without issue, I don't
    want to commit a potentially-risky flag shim into the codebase that may
    be copied by others.
    
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    575de91 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2020

  1. Update proto/vtctldata.proto

    Co-authored-by: Derek Perkins <derek@derekperkins.com>
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 and derekperkins committed Dec 8, 2020
    Configuration menu
    Copy the full SHA
    37fd703 View commit details
    Browse the repository at this point in the history
  2. Update implementation for new proto

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 8, 2020
    Configuration menu
    Copy the full SHA
    9064b14 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'vitessio:master' into am_vtctld_proto

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 8, 2020
    Configuration menu
    Copy the full SHA
    ad94b67 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2020

  1. Define GetKeyspaceResponse, put topodata.Keyspace inside, update call…

    …sites and tests
    
    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    025823a View commit details
    Browse the repository at this point in the history
  2. Merge branch 'vitessio:master' into am_vtctld_proto

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    b482cca View commit details
    Browse the repository at this point in the history
  3. Run go mod tidy once more

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    30dfa30 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'vitessio:master' into am_vtctld_proto

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    27237bf View commit details
    Browse the repository at this point in the history
  5. Update vtctl command to handle nested proto response

    Signed-off-by: Andrew Mason <amason@slack-corp.com>
    ajm188 committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    d4a8812 View commit details
    Browse the repository at this point in the history