DELETE EDGE,删除边,进程一直不结束?

  • nebula 版本:3.8.0
  • 部署方式:分布式,3节点,LINUX
  • 安装方式:RPM
  • 是否上生产环境:N

执行删除边后,进程怀疑死循环了?

  1. 执行如下类似操作,删除边
$v = lookup on player yield id(vertex) as sid;go from $v.sid over * where tags($$) == ["team"] yield src(edge) as src, dst(edge) as dst, rank(edge) as rank | delete edge serve $-.src -> $-.dst @ $-.rank
  1. 前端页面已经报错超时了,执行查询,还能查到待删除的数据
    3.登录服务,3台中,只有1台服务器,CPU资源占用一直不停,cpu有个线程一直是100%,磁盘IO很低
  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
11644 root      20   0   46.0g   7.2g  12236 R 99.9 11.5  95:17.37 executor-pri3-3
11581 root      20   0   46.0g   7.2g  12236 S  0.0 11.5   0:00.03 nebula-storaged
11590 root       7 -13   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri0-1
11591 root       7 -13   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri0-2
11592 root      13  -7   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri1-1
11593 root      13  -7   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri1-2
11594 root      13  -7   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri2-1
11595 root      13  -7   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri2-2
11596 root      20   0   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri3-1
11597 root      20   0   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri3-2
11598 root      20   0   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri3-4
11600 root      20   0   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri3-3
11602 root      20   0   46.0g   7.2g  12236 S  0.0 11.5   0:00.00 executor-pri3-5

线程堆栈如下:

Thread 1 (process 11644):
#0  0x00007f4574124e75 in __memcmp_sse4_1 () from /lib64/libc.so.6
#1  0x0000000001214ed3 in __gnu_cxx::__normal_iterator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*, std::vector<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > std::__find_if<__gnu_cxx::__normal_iterator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*, std::vector<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, __gnu_cxx::__ops::_Iter_equals_val<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const> >(__gnu_cxx::__normal_iterator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*, std::vector<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, __gnu_cxx::__normal_iterator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*, std::vector<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, __gnu_cxx::__ops::_Iter_equals_val<std::tuple<int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const>, std::random_access_iterator_tag) ()
#2  0x0000000001212db3 in nebula::storage::DeleteEdgesProcessor::process(nebula::storage::cpp2::DeleteEdgesRequest const&) ()
#3  0x00000000011dc9bd in nebula::storage::GraphStorageServiceHandler::future_deleteEdges(nebula::storage::cpp2::DeleteEdgesRequest const&) ()
#4  0x0000000001633542 in nebula::storage::cpp2::GraphStorageServiceSvIf::async_tm_deleteEdges(std::unique_ptr<apache::thrift::HandlerCallback<nebula::storage::cpp2::ExecResponse>, std::default_delete<apache::thrift::HandlerCallback<nebula::storage::cpp2::ExecResponse> > >, nebula::storage::cpp2::DeleteEdgesRequest const&) ()
#5  0x0000000001657513 in void nebula::storage::cpp2::GraphStorageServiceAsyncProcessor::process_deleteEdges<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>(std::unique_ptr<apache::thrift::ResponseChannelRequest, apache::thrift::RequestsRegistry::Deleter>, apache::thrift::SerializedCompressedRequest&&, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*) ()
#6  0x0000000001638c63 in apache::thrift::RequestTask<nebula::storage::cpp2::GraphStorageServiceAsyncProcessor>::run() ()
#7  0x000000000220f757 in virtual thunk to apache::thrift::concurrency::FunctionRunner::run() ()
#8  0x000000000236b2b8 in apache::thrift::concurrency::ThreadManager::Impl::Worker::run() ()
#9  0x000000000236d3be in apache::thrift::concurrency::PthreadThread::threadMain(void*) ()
#10 0x00007f457438fea5 in start_thread () from /lib64/libpthread.so.0
#11 0x00007f45740b896d in clone () from /lib64/libc.so.6

从堆栈看,一直是在执行nebula::storage::DeleteEdgesProcessor::process函数

怀疑:

  1. 数据太多?删除很慢?明天早上再来看看结束了没
  2. 进程有BUG?死循环了。

这个删除是比较慢的,尤其是数据量大的情况

查询很快,删除也很快,但是通过管道符拼接在一起就很慢,是为什么

删除很快是怎么看出来的?
上面这个语句删除我理解应该数据量还是不小的

就是我之前有一批数据要删,直接用 lookup 查出来基本上几十毫秒就查出来,然后手动吧 id 复制出来,写成 delete 语句执行,也是几十毫秒就结束了,但是用管道符号拼在一起就会执行好几分钟

1 个赞

先看一下lookup查出来要多久,大概有多少数据,数据多的话建议中间加一下 limit 分批处理

1 个赞

这样啊,比较奇怪的现象。你语句方便的时候贴出来看看?

确实,早上起来发现跑完了,数据也删除完成了,没有问题了,就是慢,不知道进度条

GO FROM '1234' OVER C REVERSELY YIELD id($$) as n, id($^) as cid
| limit 150
| delete vertex $-.cid with edge
1 个赞

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。