JanusGraph / JanusGraph/janusgraph

Solr index contains stale values after vertex property is updated

Open
#1,050 1 comment 0 reactions 0 assignees View on GitHub
index/solr
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

Note that this occurs on a multivalued property, defined on JanusGraph with `Cardinality.list` and on Solr with `multivalued=true`. I am not aware of the behavior of single-valued properties.

When a vertex property is updated either by removing and then recreating the property, or simply assigning the property using `Cardinality.single`, the graph data is accurately updated but Solr is not. On Solr, it seems the old value is maintained and the new one is simply appended.

Steps to reproduce:
- Create a graph and add some data, ensuring that the solr index is also created and you can view your vertices in the Solr UI. Take note of the data on a specific vertex on Solr.
- On the Gremlin shell, update a property value as follows:
`v.property(VertexProperty.Cardinality.single, "Gender", "F")`
- Commit the change:
`graph.tx().commit()`
- After a few seconds, refresh Solr and take another look at the vertex.

Expected:
- The new value replaces the old one on the graph.
- The new value replaces the old one on Solr.

Actual:
- The new value replaces the old one on the graph.
- The new value is **appended** to the old one on Solr.

The only way the behavior is as expected is if the vertex property is removed, change committed, vertex property added, change committed again, which essentially nullifies the effect of committing things in batches, and also potentially leaves the graph in an inconsistent state if an error occurs after the first commit.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from the Gremlin shell using a multivalued Solr property, update it with Cardinality.single, commit, and compare the graph with the Solr UI. Trace how the committed property update reaches Solr; done means the new value replaces the old value in both the graph and Solr without separate removal and addition commits.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.