JanusGraph / JanusGraph/janusgraph
Lucene index inconsistency
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
- Version: 0.6.2
- Storage Backend: inmemory
- Mixed Index Backend: lucene
- Link to discussed bug: https://lists.lfaidata.foundation/g/janusgraph-users/topic/92399796#6566
- Expected Behavior:
I would expect it to be possible to create an index with any name.
Or the name should be checked during the index creation and not at some point later.
- Current Behavior:
The index is created but any insert seems to fail with a `PermanentBackendException` due to a precondition check.
- Steps to Reproduce:
```java
PropertiesConfiguration conf = ConfigurationUtil.loadPropertiesConfig("conf/test.properties");
JanusGraph graph = JanusGraphFactory.open(conf);
String name = "some_name";
graph.tx().rollback();
JanusGraphManagement management = graph.openManagement();
management.makePropertyKey("name").dataType(String.class).make();
management.commit();
management = graph.openManagement();
management.buildIndex(name, Vertex.class)
.addKey(management.getPropertyKey("name"))
.buildMixedIndex("search");
management.commit();
ManagementSystem.awaitGraphIndexStatus(graph, name).
status(SchemaStatus.REGISTERED)
.call();
management = graph.openManagement();
management.updateIndex(management.getGraphIndex(name), SchemaAction.REINDEX).get();
management.commit();
management = graph.openManagement();
System.out.println(management.printIndexes());
graph.traversal().addV().property("name", "Test").next();
graph.tx().commit();
```
With the following configuration:
```
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=inmemory
index.search.backend=lucene
index.search.directory=data/searchindex
```
Contributor guide
Research direction
Start by running the Java reproducer using ConfigurationUtil.loadPropertiesConfig, JanusGraphFactory.open, buildMixedIndex, and the traversal insertion. Trace the PermanentBackendException from index creation or registration through the insert path; done means invalid index names are rejected during creation or valid names no longer cause later inserts to fail, with regression coverage.
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
- 42/100