Violation of UNIQUE INDEX deleted the property from the all the all ready existed vertex


Krishna Sailesh <krishna...@...>
 

Hi,

i have created a Unique Composite Index for vertices with id, name properties.
  1. create a vertex with an id(-109), name("test").
  2. take the already created vertex which is having different id(-201654672484678624),name('test") which are having few properties like age, createdTime, gender, etc
  3. try to update the already available vertex stated in point 2 with id(-109) of vertex stated in point 1
  4. then the following exception is thrown which is expected
    1. Adding this property for key [id] and value [-109] violates a uniqueness constraint [newUniqueIndex]Type ':help' or ':h' for help.Display stack trace? [yN]yorg.janusgraph.core.SchemaViolationException: Adding this property for key [id] and value [-109] violates a uniqueness constraint [newUniqueIndex]{{ at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addProperty(StandardJanusGraphTx.java:817)}}{{ at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addProperty(StandardJanusGraphTx.java:745)}}{{ at org.janusgraph.graphdb.vertices.AbstractVertex.property(AbstractVertex.java:152)}}{{ at org.janusgraph.core.JanusGraphVertex.property(JanusGraphVertex.java:72)}}{{ at org.janusgraph.core.JanusGraphVertex.property(JanusGraphVertex.java:33}}{{}}
  5. But the unexpected thing happening is the id(-201654672484678624) property of the vertex stated in point is removed from it
can you please help me to solve the issue as there is a loss in data as we can't retrive the data which is lost.


attaching the console logs of reproducing the issue through gremlin console


Thanks
Krishna Jalla


Krishna Sailesh <krishna...@...>
 

Hi,

I am using Cassandra database as backend and elastic search for indexing

Thanks
Krishna Jalla


On Friday, June 5, 2020 at 8:13:40 PM UTC+5:30, Krishna Sailesh wrote:
Hi,

i have created a Unique Composite Index for vertices with id, name properties.
  1. create a vertex with an id(-109), name("test").
  2. take the already created vertex which is having different id(-201654672484678624),name('test") which are having few properties like age, createdTime, gender, etc
  3. try to update the already available vertex stated in point 2 with id(-109) of vertex stated in point 1
  4. then the following exception is thrown which is expected
    1. Adding this property for key [id] and value [-109] violates a uniqueness constraint [newUniqueIndex]Type ':help' or ':h' for help.Display stack trace? [yN]yorg.janusgraph.core.SchemaViolationException: Adding this property for key [id] and value [-109] violates a uniqueness constraint [newUniqueIndex]{{ at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addProperty(StandardJanusGraphTx.java:817)}}{{ at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addProperty(StandardJanusGraphTx.java:745)}}{{ at org.janusgraph.graphdb.vertices.AbstractVertex.property(AbstractVertex.java:152)}}{{ at org.janusgraph.core.JanusGraphVertex.property(JanusGraphVertex.java:72)}}{{ at org.janusgraph.core.JanusGraphVertex.property(JanusGraphVertex.java:33}}{{}}
  5. But the unexpected thing happening is the id(-201654672484678624) property of the vertex stated in point is removed from it
can you please help me to solve the issue as there is a loss in data as we can't retrive the data which is lost.


attaching the console logs of reproducing the issue through gremlin console


Thanks
Krishna Jalla