-
Notifications
You must be signed in to change notification settings - Fork 111
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
Restructure modules - purge transport
module
#1163
Conversation
See the following report for details: cargo semver-checks output
|
d380148
to
e3e3f28
Compare
e1b6fdf
to
68fd5d0
Compare
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.
Really great work, this is something that was really needed here!
I'm posting the review for ~first half of the PR so that you can address comments quicker.
A few thoughts on the structure after reading the description:
execution
module is quite big and contains various things that are not very related.- First thing that comes to my mind is to split off "policies" module from "execution" module, containing load balancing, retries and speculative execution.
- I did not yet reach those modules in review, so I'm not 100% sure what they contain, but we could also split off something like "inspection" / "introspection" / "observability" (I'm not sure what is the best name) containing driver_tracing.rs, history.rs, metrics.rs and tracing.rs.
- errors.rs should imo be a top-level file as it is not specific to "execution" module.
- After those changes, "execution" is left with "execution_profile.rs" and "pager.rs". It can be left like this, or maybe merged with session? I'm not sure.
Apart from removing oversized "execution" module, I really believe those changes would simply improve the structure.
I see you did not mark "All commits compile, pass static checks and pass test.", but I see that the commits I reviewed until now are done in a way to maintains this property. I found one problem which I posted in a comment.
It would be really nice to fix this and potentially other such issues and maintain the passing state of CI throughout the PR - it looks like it should not be a lot of effort now.
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.
Second half was much quicker to review :D
Oh wow, I understand now why some comments are marked as outdated despite there not being any changes since the review. Another example of GitHub being not an appropriate tool for reviews. |
🎉
It's quite big, that's true.
Extracting a
💯 , I'll extract those into a new top-level
Agreed.
To me,
WDYT about my above alternative suggestions to improve the
🎉 |
I proposed it as a top-level module because of the possibility that in the future we add policies that are not related to statement execution. There is for example an issue about ReconnectPolicy: #184 and related #559 . There is also some relevant work in gocql: scylladb/gocql#231 If we keep |
I see no reason to group various policies in one module just because they are all called policies. To me, execution-related policies can be grouped together, but It makes sense IMO to have |
The reason I see is that the policies (either execution-related or not) are the main (only?) pluggable points of the driver - user can influence the behavior of the driver by writing their own implementation of those policies. This is done similarly in other driver, so keeping the structure familiar for other people is an additional advantage. Java Driver 3.x has a policies folder: https://github.com/scylladb/java-driver/tree/scylla-3.x/driver-core/src/main/java/com/datastax/driver/core/policies Python Driver has policies.py file: https://github.com/scylladb/python-driver/blob/master/cassandra/policies.py GoCql has a policies.go file https://github.com/scylladb/gocql/blob/master/policies.go |
This convinced me. Let's make a similar module for all user-implementable traits that configure driver's behaviour. |
68fd5d0
to
c7b7252
Compare
v2.0: addressed some of the comments (mostly the resolved ones). |
c7b7252
to
6991831
Compare
v2.1: addressed another bunch of comments.
|
6991831
to
57aad86
Compare
v2.1.1: fixed docs. |
The module tree should reflect all suggestions proposed by @Lorak-mmk. Please confirm that this is the case. |
57aad86
to
9812fb1
Compare
v2.1.2: appeased Clippy. |
9812fb1
to
989bee0
Compare
v2.2: addressed all remaining comments. |
989bee0
to
044c5f0
Compare
Metrics should rather be imported from its defining module, or from prelude once it's added.
PagingState[Response] suit response module better, and it's better to have it re-exported from scylla-cql in only one place.
2b39daa
to
005354d
Compare
v2.2.4 - fixed serverless again... |
One more thing - it would probably be nice to mention in the description of the PR which types were renamed, for posterity (take the contents of #1163 (comment) and put them in the description). Otherwise, LGTM. |
We'll definitely need to put description of those changes in the release notes. |
This is a revival of #804.
Motivation
The division into modules used to be poor. The
transport
module has long been abused, as a bag full of everything, with no clear intention behind it.What's done
The
transport
module was dissolved. Its contents were grouped in other modules, many of them newly introduced. The new modules were documented with docstrings, so that it's clear what is the intended scope of each module.ClusterData
was renamed toClusterState
, which we believe suits its semantics better.Now, the module tree looks the following way (omitting the unchanged modules -
cloud
,statement
,utils
, andauthentication
):Pre-review checklist
[ ] I added relevant tests for new features and bug fixes../docs/source/
.[ ] I added appropriateFixes:
annotations to PR description.