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

[Improvement] Graph server edgeCache invalidate strategy #2731

Open
imbajin opened this issue Feb 13, 2025 · 0 comments · May be fixed by #2730
Open

[Improvement] Graph server edgeCache invalidate strategy #2731

imbajin opened this issue Feb 13, 2025 · 0 comments · May be fixed by #2730
Labels
improvement General improvement

Comments

@imbajin
Copy link
Member

imbajin commented Feb 13, 2025

Discussed in https://github.com/apache/incubator-hugegraph/discussions/2720

Originally posted by haohao0103 January 7, 2025
image
According to the current logic, the edgeCache invalidation mechanism is triggered by any vertex addition, update, or deletion, as well as any edge addition, update, or deletion, resulting in the clearing of the entire edge cache. As shown in the image, my expectation is to handle edgeCache invalidation differently based on the type of vertex change. From what I understand, the edgeCache's cache key is the queryId, such as:

Query * from EDGE where [OWNER_VERTEX == 2, DIRECTION == OUT OR DIRECTION == IN] Query * from EDGE where [OWNER_VERTEX == 1, DIRECTION == OUT OR DIRECTION == IN]

This data is sourced from CachedGraphTransactionTest#testEdgeCacheClearWhenUpdateVertex.

The queryId in edgeCache is related to the vertex ID and not to the vertex's properties. Therefore, vertex addition or update operations should not trigger edgeCache invalidation. Is this understanding correct?

For vertex deletion operations, only the edgeCache entries corresponding to the relevant queryId should be cleared, rather than clearing the entire edge cache. This requires designing a data structure to maintain the mapping between vertices and their associated queryIds.

For edge change operations, I do not yet have a clear approach and will temporarily maintain the original design.

I welcome any guidance, suggestions, or feedback on this approach. Thank you in advance for your input!

@imbajin imbajin linked a pull request Feb 13, 2025 that will close this issue
@dosubot dosubot bot added the improvement General improvement label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement General improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant