Add bookmarks support#238
Conversation
|
I see tests fail since they run without the |
|
You can run the test only when the feature is enabled, e.g. neo4rs/lib/tests/result_summary.rs Line 1 in afbe45d |
|
I fixed the issue, but I had to run the new integration test under the feature |
|
No, it's fine. I think now I overdid it with the various unstable subfeatures, they should probably collapsed into the unstable-v1 feature instead of new ones being added. |
knutwalker
left a comment
There was a problem hiding this comment.
Nice, this looks good.
One change it would like to make is to not have a signature change on the commit method when the unstable feature is not enabled.
|
Thanks for the PR, this looks great! |
This PR aims to add support for bookmarks in transactions. It also collects bookmarks used in a routed manager and sends them when requesting a new routing table. The list of collected bookmarks is cleared up every time a READ operation returns no bookmarks (that should mean the state of the cluster is consistent).
The bookmarks are sent in the BEGIN message and retrieved from the COMMIT message.
Doubts
I read somewhere that the command HELLO can also contain bookmarks, but the documentation does not say a thing about it.
Bonus: While implementing this feature, I found a problem when getting a connection in a routed environment, caused by a synchronization problem between the manager and the thread fetching the routing table.
Changes
Transaction Handling Updates:
Beginrequest type with associated metadata and builder pattern for constructing instances. (lib/src/bolt/request/begin.rs)Commitrequest type to include aCommitResponsethat handles bookmarks. (lib/src/bolt/request/commit.rs) [1] [2] [3]Graphstruct to support starting transactions with bookmarks and to handle bookmarks in query execution results. (lib/src/graph.rs) [1] [2] [3] [4] [5] [6]Routing Mechanism Updates:
Beginrequest type to thebolt/request/mod.rsmodule. (lib/src/bolt/request/mod.rs) [1] [2]Routerequest type to remove lifetime parameters and updated serialization logic. (lib/src/bolt/request/route.rs) [1] [2] [3] [4] [5] [6]Miscellaneous:
Bookmarktrait to standardize bookmark handling across different response types. (lib/src/bookmarks.rs)Connectionstruct to support the newRouterequest type without lifetime parameters. (lib/src/connection.rs)