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

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

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

cfwl100
Copy link
Contributor

@cfwl100 cfwl100 commented Aug 9, 2024

What type of PR is this?

  • bug

What problem(s) does this PR solve?

Issue(s)

#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:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

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

@cfwl100 cfwl100 requested a review from critical27 as a code owner August 9, 2024 12:49
@CLAassistant
Copy link

CLAassistant commented Aug 9, 2024

CLA assistant check
All committers have signed the CLA.

@cfwl100
Copy link
Contributor Author

cfwl100 commented Aug 16, 2024

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

@cfwl100 cfwl100 changed the title Added support for data balancing when SSL is enabled. snapshot manager add ssl config [BUG]Added support for data balancing when SSL is enabled. snapshot manager add ssl config Aug 16, 2024
critical27
critical27 previously approved these changes Aug 27, 2024
Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Thx~

wey-gu
wey-gu previously approved these changes Sep 2, 2024
* 'master' of https://github.com/cfwl100/nebula:
  Enabled CodeQL scanning
  fix the bug that index scan rule chooses a wrong geo index (vesoft-inc#5922)
  snapshot manager add ssl config
@critical27 critical27 enabled auto-merge (squash) September 3, 2024 01:50
@critical27 critical27 added the ready-for-testing PR: ready for the CI test label Sep 3, 2024
@critical27
Copy link
Contributor

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

auto-merge was automatically disabled September 3, 2024 07:08

Head branch was pushed to by a user without write access

@cfwl100 cfwl100 dismissed stale reviews from critical27 and wey-gu via 0f45199 September 3, 2024 07:08
@cfwl100
Copy link
Contributor Author

cfwl100 commented Sep 3, 2024

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

Has been fixed

wey-gu
wey-gu previously approved these changes Sep 3, 2024
@wey-gu
Copy link
Contributor

wey-gu commented Sep 7, 2024

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

@critical27 critical27 enabled auto-merge (squash) September 20, 2024 08:30
@critical27 critical27 merged commit b2437e4 into vesoft-inc:master Sep 20, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants