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

feat: [curve/toos-v2] add list chunkserver #2386

Merged
merged 1 commit into from
May 19, 2023

Conversation

Sindweller
Copy link
Contributor

@Sindweller Sindweller commented Apr 10, 2023

What problem does this PR solve?

Issue Number: #2036

Problem Summary: support list chunkserver command in curve tool

What is changed and how it works?

What's Changed: add /tools-v2/pkg/cli/command/curvebs/list/chunkserver.go

How it Works: curve bs list chunkserver

root@d6c388ef51ff:/# ./curve bs list chunkserver 
+----+------+-----------+------+-----------+------------+------------+-----------------------------------------------+--------------+-------------+------------------+-----------+
| ID | TYPE |    IP     | PORT | RWSTATUS  | DISKSTATE  | COPYSETNUM |                  MOUNTPOINT                   | DISKCAPACITY |  DISKUSED   | UNHEALTHYCOPYSET |  EXTADDR  |
+----+------+-----------+------+-----------+------------+------------+-----------------------------------------------+--------------+-------------+------------------+-----------+
| 1  | nvme | 127.0.0.1 | 8201 | READWRITE | DISKNORMAL | 100        | local:///curvebs/playground/chunkserver1/data | 39 GiB       | 42140479488 | 0 %              | 127.0.0.1 |
+----+      +           +------+           +            +------------+-----------------------------------------------+--------------+-------------+------------------+           +
| 2  |      |           | 8202 |           |            | 100        | local:///curvebs/playground/chunkserver2/data | 39 GiB       | 42140479488 | 0 %              |           |
+----+      +           +------+           +            +------------+-----------------------------------------------+--------------+-------------+------------------+           +
| 3  |      |           | 8200 |           |            | 100        | local:///curvebs/playground/chunkserver0/data | 39 GiB       | 42140479488 | 0 %              |           |
+----+------+-----------+------+-----------+------------+------------+-----------------------------------------------+--------------+-------------+------------------+-----------+

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@wuhongsong
Copy link
Contributor

good job, feel free to communicate if you have any questions

@Sindweller Sindweller marked this pull request as ready for review April 28, 2023 05:19
@Sindweller
Copy link
Contributor Author

@Cyber-SiKu plz have a look
and,

  1. where should I place the /list/chunkserver/copyset.go? it may not be good to put it under /chunkserver but I have no idea about how to handle it.
  2. how can I get the value of FLAGS_checkCSAlive?

@Cyber-SiKu
Copy link
Contributor

@Cyber-SiKu plz have a look and,

  1. where should I place the /list/chunkserver/copyset.go? it may not be good to put it under /chunkserver but I have no idea about how to handle it.
  2. how can I get the value of FLAGS_checkCSAlive?
  1. lsit/copyset is good idea.
  2. add a flag check csalive

Copy link
Contributor

@Cyber-SiKu Cyber-SiKu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to split into two pr:
check-chunkserver and list-chunkserver

tools-v2/internal/utils/row.go Outdated Show resolved Hide resolved
tools-v2/pkg/cli/command/curvebs/list/server/server.go Outdated Show resolved Hide resolved
tools-v2/pkg/cli/command/curvebs/check/chunkserver.go Outdated Show resolved Hide resolved
tools-v2/pkg/cli/command/curvebs/check/chunkserver.go Outdated Show resolved Hide resolved
tools-v2/pkg/cli/command/curvebs/check/chunkserver.go Outdated Show resolved Hide resolved
tools-v2/pkg/cli/command/curvebs/check/chunkserver.go Outdated Show resolved Hide resolved
@Sindweller Sindweller force-pushed the chunkserver branch 2 times, most recently from d61973b to bc56358 Compare May 9, 2023 03:10
tools-v2/internal/utils/row.go Outdated Show resolved Hide resolved
tools-v2/internal/utils/row.go Outdated Show resolved Hide resolved
tools-v2/internal/utils/row.go Outdated Show resolved Hide resolved
@pengpengSir
Copy link
Contributor

Hi, I am trying to use ListChunkServer method in my job, could you please add an interface for others? like this method in the end

@Xinlong-Chen
Copy link
Contributor

Hi, I am trying to use ListChunkServer method in my job, could you please add an interface for others? like this method in the end

+1
It seem that we can reuse her code, but this function ought to implement by user(we) is better beacuse she doesn't know which data we need.

@Sindweller
Copy link
Contributor Author

Hi, I am trying to use ListChunkServer method in my job, could you please add an interface for others? like this method in the end

I'll done it.

@Sindweller Sindweller force-pushed the chunkserver branch 2 times, most recently from 1da337b to ae30555 Compare May 18, 2023 13:19
Signed-off-by: Sindweller <[email protected]>
@Cyber-SiKu
Copy link
Contributor

cicheck

@Cyber-SiKu
Copy link
Contributor

cicheck

@caoxianfei1 caoxianfei1 merged commit 6f533ae into opencurve:master May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants