-
Notifications
You must be signed in to change notification settings - Fork 529
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
[Question] Doubts About the Logical Design of edge Cache Invalidation in Graph Servers #2719
Comments
The edge cache is cleared during the addition and update operations of a vertex in the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu I understand that the edge cache is based on the
|
Updating the attributes of a vertex affects the edge cache because the cache invalidation mechanism is triggered by any vertex update, not just changes to the edge structure or query results. This is due to the current implementation, which lacks a precise strategy to selectively update only the affected edges. As a result, the entire edge cache is cleared to maintain consistency, even if the edge structure and query results remain unchanged [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu "the cache invalidation mechanism is triggered by any vertex update",Can you provide a concrete example to explain why updating vertex attributes should trigger edge cache invalidation? What problems might occur if the edge cache is not invalidated? |
Updating vertex attributes should trigger edge cache invalidation because edges often depend on the properties of their connected vertices. If the edge cache is not invalidated, it can lead to inconsistencies where the cached edges do not reflect the updated state of the vertices they connect, causing incorrect query results or application logic errors. For example, consider a test case where two vertices If the edge cache were not invalidated, querying the edges connected to cache.addVertexProperty(new HugeVertexProperty<>(v1,
cache.graph().schema()
.getPropertyKey("name"),
"test-name"));
cache.commit();
Assert.assertEquals(0L,
Whitebox.invoke(cache, "edgesCache", "size"));
String name = cache.queryEdgesByVertex(IdGenerator.of(1)).next().outVertex()
.value("name");
Assert.assertEquals("test-name", name); This demonstrates the necessity of edge cache invalidation upon vertex updates to maintain data consistency [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu cache.addVertexProperty(new HugeVertexProperty<>(v1, |
The code snippet involving To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu CachedGraphTransaction#testEdgeCacheClearWhenUpdateVertex() the cacheKey of edgeCache is
When we update the name property of v3, this operation does not change the edge query result, so we do not need to clear the edge cache. |
The edge cache is cleared in To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label |
Problem Type (问题类型)
struct / logic (架构 / 逻辑设计问题)
Before submit
Environment (环境信息)
Your Question (问题描述)
CacheGraphTransaction#commitMutation2Backend()
commitMutation2Backend, i think the edge cache needs to be cleared only when there is an edge update or deletion vertex that would cause the associated edge to be deleted,Why do we need to trigger the clear of edge cache for the addition and update operations of vertex?
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response
The text was updated successfully, but these errors were encountered: