-
Notifications
You must be signed in to change notification settings - Fork 231
Effects #2826
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
Conversation
dd92c2b
to
a8c0587
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2826 +/- ##
==========================================
+ Coverage 90.36% 90.48% +0.11%
==========================================
Files 283 287 +4
Lines 28072 28747 +675
==========================================
+ Hits 25367 26011 +644
- Misses 2705 2736 +31
... and 5 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
nice
src/commands/cmd_query.c
Outdated
UndoLog *undolog = QueryCtx_GetUndoLog(); | ||
uint n = UndoLog_Length(*undolog); | ||
|
||
if(n > 2048 || n == 0) { |
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.
why 2048?
src/commands/cmd_query.c
Outdated
|
||
if(n > 2048 || n == 0) { | ||
// either no changes or too many changes, do not use effects | ||
return false; |
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.
we don't check if there is non-deterministic change
src/configuration/config.h
Outdated
@@ -47,11 +48,13 @@ static const Config_Option_Field RUNTIME_CONFIGS[] = { | |||
Config_MAX_QUEUED_QUERIES, | |||
Config_QUERY_MEM_CAPACITY, | |||
Config_VKEY_MAX_ENTITY_COUNT, | |||
Config_DELTA_MAX_PENDING_CHANGES | |||
Config_DELTA_MAX_PENDING_CHANGES, | |||
Config_REPLICATE_EFFECTS |
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.
are you sure we want it to changed during runtime?
did you test what happen if you change this during traffic?
also need to test that we can load aof file mixed with effect and queries
src/graph/graph_hub.c
Outdated
bool has_indecise = GraphContext_HasIndices(gc); | ||
UndoLog *undo_log = (log == true) ? QueryCtx_GetUndoLog() : NULL; | ||
|
||
for (uint i = 0; i < n; i++) { |
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.
maybe
if(log == true) {
for (uint i = 0; i < n; i++) {
// add each deleted edge to undo-log
UndoLog_DeleteEdge(undo_log, edges + i);
}
}
if(has_indecise == true) {
for (uint i = 0; i < n; i++) {
// remove edge from relevant indices
_DeleteEdgeFromIndices(gc, edges + i);
}
}
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.
I don't want to perform 2N operations
we need to add summary of the changes and then update matrix size so the matrix policy will be not or only resize when applying effect |
a21b477
to
db97417
Compare
total execution time / number of changes: 5ms / 5 = 1ms. | ||
if the average modification time is greater then `EFFECTS_THRESHOLD` the query | ||
will be replicated to both replicas and AOF as a graph effect otherwise the original | ||
query will be replicated. |
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.
Suggestion: Add:
0: always replicate the effect; -1: always replicate the original query.
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.
Please add:
(Since RedisGraph v2.12)
* update with master * wait for replica * wait after each query * refactor test * effect configuration * wip * determine when to use effects * remove stats * skip replica config * adjust constraint test * use readonly query whenever possible * debuging * pass array and len to update labels * set edge endpoints * mostly repositioning * remove debugging prints
* Effects (#2826) * update with master * wait for replica * wait after each query * refactor test * effect configuration * wip * determine when to use effects * remove stats * skip replica config * adjust constraint test * use readonly query whenever possible * debuging * pass array and len to update labels * set edge endpoints * mostly repositioning * remove debugging prints * Update graph.query.md (#3029) BFS: 3 arguments instead of 4 * Clear errno before strtol() (#3021) Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> * Validate with fix (#3018) * wip * fix validations * touchup * no if branch when children are not visited * migrate and add tests, fix RETURN validation * doc addition --------- Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> * Refactor execution-plan freeing mechanism (#2946) * Refactor execution-plan freeing mechanism Co-authored-by: razmon <razmonsonego2@gmail.com> * use rax to store labels * fix comments * add comment * addressing review comments * addressed review comments * fix * leak fix * free ops deepest first * addressing review comments * Update execution_plan.c remove dict init * Update execution_plan.c include setjmp * touchup * touchup --------- Co-authored-by: Ofir Moskovich <ofir.moskovich@redislabs.com> Co-authored-by: Avi Avni <avi.avni@gmail.com> Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> * Fix optimize label scan (2) (#3034) * introduce swap candidates to Label-Scan * doc-fix * fix * tests fix * Update test_optimizations_plan.py * Update scan_functions.h * move context to heap * fix leak * for index scan as well * addressing review comments * touchup * Update scan_functions.c * Update scan_functions.c --------- Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> * Fix LockWrite crash (#3039) * JoinConsume(): Propagaget reset if stream depleted * WIP: Test FOREACH * fix foreach crash * fix tests * fix --------- Co-authored-by: Avi Avni <avi.avni@gmail.com> * Fix for Xenial (OpenMP 4.0/4.5) (#3017) * Fix for Xenial (OpenMP 4.5) * fixes 1 * fixes 2 * fixes 3 * fixes 4 * fixes 5 * fixes 6 * fixes 7 --------- Co-authored-by: Avi Avni <avi.avni@gmail.com> * accumulate updates (#3005) * accumulate updates * fix leaks * add test * unify default dictType definitions * fix * fix 2 * add test * wip fix * wip fix * fix crash * add effect log * early review * fix build * fix test * fixes * fix * refactoring in progress * refactoring continue * write effects directly into buffer * effects-buffer * no need to clone value * no need to clone string * address review comments * address review * fix * address review comment * address reivew * fix perf issue * fix build * refactoring * fix perf * fix build * fix * fix leak * remove redundant flags * compute change against new attribute-set * fix perf * address review * fix * fix * adding comments --------- Co-authored-by: razmon <razmonsonego2@gmail.com> Co-authored-by: Raz Monsonego <74051729+raz-mon@users.noreply.github.com> Co-authored-by: swilly22 <roi@redislabs.com> Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> * Fix rewrite `DELETE` clauses (#3067) * fix and test * add example --------- Co-authored-by: Avi Avni <avi.avni@gmail.com> * Reattach on reset (#3070) * formatting * reattach iterator on reset * disable graphblas memory pool (#3068) * bump version 2.12.1 --------- Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> Co-authored-by: Lior Kogan <koganlior1@gmail.com> Co-authored-by: nafraf <nafraf@users.noreply.github.com> Co-authored-by: Raz Monsonego <74051729+raz-mon@users.noreply.github.com> Co-authored-by: Ofir Moskovich <ofir.moskovich@redislabs.com> Co-authored-by: Rafi Einstein <raffapen@outlook.com> Co-authored-by: razmon <razmonsonego2@gmail.com> Co-authored-by: swilly22 <roi@redislabs.com>
Support for GRAPH.EFFECT replicating modifications to both replicas and AOF