JanusGraph / JanusGraph/janusgraph

Using adjacent queries for Partitioned Vertices does not work correctly

Open
#1,533 5 comments 0 reactions 0 assignees View on GitHub
area/tinkerpop kind/bug/confirmed
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

While using Graph Partitioning (Vertex Cut) to alleviate large partition sizes in a backed like cassandra, I noticed a specific issue where if you try to query for adjacency, the query returns incorrect results.
Assuming 'left' and 'right' are two partitioned vertices connected by an edge, a query like

_left.query().adjacent(right).direction(Direction.OUT).labels("leftToRight").edges()_

will return incorrect results.
In case of a vertex cut, where the cluster.maxPartition is 32, both left and right will be cut in 32 segments, and can be represented as left[32] and right[32]. The VertexCentricQueryBuilder and the BasicVertexCentricQueryBuilder attempts to query the canonical long id of 'right' against the all representatives of left aka left[32] and may or may not find the correct right[i] in this query resulting into incorrect results.

Contributor guide

Open the contributing guide

Research direction

Start with VertexCentricQueryBuilder and BasicVertexCentricQueryBuilder, focusing on how the canonical long id for the adjacent partitioned vertex is queried against vertex representatives. Reproduce the adjacent OUT edge query with vertex cuts and verify that it returns the correct results for the relevant partition segment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cassandra, java
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.