Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.4升级或者release note哪里最好提下全文索引在升级之后需要rebuild #2559

Closed
critical27 opened this issue Feb 7, 2023 · 7 comments
Assignees

Comments

@critical27
Copy link

critical27 commented Feb 7, 2023

3.4全文索引格式和以前的都不兼容,在启动3.4meta时候,会把以前的全文索引全部删掉。用户怎么rebuild步骤不明确(可能还需要把listener remove再add回来,最后才能rebuild)最好测下,再给个操作。

@jinyingsunny
Copy link
Contributor

ok, i will check id

@jinyingsunny
Copy link
Contributor

jinyingsunny commented Feb 8, 2023

升级前ent3.1.3创建的全文索引在升级后ent3.4:部分lookup语句无法使用。
过程:
1.升级后,启动storage-listener,会将全文索引用新的数据格式写入到es,这时,es中数据会变成原来的两倍;后续进行数据的新增、修改和删除,模糊匹配WILDCARD都可以正常返回,但是前缀匹配,es始终返回null。 即使重新rebuild了全文索引,前缀匹配仍然返回空。
2.之前依赖的索引在删除后,也可以继续使用。

(root@nebula) [nba]> LOOKUP ON player WHERE PREFIX(player.name, "B")  YIELD player.name, player.age;
+-------------+------------+
| player.name | player.age |
+-------------+------------+
+-------------+------------+
Empty set (time spent 8009/29320 us)

Wed, 08 Feb 2023 10:02:14 CST

(root@nebula) [nba]> LOOKUP ON player WHERE WILDCARD(player.name, "*ri*") YIELD player.name, player.age;
+----------------------+------------+
| player.name          | player.age |
+----------------------+------------+
| "Chris Paul"         | 33         |
| "Boris Diaw"         | 36         |
| "Kristaps Porzingis" | 23         |
| "LaMarcus Aldridge"  | 33         |
| "Ricky Rubio"        | 28         |
| "Kyrie Irving"       | 26         |
| "Blake Griffin"      | 30         |
+----------------------+------------+
Got 7 rows (time spent 8464/24868 us)

3.对于新增的数据,前缀匹配可以正常返回:

(root@nebula) [nba]> insert vertex player(name,age) values "1111":("1111",88)
Execution succeeded (time spent 1095/22109 us)

Wed, 08 Feb 2023 10:59:04 CST

(root@nebula) [nba]> LOOKUP ON player WHERE PREFIX(player.name, "11") YIELD id(vertex);
+------------+
| id(VERTEX) |
+------------+
| "1111"     |
+------------+
Got 1 rows (time spent 5680/30291 us)

注意点:

  1. 升级后的storage中:--snapshot_send_files要改成0;

@cangfengzhs
Copy link

ES数据你要手动全删

@jinyingsunny
Copy link
Contributor

image
用贺双的开发分支:https://github.com/vesoft-inc/nebula/pull/5326/files

 有全文索引的情况,从社区版从2.5到3.4升级正常。
操作步骤:
1. 2.5中建立全文索引,查询正常;
2. 停机,用3.4的bin替换2.5 ; & 删除es中的全文索引; curl -XDELETE -u elastic:elastic 'http://192.168.8.223:9200/nebula_index_2534' 
{"acknowledged":true}%                             
3. 按照[手册中](https://docs.nebula-graph.com.cn/3.4.0/4.deployment-and-installation/3.upgrade-nebula-graph/upgrade-nebula-graph-to-latest/)修改了两个参数timeout参数;(注意把zonespec.csv 文件copy一下,否则启动meta会core。)
4. 启动meta,正常;启动storage、graph、storage-listener服务都正常。
5. 这时只有show listener还存在, show text search clients已经是空,全文索引已经不存在;
6. 重新创建全文索引,完成rebuild,进行数据查询/增加/修改/删除,均正常;将字段设置成“” 和 设置成null,在es中会“”和删除;
7. 对全文索引进行删除、space删除也都符合预期;

@jinyingsunny
Copy link
Contributor

讨论结论和原因:

结论:社区版2.5 及以后的版本,支持直接升级到3.4; 社区版 2.x(x<5) 不支持升级 到3.4 ,需要先升级到2.5/2.6。
原因: 

* 2.x(x<5)之前的版本 和3.x都没记录meta版本号, 升级到3.4时,无法识别是哪种,所以就在手册写禁止2.5之前的升级,而允许3.x的升级;

* 2.5和2.6是有记录meta版本号的,所以可以升级;


ps:如果2.x(x<5)来做到3.4的升级,升级过程不会报错,因为是按照3.x来做的处理,某些情况下数据可能不正确(这里的某些比较复杂),所以就禁止了

@jinyingsunny
Copy link
Contributor

jinyingsunny commented Feb 8, 2023

有全文索引的情况,从社区版从3.1到3.4升级正常。
操作步骤:

1. 3.1 中建立全文索引,查询正常;
2. 停机,用3.4的bin替换3.1 ; & 删除es中的全文索引; curl -XDELETE -u elastic:elastic 'http://192.168.8.223:9200/nebula_index_3134' {"acknowledged":true}%                             
3. 按照[手册中](https://docs.nebula-graph.com.cn/3.4.0/4.deployment-and-installation/3.upgrade-nebula-graph/upgrade-nebula-from-300-to-latest/)什么都没有做;
4. 启动meta,正常;启动storage、graph、storage-listener服务都正常。
5. 这时show listener存在, show text search clients也存在,全文索引已经不存在;
6. 重新创建全文索引,完成rebuild,进行数据查询/增加/修改/删除,均正常;将字段设置成“” 和 设置成null,在es中会“”和删除;
7. 对全文索引进行删除、space删除也都符合预期;

@abby-cyber
Copy link
Contributor

notes added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants