Repository: thinkaurelius/titan

Issue #212: Vertices Not Deleting Fully
Created: 2013-04-06T10:14:03Z
Vertices only partially deleting under certain conditions.  First reported here:
https://groups.google.com/forum/#!topic/gremlin-users/m5RjyS97iNA
To recreate:

Start Titan Server:

bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties`


Start gremlin and connect to titan server and add a few vertices:

gremlin> g = TitanFactory.open('bin/cassandra.local')
==>titangraph[cassandrathrift:127.0.0.1]
gremlin> g.addVertex([name:'allen'])
==>v[4]
gremlin> g.addVertex([name:'rick'])
==>v[8]
gremlin> g.addVertex([name:'sandy'])
==>v[12]
gremlin> g.commit()
==>null
gremlin> g.V
==>v[4]
==>v[8]
==>v[12]


You should be able to curl that out via REST:

curl http://localhost:8182/graphs/graph/vertices
{"version":"2.3.0","results":[{"name":"allen","_id":4,"_type":"vertex"},{"name":"rick","_id":8,"_type":"vertex"},{"name":"sandy","_id":12,"_type":"vertex"}],"totalSize":3,"queryTime":270.671319}


You should be able to remove all those vertices via REST:

curl "http://localhost:8182/graphs/graph/tp/gremlin?script=g.V.remove();g.commit()"
{"results":null,"success":true,"version":"2.3.0","queryTime":843.982107}


But they are still there...sort of.  They are listed but have no properties:

curl http://localhost:8182/graphs/graph/vertices{"version":"2.3.0","results":[{"_id":4,"_type":"vertex"},{"_id":8,"_type":"vertex"},{"_id":12,"_type":"vertex"}],"totalSize":3,"queryTime":26.497273}


So check in Gremlin REPL and see what it says:

gremlin> g.V
gremlin> 

Apparently they were deleted.

It must be a problem with Rexster.  Maybe a lurking cache somewhere in memory.  Perhaps some trick of multithreading.  So...restart Titan Server and try to grab the data again:

gremlin> g = TitanFactory.open('bin/cassandra.local')
==>titangraph[cassandrathrift:127.0.0.1]
gremlin> g.V
gremlin> 

Gremlin is good...what about REST:
curl http://localhost:8182/graphs/graph/vertices
{"version":"2.3.0","results":[{"_id":4,"_type":"vertex"},{"_id":8,"_type":"vertex"},{"_id":12,"_type":"vertex"}],"totalSize":3,"queryTime":231.322573}

Still showing those "empty" vertices.  What about Rexster Console:
rexster[groovy]> g = rexster.getGraph('graph')
==>titangraph[embeddedcassandra:null]
rexster[groovy]> g.V
==>v[4]
==>v[8]
==>v[12]
rexster[groovy]> g.V.map
==>{}
==>{}
==>{}

Same problem.  The fact that restarting Titan Server doesn't fix the problem seems to indicated that Rexster is not the problem as it maintains no state itself between stop/start. The fact that Gremlin REPL is working properly seems to indicate that the problem is not in Titan as we're removing layers from the stack and simplifying.

Duplicate issue #213: deleted vertices can still be loaded from a separate transaction with getVertices
Created: 2013-04-06T22:45:49Z
I've created a test case that reproduces
https://gist.github.com/bdeggleston/5320684
this may be the same issue reported here:
#212

Closing comment (2013-05-03T00:34:57Z): I added a test case and it looks like its related to #212 as you suggested. We have disabled vertex iteration when using BoP with embedded cassandra for now and are looking into possible ways to make it work.