Skip to content

[vtadmin] Remove explicit Dial-ing for vtctldclient proxy#10233

Merged
ajm188 merged 6 commits intovitessio:mainfrom
planetscale:andrew/vtadmin/nodial
May 9, 2022
Merged

[vtadmin] Remove explicit Dial-ing for vtctldclient proxy#10233
ajm188 merged 6 commits intovitessio:mainfrom
planetscale:andrew/vtadmin/nodial

Conversation

@ajm188
Copy link
Copy Markdown
Contributor

@ajm188 ajm188 commented May 8, 2022

Description

Okay!! This is something I've wanted to do since #9977; since, for a given proxy, grpc will keep going back to the discovery to get a fresh address list, there's no need for us to provide Dial/Close semantics and do any sort of manual futzing around ourselves (see the large amount of deletions of if err := vtctld.Dial(...); err != nil this removes for just how much we previously had to care about this).

This sets up a bunch of prep work and then finally changes vtctldclient.New to Dial once on startup. Then, every cluster/api method will assume each vtctld has a connection (or if not, we're in transient failure and grpc will either fix it in time or we fail the request -- this is consistent with current behavior).

The only functional difference is that Close now really, truly, permanently closes a proxy. You need to New up another one, since you can't call Dial on it (the method is now private)

change breakdown

  • refactor Dial/Redial tests to operate under the new model
  • thread contexts from startup all the way through to vtctldclient.New
  • remove all explicit Dial calls
  • remove Dial from the interface

testing

  • all unit tests pass (with both -count=50 and -race so i'm feeling good)
  • can run the local example

Related Issue(s)

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

Andrew Mason added 6 commits May 7, 2022 09:11
Signed-off-by: Andrew Mason <andrew@planetscale.com>
….New

Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
@ajm188 ajm188 marked this pull request as ready for review May 9, 2022 15:42
@ajm188 ajm188 mentioned this pull request May 9, 2022
3 tasks
Copy link
Copy Markdown
Contributor

@doeg doeg left a comment

Choose a reason for hiding this comment

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

🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 9, 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.

@ajm188 ajm188 merged commit a63d7b3 into vitessio:main May 9, 2022
@ajm188 ajm188 deleted the andrew/vtadmin/nodial branch May 9, 2022 18:02
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