Skip to content

make delete operation eager#3152

Merged
swilly22 merged 19 commits intomasterfrom
eager-op-delete
Aug 14, 2023
Merged

make delete operation eager#3152
swilly22 merged 19 commits intomasterfrom
eager-op-delete

Conversation

@AviAvni
Copy link
Copy Markdown
Contributor

@AviAvni AviAvni commented Aug 6, 2023

fixes #3150, #2263

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 6, 2023

Codecov Report

Patch coverage: 98.84% and project coverage change: -0.07% ⚠️

Comparison is base (b52fbc5) 90.87% compared to head (b1b7e22) 90.80%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3152      +/-   ##
==========================================
- Coverage   90.87%   90.80%   -0.07%     
==========================================
  Files         294      294              
  Lines       30286    30286              
==========================================
- Hits        27522    27502      -20     
- Misses       2764     2784      +20     
Files Changed Coverage Δ
src/graph/graphcontext.c 91.90% <0.00%> (ø)
src/undo_log/undo_log.c 95.45% <98.27%> (+0.93%) ⬆️
src/arithmetic/entity_funcs/entity_funcs.c 97.56% <100.00%> (ø)
src/ast/ast.c 91.94% <100.00%> (+0.02%) ⬆️
src/commands/cmd_constraint.c 94.11% <100.00%> (-0.04%) ⬇️
src/commands/cmd_query.c 97.86% <100.00%> (ø)
src/effects/effects.c 99.17% <100.00%> (ø)
src/execution_plan/ops/op_delete.c 97.52% <100.00%> (+0.08%) ⬆️
src/execution_plan/ops/shared/update_functions.c 98.25% <100.00%> (ø)
src/graph/entities/edge.c 80.00% <100.00%> (+1.73%) ⬆️
... and 6 more

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@swilly22 swilly22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Comment thread tests/flow/test_graph_deletion.py
Comment thread tests/flow/test_graph_deletion.py
Comment thread tests/flow/test_graph_deletion.py
Comment thread tests/flow/test_graph_deletion.py Outdated
Comment thread tests/flow/test_graph_deletion.py Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.h Outdated
Comment thread src/graph/graph_delete_nodes.c Outdated
Comment thread src/graph/graph_delete_nodes.c Outdated
swilly22
swilly22 previously approved these changes Aug 7, 2023
Comment thread src/undo_log/undo_log.c
swilly22
swilly22 previously approved these changes Aug 7, 2023
@AviAvni AviAvni added the action:run-benchmark Trigger CI benchmarks label Aug 8, 2023
@filipecosta90
Copy link
Copy Markdown
Collaborator

filipecosta90 commented Aug 8, 2023

Automated performance analysis summary

This comment was automatically generated given there is performance data available.

In summary:

  • Detected a total of 15 stable tests between versions.
  • Detected a total of 4 improvements above the improvement water line.
  • Detected a total of 1 regressions bellow the regression water line 5.0.

You can check a comparison in detail via the grafana link

Comparison between master and eager-op-delete.

Time Period from 30 days ago. (environment used: oss-standalone)

Test Case Baseline master (median obs. +- std.dev) Comparison eager-op-delete (median obs. +- std.dev) % change (higher-better) Note
ENTITY_COUNT 49999 +- 0.0% (5 datapoints) 49998 +- nan% (1 datapoints) -0.0% -- no change --
EXPLICIT-EDGE-DELETION 100 +- 0.0% (5 datapoints) 50 +- nan% (1 datapoints) -50.0% REGRESSION
GRAPH500-SCALE_18-EF_16-1_HOP 33323 +- 0.0% (5 datapoints) 33324 +- nan% (1 datapoints) 0.0% -- no change --
GRAPH500-SCALE_18-EF_16-1_HOP_MIXED_READ_65perc_WRITE_25perc_DEL_10perc 50 +- 0.0% (5 datapoints) 50 +- nan% (1 datapoints) -0.0% -- no change --
GRAPH500-SCALE_18-EF_16-1_HOP_MIXED_READ_75perc_WRITE_25perc 56 +- 2.6% (5 datapoints) 59 +- nan% (1 datapoints) 5.9% IMPROVEMENT
GRAPH500-SCALE_18-EF_16-2_HOP 11111 +- 5.5% (5 datapoints) 11111 +- nan% (1 datapoints) 0.0% waterline=5.5%. -- no change --
GRAPH500-SCALE_18-EF_16-2_HOP_MIXED_READ_75perc_WRITE_25perc 56 +- 3.2% (5 datapoints) 59 +- nan% (1 datapoints) 5.9% IMPROVEMENT
GRAPH500-SCALE_18-EF_16-3_HOP 893 +- 0.4% (5 datapoints) 893 +- nan% (1 datapoints) 0.0% -- no change --
GRAPH500-SCALE_18-EF_16-3_HOP_MIXED_READ_75perc_WRITE_25perc 53 +- 3.0% (5 datapoints) 56 +- nan% (1 datapoints) 5.6% IMPROVEMENT
IMPLICIT-EDGE-DELETION 17 +- 0.0% (5 datapoints) 50 +- nan% (1 datapoints) 199.8% IMPROVEMENT
INSPECT-EDGES 2500 +- 0.0% (5 datapoints) 2500 +- nan% (1 datapoints) -0.0% -- no change --
MIX_READ_WRITE 10000 +- 0.0% (5 datapoints) 10000 +- nan% (1 datapoints) -0.0% -- no change --
NODE-BATCH-DELETE 50 +- 0.0% (5 datapoints) 50 +- nan% (1 datapoints) 0.0% -- no change --
NODE-INDEX-LOOKUP 33 +- 0.0% (5 datapoints) 33 +- nan% (1 datapoints) 0.0% -- no change --
SORT_ENTITIES 100 +- 0.0% (5 datapoints) 100 +- nan% (1 datapoints) -0.0% -- no change --
UPDATE-BASELINE 24998 +- 0.0% (5 datapoints) 24998 +- nan% (1 datapoints) 0.0% -- no change --
VARIABLE-LENGTH-FILTER 33323 +- 0.0% (5 datapoints) 33323 +- nan% (1 datapoints) -0.0% -- no change --
VARIABLE_LENGTH_EXPAND_INTO 100 +- 0.0% (5 datapoints) 100 +- nan% (1 datapoints) -0.0% -- no change --
allShortestPaths-10hop-100Kpaths 30 +- 6.1% (5 datapoints) 30 +- nan% (1 datapoints) -0.0% waterline=6.1%. -- no change --
allShortestPaths-4hop-10Kpaths 333 +- 3.9% (5 datapoints) 333 +- nan% (1 datapoints) -0.0% -- no change --

Copy link
Copy Markdown
Contributor

@swilly22 swilly22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review in progress

Comment thread src/arithmetic/entity_funcs/entity_funcs.c
Comment thread tests/tck/features/clauses/merge/Merge5.feature
res = redis_graph.query("MATCH (n:Bar) RETURN count(n)")
self.env.assertEquals(res.result_set[0][0], 0)

No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing tests which are trying to interact / return deleted entities.
e.g

MATCH (a) DELETE a RETURN a.v
MATCH (a) WITH a, a AS b DELETE a RETURN b
MATCH (a) DELETE a CALL P(a) ...
...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we need to finish with #3085

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Still I think the tests should be either written or copied over from that PR.
I feel like we might get into crashes if we allow users to access deleted entities.

Comment thread tests/benchmarks/implicit_edge_deletion.yml
Comment thread tests/benchmarks/implicit_edge_deletion.yml Outdated
Comment thread src/undo_log/undo_log.c Outdated
Comment thread src/undo_log/undo_log.c Outdated
Comment thread src/undo_log/undo_log.c
Comment thread src/query_ctx.c
Comment thread src/query_ctx.c Outdated
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c
res = redis_graph.query("MATCH (n:Bar) RETURN count(n)")
self.env.assertEquals(res.result_set[0][0], 0)

No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Still I think the tests should be either written or copied over from that PR.
I feel like we might get into crashes if we allow users to access deleted entities.

Comment thread src/undo_log/undo_log.c Outdated
Comment thread src/undo_log/undo_log.c Outdated
Comment thread src/undo_log/undo_log.c
Comment thread src/undo_log/undo_log.c Outdated
Comment thread src/graph/rg_matrix/rg_wait.c Outdated
// perform additions
//--------------------------------------------------------------------------
s = (t == GrB_BOOL) ? GxB_ANY_PAIR_BOOL : GxB_ANY_PAIR_UINT64;
info = GrB_Matrix_eWiseAdd_Semiring(m, NULL, NULL, s, m, dp, NULL);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to investigate performance I've got a hunch that GrB_Matrix_assign would yield better performance

Comment thread src/graph/rg_matrix/rg_wait.c
Comment thread src/graph/entities/edge.c Outdated
Comment thread src/graph/graph_delete_nodes.c Outdated
Comment thread src/graph/graph_hub.c Outdated
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c
Comment thread src/execution_plan/ops/op_delete.c Outdated
Comment thread src/execution_plan/ops/op_delete.c
@swilly22 swilly22 merged commit 8dc6b59 into master Aug 14, 2023
@swilly22 swilly22 deleted the eager-op-delete branch August 14, 2023 12:33
AviAvni added a commit that referenced this pull request Aug 16, 2023
* make delete operation eager

* address review comments

* address review

* address review

* fix leak

* fix benchmark issue

* fix benchmark

* back to scalar

* try fix perf

* fix benchmark

* try to improve rg_wait

* lazy create undo_log and effect_buffer

* change sanizaiter parallel

* address review

* address review

* addres review

* fix warning

* perf
AviAvni added a commit that referenced this pull request Aug 16, 2023
* Updated clang sanitizer (sanbox) version (#3153)

* make delete operation eager (#3152)

* make delete operation eager

* address review comments

* address review

* address review

* fix leak

* fix benchmark issue

* fix benchmark

* back to scalar

* try fix perf

* fix benchmark

* try to improve rg_wait

* lazy create undo_log and effect_buffer

* change sanizaiter parallel

* address review

* address review

* addres review

* fix warning

* perf

* conditional reserve adjust (#3154)

* conditional reserve adjust

* Update test_graph_merge.py

* bump version 2.12.5

---------

Co-authored-by: Rafi Einstein <raffapen@outlook.com>
Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action:run-benchmark Trigger CI benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect use of reserved node id when using delete before merge or create

3 participants