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

Replace shell's proxy with new gRPC backed proxy #759

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Conversation

mattrobenolt
Copy link
Member

This replaces the sql-proxy implementation with the new psdbproxy implementation.

Swapping in pscale shell is the first on the chopping block but wanted to get this integrated into the codebase first to serve as the base for the other uses of sql-proxy.

In summary, this replaces the certificate based sql-proxy, which relies on deprecated infrastructure, with a new HTTP based proxy.

This new HTTP-based proxy will be more resilient to network issues as well as acting as a connection pooler for local mysql connections.

This relies on open sourcing the planetscale/psdbproxy repo yet.

Copy link
Member

@fatih fatih left a comment

Choose a reason for hiding this comment

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

SGTM. Added couple of comments regarding style.

UpstreamAddr: cfg.UpstreamAddr,
Authorization: auth.NewBasicAuth(cfg.Username, cfg.Password),
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this extra package for constructing the server type. I would include this only if we reuse it in multiple places. Otherwise it'll just create an additional abstraction with no immediate benefits.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's reused in subsequent PRs. I just didn't want to do them all in one big one. So if this were the only implementation, I'd agree, but it was intended to be shared by every use case of sql-proxy.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, thanks for the clarification.

Copy link
Member Author

Choose a reason for hiding this comment

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

For context, #760 #761 and #762 are the other implementations of this.

internal/passwordutil/password.go Outdated Show resolved Hide resolved
internal/passwordutil/password.go Show resolved Hide resolved
internal/passwordutil/password.go Outdated Show resolved Hide resolved
@mattrobenolt mattrobenolt force-pushed the grpcproxy branch 2 times, most recently from 6d347a7 to 0cb7d4c Compare November 28, 2023 17:17
licensed was marking them as `other`. Manually reviewed each.
@mattrobenolt mattrobenolt merged commit 3884029 into main Dec 6, 2023
1 check passed
@mattrobenolt mattrobenolt deleted the grpcproxy branch December 6, 2023 20:45
mattrobenolt added a commit that referenced this pull request Dec 6, 2023
As it turns out, bringing in a dependency on vitess is going to be
borderline impossible into our CLI since it completely restricts what
environments we can compile to.

Specifically, vitess has 0 support for anything Windows currently.

So this will have to come back in a reimagined way.

Revert "database/restore: port to using psdbproxy (#761)"

This reverts commit 33bb6bd.

Revert "database/dump: port to using psdbproxy (#760)"

This reverts commit 067d436.

Revert "Replace shell's proxy with new gRPC backed proxy (#759)"

This reverts commit 3884029.
mattrobenolt added a commit that referenced this pull request Dec 6, 2023
As it turns out, bringing in a dependency on vitess is going to be
borderline impossible into our CLI since it completely restricts what
environments we can compile to.

Specifically, vitess has 0 support for anything Windows currently.

So this will have to come back in a reimagined way.

Revert "database/restore: port to using psdbproxy (#761)"

This reverts commit 33bb6bd.

Revert "database/dump: port to using psdbproxy (#760)"

This reverts commit 067d436.

Revert "Replace shell's proxy with new gRPC backed proxy (#759)"

This reverts commit 3884029.
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.

4 participants