TITAN: Gremlin query returns inconsistent results when re-executed

I am running REXSTER / TITAN 0.4 over cassandra and using gremlin for traversals. I ran below gremlin request in Rexster Doghouse Gremlin console.

Vertex 92 was removed earlier because it was a duplicate vertex with the same key ("eddy.com")

But when I ask, I sometimes get that top and sometimes I don't. This is done in the local dev machine means no other threads or parallel task is starting / updating that vertex in between. Are there any settings / settings missing here? this is mistake? please, help!

gremlin> g.V('domain','eddy.com')

==>v[88]
gremlin> g.V('domain','eddy.com')

==>v[88]
==>v[92]
gremlin> g.V('domain','eddy.com')

==>v[88]
gremlin> g.V('domain','eddy.com')

==>v[88]
gremlin> g.V('domain','eddy.com')

==>v[88]
==>v[92]

      

+3


source to share


1 answer


You didn't say how your deletion happened, but the question almost always boils down to an uncommitted or outdated transaction. In other words, it is either:

  • Unable to execute delete transaction.
  • The transaction was completed, but the requesting party did not start a new transaction and thus receives cached data.

So, don't forget to call g.commit()

after you draw the mutation. Then when you navigate to the request (in a different context like Rexster Console, Dog House, etc.), before you execute the request, remember g.rollback()

to make sure you are not reading something outdated.



If you are wondering why you saw deleted data in some cases and not others, it is because issuing a request to Rexster can be processed on a stream with a fresh transaction state (or not), giving you different results.

In case it is none of these things and possibly a bug, I can only recommend that you update Titan 0.5.4.

+3


source







All Articles