sodonnel opened a new pull request #2995:
URL: https://github.com/apache/ozone/pull/2995
## What changes were proposed in this pull request?
When debugging some recent cluster issues related to containers, it would be
useful if the details of the replicas were available in the output from the
`ozone admin container info <id>` command.
Ideally, the ContainerReplica object, which is used to stored the replicas
details on SCM would be re-used for this purpose, but it is only available in
the `hadoop-hdds-server-scm` package, while the client code lives in the common
package. Creating a dependency
Therefore I have created a new class called ContainerReplicaInfo and
corresponding proto definition to send the replica details from SCM to the
client, and hence display on the command output.
With the change in place, the output from the command looks like below, with
the line starting "Replicas":
```
ozone admin container info 2
Container id: 2
Pipeline id: ce499ca8-e9be-4ba4-91e7-0c7f33bb0ccb
Container State: OPEN
Datanodes:
[2de8adb0-504c-4890-8d68-cc699c02cf01/ozone_datanode_2.ozone_default,
cd79c851-277a-4b89-8c6b-e1cc8f549ebc/ozone_datanode_1.ozone_default,
29b032e6-f76a-44a8-a582-427fc8a83aa9/ozone_datanode_3.ozone_default]
Replicas: [State: OPEN; Origin: cd79c851-277a-4b89-8c6b-e1cc8f549ebc;
Location: cd79c851-277a-4b89-8c6b-e1cc8f549ebc/ozone_datanode_1.ozone_default,
State: OPEN; Origin: 2de8adb0-504c-4890-8d68-cc699c02cf01; Location:
2de8adb0-504c-4890-8d68-cc699c02cf01/ozone_datanode_2.ozone_default,
State: OPEN; Origin: 29b032e6-f76a-44a8-a582-427fc8a83aa9; Location:
29b032e6-f76a-44a8-a582-427fc8a83aa9/ozone_datanode_3.ozone_default]
```
More verbose output is available in the JSON output:
```
ozone admin container info 2 --json
{
"containerInfo" : {
"state" : "OPEN",
"replicationConfig" : {
"replicationFactor" : "THREE",
"requiredNodes" : 3,
"replicationType" : "RATIS"
},
"usedBytes" : 0,
"numberOfKeys" : 0,
"lastUsed" : "2022-01-17T11:47:04.997Z",
"stateEnterTime" : "2022-01-17T11:45:49.415Z",
"owner" : "om1",
"containerID" : 2,
"deleteTransactionId" : 0,
"sequenceId" : 702,
"open" : true,
"replicationType" : "RATIS",
"replicationFactor" : "THREE"
},
"pipeline" : {
<snipped existing pipeline>
},
"replicas" : [ {
"containerID" : 2,
"state" : "OPEN",
"datanodeDetails" : {
"level" : 0,
"cost" : 0,
"uuid" : "cd79c851-277a-4b89-8c6b-e1cc8f549ebc",
"uuidString" : "cd79c851-277a-4b89-8c6b-e1cc8f549ebc",
"ipAddress" : "172.28.0.7",
"hostName" : "ozone_datanode_1.ozone_default",
"ports" : [ {
"name" : "REPLICATION",
"value" : 9886
}, {
"name" : "RATIS",
"value" : 9858
}, {
"name" : "RATIS_ADMIN",
"value" : 9857
}, {
"name" : "RATIS_SERVER",
"value" : 9856
}, {
"name" : "STANDALONE",
"value" : 9859
} ],
"setupTime" : 0,
"persistedOpState" : "IN_SERVICE",
"persistedOpStateExpiryEpochSec" : 0,
"initialVersion" : 0,
"currentVersion" : 1,
"signature" : -1230887375,
"networkLocation" : "/default-rack",
"networkName" : "cd79c851-277a-4b89-8c6b-e1cc8f549ebc",
"networkFullPath" :
"/default-rack/cd79c851-277a-4b89-8c6b-e1cc8f549ebc",
"numOfLeaves" : 1
},
"placeOfBirth" : "cd79c851-277a-4b89-8c6b-e1cc8f549ebc",
"sequenceId" : 0,
"keyCount" : 0,
"bytesUsed" : 0
}, {
"containerID" : 2,
"state" : "OPEN",
"datanodeDetails" : {
"level" : 0,
"cost" : 0,
"uuid" : "2de8adb0-504c-4890-8d68-cc699c02cf01",
"uuidString" : "2de8adb0-504c-4890-8d68-cc699c02cf01",
"ipAddress" : "172.28.0.8",
"hostName" : "ozone_datanode_2.ozone_default",
"ports" : [ {
"name" : "REPLICATION",
"value" : 9886
}, {
"name" : "RATIS",
"value" : 9858
}, {
"name" : "RATIS_ADMIN",
"value" : 9857
}, {
"name" : "RATIS_SERVER",
"value" : 9856
}, {
"name" : "STANDALONE",
"value" : 9859
} ],
"setupTime" : 0,
"persistedOpState" : "IN_SERVICE",
"persistedOpStateExpiryEpochSec" : 0,
"initialVersion" : 0,
"currentVersion" : 1,
"signature" : 771714490,
"networkLocation" : "/default-rack",
"networkName" : "2de8adb0-504c-4890-8d68-cc699c02cf01",
"networkFullPath" :
"/default-rack/2de8adb0-504c-4890-8d68-cc699c02cf01",
"numOfLeaves" : 1
},
"placeOfBirth" : "2de8adb0-504c-4890-8d68-cc699c02cf01",
"sequenceId" : 702,
"keyCount" : 213,
"bytesUsed" : 2181120
}, {
"containerID" : 2,
"state" : "OPEN",
"datanodeDetails" : {
"level" : 0,
"cost" : 0,
"uuid" : "29b032e6-f76a-44a8-a582-427fc8a83aa9",
"uuidString" : "29b032e6-f76a-44a8-a582-427fc8a83aa9",
"ipAddress" : "172.28.0.6",
"hostName" : "ozone_datanode_3.ozone_default",
"ports" : [ {
"name" : "REPLICATION",
"value" : 9886
}, {
"name" : "RATIS",
"value" : 9858
}, {
"name" : "RATIS_ADMIN",
"value" : 9857
}, {
"name" : "RATIS_SERVER",
"value" : 9856
}, {
"name" : "STANDALONE",
"value" : 9859
} ],
"setupTime" : 0,
"persistedOpState" : "IN_SERVICE",
"persistedOpStateExpiryEpochSec" : 0,
"initialVersion" : 0,
"currentVersion" : 1,
"signature" : 1091981010,
"networkLocation" : "/default-rack",
"networkName" : "29b032e6-f76a-44a8-a582-427fc8a83aa9",
"networkFullPath" :
"/default-rack/29b032e6-f76a-44a8-a582-427fc8a83aa9",
"numOfLeaves" : 1
},
"placeOfBirth" : "29b032e6-f76a-44a8-a582-427fc8a83aa9",
"sequenceId" : 702,
"keyCount" : 213,
"bytesUsed" : 2181120
} ]
}
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6177
## How was this patch tested?
New unit tests and validated the new command via a docker-compose cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]