vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability
https://nebula-graph.io
Apache License 2.0
10.68k stars 1.2k forks source link

[BUG]Added support for data balancing when SSL is enabled. snapshot manager add ssl config #5920

Closed cfwl100 closed 1 week ago

cfwl100 commented 1 month ago

What type of PR is this?

What problem(s) does this PR solve?

Issue(s)

https://github.com/vesoft-inc/nebula/issues/5924:

Description:

数据均衡时,出现storaged节点间发送 Raft 副本的快照报错,且反复重试,任务一直长时间运行中,具备报错如下: 客户端报错

image

服务端报错

image 根据报错日志,追踪关键代码调用路径,SnapshotManager 管理和发送 Raft 副本的快照,承载创建Thrift客户端和发送数据能力,代码如下: image

ThriftClientManager中构造方法有两个,带参数和不带参数的,带参数的构造方法会传递入参enableSSL_,默认值是false Client方法中会根据enableSSL配置项走分支,当enableSSL为true时,创建AsyncSSLSocket(开启SSL),当为false时创建 AsyncSocket(未开启SSL)。

当客户端使用AsyncSocket,服务端使用AsyncSSLSocket进行解析时,会出现消息格式错误,因为客户端发送的消息未加密,最终服务端报错。 综上,SnapshotManager中enableSSL默认值为false,但是创建实例时使用了无参构造方法,导致这种致命性问题。

How do you solve it?

根据系统配置文件中的SSL配置项,将此配置设置到SnapshotManager带参的构造方法中,保证系统整体客户端和服务端SSL配置一致。

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

Affects:

Release notes:

Please confirm whether to be reflected in release notes and how to describe: Added support for data balancing when SSL is enabled.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

cfwl100 commented 1 month ago

@critical27 @dutor @SuperYoko Please help me with this issue,thanks

critical27 commented 4 weeks ago

Sorry for late response. The cpplint in CI failed, please reformat the code~

cfwl100 commented 4 weeks ago

Sorry for late response. The cpplint in CI failed, please reformat the code~

Has been fixed

wey-gu commented 3 weeks ago

@critical27 it's in a shape ready for merging 🤩