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

use gms engine instead of mysql handler #677

Merged
merged 29 commits into from
Sep 19, 2024
Merged

use gms engine instead of mysql handler #677

merged 29 commits into from
Sep 19, 2024

Conversation

jennifersp
Copy link
Contributor

No description provided.

@jennifersp jennifersp marked this pull request as ready for review September 12, 2024 20:00
@jennifersp jennifersp changed the title [WIP] use gms engine instead of mysql handler use gms engine instead of mysql handler Sep 13, 2024
Copy link
Collaborator

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

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

Great job! A lot of work, but I definitely think it'll pay off for us!

server/doltgres_handler.go Show resolved Hide resolved
testing/go/framework.go Show resolved Hide resolved
testing/go/set_test.go Outdated Show resolved Hide resolved
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

This seems like an improvement, in that it puts more of the basic wire protocol in our control, rather than relying on the underlying GMS handler that Dolt instantiates. What bothers me: we're still instantiating a GMS handler on the Dolt side, which we use here or not depending on a bunch of factors.

If we've outgrown the Handler interface and need to do our own thing for better accuracy, that's great. But this only gets us partway there. Ideally Dolt no longer installs a Handler at all, and uses ours instead (or knows nothing about it). Next best thing would be that Dolt installs a Handler but we don't use it at all. This PR is at least 2 steps removed from that ideal.

I'm fine with this directionally, but we need to move quickly to a single code path managed by this package with clearly demarcated lines of responsibility, and this doesn't get us there. This makes the interaction between the packages substantially harder to reason about. Who owns getting us a cleaner set of abstractions and separation of concerns? You, or somebody else? The last major revision to this set of interactions (me, to support prepared statements) introduced a bunch of new abstractions and changes in the GMS layer to cope with. I expected to see some of that here, or the outline for a plan, or something, and I don't. It's likely that we need to move some of the functionality in the GMS Handler to a different layer of abstraction so that it can be re-used in both places that need it.

Other than that primary concern, the fact that some of the tests are now using string values instead of numerics is concerning to me. I don't see anywhere in the testing framework code explaining why this should be the case.

I don't want to block forward progress on this work, but I do need to know there is a plan to clean up the issues above and that this isn't the final state of this interaction. Daylon's OK on the overall PR for correctness etc. is fine by me.

testing/go/set_test.go Outdated Show resolved Hide resolved
testing/go/functions_test.go Outdated Show resolved Hide resolved
testing/go/functions_test.go Outdated Show resolved Hide resolved
server/doltgres_handler.go Show resolved Hide resolved
server/doltgres_handler.go Outdated Show resolved Hide resolved
server/connection_handler.go Outdated Show resolved Hide resolved
server/connection_data.go Show resolved Hide resolved
postgres/messages/data_row.go Show resolved Hide resolved
server/connection_handler.go Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Sep 18, 2024

Main PR
Total 42090 42090
Successful 11475 11833
Failures 30615 30257
Partial Successes1 4608 4832
Main PR
Successful 27.2630% 28.1136%
Failures 72.7370% 71.8864%

Regressions:

date

QUERY:          SELECT EXTRACT(EPOCH FROM DATE        '1970-01-01');
RECEIVED ERROR: row sets differ:
    Postgres:
        {"0"}
    Doltgres:
        {"0.000000"}
QUERY:          SELECT EXTRACT(EPOCH         FROM DATE '2020-08-11');
RECEIVED ERROR: row sets differ:
    Postgres:
        {"1597104000"}
    Doltgres:
        {"1597104000.000000"}

numeric

QUERY:          select trim_scale(1.120);
RECEIVED ERROR: row sets differ:
    Postgres:
        {"1.12"}
    Doltgres:
        {"1.120"}
QUERY:          select trim_scale(0.00);
RECEIVED ERROR: row sets differ:
    Postgres:
        {"0"}
    Doltgres:
        {"0.00"}
QUERY:          select trim_scale(1.1234500);
RECEIVED ERROR: row sets differ:
    Postgres:
        {"1.12345"}
    Doltgres:
        {"1.1234500"}
QUERY:          select trim_scale(110123.12475871856128000);
RECEIVED ERROR: row sets differ:
    Postgres:
        {"110123.12475871856128"}
    Doltgres:
        {"110123.12475871856128000"}
QUERY:          select trim_scale(-1123.124718561280000000);
RECEIVED ERROR: row sets differ:
    Postgres:
        {"-1123.12471856128"}
    Doltgres:
        {"-1123.124718561280000000"}
QUERY:          select trim_scale(-13.00000000000000000000);
RECEIVED ERROR: row sets differ:
    Postgres:
        {"-13"}
    Doltgres:
        {"-13.00000000000000000000"}

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the changes

server/doltgres_handler.go Outdated Show resolved Hide resolved
@jennifersp jennifersp merged commit bcff550 into main Sep 19, 2024
13 checks passed
@jennifersp jennifersp deleted the jennifer/handler branch September 19, 2024 01:28
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.

3 participants