nebula-studio
nebula-studio copied to clipboard
The refresh time for statistics in NebulaGraph Studio 3.6.0 is incorrect.
版本:nebula-graph-studio-3.6.0
统计刷新时间不对
查看schema刷新时间倒是正确的
这里的逻辑不太一样,统计页面使用 show stats 等内核的 job 语句来获取信息,时间也是内核启动时定义的时间,没有特殊配置的话就是和东八区差八个小时,查看 schema 这里是 studio 自己的执行逻辑,所以会以当地时间来记录。这块我们后续会优化一下
内核的机器和你电脑本地时区不一致?
问题原因
基础库 nebula-go 在做时间转换时,将标准时间转换为了本地时间字符串 2023-01-01T00:00:01.000000
格式,忽略了 TZD(time zone designator) 时区标志
https://github.com/vesoft-inc/nebula-go/blob/master/value_wrapper.go#L347
假如 graphd/meta/storage 默认采用的是 UTC+00:00 的零时区时间,而浏览器所在系统采用的是东八区(UTC+08:00)时间,缺少 TZD 的字符串 2023-01-01T00:00:01.000000
传递到浏览器后,会默认被当成浏览器本地时间处理(见 IOS 8601 规范),和真实的东八区时间相差 8 个小时。
处理方法
- 可通过修改 graphd 服务配置 doc 中
timezone_name
为UTC+08:00
来快速规避问题 - 等待后续产品升级修复
Issue Cause
The base library, nebula-go, converts standard time to a local time string format 2023-01-01T00:00:01.000000
, neglecting the TZD (time zone designator).
https://github.com/vesoft-inc/nebula-go/blob/master/value_wrapper.go#L347
If the default time for graphd/meta/storage is UTC+00:00, and the system where the browser is located uses the East 8 Zone (UTC+08:00) time, the string 2023-01-01T00:00:01.000000
without TZD, when passed to the browser, will be treated as the browser's local time by default (see IOS 8601 standard), differing from the actual East 8 Zone time by 8 hours.
Solution
- A quick workaround is to change the
timezone_name
in the graphd service configuration document toUTC+08:00
, doc. - Awaiting subsequent product upgrades for a permanent fix.