-
Notifications
You must be signed in to change notification settings - Fork 110
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
frame/result: allow differing TableSpecs in PreparedMetadata #1135
frame/result: allow differing TableSpecs in PreparedMetadata #1135
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but can we add a regression test for the scenario mentioned in issue (i.e., where we prepare a batch statement with bind markers)?
6b72adb
to
eade6b6
Compare
Rebased on main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that the metadata supports zero-copy deserialization, what is the benefit of having this check at all? If the only benefit is that some objects are a bit smaller, then this is imo not enough to justify additional complexity.
Diverging from CQL protocol have just hurt us, so we should avoid letting it hurt us again in the future.
OK, I'll remove the check at all. |
Ok. If there are other considerations here (e.g. simpler API) then it may be worth keeping the check. So the question remains - is it only a performance opt or something more? |
What is the "it" that you are referring to? What do you consider to be a performance optimisation? Because the check itself is for sure not an optimisation. |
2100859
to
0dc7867
Compare
v2:
A step that should actually be performed in that regard is pushing scylladb/scylladb#17788 forwards, because the current way it's done is a dramatic waste. |
Sorry, I was writing the comment quickly and hastily. What I meant is that if assuming the same table spec for columns gives us some API advantages, like being able to expose a table spec directly on query response (compared to expising it on the column metadata of the response), then it may be worth considering. Getting rid of the assumption also lets us get rid of some types (like ColumnSpecView / ColumnSpecs), right? Then imo it is argument for that because it removes and simplifies code. |
What I like about cc @muzarski |
Ok, makes sense. |
This is API-breaking due to an error variant being removed. I suggest leaving the error variant for now under a TODO and removing it in the next major release. FYI @Lorak-mmk |
Yes, lets do that so we can release 0.15.1 |
0dc7867
to
e5d3f8c
Compare
Rebased on main. |
e5d3f8c
to
26485f8
Compare
Done. |
Actually - one more nit: aren't docstrings/comment related to this function outdated now? |
Yees, good catch! |
As noted in scylladb#1134, when preparing batches containing requests to multiple to different tables, the PreparedMetadata received upon preparation contains differing TableSpecs (i.e., TableSpecs with more than table mentioned). This fails the check that we introduced with ResultMetadata in mind: we've been assuming that all TableSpecs are the same, because ScyllaDB/ Cassandra has no support for JOINs. Not to fail preparation of cross-table batches, the check is disabled. We decided that we should not rely on an assumption that is not guaranteed by the CQL protocol.
26485f8
to
c3a16d9
Compare
Fixed. |
After equality checks were removed between table specs in consecutive column specs, deser_table_spec_for_col_spec has now trivial logic that is concise enough to be inlined into deser_col_specs_generic.
The previous commit fixed the bug described in scylladb#1134. This commit adds a regression test for that particular case, that is, for preparing a batch that operates on multiple tables.
c3a16d9
to
693c9db
Compare
…ent-tables frame/result: allow differing TableSpecs in PreparedMetadata (cherry picked from commit 92fdd71)
As noted in #1134, when preparing batches containing requests to multiple to different tables, the PreparedMetadata received upon preparation contains differing TableSpecs (i.e., TableSpecs with more than table mentioned).
This fails the check that we introduced with ResultMetadata in mind: we've been assuming that all TableSpecs are the same, because ScyllaDB/ Cassandra has no support for JOINs.
Not to fail preparation of cross-table batches, the check is now only turned on for ResultMetadata and turned off for PreparedMetadata.
Fixes: #1134
Pre-review checklist
[ ] I have provided docstrings for the public items that I want to introduce.[ ] I have adjusted the documentation in./docs/source/
.Fixes:
annotations to PR description.