TITAN:Gremlin查询在重复执行时返回不一致的结果 [英] TITAN : Gremlin query returns inconsistent results on repeated execution

查看:283
本文介绍了TITAN:Gremlin查询在重复执行时返回不一致的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Cassandra上运行REXSTER / TITAN 0.4并使用gremlin进行遍历。
我在Rexster Doghouse Gremlin控制台的gremlin查询下运行。



Vertex 92之前被删除,因为它是一个具有相同键的重复顶点(eddy.com )



但是当我查询时,我有时会得到顶点,有时候不会。
这是在本地开发机器上运行,意味着没有其他线程或并行任务正在运行/更新之间的这个顶点。
我是否错过了这里的任何配置/设置?这是一个错误?请帮助!

  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> gV('domain','eddy.com')

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


解决方案

您没有说明您的删除是如何发生的,但这个问题几乎总是归结为未提交或陈旧的交易。换句话说,它可以是:


  1. 删除事务未提交

  2. 事务已提交但查询方没有启动新的事务并因此获取缓存的数据。

因此,一定要调用 g.commit()在你做图表变异之后。然后,当您查询时(在Rexster Console,Dog House等不同的环境中),请确保您在查询之前确保 g.rollback()>没有看到陈旧的东西。

如果您想知道为什么您会在某些情况下看到已删除的数据,而不是其他情况,这是因为向Rexster发出请求可能会在一个新鲜的线程中处理交易状态(或不)给你不同的结果。



有可能它既不是这些东西,也可能是一个bug,我只能建议你更新到Titan 0.5.4。


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

Vertex 92 was deleted earlier, since it was a duplicate vertex with same key ("eddy.com")

But when I am querying, I am getting that vertex sometimes, and sometimes not . This is running in local dev machine, means no other threads or parallel task is running/updating this vertex in between. Am I missing any configuration/settings here? is this a bug? 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]

解决方案

You didn't say how your deletion occurred, but this issue almost always boils down to a uncommitted or stale transaction. In other words, it's either:

  1. The deleting transaction was not committed
  2. The transaction was committed but the querying side did not start a new transaction and is thus getting cached data.

So, be sure to call g.commit() after you do you graph mutation. Then, when you go to query (in a different context like Rexster Console, Dog House, etc.), be sure to g.rollback() before you query to ensure you aren't reading something stale.

If you're wondering why you would see the removed data in some cases and not others, it's because issuing a request to Rexster might get handled in a thread with a fresh transaction state (or not) giving you differing results.

On the chance that it is neither of these things and possibly a bug, I can only recommend that you update to Titan 0.5.4.

这篇关于TITAN:Gremlin查询在重复执行时返回不一致的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆