JanusGraph / JanusGraph/janusgraph
Dynamic traversal source does not get updated without server restart
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
Fresh install of gremlin server with latest code from `master` (0.3.1), fresh install of Cassandra, fresh install of elasticsearch does not update dyanmic traversal sources for graphs created using ConfiguredGraphFactory without doing a server restart.
## Steps to reproduce:
1) Build current master branch (0.3.1)
2) Start gremlin server using [yaml](https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-dist/src/assembly/static/conf/gremlin-server/gremlin-server-configuration.yaml)
3) Create configured graph factory like shown [here](https://gist.github.com/mchandrasekar/5aa505d8dafc2ea836c0f6b71a31cac4).
When [this](https://gist.github.com/mchandrasekar/5aa505d8dafc2ea836c0f6b71a31cac4#file-configuredgraphfactoryremotetraversal-java-L59) is executed `traversalSourceAlias` is not updated in the remote gremlin-server, even though [this](https://github.com/paul-k-civitas/janusgraph/blob/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/management/JanusGraphManager.java#L120) is executed. Because of which the following exception orrucrs
````
The traversal source [graph1_traversal] for alias [g] is not configured on the server.
````
## What fixed the problem:
Changing the `ConfigurationManagementGraph.getConfigurations()` to the code below fixed the issue. For some reason, `graph.traversal().V().has(PROPERTY_TEMPLATE, false)` is not returning any results even in the `gremlin shell` without doing a server restart. But updating this to `graph.traversal().V().hasLabel(VERTEX_LABEL)` is working. This also seemed like a better way to look up configuration vertices.
````
public List> getConfigurations() {
final List> graphConfigurations = graph.traversal().V().hasLabel(VERTEX_LABEL).valueMap().toList();
return graphConfigurations.stream().map(this::deserializeVertexProperties).collect(Collectors.toList());
}
````
Contributor guide
Research direction
Start with ConfigurationManagementGraph.getConfigurations() and the JanusGraphManager path linked in the report, using the Gremlin server YAML and configured graph factory reproduction. Confirm why the configuration lookup misses newly created graphs and verify that the remote traversal source alias updates without restarting the server or raising the reported exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cassandra, elasticsearch, java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100