JanusGraph / JanusGraph/janusgraph
Unique index with partitioned vertex label constraint not respected across transactions
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
Steps to reproduce issue:
```
gremlin> graph = JanusGraphFactory.build().set('storage.backend','hbase').set('storage.hbase.table','janusgraph').open()
==>standardjanusgraph[hbase:[127.0.0.1]]
gremlin>
gremlin> m=graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@fe7b6b0
gremlin> vl=m.makeVertexLabel('system').partition().make()
==>system
gremlin> pk=m.makePropertyKey('system_id').dataType(String.class).make()
==>system_id
gremlin> i=m.buildIndex('idx_system_id', Vertex.class).addKey(pk).indexOnly(vl).unique().buildCompositeIndex()
==>idx_system_id
gremlin> m.commit()
==>null
gremlin> g=graph.traversal()
==>graphtraversalsource[standardjanusgraph[hbase:[127.0.0.1]], standard]
gremlin> g.addV('system').property('system_id','A')
==>v[4226]
gremlin> g.tx().commit()
==>null
gremlin> g.addV('system').property('system_id','A')
==>v[8202]
gremlin> g.tx().commit()
==>null
gremlin> g.V()
==>v[8202]
==>v[4226]
gremlin> g.V().properties()
==>vp[system_id->A]
==>vp[system_id->A]
```
Issue is present only when using partitioned vertex label constraint:
vl=m.makeVertexLabel('system').**partition()**.make()
Version: JanusGraph 0.2.0-SNAPSHOT on HBase 1.2.4
Further details: https://groups.google.com/forum/#!topic/janusgraph-users/KlJcsNdtZxE
Contributor guide
Research direction
Start by running the Gremlin reproduction using a partitioned vertex label, a unique composite index, and two committed transactions. Trace the management and transaction entry points involved in the index constraint, then verify that the second transaction cannot create a duplicate value across partitions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100