Skip to content

[curve/toos-v2]: add snapshot-clone-status #2346

Closed
@Cyber-SiKu

Description

@Cyber-SiKu

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

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

  • The implementation of the old tool is here:
    int StatusTool::PrintSnapshotCloneStatus() {
    std::cout << "SnapshotCloneServer status:" << std::endl;
    if (noSnapshotServer_) {
    std::cout << "No SnapshotCloneServer" << std::endl;
    return 0;
    }
    std::string version;
    std::vector<std::string> failedList;
    int res = versionTool_->GetAndCheckSnapshotCloneVersion(&version,
    &failedList);
    int ret = 0;
    if (res != 0) {
    std::cout << "GetAndCheckSnapshotCloneVersion fail" << std::endl;
    ret = -1;
    } else {
    std::cout << "version: " << version << std::endl;
    if (!failedList.empty()) {
    versionTool_->PrintFailedList(failedList);
    ret = -1;
    }
    }
    std::vector<std::string> activeAddrs = snapshotClient_->GetActiveAddrs();
    std::map<std::string, bool> onlineStatus;
    snapshotClient_->GetOnlineStatus(&onlineStatus);
    std::cout << "current snapshot-clone-server: " << activeAddrs << std::endl;
    PrintOnlineStatus("snapshot-clone-server", onlineStatus);
    return ret;
    }
  • The old command input and out put:
curve_ops_tool snapshot-clone-status

-------
output:
SnapshotCloneServer status:
version: ***
current snapshot-clone-server: ***
online snapshot-clone-server list: ***
offline snapshot-clone-server list: ***

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 list.

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

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions