-
Notifications
You must be signed in to change notification settings - Fork 622
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
CASSGO-30 DSE Search Results May Not Be Queryable #1689
Comments
Hi! How does your code that calls gocql look like? What do you see in the results with gocql instead of the expected result? "The data is not returned" is not very specific. I need more information to be able to help you. Gocql can be built with gocql_debug tag for more verbose logs, however it's possible that will not provide enough information. Can you provide packet capture showing this query execution with gocql (if the results of the query are not sensitive)? Does |
From what I see the problem is linked to the "direct" JSON response that DSE returns. The reponse doesn't match any colums. We get a crash when we run solr queries (panic is the same as #1460):
I've attached the output of the debugger The full buffer is:
if there is a way to get the response from that buffer, that would work. |
A little more context, the first column readInt works and the buffer contains the value, it's the second column read that causes the crash ( A workaround that works for us, specify any column of the text data type (we use the solr_query one |
Thanks! @remiphilippe could you please provide the the Go code that calls gocql in the reproducer? Having a dump of the whole PREPARE/EXECUTE exchange from the protocol would help as well, as it is not clear to me how the result metadata looks like in this case and I don't have access to DSE to try myself. In any case it seems that the error handling in frame parsing should be more robust, it definitely should not panic, just return an error. However, we also need to find out why gocql expects int while there is JSON blob. cc @joao-r-reis is this issue something that Datastax would be willing to help with? |
@martin-sucha sure can do that, are you looking for outputs from delve or specific dumps? If you let me know what to dump I'll update my test code. |
We can't look into this at this exact moment but I'm going to add this to my list and see if I can find some free time in the near future to investigate and potentially fix the issue. |
@remiphilippe pcap dump from Wireshark/tcpdump with the network communication would help. Please make sure there isn't any secret included, like the database password or sensitive contents of tables. Specifically, gocql will send a PREPARE message to the server when first executing the query and then EXECUTE message to execute the prepared statement. The RESULT of the prepare message will contain description of the columns and the RESULT from the execute call will contain the values. With the captured network packets, it should be possible to:
|
Now that Apache owns this library, and DataStax is a major contributor to the open source project, is there anyone at DataStax that could help with this issue? |
Background Workaround Proposed Solution |
Thanks @lukasz-antoniak for the investigation. Since this is related to gocql not prioritizing the metadata of the response over the prepared metadata this will be fixed by #1822 |
What version of Cassandra are you using?
DataStax Enterprise 5.1 / Cassandra 3.11
What version of Gocql are you using?
1.3.2
What version of Go are you using?
1.20.2
What did you do?
I am using the Search product in DSE to run solr queries for BI purposes. gocql works great for this the vast majority of the time because the queries return results that look just like the table schema, however there is a style of solr query with a pivot/facet where the response fields can differ from the table fields and gocql does not seem to be able to handle this while other Cassandra connectors can.
What did you expect to see?
For example, if I run a query like this:
If I run this from cqlsh or from a tool we use called SQLPad, I get back two columns in the response,
facet_ranges
andfacet_pivot
. These are json fields that have various faceted statistics in them. I tried using the dynamic fields functionality but even those weren't able to see the data returned from these fields in any way that I could parse.What did you see instead?
The data is not returned in the gocql files in any way I can find it.
What I'm looking for is if there is something I should try, some kind of debug output I should enable, or anything else I could do that would help get support for this type of response working in gocql. I realize the maintainers don't really have access to or use DSE, but it would be very helpful for BI use cases.
The text was updated successfully, but these errors were encountered: