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

[tools-v2] The command "curve bs check chunkserver" works incorrectly #2922

Open
zhengweizhu opened this issue Nov 22, 2023 · 2 comments
Open
Assignees
Labels
assigned bug Something isn't working

Comments

@zhengweizhu
Copy link

Describe the bug (描述bug)
The command "curve bs check chunkserver --chunkserverid n" works in this way:

  1. get all copysets in the chunkserver specified
  2. make a subcommand "CopysetCommand" with slice param for all copysetid and logicpoolid
  3. get chunkserver list for each copyset
  4. call CopysetCommand.cmd.ParseFlag with param "--peers"
  5. make a subcommand "GetCopysetStatusCommand" for each copyset and duplicate param "--peers" from CopysetCommand.cmd, then visit each chunkserver specified in param "--peers" to get copyset status

The problem is that in step4, each call to CopysetCommand.cmd.ParseFlag only adds param (but no clean), which leads to param "--peers" for command "GetCopysetStatusCommand" longer and longer. The result is that visiting to most chunkservers is unnecessary and spends too much time, and the output of the command "curve bs check chunkserver" may be misleading.

By the way, there is also another bug where the output of this command is wrongly missing value "HEALTHYCOUNT UNHEALTHYCOUNT UNHEALTHYRATIO"

To Reproduce (复现方法)
curve bs check chunkserver --chunkserverid 1 --verbose # must reproduce. you can see the detail by verbose log

Expected behavior (期望行为)
No unnecessary visit to chunkservers and the command output is correct.

Versions (各种版本)
OS:
Compiler:
branch:
commit id:

Additional context/screenshots (更多上下文/截图)
curve-cli

@zhengweizhu zhengweizhu added the bug Something isn't working label Nov 22, 2023
@zhengweizhu
Copy link
Author

It's fixed by me. Glad to make a pr.

@caoxianfei1
Copy link
Contributor

It's fixed by me. Glad to make a pr.

Welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants