-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Regression starting from 19.2 with Elixir / binary protocol when loading arrays #51360
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Thanks for the issue. I haven't been able to reproduce it yet. I wrote the following test using our DSL for testing wire protocol, and it passes.
Would you be able to provide an exact sequence of commands and queries that fails? I believe the report is saying that this only happens when using prepared statements. Is that correct? If you could point me to how to run the code (and if I can get an Elixir environment set up on my computer), I might be able to try capturing the wire protocol commands that are being sent. Or if you are able to capture this yourself with Wireshark, that would be really helpful! |
Hi @rafiss, I can definitely capture the sequence for you. I will get back to you on this asap. |
Hi @rafiss , Please find the captured packets View of the table and the data: The exact error:
|
Thank you @tlvenn. I looked at the captured packets, and it looks like the
The type OID is 1099, which is the OID for a Would you mind sharing the output of the following commands:
I wonder if some part of the Ecto CockroachDB adapter is turning |
It seems the column has the good type (varchar[]) and the issue is elsewhere. |
@rafiss is there any thing else I could help you with ? |
Thanks for the info so far. It does look like the schema is correct. I've tried a few other ideas and still cannot reproduce it. Can you provide me with Elixir code that runs into the issue and instructions to run it? |
Sure thing |
I created a repo to reproduce the issue at: https://github.com/tlvenn/cdb_test |
Thank you very much for creating this sample. It was really helpful to finally track this down. My previous attempts to reproduce this failed because of a combo of this being fixed in our 20.2 alphas (unintentionally) and my own issues with getting our pgwire testing DSL working on older branches. The reason this is not working with 19.2 and 20.1 is this code: cockroach/pkg/sql/pgwire/types.go Lines 67 to 88 in 20ea783
PR #44471 removed that bit of code, and indeed this issue doesn't happen in the 20.2 release. Since we broke functionality here, we could consider backporting the PR that repairs the functionality to the 19.2 and 20.1 branches. Thoughts @jordanlewis / @RaduBerinde? (tagging you two since the idea of backporting this same PR already came up in #49353) @tlvenn: even if we aren't able to backport, the good news is that this will be fixed in the 20.2 release that will come later this year. |
Given how trivial the PR seems to be, it would make sense to backport it to at the very least the 20.1.X branch so it's available within the next release. It seems we missed the 20.1.4 already, hoping to see this fixed with the 20.1.5. |
I created the backport #52351 and will advocate for it to be approved. |
See issue cockroachdb#51360. The bug described in it was fixed somewhat accidentally, do this test will verify that we don't regress again. Release note: None
See issue cockroachdb#51360. The bug described in it was fixed somewhat accidentally, do this test will verify that we don't regress again. Release note: None
51803: cmd/docgen: add HTTP extractor r=mjibson a=mjibson Add a way to extract docs from the status.proto HTTP endpoint. These can be imported into the docs project as needed. Release note: None 52083: roachtest: small misc r=andreimatei a=andreimatei See individual commits. 52094: rpc: implement tenant access control policies at KV RPC boundary r=nvanbenschoten a=nvanbenschoten Fixes #47898. Rebased on #51503 and #52034. Ignore all but the last 3 commits. This commit adds a collection of access control policies for the newly exposed tenant RPC server. These authorization policies ensure that an authenticated tenant is only able to access keys within its keyspace and that no tenant is able to access data from another tenant's keyspace through the tenant RPC server. This is a major step in providing crypto-backed logical isolation between tenants in a multi-tenant cluster. The existing auth mechanism is retained on the standard RPC server, which means that the system tenant is still able to access any key in the system. 52352: sql/pgwire: add regression test for varchar OIDs in RowDescription r=jordanlewis a=rafiss See issue #51360. The bug described in it was fixed somewhat accidentally, so this test will verify that we don't regress again. Release note: None 52386: opt: add SerializingProject exec primitive r=RaduBerinde a=RaduBerinde The top-level projection of a query has a special property - it can project away columns that we want an ordering on (e.g. `SELECT a FROM t ORDER BY b`). The distsql physical planner was designed to tolerate such cases, as they were much more common with the heuristic planner. But the new distsql exec factory does not; it currently relies on a hack: it detects this case by checking if the required output ordering is `nil`. This is fragile and doesn't work in all cases. This change adds a `SerializingProject` primitive which is like a SimpleProject but it forces serialization of all parallel streams into one. The new primitive is used to enforce the final query presentation. We only need to pass column names for the presentation, so we remove `RenameColumns` and remove the column names argument from `SimpleProject` (simplifying some execbuilder code). We also fix a bug in `ConstructSimpleProject` where we weren't taking the `PlanToStreamColMap` into account when building the projection. Release note: None Co-authored-by: Matt Jibson <[email protected]> Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Radu Berinde <[email protected]>
Closing this out since it will be in the next 20.1 release. |
Describe the problem
Arrays use to work just fine in 19.1 but from 19.2, it seems a regression has been introduced and now Elixir / Postgrex is crashing when trying to decode an array from the DB:
This was first reported to me by @damboscolo in jumpn/ecto_cockroachdb#3 and I was kinda hoping it would go away with the 20.X release but unfortunately we are not so lucky ;)
To Reproduce
Create a table with a array column, in my case it is a
VARCHAR(255)[] NOT NULL
, insert one row in the database and query itExpected behavior
The rows should load just fine.
Environment:
The text was updated successfully, but these errors were encountered: