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

Fix prepared queries #28

Merged
merged 14 commits into from
Sep 3, 2021
Merged

Fix prepared queries #28

merged 14 commits into from
Sep 3, 2021

Conversation

mpenick
Copy link
Contributor

@mpenick mpenick commented Aug 31, 2021

In the existing code execute queries were just a pass-through. That means that if an unprepared error occurred it was just passed back to the driver. The problem is that an attempt to prepare that query again would be forwarded to a connection that was not the one that originally serviced the execute. This could cause a scenario where execute requests would never resolve from the unprepared state.

The proxy fixes this by keeping its own cache and properly handling unprepared errors. This cache was push down into the proxycore because eventually we should add pre-preparing queries on add/up node events. This should be address in a follow up issue: #32

`Prepared` result responses get put into a prepared cache and when an
`Unprepared` error response happen the cache is referenced to prepare
the query on the erred node and the original request is re-tried.
@mpenick
Copy link
Contributor Author

mpenick commented Aug 31, 2021

Resolves #14

@mpenick mpenick changed the title WIP: First pass at handling re-prepares Fix prepared queries Sep 2, 2021
@mpenick mpenick marked this pull request as ready for review September 2, 2021 17:25
proxy/proxy.go Outdated Show resolved Hide resolved
@mpenick mpenick merged commit 5fc1187 into main Sep 3, 2021
@mpenick mpenick deleted the reprepares branch September 3, 2021 14:18
@mpenick mpenick mentioned this pull request Jan 20, 2022
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.

None yet

2 participants