Skip to content
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(core): edge cache not clear when update or delete associated vertex #1780

Merged
merged 7 commits into from
Mar 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update CachedGraphTransaction.java
format code using  hugegraph code style
  • Loading branch information
sunlujing authored Mar 14, 2022
commit 9f21a98904dbf037e15b88dc4cb9bfcc6af30116
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,12 @@ protected final void commitMutation2Backend(BackendMutation... mutations) {
}
}

// Update edge cache if any vertex or edge change
// for vertex change, the edge associated with that vertex should also be updated
// here we just clear all the edge cache , before we use a more precise strategy
boolean invalidEdgesCache = (this.edgesInTxSize() + updates.size() + deletions.size()) > 0;
/*
* Update edge cache if any vertex or edge changed
* For vertex change, the edges linked with should also be updated
* Before we use a more precise strategy,now we just clear all the edge cache
Copy link
Member

@imbajin imbajin Mar 14, 2022

Choose a reason for hiding this comment

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

enhance to--> Before we find a more precise strategy, just clear all the edge cache now (expect a space after ,)

PS: For convenience, u can edit the file directly on github page 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

*/
boolean invalidEdgesCache = (edgesInTxSize + updates.size() + deletions.size()) > 0;
if (invalidEdgesCache && this.enableCacheEdge()) {
// TODO: Use a more precise strategy to update the edge cache
this.edgesCache.clear();
Expand Down