Curve is a sandbox project hosted by the CNCF Foundation. It's cloud-native, high-performance, and easy to operate. Curve is an open-source distributed storage system for block and shared file storage.
Describe the bug (描述bug)
The command "curve bs check chunkserver --chunkserverid n" works in this way:
get all copysets in the chunkserver specified
make a subcommand "CopysetCommand" with slice param for all copysetid and logicpoolid
get chunkserver list for each copyset
call CopysetCommand.cmd.ParseFlag with param "--peers"
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.
Describe the bug (描述bug) The command "curve bs check chunkserver --chunkserverid n" works in this way:
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 (更多上下文/截图)