JanusGraph / JanusGraph/janusgraph

inconsistencies when add/remove with cassandrathrift

Open
#912 0 comments 0 reactions 0 assignees View on GitHub
kind/bug/possible storage/cassandra
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

This was reported on a [janusgraph-users thread](https://groups.google.com/d/msg/janusgraph-users/i1604yDPJbM/j1aWM4eNAQAJ) by shrikant pachauri.

> I am trying to perform some CRUD operations using java on the janus graph. I have run mix transactions say 4k includes (create and delete). Now when i try to query all the vertices that are in the graph by console as g.V(). It returns only two results.
> However when i try to get vertices via particular id which is not in the result of above query they seem to present in the janus graph.

Full code is available on the thread, but this is the meat of it. Add 10 vertices, then continually add/remove 1 vertex. With `storage.backend=cassandrathrift` it failed for me after 547 vertices.

```
for (int i=0; i<10; i++) {
Vertex student = graph.addVertex("student");
student.property("status",true);
student.property("startDate",new Date());
student.property("marks",12);
student.property("completion",2);
graph.tx().commit();
System.out.println(student)
//Thread.sleep(1000)
}
System.out.println(g.V().count().next());

for (int i=0; i<10000000; i++) {
Vertex student = graph.addVertex("student");
student.property("status",true);
student.property("startDate",new Date());
student.property("marks",12);
student.property("completion",2);
graph.tx().commit();
if (i%10000 == 0) System.out.println(i);

long before=g.V().count().next();
student.remove();
graph.tx().commit();
long after=g.V().count().next();
if (before-after > 1) {
System.out.println("vertices before deletion "+before);
System.out.println("vertices after deletion "+after);
System.out.println("Error Occured at "+i);
System.exit(0);
}
}
```

After hitting the failure, I was able to connect to the same keyspace with `cassandra` or `cql` and see the correct number of vertices. Only `cassandrathrift` reported the wrong number, so it seems that there is a bug in that specific adapter.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied add/remove loop with storage.backend=cassandrathrift, then compare g.V().count() with the same keyspace queried through cassandra or cql. The work is done when repeated vertex additions and removals return the correct count through the cassandrathrift adapter.

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.