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 chunkserver-status #2344

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

[curve/toos-v2]: add chunkserver-status #2344

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

Comments

@Cyber-SiKu
Copy link
Contributor

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

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

  • The implementation of the old tool is here:
    int StatusTool::PrintChunkserverStatus(bool checkLeftSize) {
    // get and check chunkserver version
    std::cout << "ChunkServer status:" << std::endl;
    std::string version;
    std::vector<std::string> failedList;
    int res = versionTool_->GetAndCheckChunkServerVersion(&version,
    &failedList);
    int ret = 0;
    if (res != 0) {
    std::cout << "GetAndCheckChunkserverVersion fail" << std::endl;
    ret = -1;
    } else {
    std::cout << "version: " << version << std::endl;
    if (!failedList.empty()) {
    versionTool_->PrintFailedList(failedList);
    ret = -1;
    }
    }
    // list chunkservers in cluster group by poolid
    std::map<PoolIdType, std::vector<ChunkServerInfo>> poolChunkservers;
    res = mdsClient_->ListChunkServersInCluster(&poolChunkservers);
    if (res != 0) {
    std::cout << "ListChunkServersInCluster fail!" << std::endl;
    return -1;
    }
    // get chunkserver online status
    ret = PrintChunkserverOnlineStatus(poolChunkservers,
    copysetCheckCore_,
    mdsClient_);
    if (!checkLeftSize) {
    return ret;
    }
    bool useWalPool = false;
    bool useChunkFilePoolAsWalPool = true;
    // check use walpool
    ret = CheckUseWalPool(poolChunkservers, &useWalPool,
    &useChunkFilePoolAsWalPool, metricClient_);
    // get chunkserver left size
    std::map<PoolIdType, std::vector<uint64_t>> poolChunkLeftSize;
    std::map<PoolIdType, std::vector<uint64_t>> poolWalSegmentLeftSize;
    ret = GetChunkserverLeftSize(poolChunkservers,
    &poolChunkLeftSize,
    &poolWalSegmentLeftSize,
    useWalPool,
    useChunkFilePoolAsWalPool,
    metricClient_);
    if (0 != ret) {
    return ret;
    }
    // print filepool left size
    PrintCsLeftSizeStatistics("chunkfilepool", poolChunkLeftSize);
    if (useWalPool && !useChunkFilePoolAsWalPool) {
    PrintCsLeftSizeStatistics("walfilepool", poolWalSegmentLeftSize);
    } else if (useChunkFilePoolAsWalPool) {
    std::cout << "No walpool left size found, "
    << "use chunkfilepool as walpool!\n";
    } else {
    std::cout << "No walpool left size found, "
    << "no walpool used!\n";
    }
    return ret;
    }
  • The old command input and out put:
curve_ops_tool chunkserver-status
  
----------
output:
version: 45bcea49+release
chunkserver: total num = 3, online = 3, offline = 0(recoveringout = 0, chunkserverlist: [])

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

Add subcommand dir to curve bs list.

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

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

@TheR1sing3un
Copy link

I would like to contribute to this issue, please assign it to me~

@ilixiaocui
Copy link
Contributor

I would like to contribute to this issue, please assign it to me~

Welcome!

@zhanghuidinah
Copy link
Member

@TheR1sing3un TheR1sing3un moved this from 📋 Backlog to 🏗 In progress in @TheR1sing3un's opensource works Apr 23, 2023
@Cyber-SiKu
Copy link
Contributor Author

@TheR1sing3un Are you still going on? Still have any difficulties?

@TheR1sing3un
Copy link

@TheR1sing3un Are you still going on? Still have any difficulties?

Sorry, I've been a little busy these past few weeks, I will restart this issue next few days~

@Cyber-SiKu
Copy link
Contributor Author

@TheR1sing3un Are you still going on? Still have any difficulties?

Sorry, I've been a little busy these past few weeks, I will restart this issue next few days~

ok

@Cyber-SiKu
Copy link
Contributor Author

@TheR1sing3un Are you still going on? Still have any difficulties?

@caoxianfei1
Copy link
Contributor

@TheR1sing3un This issue will be temporarily unassigned because you have no response, reassign to you if you want to continue.

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

6 participants