JanusGraph / JanusGraph/janusgraph

Janus graph with Cassandra query returning inconsistent vertices

Open
#1,607 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

Environment:
Test code, jansugraph and cassandra embedded in the same JVM
jansugraph-core.jar (0.3.1)
janusgraph-cassandra.jar (0.3.1)

database caching - not enabled
Indexing - not enabled

Our long running test has captured a scenario where, the query `g.V().count()` returns the vertex count as 1 while the graph has many vertices. Queries involving specific vertex ids are brining back the corresponding vertices though e.g. `g.V(1024, 30980).count()` return 2.

We were able to narrow down the issue to some sort of data inconsistency within Cassandra database, since we were able to replicate the exact scenario on a different environment by restoring the Cassandra data files.

Janusgraph embedded server initialisation code,

```
janusGraph = JanusGraphFactory.build()
.set("gremlin.graph", "org.janusgraph.core.JanusGraphFactory")
.set("storage.backend", "embeddedcassandra")
.set("graph.set-vertex-id", false)
.set("graph.default", "none")
.set("storage.conf-file", "cassandra.yaml")
.set("gremlin.remote.remoteConnectionClass", "org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection")
.set("gremlin.remote.driver.sourceName", "graph")
.set("cache.db-cache", false)
.set("root.attributes.custom.attribute1.attribute-class", "java.util.ArrayList")
.set("root.attributes.custom.attribute1.serializer-class", "com.xyz.graphdb.serialize.attribute.ArrayListSerializer")
.set("root.attributes.custom.attribute2.attribute-class", "com.xyz.graphdb.models.Traits")
.set("root.attributes.custom.attribute2.serializer-class", "com.xyz.graphdb.serialize.attribute.TraitsSerializer")
.set("root.attributes.custom.attribute3.attribute-class", "java.util.LinkedHashMap")
.set("root.attributes.custom.attribute3.serializer-class", "org.janusgraph.graphdb.database.serialize.attribute.SerializableSerializer")
.set("root.attributes.custom.attribute4.attribute-class", "java.util.LinkedList")
.set("root.attributes.custom.attribute4.serializer-class", "com.xyz.graphdb.serialize.attribute.LinkedListSerializer").open();

```
[cassandra.txt](https://github.com/JanusGraph/janusgraph/files/3232904/cassandra.txt)

This seems to be a bug since two queries against the same backend database returns inconsistent results.

Contributor guide

Open the contributing guide

Research direction

Start with the embedded Cassandra initialization shown in the issue and the attached cassandra.txt data. Reproduce the discrepancy by comparing g.V().count() with g.V(1024, 30980).count() using the restored data, then trace the backend behavior responsible for the inconsistent results. Done means the two queries return consistent vertex results against the same database.

Written by the indexing model from the issue text.

Assessment

Tech stack
cassandra, java
Domain
databases
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.