JanusGraph / JanusGraph/janusgraph

Lucene migration: Format version is not supported

Open
#496 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/docs
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

I tried to move from a JanusGraph 0.1.1 Graph of the Gods graph with BerkeleyJE and Lucene over to JanusGraph 0.2.0-SNAPSHOT. Ran into the exception below:

```
gremlin> g.E().has('place', geoWithin( Geoshape.circle(37.6, 23.8, 20) )).values('place')
Could not process individual retrieval call
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.janusgraph.core.JanusGraphException: Could not process individual retrieval call
at org.janusgraph.graphdb.query.QueryUtil.processIntersectingRetrievals(QueryUtil.java:257)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6.execute(StandardJanusGraphTx.java:1280)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6.execute(StandardJanusGraphTx.java:1148)
at org.janusgraph.graphdb.query.QueryProcessor$LimitAdjustingIterator.getNewIterator(QueryProcessor.java:209)
at org.janusgraph.graphdb.query.LimitAdjustingIterator.hasNext(LimitAdjustingIterator.java:68)
at org.janusgraph.graphdb.query.ResultSetIterator.nextInternal(ResultSetIterator.java:54)
at org.janusgraph.graphdb.query.ResultSetIterator.(ResultSetIterator.java:44)
at org.janusgraph.graphdb.query.QueryProcessor.iterator(QueryProcessor.java:68)
at com.google.common.collect.Iterables$7.iterator(Iterables.java:613)
at org.janusgraph.graphdb.tinkerpop.optimize.JanusGraphStep.lambda$new$0(JanusGraphStep.java:69)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:139)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.hasNext(ExpandableStepIterator.java:42)
at org.janusgraph.graphdb.tinkerpop.optimize.JanusGraphPropertiesStep.initialize(JanusGraphPropertiesStep.java:87)
at org.janusgraph.graphdb.tinkerpop.optimize.JanusGraphPropertiesStep.processNextStart(JanusGraphPropertiesStep.java:106)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
at org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:234)
...
Caused by: org.janusgraph.core.JanusGraphException: Could not call index
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6$6.call(StandardJanusGraphTx.java:1273)
at org.janusgraph.graphdb.query.QueryUtil.processIntersectingRetrievals(QueryUtil.java:255)
... 65 more
Caused by: org.janusgraph.core.JanusGraphException: Could not execute operation due to backend exception
at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:57)
at org.janusgraph.diskstorage.BackendTransaction.executeRead(BackendTransaction.java:469)
at org.janusgraph.diskstorage.BackendTransaction.indexQuery(BackendTransaction.java:413)
at org.janusgraph.graphdb.database.IndexSerializer.query(IndexSerializer.java:547)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6$6$1.lambda$call$0(StandardJanusGraphTx.java:1269)
at org.janusgraph.graphdb.query.profile.QueryProfiler.profile(QueryProfiler.java:97)
at org.janusgraph.graphdb.query.profile.QueryProfiler.profile(QueryProfiler.java:89)
at org.janusgraph.graphdb.query.profile.QueryProfiler.profile(QueryProfiler.java:81)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6$6$1.call(StandardJanusGraphTx.java:1269)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6$6$1.call(StandardJanusGraphTx.java:1266)
at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4742)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4739)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx$6$6.call(StandardJanusGraphTx.java:1266)
... 66 more
Caused by: org.janusgraph.diskstorage.PermanentBackendException: Could not open index reader on store: edges
at org.janusgraph.diskstorage.lucene.LuceneIndex$Transaction.getSearcher(LuceneIndex.java:773)
at org.janusgraph.diskstorage.lucene.LuceneIndex$Transaction.access$000(LuceneIndex.java:753)
at org.janusgraph.diskstorage.lucene.LuceneIndex.query(LuceneIndex.java:440)
at org.janusgraph.diskstorage.indexing.IndexTransaction.query(IndexTransaction.java:102)
at org.janusgraph.diskstorage.BackendTransaction$6.call(BackendTransaction.java:416)
at org.janusgraph.diskstorage.BackendTransaction$6.call(BackendTransaction.java:413)
at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:69)
at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:55)
... 83 more
Caused by: org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="/private/tmp/gods/luc/edges/segments_1"))): 3 (needs to be between 4 and 6). This version of Lucene only supports indexes created with release 5.0 and later.
at org.apache.lucene.codecs.CodecUtil.checkHeaderNoMagic(CodecUtil.java:213)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:304)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:288)
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:57)
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:54)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:692)
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:77)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63)
at org.janusgraph.diskstorage.lucene.LuceneIndex$Transaction.getSearcher(LuceneIndex.java:768)
... 90 more
```

There is some documentation suggesting that the [IndexUpgrader Tool](https://cwiki.apache.org/confluence/display/solr/IndexUpgrader+Tool) can upgrade an existing index to the current file format, but I ran into this after using the IndexUpgrader:

```
Caused by: java.lang.IllegalStateException: unexpected docvalues type NONE for field 'place__x' (expected=NUMERIC). Re-index with correct docvalues type.
at org.apache.lucene.index.DocValues.checkField(DocValues.java:212)
at org.apache.lucene.index.DocValues.getNumeric(DocValues.java:227)
at org.apache.lucene.spatial.vector.DistanceValueSource.getValues(DistanceValueSource.java:68)
at org.apache.lucene.queries.function.FunctionRangeQuery$FunctionRangeWeight.scorer(FunctionRangeQuery.java:163)
at org.apache.lucene.queries.function.FunctionRangeQuery$FunctionRangeWeight.scorer(FunctionRangeQuery.java:121)
at org.apache.lucene.search.Weight.scorerSupplier(Weight.java:126)
at org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.scorerSupplier(LRUQueryCache.java:726)
at org.apache.lucene.search.BooleanWeight.scorerSupplier(BooleanWeight.java:400)
at org.apache.lucene.search.BooleanWeight.scorer(BooleanWeight.java:381)
at org.apache.lucene.search.Weight.bulkScorer(Weight.java:160)
at org.apache.lucene.search.BooleanWeight.bulkScorer(BooleanWeight.java:375)
at org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight.bulkScorer(LRUQueryCache.java:790)
at org.apache.lucene.search.ConstantScoreQuery$1.bulkScorer(ConstantScoreQuery.java:120)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:665)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:591)
at org.apache.lucene.search.IndexSearcher.searchAfter(IndexSearcher.java:576)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:503)
at org.janusgraph.diskstorage.lucene.LuceneIndex.query(LuceneIndex.java:448)
at org.janusgraph.diskstorage.indexing.IndexTransaction.query(IndexTransaction.java:102)
at org.janusgraph.diskstorage.BackendTransaction$6.call(BackendTransaction.java:416)
at org.janusgraph.diskstorage.BackendTransaction$6.call(BackendTransaction.java:413)
at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:69)
... 84 more
```

Deleting the `index.search.directory` and reindexing made it work again.

```
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@4dde8976
gremlin> idx = mgmt.getGraphIndex('edges')
==>edges
gremlin> mgmt.updateIndex(idx, SchemaAction.REINDEX)
==>org.janusgraph.diskstorage.keycolumnvalue.scan.StandardScannerExecutor@76e3b45b
gremlin> mgmt.commit()
==>null
gremlin> org.janusgraph.graphdb.database.management.ManagementSystem.awaitGraphIndexStatus(graph, 'edges').status(SchemaStatus.ENABLED).call()
==>GraphIndexStatusReport[success=true, indexName='edges', targetStatus=[ENABLED], notConverged={}, converged={reason=ENABLED, place=ENABLED}, elapsed=PT0.001S]
gremlin> g.E().has('place', geoWithin( Geoshape.circle(37.6, 23.8, 20) )).values('place')
==>POINT (23.9 37.700001)
```

We'll need a migration document to capture this among other things.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Lucene IndexUpgrader behavior and the Gremlin management entry points `mgmt.updateIndex(idx, SchemaAction.REINDEX)` and `awaitGraphIndexStatus`. Document the format incompatibility, the failed upgrade symptom, and the successful delete-and-reindex procedure; done means the migration guidance covers this scenario clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 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.