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
Next Next commit
Update CachedGraphTransaction.java
1. fix the bug when vertex updated, but the edge cache associated with that vertex was not updated. Here we simply clear all edge cache when  any vertex changes.
  • Loading branch information
sunlujing authored Mar 12, 2022
commit a75e4c5ff36ac58b8ab3ecf42b68920a063bb7e1
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,11 @@ protected final void commitMutation2Backend(BackendMutation... mutations) {
}
}

// Update edge cache if any edges change
if (edgesInTxSize > 0 && this.enableCacheEdge()) {
// 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
Copy link
Member

Choose a reason for hiding this comment

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

some typo:

  • we could use /* xx */ and let them looks like a paragraph
  • vertex change --> vertex changed
  • here xx, before xxx --> Before xx. now we just xx

boolean invalidEdgesCache = (this.edgesInTxSize() + updates.size() + deletions.size()) > 0;
if (invalidEdgesCache) {
// TODO: Use a more precise strategy to update the edge cache
this.edgesCache.clear();
this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE, null);
Expand Down