-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix concurrent exception related to multi-match statement #4605
Conversation
e45ad87
to
40afef3
Compare
d724974
to
d4486a6
Compare
Please add a comment. |
I explained in the description of pr why I need to fix it this way, as for the logic of fixing the code is relatively simple. |
I think you could simply remove |
Some of the previous revisions considered performance issues more comprehensively, and it is feasible to revert this refactoring if the previous considerations can be covered. The current pr fix is feasible, and the code changes and performance impact are manageable. |
c3b449c
to
1d3ffcf
Compare
|
1d3ffcf
to
c3eb378
Compare
The |
If other operator reference input of Intersection, it's of course read-write conflicts. |
This issue will only be reproduced by the arguement operator of multiple match statements. nebula/src/graph/executor/logic/ArgumentExecutor.cpp Lines 18 to 36 in fc5735a
|
@@ -84,6 +84,10 @@ Status FilterExecutor::handleSingleJobFilter() { | |||
bool canMoveData = movable(inputVar); | |||
Result result = ectx_->getResult(inputVar); | |||
auto *iter = result.iterRef(); | |||
// Always reuse getNeighbors's dataset to avoid some go statement execution plan related issues | |||
if (iter->isGetNeighborsIter()) { | |||
canMoveData = true; |
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 add this?
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.
Reuse getNeighbors's dataset. Go statements do not cause write-read conflicts.
fix iterator fix small delete small delete skip iterator type handle for concurrency small delete fix scan edges small delete small delete fix small delete small change small change fix ut small fix
9e2f26f
to
a051931
Compare
Codecov Report
@@ Coverage Diff @@
## master #4605 +/- ##
==========================================
+ Coverage 84.72% 84.75% +0.03%
==========================================
Files 1357 1358 +1
Lines 135323 135531 +208
==========================================
+ Hits 114652 114870 +218
+ Misses 20671 20661 -10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* fix filter executor * Fix concurrency exception of multi-match statements fix iterator fix small delete small delete skip iterator type handle for concurrency small delete fix scan edges small delete small delete fix small delete small change small change fix ut small fix Co-authored-by: Sophie <[email protected]>
* fix lookup (#4552) fix Co-authored-by: jimingquan <[email protected]> Co-authored-by: Sophie <[email protected]> * fix split brain in raft (#4479) Co-authored-by: Sophie <[email protected]> * fix invalid filter in GetProp make storage crashed (#4568) Co-authored-by: haowen <[email protected]> * fix scan vertex/edge do not handle ttl (#4578) * fix scan vertex/edge do not handle ttl * use ErrorCode to unify community version and end version * Fix #1212. Return FoldConstantExprVisitor, if status_ already failed due to found syantax errors. (#4607) Co-authored-by: jie.wang <[email protected]> * Avoid fatal when expression illegal. (#4618) * Fix concurrent exception related to multi-match statement (#4605) * fix filter executor * Fix concurrency exception of multi-match statements fix iterator fix small delete small delete skip iterator type handle for concurrency small delete fix scan edges small delete small delete fix small delete small change small change fix ut small fix Co-authored-by: Sophie <[email protected]> * Prune properties(#4523) * fix conflict * extract attribute from properties function (#4604) * extract attribute from properties function * fix error * fix subscript error * add test case * process scanEdges * fix test error * add unwind & check vidType when executing not validate (#4456) * Update AppendVerticesExecutor.cpp fix conflict * Update AppendVerticesExecutor.cpp * Replace obsolete RocksDB API (#4395) Co-authored-by: Sophie <[email protected]> * Update PrunePropertiesRule.feature * remove useless dc (#4533) * Update PrunePropertiesRule.feature * fix test error Co-authored-by: kyle.cao <[email protected]> Co-authored-by: jimingquan <[email protected]> Co-authored-by: liwenhui-soul <[email protected]> Co-authored-by: Doodle <[email protected]> Co-authored-by: haowen <[email protected]> Co-authored-by: Cheng Xuntao <[email protected]> Co-authored-by: jie.wang <[email protected]> Co-authored-by: shylock <[email protected]> Co-authored-by: Qiaolin Yu <[email protected]>
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
#4430
Description:
Plan of

match (v:player) where v.player.name == "Tim Duncan" MATCH (v)-[e:serve]->(n:team) return v
:In the execution plan of the above multiple match query,
_AppendVertices_3
dataset is depended on by operatorsFilter_14
andArguement_6
at the same time, and operatorsFilter_14
andArguement_6
are scheduled concurrently, where operatorFilter_14
will modify_AppendVertices_3
dataset, which cause write-read conflict. If operatorArguement_6
is scheduled after operatorFilter_14
, it may be undefined behavior (crash or output incorrect results).How do you solve it?
I have considered the following options:
Option 1. Customize a special Iterator view for filter/limit, because these two operators will reuse the dataset of the pre-operator
Option 2. Use the
readby
member of dataset to determine the scenarios that may cause concurrent exceptions and eliminate errors that may be caused by write-read conflicts by copying the datasetOption 3. Set the validity flag in the dataset to handle write-read conflicts
Option 4. Make the scheduler aware of possible concurrent write-read conflicts and reasonably schedule the execution order of operators
Option 1 Due to the complicated generation of various statement execution plans, for example, the iterator type of the filter of the go statement may be getNeighborsIter. If it is consistent with the previous behavior, the modification may be complicated.
Option 3 will affect the way all operators access the dataset, and the impact is relatively large, making it difficult to assess the performance impact.
Option 4. May lead to complex scheduling logic.
Therefore, the current pr adopts option 2 to ensure that it does not affect the irrelevant implementation as much as possible, and only handles scenarios with concurrent scheduling exceptions, and the performance impact is relatively small.
Checklist:
Tests:
Affects:
Special notes for reviewer
In the case of possible concurrency exceptions, it is necessary to copy data and bring additional overhead, but this overhead is necessary for correctness.
This is a patch, and a better fix may exist.
Since the problem caused by concurrency is difficult to reproduce, no test case is provided to constrain it.