Cached schema not updated when using management.addProperties, management.addConnection
#1.319 aberto em 13 de nov. de 2018
Métricas do repositório
- Stars
- (4.985 stars)
- Métricas de merge de PR
- (Mesclagem média 3d 18h) (12 fundiu PRs em 30d)
Description
We're currently building out a schema and testing how to update that schema in the future. We want to use management.addProperties() to map properties to vertices and management.addConnection() to map which vertices can be connected via which edges as seen in the docs. This works fine for the initial schema commit. We can see the changes immediately. However, if we do another schema commit where we create a new PropertyKey and map it to an existing VertexLabel via addProperties (after data has been added to the graph), then the changes to the schema are not immediately seen.
As an example, let's say we have a "animal" VertexLabel initially mapped to a "name" PropertyKey. This is committed and working well. We create an animal vertex. Then we create a new PropertyKey called "color" and map it to the "animal" VertexLabel with a management.addProperties(animal, color); call. Once this has been committed, we can see the new "color" PropertyKey immediately, but it is not mapped to the "animal" VertexLabel until we restart the JanusGraph server.
We're currently running JanusGraph in server mode, connecting to it remotely via a java app. We are running the schema updates when the java app starts via a call to client.submit(), connecting via a Cluster object.
Error received when trying to update the animal vertex with new property:
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Property Key constraint does not exist for given Vertex Label [animal] and property key [color].
The error above goes away once the JanusGraph server is restarted.
The same behavior is seen when adding new connections via management.addConnection().
Problem was originally discussed on janusgraph-users .
Please let me know if any additional information is needed.