JanusGraph / JanusGraph/janusgraph
Corrupted data & index after simultaneous vertex delete and indexed property update
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
[similar to #993]
Checked on janusgraph 0.2.0 and 0.3.0 (snapshot from 04.April.2018) on cassandra 3.11.1
This problem occurs on our environment, where by default we have 30 separate simultaneous connections to single janusgraph instance.
I was able to reduce the problem to simple reproducible scenario:
First, you need to connect to db (best empty) from two gremlin consoles (A and B) and proceed as follows:
**on any gremlin console**:
```
mgmt = g.openManagement()
mgmt.makePropertyKey("name").dataType(String.class).cardinality(Cardinality.SINGLE).make()
idx = mgmt.buildIndex("nameIndex", Vertex.class)
idx.addKey(mgmt.getPropertyKey("name")).buildCompositeIndex()
mgmt.commit()
```
**gremlin console A)**
```
g.addVertex("name", "A")
g.tx().commit()
v = g.traversal().V().has("name", "A").next()
```
**gremlin console B)**
```
g.traversal().V().has("name", "A").drop()
g.tx().commit()
```
**gremlin console A)**
```
v.property("name", "C")
g.tx().commit()
```
**AFTER this check corrupted data on any console:**
this will return "zombie" vertex
`g.traversal().V().has("name", "C")`
that is not on all vertices list:
`g.traversal().V()`
Contributor guide
Research direction
Reproduce the sequence in two Gremlin consoles against Cassandra: create the composite index, delete the vertex in one transaction, then update its indexed property in the other. Trace the transaction and index behavior around the concurrent delete and update. Done means the updated property cannot return a zombie vertex and indexed results remain consistent with g.traversal().V().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cassandra, java
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100