JanusGraph / JanusGraph/janusgraph

Lucene index long overflow

Open
#3,154 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug/possible
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/92505129#6571
- Expected Behavior:
I would expect the queries to not throw any exceptions.
- Current Behavior:
A `PermanentBackendException` is thrown because of an `ArithmeticException` in the `LuceneIndex` class.
- Steps to Reproduce:
```java
PropertiesConfiguration conf = ConfigurationUtil.loadPropertiesConfig("conf/test.properties");
JanusGraph graph = JanusGraphFactory.open(conf);

JanusGraphManagement m = graph.openManagement();
PropertyKey key = m.makePropertyKey("prop").dataType(Long.class).make();
m.buildIndex("propIndex", Vertex.class).addKey(key).buildMixedIndex("search");
m.commit();

graph.traversal()
.V()
.has("prop", P.neq(Long.MAX_VALUE))
.next();

graph.traversal()
.V()
.has("prop", P.inside(Long.MAX_VALUE, 0L))
.next();

graph.traversal()
.V()
.has("prop", P.outside(Long.MIN_VALUE, 0L))
.next();
```
With the following configuration:
```
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=inmemory
index.search.backend=lucene
index.search.directory=data/searchindex
```
The bug seems to happen for `P.neq`, `P.inside` and `P.outside` both with `MIN_VALUE` and `MAX_VALUE`.

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 LuceneIndex class and reproduce the issue using the supplied in-memory storage, Lucene configuration, and Long property queries. Check the P.neq, P.inside, and P.outside cases at Long.MIN_VALUE and Long.MAX_VALUE; done means these queries no longer throw PermanentBackendException or ArithmeticException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases, search
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.