JanusGraph/janusgraph

Cached schema not updated when using management.addProperties, management.addConnection

Open

#1,319 创建于 2018年11月13日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)Java (1,137 fork)batch import
help wantedkind/bug/possible

仓库指标

Star
 (4,985 star)
PR 合并指标
 (平均合并 3天 18小时) (30 天内合并 12 个 PR)

描述

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.

贡献者指南