Storage 2.0.1版本,db_dump工具的vid为int64类型问题

1、创建空间,指定vid为int64类型
CREATE SPACE xxx(PARTITION_NUM=6,vid_type=int64)
2、创建标签
CREATE TAG test*(name string,age int)
并插入部分数据

采用db_dump查询。 space_name +mode=scan查询。
命令如下
./db_dump --space_name=xxx --db_path=数据目录 --meta_server=xxx.xxx.xxx.xxx:端口 --mode=scan --limit=0
插线查询出来的VID,显示存在乱码。
如果基于VID查询,则查询不出来出数据

感谢,我可以重现这个问题,issue 提在这里: https://github.com/vesoft-inc/nebula-storage/issues/531

(root@nebula) [test]> show create tag test_tag
+------------+-----------------------------------+
| Tag        | Create Tag                        |
+------------+-----------------------------------+
| "test_tag" | "CREATE TAG `test_tag` (          |
|            |  `name` string NULL               |
|            | ) ttl_duration = 0, ttl_col = """ |
+------------+-----------------------------------+

(root@nebula) [test]> INSERT VERTEX test_tag (name) VALUES 13:("n3"), 14:("n4");
Execution succeeded (time spent 2825/7967 us)

Thu, 22 Jul 2021 15:05:01 CST

(root@nebula) [test]> INSERT VERTEX test_tag (name) VALUES 1312:("n312"), 1412:("n412");
Execution succeeded (time spent 1816/15255 us)
sh-4.2# ./db_dump -space_name=test -db_path=/data/storage/nebula/ -meta_server=metad0:9559 -mode=scan -limit=0
===========================PARAMS============================
mode: scan
meta server: metad0:9559
space name: test
path: /data/storage/nebula/
parts:
vids:
tags:
edges:
limit: 0
===========================PARAMS============================

===========================STATISTICS============================
COUNT: 0
VERTEX COUNT: 0
EDGE COUNT: 0
TAG STATISTICS:
EDGE STATISTICS:
============================STATISTICS===========================
Time cost: 124 us

sh-4.2# ./db_dump -space_name=test -db_path=/data/storage/nebula/ -meta_server=metad0:9559 -mode=scan -limit=0
===========================PARAMS============================
mode: scan
meta server: metad0:9559
space name: test
path: /data/storage/nebula/
parts:
vids:
tags:
edges:
limit: 0
===========================PARAMS============================

[vertex] key: 3, , test_tag value: "n4",
[vertex] key: 3, �, test_tag value: "n412",
===========================STATISTICS============================
COUNT: 2
VERTEX COUNT: 2
EDGE COUNT: 0
TAG STATISTICS:
	test_tag : 2
EDGE STATISTICS:
============================STATISTICS===========================
Time cost: 156 us

因为工作原因,不能贴图。感谢重视。
首先是打印乱码问题。
DbDumper.cpp类。2.0.1版本。
std::cout << "[vertex] key: " << part << ", " << vid << ", " << getTagName(tagId);
我这边准备修改vid 的打印,有什么好的建议吗?

看这个 pr https://github.com/vesoft-inc/nebula-storage/pull/533

1 个赞

太 cool 了 :rocket:

另外, 其实 db_dump 工具并没有很大优势了哈,之前一部分是用来统计数据的,我们现在封装了 stats job,不推荐用它来统计哈。

我还在改呢,感谢啊。我仔细看下,我们也遇到这个问题。准备修复

stats job,目前有这个相关的文档吗?那我们也可以考虑采用你说的stats job,尝试用一下

https://docs.nebula-graph.com.cn/2.0.1/3.ngql-guide/7.general-query-statements/6.show/14.show-stats/

提交一个 stats job ( 作业管理 - Nebula Graph Database 手册 )

然后 SHOW STATS;

还有个问题。
./db_dump -space_name=test -db_path=/data/storage/nebula/ -meta_server=metad0:9559 -mode=scan -limit=0 --vids= vid的数值

这时,查不到数据的。看下面.(增加了–vids参数)

root@host-xxxx.xxx.xx.xx bin]# ./db_dump --space_name=spacenameA --db_path=//nebula --meta_server=...:*** --mode=scan --limit=0 --vids=200
===========================PARAMS============================
mode: scan
meta server: ...::*
space name: spacenameA
path: /***/nebula
parts:
vids: 200
tags:
edges:
limit: 0
===========================PARAMS============================

===========================STATISTICS============================
COUNT: 0
VERTEX COUNT: 0
EDGE COUNT: 0
TAG STATISTICS:
EDGE STATISTICS:

好的,在上面的pr一起修了

我这边测试了一下。最新的这个pr,还没解决如果vid类型为int64类型,增加–vids= 数值。 还是没查询出对应的数值。方法没执行到printTagKey

应该是 vids_.emplace(std::string(reinterpret_cast<const char*>(&vid), 8));没赋值过去

Screen Shot 2021-07-23 at 11.17.44

我看下,pr。感谢

你好。核对代码一致。无显示参数。
测试场景如下:
create space test_nebula(vid_type=int64)

use test_nebula

create TAG A(name string ,age int)

INSERT VERTEX A(name,age) VALUES 100:(‘test1’,100)

INSERT VERTEX A(name,age) VALUES 200:(‘test1’,200)

INSERT VERTEX A(name,age) VALUES 300:(‘test1’,300)

运行结果如下
./db_dump --space_name=test_nebula --db_path=/***/nebula --meta_server=...::## --mode=scan --limit=0 --vids=200
===========================PARAMS============================
mode: scan
meta server: *.
..::##
space name: test_nebula
path: /
/nebula
parts:
vids: 200
tags:
edges:
limit: 0
==========================PARAMS============================

===========================STATISTICS============================
COUNT: 0
VERTEX COUNT: 0
EDGE COUNT: 0
TAG STATISTICS:
EDGE STATISTICS:
============================STATISTICS===========================
Time cost: 100 us

你再更新一下,我测试刚好用的是一个part的space所以没有问题,获取part的代码漏改了,现在改了,你可以再试下,测试用的是你的例子

Screen Shot 2021-07-23 at 15.21.00

非常感谢社区如此及时的回复。解决了不少问题。赞一个

1 个赞

该话题在最后一个回复创建后7天后自动关闭。不再允许新的回复。