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

HDDS-2197. Extend SCMCLI Topology command to print node Operational States #37

Closed
wants to merge 3 commits into from

Conversation

sodonnel
Copy link
Contributor

The scmcli topology command only consider the node health (healthy, stale or dead). With decommission and maintenance stages, we need to also consider the operational states and display them with this command.

The current topology command prints details in the format:

State = HEALTHY
 IpAddress(hostName)    networkLocation
 IpAddress(hostName) networkLocation
 IpAddress(hostName) networkLocation

State = STALE
  ...

State = DEAD
  ... 

Alternatively, it prints the details ordered by network location

State = HEALTHY
Location: somelocation
 ipAddress(hostName)
 ipAddress(hostName)
 ipAddress(hostName)
Location: otherlocation
 ipAddress(hostName)
 ipAddress(hostName)
 ipAddress(hostName) 

State = STALE
Location: someLocation
 ...
 ...

In this PR, I propose we simple add the operational state into the existing output, and keep the ordering and formatting as is:

State = HEALTHY
 IpAddress(hostName) IN_SERVICE networkLocation
 IpAddress(hostName) IN_SERVICE networkLocation
 IpAddress(hostName) DECOMMISSIONING networkLocation

State = STALE
 ...

State = DEAD
 ...  

Or

State = HEALTHY
Location: somelocation
 ipAddress(hostName) IN_SERVICE
 ipAddress(hostName) IN_SERVICE
 ipAddress(hostName) DECOMMISSIONED
Location: otherlocation
 ipAddress(hostName) IN_SERVICE
 ipAddress(hostName) IN_MAINTENANE
 ipAddress(hostName) IN_SERVIE

State = STALE
Location: someLocation
 ...
 ...

Copy link
Member

@elek elek left a comment

Choose a reason for hiding this comment

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

+1

Tested and worked well:

ozone scmcli printTopology
State = HEALTHY
 192.168.240.2(ozone_datanode_2.ozone_default)    IN_SERVICE    /default-rack
 192.168.240.5(ozone_datanode_3.ozone_default)    IN_SERVICE    /default-rack
State = DEAD
 192.168.240.6(ozone_datanode_1.ozone_default)    IN_SERVICE    /default-rack
bash-4.2$ 

There is one commented out part, we discussed it offline that it will be re-enabled in one of the next patches.

elek pushed a commit that referenced this pull request Oct 18, 2019
@elek elek changed the title HDDS-2197 Extend SCMCLI Topology command to print node Operational States HDDS-2197. Extend SCMCLI Topology command to print node Operational States Oct 18, 2019
@elek elek closed this Oct 18, 2019
Copy link
Contributor

@anuengineer anuengineer left a comment

Choose a reason for hiding this comment

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

+1. LGTM. Thanks for getting this done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants