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

ccl/sqlproxyccl: add basic Balancer component for load balancing #78156

Closed

Conversation

jaylim-crl
Copy link
Collaborator

Only review the last commit. The first four are in #78143.


This commit adds a basic Balancer component that is responsible for load
balancing connections across SQL pods. This commit updates the connector
component to invoke methods on the balancer when selecting a pod instead of
the tenant directory. For now, the balancer does nothing specific, and
invokes methods on the directory.

Release note: None

…tory

Previously, --routing-rule is used as a fallback resolution if a tenant cannot
be found from the directory. Note that we no longer need this on Cloud. This
commit addresses a TODO comment by moving the resolution rule implementation
into a simple directory.

The plan is to replace the tenant.Resolver interface with a tenant.Directory
interface. The existing tenant.Directory struct will be renamed to
tenant.serviceDirectory. For now, there will be two types of directory
implementations: simple directory (a single rule), and service directory
(one that connects to a GRPC server). There are plans to add a static directory
(perhaps backed by a config file) which will enable roachprod to use sqlproxy
in a multi-tenant setup.

This TODO is also a pre-req to the load balancing work for sqlproxy. Without
that addressed, maintaining a routing rule for the balancing work can be
non-trivial.

Release note: None
This commit addresses one of the TODOs to make tenant.Directory a generic
interface instead of a struct. For that to work, we'd have to rename the
existing Directory struct. This is purely a mechanical commit.

Release note: None
Previously, all directory related files are located in a tenant package, which
can be confusing. This commit moves files into specific directories, and is
purely mechanical.

Release note: None
This commit completes the work of making tenant.Directory an interface.
Since we have renamed the previous Directory struct into a serviceDirectory
struct, we can now use Directory as an interface for what was previously known
as the resolver.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

This commit adds a basic Balancer component that is responsible for load
balancing connections across SQL pods. This commit updates the connector
component to invoke methods on the balancer when selecting a pod instead of
the tenant directory. For now, the balancer does nothing specific, and
invokes methods on the directory.

Release note: None
@jaylim-crl jaylim-crl force-pushed the jay/add-basic-balancer branch from bdcb0b8 to fd3c5be Compare March 20, 2022 15:08
@jaylim-crl jaylim-crl marked this pull request as ready for review March 21, 2022 14:45
@jaylim-crl jaylim-crl requested review from a team as code owners March 21, 2022 14:45
@jaylim-crl jaylim-crl requested review from jeffswenson and andy-kimball and removed request for a team March 21, 2022 14:45
@jaylim-crl
Copy link
Collaborator Author

Superseded by #78396.

@jaylim-crl jaylim-crl closed this Mar 24, 2022
@jaylim-crl jaylim-crl deleted the jay/add-basic-balancer branch March 24, 2022 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants