Skip to content

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

@ZhengweiZhu

Description

@ZhengweiZhu

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

Metadata

Metadata

Assignees

Labels

assignedbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions