Match 使用索引查询点,边的属性也要求索引,删除边索引后再查询graphd会crash

提问参考模版:

  • nebula 版本:2.5
  • 部署方式(分布式 / 单机 / Docker / DBaaS):单机
  • 是否为线上版本:Y / N
  • 硬件信息
    • 磁盘( 推荐使用 SSD)
    • CPU、内存信息
  • 问题的具体描述.

本来是一个索引的问题,没想到复现的时候graphd直接崩了。。。
首先给点 t1 创建 age属性的索引,可以使用
match (v)-[e]-() where v.age==12 return v


然后想对边的属性做过滤
match (v)-[e]-() where v.age==toInteger(“11”) and e.transtime > 10000 return v
此时提示没有找到对应的索引
然后对边的transtime 创建了索引,此时查询正常。
本来想提问,点使用索引查找时,边应该不需要索引才对。
然后我把边的索引删除掉,同时rebuild index
想进行复现来提问,没想到复现的时候graphd 直接crash了

经过多次测试发现是因为使用索引查询的时候未指定label就会crash,
比如

MATCH p=(v) -[e]->(v2) where v.name =="name33" RETURN p;

请dev看一下,顺便问下点使用索引查询时,边能否不限制索引,我理解此时应该已经不需要索引了。

github issue https://github.com/vesoft-inc/nebula-graph/issues/1356

3 个赞

你确定用2.5的话,这个query能运行吗?我们2.5不支持这种查询的啊。

确实是2.5版本的


而且崩溃产生的core文件都有
image

1 个赞

能不能发下你的schema,这个query其实也是跑不起来的啊。

schema 如下:

(root@nebula) [product_28]> show create tag t1
+------+-----------------------------------+
| Tag  | Create Tag                        |
+------+-----------------------------------+
| "t1" | "CREATE TAG `t1` (                |
|      |  `values` string NULL,            |
|      |  `name` string NULL,              |
|      |  `age` int64 NULL                 |
|      | ) ttl_duration = 0, ttl_col = """ |
+------+-----------------------------------+
(root@nebula) [product_28]> show create edge tt1
+-------+-----------------------------------+
| Edge  | Create Edge                       |
+-------+-----------------------------------+
| "tt1" | "CREATE EDGE `tt1` (              |
|       |  `transtime` int64 NULL,          |
|       |  `num` int64 NULL,                |
|       |  `remark` string NULL             |
|       | ) ttl_duration = 0, ttl_col = """ |
+-------+-----------------------------------+
(root@nebula) [product_28]> show create  tag index index_name_t1
+-----------------+---------------------------------------------+
| Tag Index Name  | Create Tag Index                            |
+-----------------+---------------------------------------------+
| "index_name_t1" | "CREATE TAG INDEX `index_name_t1` ON `t1` ( |
|                 |  `name`(10)                                 |
|                 | )"                                          |
+-----------------+---------------------------------------------+
(root@nebula) [product_28]> show create  tag index index_values_t1
+-------------------+-----------------------------------------------+
| Tag Index Name    | Create Tag Index                              |
+-------------------+-----------------------------------------------+
| "index_values_t1" | "CREATE TAG INDEX `index_values_t1` ON `t1` ( |
|                   |  `values`(3)                                  |
|                   | )"                                            |
+-------------------+-----------------------------------------------+

core 文件贴在这里,你可以看下。
https://space.dingtalk.com/s/gwHOAxyKUALOEVwinwPaACBlMDI1YjRkODU2NDc0MTdjYTExNTc4OWQzYmUwZjYxZQ 密码: yf7R

你能用gdb看下调用栈吗 :grinning:

具体怎么操作,C++相关的操作不会啊 :sob:


使用了where,你看下还需要什么操作。

gdb bin/nebula-graphd core.30074
用这个命令

[root@template nebula-2.5]# gdb bin/nebula-graphd core.30074
GNU gdb (GDB) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bin/nebula-graphd...done.
[New LWP 30095]
[New LWP 30091]
[New LWP 30099]
[New LWP 30075]
[New LWP 30096]
[New LWP 30078]
[New LWP 30076]
[New LWP 30097]
[New LWP 30098]
[New LWP 30077]
[New LWP 30100]
[New LWP 30090]
[New LWP 30089]
[New LWP 30088]
[New LWP 30074]
[New LWP 30087]
[New LWP 30086]
[New LWP 30084]
[New LWP 30093]
[New LWP 30083]
[New LWP 30079]
[New LWP 30094]
[New LWP 30082]
[New LWP 30092]
[New LWP 30085]
[New LWP 30081]
[New LWP 30080]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/local/nebula-2.5/bin/nebula-graphd --flagfile /usr/local/nebula-2.5/etc/ne'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000f298e1 in nebula::graph::LabelIndexSeek::pickEdgeIndex(nebula::graph::EdgeContext const*) ()
[Current thread is 1 (Thread 0x7f16d9dfe700 (LWP 30095))]
(gdb) where 
#0  0x0000000000f298e1 in nebula::graph::LabelIndexSeek::pickEdgeIndex(nebula::graph::EdgeContext const*) ()
#1  0x0000000000f29a19 in nebula::graph::LabelIndexSeek::matchEdge(nebula::graph::EdgeContext*) ()
#2  0x0000000000f1ba80 in nebula::graph::MatchClausePlanner::findStarts(nebula::graph::MatchClauseContext*, bool&, unsigned long&, nebula::graph::SubPlan&) ()
#3  0x0000000000f1ed44 in nebula::graph::MatchClausePlanner::transform(nebula::graph::CypherClauseContextBase*) ()
#4  0x0000000000f1af43 in nebula::graph::MatchPlanner::transform(nebula::graph::AstContext*) ()
#5  0x0000000000f12797 in nebula::graph::Planner::toPlan(nebula::graph::AstContext*) ()
#6  0x0000000000e66aff in nebula::graph::Validator::toPlan() ()
#7  0x0000000000e67a06 in nebula::graph::Validator::validate() ()
#8  0x0000000000e73b21 in nebula::graph::SequentialValidator::validateImpl() ()
#9  0x0000000000e67992 in nebula::graph::Validator::validate() ()
#10 0x0000000000e6b510 in nebula::graph::Validator::validate(nebula::Sentence*, nebula::graph::QueryContext*) ()
#11 0x0000000000e23c1c in nebula::graph::QueryInstance::validateAndOptimize() ()
#12 0x0000000000e23f7f in nebula::graph::QueryInstance::execute() ()
#13 0x0000000000e1fa66 in nebula::graph::QueryEngine::execute(std::unique_ptr<nebula::graph::RequestContext<nebula::ExecutionResponse>, std::default_delete<nebula::graph::RequestContext<nebula::ExecutionResponse> > >) ()
#14 0x0000000000e03f41 in _ZN5folly6detail8function14FunctionTraitsIFvRNS_7futures6detail8CoreBaseEONS_8Executor9KeepAliveIS7_EEPNS_17exception_wrapperEEE9callSmallIZNS4_4CoreIN6nebula8StatusOrISt10shared_ptrINSH_5graph13ClientSessionEEEEE11setCallbackIZNS4_10FutureBaseISN_E18thenImplementationIZNOS_6FutureISN_E9thenValueIZNSK_12GraphService14future_executeElRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEUlSN_E_EENST_INS4_19valueCallableResultISN_T_E10value_typeEEEOS17_EUlSA_ONS_3TryISN_EEE_NS4_25tryExecutorCallableResultISN_S1F_vEEEENSt9enable_ifIXntsrNT0_13ReturnsFutureE5valueENS1J_6ReturnEE4typeES1B_S1J_NS4_18InlineContinuationEEUlSA_S1E_E_EEvS1B_OSJ_INS_14RequestContextEES1O_EUlS6_SA_SC_E_EEvS6_SA_SC_RNS1_4DataE ()
#15 0x0000000001c3667c in ?? ()
#16 0x0000000001a3eda7 in virtual thunk to apache::thrift::concurrency::FunctionRunner::run() ()
#17 0x0000000001b4f503 in apache::thrift::concurrency::ThreadManager::Impl::Worker::run() ()
#18 0x0000000001b5315d in apache::thrift::concurrency::PthreadThread::threadMain(void*) ()
#19 0x00007f16df988ea5 in start_thread () from /lib64/libpthread.so.0
#20 0x00007f16df6b19fd in clone () from /lib64/libc.so.6
(gdb) 

边的索引是怎么建的呢?

边没有建索引

好的,已经提交了一个bug fix了。确实是bug。另外我们当前使用match的话,要指定tag的,否则是不能执行的。

2 个赞

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