JanusGraph / JanusGraph/janusgraph

Property cannot reuse the name of another renamed property in the same mixed index

Open
#2,653 12 comments 0 reactions 0 assignees View on GitHub
area/index area/schema kind/bug/confirmed kind/enhancement
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

Hi
here is an issue related with mix index. Java client app connecting with janusgraph-0.5.3-gremlin-server, created a mix index(eg: edgeIndex) for several properties(eg: name, address), then rename name property to del_name, after that create "name" property again, and add the "name" property to mix index with error "Multiple entries with same key"

For confirmed bugs, please report:
- Version: 0.5.3
- Storage Backend: hbase 2.1.3
- Mixed Index Backend: elasticsearch 6.7.1
- Link to discussed bug:
- Expected Behavior:
- Current Behavior:
- Steps to Reproduce:
1. create property with mix index.
```
size = graph.getOpenTransactions().size();
for(i=0;i(RegularImmutableMap.java:70)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)
at org.janusgraph.graphdb.database.IndexSerializer$IndexInfoRetriever$1.get(IndexSerializer.java:165)
at org.janusgraph.diskstorage.indexing.IndexTransaction.getIndexMutation(IndexTransaction.java:82)
at org.janusgraph.diskstorage.indexing.IndexTransaction.add(IndexTransaction.java:67)
at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:647)
at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:731)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1438)
at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsGraph$GraphTransaction.doCommit(JanusGraphBlueprintsGraph.java:297)
at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.commit(AbstractTransaction.java:104)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.onTraversalSuccess(TraversalOpProcessor.java:471)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.handleIterator(TraversalOpProcessor.java:603)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.lambda$iterateBytecodeTraversal$4(TraversalOpProcessor.java:411)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
88386919 [gremlin-server-exec-3] WARN org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Exception processing a Traversal on iteration for request [84e68f28-2fe0-4259-8eee-cfffc45e787c].
org.janusgraph.core.JanusGraphException: Could not commit transaction due to exception during persistence
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1449)
at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsGraph$GraphTransaction.doCommit(JanusGraphBlueprintsGraph.java:297)
at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.commit(AbstractTransaction.java:104)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.onTraversalSuccess(TraversalOpProcessor.java:471)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.handleIterator(TraversalOpProcessor.java:603)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.lambda$iterateBytecodeTraversal$4(TraversalOpProcessor.java:411)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Multiple entries with same key: name=org.janusgraph.diskstorage.indexing.StandardKeyInformation@4a1477cc and name=org.janusgraph.diskstorage.indexing.StandardKeyInformation@26dc5b3e
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150)
at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104)
at com.google.common.collect.RegularImmutableMap.(RegularImmutableMap.java:70)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)
at org.janusgraph.graphdb.database.IndexSerializer$IndexInfoRetriever$1.get(IndexSerializer.java:165)
at org.janusgraph.diskstorage.indexing.IndexTransaction.getIndexMutation(IndexTransaction.java:82)
at org.janusgraph.diskstorage.indexing.IndexTransaction.add(IndexTransaction.java:67)
at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:647)
at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:731)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1438)
```

Contributor guide

Open the contributing guide

Research direction

Start at org.janusgraph.graphdb.database.IndexSerializer.IndexInfoRetriever.get, reported at line 165, and reproduce the management sequence using the mixed index configuration described in the issue. Done means renaming a property and reusing its former name no longer produces duplicate-key entries when adding the property to the mixed index and committing.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, 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.