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

[curve/toos-v2]: add scan-status #2361

Closed
Cyber-SiKu opened this issue Mar 30, 2023 · 6 comments
Closed

[curve/toos-v2]: add scan-status #2361

Cyber-SiKu opened this issue Mar 30, 2023 · 6 comments
Assignees
Labels
enhancement improve feature good first issue Good for newcomers

Comments

@Cyber-SiKu
Copy link
Contributor

Cyber-SiKu commented Mar 30, 2023

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

we'd like to support bs scan status command in curve tool

  • The implementation of the old tool is here:
    int StatusTool::ScanStatusCmd() {
    if (FLAGS_logicalPoolId != 0 && FLAGS_copysetId != 0) {
    CopysetInfo copysetInfo;
    auto lpid = FLAGS_logicalPoolId;
    auto copysetId = FLAGS_copysetId;
    if (mdsClient_->GetCopyset(lpid, copysetId, &copysetInfo) != 0) {
    std::cout << "GetCopyset fail!" << std::endl;
    return -1;
    }
    std::cout
    << "Scan status for copyset("
    << lpid << "," << copysetId << "):" << std::endl
    << " scaning=" << copysetInfo.scaning()
    << " lastScanSec=" << copysetInfo.lastscansec()
    << " lastScanConsistent=" << copysetInfo.lastscanconsistent()
    << std::endl;
    return 0;
    }
    std::vector<CopysetInfo> copysetInfos;
    if (mdsClient_->GetCopySetsInCluster(&copysetInfos, true) != 0) {
    std::cout << "GetCopySetsInCluster fail!" << std::endl;
    return -1;
    }
    int count = 0;
    std::cout << "Scaning copysets: " << copysetInfos.size();
    for (auto& copysetInfo : copysetInfos) {
    if (count % 5 == 0) {
    std::cout << std::endl;
    }
    std::cout << " (" << copysetInfo.logicalpoolid()
    << "," << copysetInfo.copysetid() << ")";
    count++;
    }
    std::cout << std::endl;
    return 0;
    }
  • The old command input and out put:
curve_ops_tool scan-status

-------
output:
Scaning copysets: ***

Refer to tool develop guide to get start, and paste the result of the command in pr.

Build compilation environment:https://github.com/opencurve/curve/blob/master/docs/cn/build_and_run.md

Describe the solution you'd like (描述你期望的解决方法)

Add subcommand clinet to curve bs query scan-status.

Describe alternatives you've considered (描述你想到的折衷方案)

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

@zhanghuidinah
Copy link
Member

@Cyber-SiKu Cyber-SiKu self-assigned this Apr 26, 2023
@lianzhanbiao
Copy link

I'd like to do this task. Please assign it to me.

@Cyber-SiKu
Copy link
Contributor Author

@lianzhanbiao are you join our wechat groud?

@lianzhanbiao
Copy link

@lianzhanbiao are you join our wechat groud?


already in

@Cyber-SiKu
Copy link
Contributor Author

Cyber-SiKu commented Apr 28, 2023

@lianzhanbiao I have implemented GetCopyset, if you want to complete this function, you can continue to develop on this basis.

@Cyber-SiKu
Copy link
Contributor Author

@lianzhanbiao Have you encountered any difficulties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants