-
Notifications
You must be signed in to change notification settings - Fork 41
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
Introduce procedure mode selection for RedisGraph. #162
Conversation
* Add option to specify procedure mode as specified by `dbms.procedures()`. * Refactor `GraphCacheList` to use READ mode for `db.labels()`, `db.propertyKeys()`, and `db.relationshipTypes()` in `GraphCache`.
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #162 +/- ##
==========================================
+ Coverage 93.82% 93.99% +0.17%
==========================================
Files 82 82
Lines 5082 5080 -2
Branches 476 479 +3
==========================================
+ Hits 4768 4775 +7
+ Misses 185 177 -8
+ Partials 129 128 -1
☔ View full report in Codecov by Sentry. |
Hi @haysch, thanks for your contribution! |
Sure thing, will look into it as soon as possible. Please let me know what you think of the procedure mode discriminator. |
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.
Hi, thanks again for your contribution, looks good!
I wrote some comments and questions about the code. I would appreciate it if you could answer my questions and change what is needed :)
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.
First batch of answers.
Will take a look at the remaining suggestions later :)
Is it possible to retry the test run without pushing a dummy commit? |
@slorello89 do you want to take a look? |
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.
LGTM 👍
Problem
It is not possible to use
GraphCache
for replicas-only connections.If
GraphCache.GetCachedData
is invoked, the following exception will be thrownContext
Current implementation uses
Query
andQueryAsync
for everyCALL PROCEDURE
.However, as procedures can be defined as
write
orread
(as defined bydbms.procedures()
), it would make sense to be able to select mode.Solution
Add option to specify procedures as Read or Write when calling
CallProcedure
andCallProcedureAsync
.Discussion
I opted to go for the enum approach, and specify
ProcedureMode.Write
as default to avoid breaking existing use.One could instead go with a new
CallReadProcedure
andCallReadProcedureAsync
.