thinkaurelius / titan

Distributed Graph Database
http://titandb.io
Apache License 2.0
5.25k stars 1.01k forks source link

Cannot delete "poisonous" element from graph #1364

Open rsteppac opened 8 years ago

rsteppac commented 8 years ago

I am in the process of migrating from Titan 0.5.4 to 1.0.0. To maintain our data model I had to implement a custom serializer for collections (of Java native types). That serializer utilizes com.thinkaurelius.titan.graphdb.database.serialize.attribute.StringSerializer to store the JSON serialized collection as a string. While playing with the serializer I managed to create edges that could neither be read nor deleted. Neither via Java code nor the Gremlin shell. The exception I received is this:

Caused by: java.lang.IllegalArgumentException: Invalid ASCII encoding offset: 176
    at com.thinkaurelius.titan.graphdb.database.serialize.attribute.StringSerializer.read(StringSerializer.java:105)
    at ch.vivates.ams.graph.titan.serializer.AbstractCollectionJsonSerializer.read(AbstractCollectionJsonSerializer.java:28)
    at ch.vivates.ams.graph.titan.serializer.AbstractCollectionJsonSerializer.read(AbstractCollectionJsonSerializer.java:14)
    at com.thinkaurelius.titan.graphdb.database.serialize.StandardSerializer.readObjectNotNullInternal(StandardSerializer.java:259)
    at com.thinkaurelius.titan.graphdb.database.serialize.StandardSerializer.readObjectInternal(StandardSerializer.java:249)
    at com.thinkaurelius.titan.graphdb.database.serialize.StandardSerializer.readObject(StandardSerializer.java:229)
    at com.thinkaurelius.titan.graphdb.database.EdgeSerializer.readPropertyValue(EdgeSerializer.java:191)
    at com.thinkaurelius.titan.graphdb.database.EdgeSerializer.readInline(EdgeSerializer.java:177)
    at com.thinkaurelius.titan.graphdb.database.EdgeSerializer.parseRelation(EdgeSerializer.java:149)
    at com.thinkaurelius.titan.graphdb.database.EdgeSerializer.readRelation(EdgeSerializer.java:60)
    at com.thinkaurelius.titan.graphdb.transaction.RelationConstructor.readRelationCache(RelationConstructor.java:27)
    at com.thinkaurelius.titan.graphdb.relations.CacheEdge.getPropertyMap(CacheEdge.java:90)
    at com.thinkaurelius.titan.graphdb.relations.CacheEdge.getPropertyKeysDirect(CacheEdge.java:102)
    at com.thinkaurelius.titan.graphdb.database.IndexSerializer.getIndexUpdates(IndexSerializer.java:264)
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.prepareCommit(StandardTitanGraph.java:517)
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.commit(StandardTitanGraph.java:702)
    at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.commit(StandardTitanTx.java:1352)
    ... 39 more

The exception is thrown when trying to read any property of the offending edge and also when attempting to delete it. E.g. a

gremlin> traversal.E('5onz-j5k-6c5-cu0').drop()
gremlin> graph.tx().commit()

would yield above exception on commit.