- nebula 版本:v2-nightly
- 部署方式(分布式 / 单机 / Docker / DBaaS):分布式
- 问题的具体描述
使用UPSERT EDGE,添加了不存在节点的边,发现系统中自动创建不可操作无法检索节点,所有属性均为空(不是null
),这样的幽灵边和幽灵节点存在会导致很多隐性问题。
希望后续版本继续改进,要么不允许这样创建边,要么创建出合法节点,并添加对于该操作说明。
操作日志如下:
>>> nebula_db.show_stats('stock')
[2021-01-06 17:40:28,944]:loading stats ...
+-------+-------------+-------+
| Type | Name | Count |
+-------+-------------+-------+
| Tag | company | 3188 |
| Tag | concept | 163 |
| Tag | industry | 49 |
| Tag | person | 20872 |
| Tag | student | 0 |
| Edge | concept_of | 9442 |
| Edge | employ_of | 21418 |
| Edge | industry_of | 2908 |
| Edge | like | 0 |
| Space | vertices | 24271 |
| Space | edges | 33768 |
+-------+-------------+-------+
>>> src = 'xxxxx1'
>>> dst = 'xxxxx2'
>>> edge_name = 'like'
>>> change_info = {'like': 'xiaoming', 'likeness': 10.0}
>>> nebula_db.upsert_edges(src, dst, edge_name, change_info)
>>> nebula_db.show_stats('stock')
[2021-01-06 17:40:58,521]:loading stats ...
+-------+-------------+-------+
| Type | Name | Count |
+-------+-------------+-------+
| Tag | company | 3188 |
| Tag | concept | 163 |
| Tag | industry | 49 |
| Tag | person | 20872 |
| Tag | student | 0 |(创建了边,创建了可以查询到的幽灵节点,但是索引不到且无法操作)
| Edge | concept_of | 9442 |
| Edge | employ_of | 21418 |
| Edge | industry_of | 2908 |
| Edge | like | 1 |
| Space | vertices | 24271 |
| Space | edges | 33769 |
+-------+-------------+-------+
Concle查询记录如下:
(root@nebula) [stock]> FETCH PROP ON student "xxxxx2"
+----------+--------------+----------------+-------------+
| VertexID | student.name | student.gender | student.age |
+----------+--------------+----------------+-------------+
| "xxxxx2" | | | |
+----------+--------------+----------------+-------------+
Got 1 rows (time spent 2166/3069 us)
Wed, 06 Jan 2021 17:40:49 CST
(root@nebula) [stock]> FETCH PROP ON student "xxxxx1"
+----------+--------------+----------------+-------------+
| VertexID | student.name | student.gender | student.age |
+----------+--------------+----------------+-------------+
| "xxxxx1" | | | |
+----------+--------------+----------------+-------------+
Got 1 rows (time spent 1740/2631 us)
Wed, 06 Jan 2021 17:40:51 CST
(root@nebula) [stock]> UPDATE VERTEX 'xxxxx1' SET student.name='xxx' --无法操作
[ERROR (-8)]: Storage Error: Vertex or edge not found.
Wed, 06 Jan 2021 17:53:24 CST
(root@nebula) [stock]> FETCH PROP ON student "xxxxx1"
+----------+--------------+----------------+-------------+
| VertexID | student.name | student.gender | student.age |
+----------+--------------+----------------+-------------+
| "xxxxx1" | | | |
+----------+--------------+----------------+-------------+
Got 1 rows (time spent 1763/2569 us)
Wed, 06 Jan 2021 17:53:30 CST
(root@nebula) [stock]> CREATE TAG INDEX student_index on student();
Execution succeeded (time spent 7087/7612 us)
Wed, 06 Jan 2021 17:43:41 CST
(root@nebula) [stock]> REBUILD TAG INDEX student_index;
+------------+
| New Job Id |
+------------+
| 140 |
+------------+
Got 1 rows (time spent 5385/6166 us)
Wed, 06 Jan 2021 17:44:17 CST
(root@nebula) [stock]> show job 140;
+----------------+---------------------+------------+------------+------------+
| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time |
+----------------+---------------------+------------+------------+------------+
| 140 | "REBUILD_TAG_INDEX" | "FINISHED" | 1609926257 | 1609926257 |
+----------------+---------------------+------------+------------+------------+
| 0 | "192.168.4.172" | "FINISHED" | 1609926257 | 1609926257 |
+----------------+---------------------+------------+------------+------------+
| 1 | "192.168.4.174" | "FINISHED" | 1609926257 | 1609926257 |
+----------------+---------------------+------------+------------+------------+
| 2 | "192.168.4.173" | "FINISHED" | 1609926257 | 1609926257 |
+----------------+---------------------+------------+------------+------------+
Got 4 rows (time spent 2156/3139 us)
Wed, 06 Jan 2021 17:44:26 CST
(root@nebula) [stock]> LOOKUP ON student --索引不到
Empty set (time spent 2773/3605 us)