Closed tmljob closed 2 years ago
目前,我们的场景是有一批数据写入时候弄错了,需要在2亿中删除2000万个边。当时没搞定,一批一批删除也不现实。最后把其他类型的数据重新灌入。 关注该问题,也希望官方能给个最佳实践方案。
大量删除数据一般会导致性能下降(产生大量墓碑),建议使用TTL或者标记删除。
实在需要删除的话,需要将drop改为迭代删除:
t = g.V().hasLabel('rel_D_wuqianw')
while (t.hasNext()) {
t.next().remove()
graph.tx().commitIfGtSize(500)
}
大量删除数据一般会导致性能下降(产生大量墓碑),建议使用TTL或者标记删除。
实在需要删除的话,需要将drop改为迭代删除:
t = g.V().hasLabel('rel_D_wuqianw') while (t.hasNext()) { t.next().remove() graph.tx().commitIfGtSize(500) }
这个迭代删除,在Hubble以异步任务执行时,为什么会自动加上limit(250)的限制? @javeme
{
"task_name": "t = g.V().hasLabel('rel_D_wuqianw').limit(250)",
"task_progress": 0,
"task_create": 1608083914414,
"task_status": "success",
"task_update": 1608083914763,
"task_result": "[]",
"task_retries": 0,
"id": 26,
"task_type": "gremlin",
"task_callable": "com.baidu.hugegraph.job.GremlinJob",
"task_input": "{\"gremlin\":\"t = g.V().hasLabel('rel_D_wuqianw').limit(250)\\nwhile (t.hasNext()) {\\n t.next().remove()\\n graph.tx().commitIfGtSize(500)\\n}\",\"aliases\":{\"daas\":\"graph\"},\"bindings\":{},\"language\":\"gremlin-groovy\"}",
"task_server": "server-1"
}
@lxb1111 关注一下执行任务的时候是否会加上.limit(250)
好的
已经确认,确实存在相关问题,谢谢反馈。我们会尽快修复完成!
在Hubble以异步任务执行时,为什么会自动加上limit(250)的限制?
limit问题在 https://github.com/hugegraph/hugegraph-hubble/pull/285 中修复了。
大量删除顶点建议使用异步任务,并且使用迭代方式删除,参考:https://github.com/hugegraph/hugegraph/issues/1298#issuecomment-745170866
Expected behavior 期望表现
在hubble执行gremlin任务,删除某个顶点的数据,能够正常删除。
说明: 1、顶点数据量5kw; 2、server0.11.2+hubble1.5.0
Actual behavior 实际表现
任务执行失败,报如下错误:com.baidu.hugegraph.exception.LimitExceedException: Vertices size has reached tx capacity 10000
server的log如下: