Skip to content

Conversation

@sodonnel
Copy link
Contributor

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.

@swagle swagle requested a review from adoroszlai January 18, 2022 16:41
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @sodonnel for working on this. Mostly LGTM.

/**
* Test for the ContainerReplicaInfo class.
*/
public class ContainerReplicaInfoTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be renamed to TestContainerReplicaInfo to be executed. (For some reason that's the naming convention for Ozone.)

ozone/pom.xml

Line 1937 in 2af225d

<include>**/Test*.java</include>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: <version> is unnecessary here, defined in root POM.

@sodonnel
Copy link
Contributor Author

@adoroszlai I have addressed your comments - can you have another look and see if it looks OK? Thanks!

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @sodonnel for updating the patch.

@sodonnel sodonnel merged commit 3a16ebe into apache:master Jan 26, 2022
errose28 added a commit to errose28/ozone that referenced this pull request Feb 4, 2022
* master: (27 commits)
  HDDS-6206. Application errors must not flood system log (apache#3001)
  HDDS-6181. Change SCMHAInvocationHandler#invokeRatis() logging to TRACE (apache#2992)
  HDDS-5529. For any IOexception from @REPLicated method we should throw it (apache#2788)
  HDDS-6201. Fix NPE for DataScanner with scanned container deleted by others. (apache#3005)
  HDDS-6239. ozonesecure-mr failing with No URLs in mirrorlist (apache#3029)
  HDDS-6227. Test helpers should observe naming conditions (apache#3020)
  HDDS-6205. Add CLI command to display the latest Replication Manager report (apache#3013)
  HDDS-6192. feature/Observability.md translated to Chinese (apache#2994)
  HDDS-6219. Switch to RATIS ReplicationType from STAND_ALONE in our tests. (apache#3014)
  HDDS-6211. [Docs] Image styling on deployed site does not replicate local builds. (apache#3007)
  HDDS-6177. Extend container info command to include replica details  (apache#2995)
  HDDS-6128. CLI tool that downloads all the block replicas and creates a manifest file (apache#2987)
  HDDS-6191. Intermittent failure in TestDeleteWithSlowFollower (apache#3015)
  HDDS-6216. Move OMOpenKeysDeleteRequest to package om.request.key (apache#3011)
  HDDS-6203. CleanUp incomplete gz files during Container move (apache#3000)
  HDDS-3408. Rename ChunkLayOutVersion to ContainerLayoutVersion. (apache#2983)
  HDDS-6109. Preserve the underlying exception raised in client lib. (apache#2989)
  HDDS-6135. SCM Container DB bootstrap on Recon startup for SCM HA. (apache#2972)
  HDDS-6202. Avoid using jmh-generator-annprocess since it is GPL2.0. (apache#2998)
  HDDS-6163. Fix PATH in docker image (apache#2967)
  ...

Conflicts:
    hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerCheck.java
errose28 added a commit to errose28/ozone that referenced this pull request Feb 7, 2022
* master: (27 commits)
  HDDS-6206. Application errors must not flood system log (apache#3001)
  HDDS-6181. Change SCMHAInvocationHandler#invokeRatis() logging to TRACE (apache#2992)
  HDDS-5529. For any IOexception from @REPLicated method we should throw it (apache#2788)
  HDDS-6201. Fix NPE for DataScanner with scanned container deleted by others. (apache#3005)
  HDDS-6239. ozonesecure-mr failing with No URLs in mirrorlist (apache#3029)
  HDDS-6227. Test helpers should observe naming conditions (apache#3020)
  HDDS-6205. Add CLI command to display the latest Replication Manager report (apache#3013)
  HDDS-6192. feature/Observability.md translated to Chinese (apache#2994)
  HDDS-6219. Switch to RATIS ReplicationType from STAND_ALONE in our tests. (apache#3014)
  HDDS-6211. [Docs] Image styling on deployed site does not replicate local builds. (apache#3007)
  HDDS-6177. Extend container info command to include replica details  (apache#2995)
  HDDS-6128. CLI tool that downloads all the block replicas and creates a manifest file (apache#2987)
  HDDS-6191. Intermittent failure in TestDeleteWithSlowFollower (apache#3015)
  HDDS-6216. Move OMOpenKeysDeleteRequest to package om.request.key (apache#3011)
  HDDS-6203. CleanUp incomplete gz files during Container move (apache#3000)
  HDDS-3408. Rename ChunkLayOutVersion to ContainerLayoutVersion. (apache#2983)
  HDDS-6109. Preserve the underlying exception raised in client lib. (apache#2989)
  HDDS-6135. SCM Container DB bootstrap on Recon startup for SCM HA. (apache#2972)
  HDDS-6202. Avoid using jmh-generator-annprocess since it is GPL2.0. (apache#2998)
  HDDS-6163. Fix PATH in docker image (apache#2967)
  ...
arp7 pushed a commit that referenced this pull request Feb 17, 2022
…ansport support (#3074)

* HDDS-6149. Remove unused keytabs (#2960)

* HDDS-6094. Some unit tests are skipped due to using JUnit4 runner (#2909)

* HDDS-6075. OzoneConfiguration constructor overrides input configuration keys. (#2921)

* HDDS-4177. SCM Container DB bootstrap on Recon startup (#2942)

* HDDS-6086. Compute MD5MD5CRC file checksum using chunk checksums from DataNodes (#2919)

* HDDS-6148. Validate ContainerBalancerConfiguration before start ContainerBalancer (#2957)

* HDDS-6161. SCM StateMachine failing to reinitialize doesn't terminate the process. (#2971)

* HDDS-6134. Move replication-specific config to ReplicationServer (#2943)

* HDDS-4010. S3G startup fails when multiple service ids are configured. (#2976)

* HDDS-6170. Add metrics to replication manager to track container health states (#2975)

* HDDS-3231. Cleanup KeyManagerImpl (#2961)

* HDDS-5927. Improve defaults in ContainerBalancerConfiguration (#2892)

* HDDS-6157. More consistent synchronization in InputStreams (#2965)

* HDDS-4743. [FSO] Add FSO variant of ITestOzoneContractDistcp. (#2980)

* HDDS-6114. Intermittent error due to Failed to init RocksDB (#2947)

* HDDS-6175. Use s3Auth during proxy during decrypt in RpcClient. (#2981)

* HDDS-6175. Use s3Auth during proxy during decrypt in RpcClient.

* HDDS-5740. Enable ratis by default for SCM. (#2637)

* HDDS-6183. Intermittent failure in TestKeyDeletingService.checkIfDeleteServiceWithFailingSCM. (#2991)

* HDDS-4190. Intermittent failure in TestOMVolumeSetOwnerRequest and TestOMVolumeSetQuotaRequest. (#2982)

* HDDS-6120. Compute block checksum using chunk checksums (#2930)

* HDDS-6147. Add ability in OM to get limited delta updates (#2956)

* HDDS-6195. Remove unused jmh-core dependency. (#2997)

* HDDS-6167. Update ozone-runner version to 20211202-1 (#2969)

* HDDS-6171. Create an API to change Bucket Owner (#2988)

* HDDS-6163. Fix PATH in docker image (#2967)

* HDDS-6202. Avoid using jmh-generator-annprocess since it is GPL2.0. (#2998)

* HDDS-6135. SCM Container DB bootstrap on Recon startup for SCM HA. (#2972)

* HDDS-6109. Preserve the underlying exception raised in client lib. (#2989)

* HDDS-3408. Rename ChunkLayOutVersion to ContainerLayoutVersion. (#2983)

* HDDS-6203. CleanUp incomplete gz files during Container move (#3000)

* HDDS-6216. Move OMOpenKeysDeleteRequest to package om.request.key (#3011)

* HDDS-6191. Intermittent failure in TestDeleteWithSlowFollower (#3015)

* HDDS-6128. CLI tool that downloads all the block replicas and creates a manifest file (#2987)

* HDDS-6177. Extend container info command to include replica details  (#2995)

* HDDS-6211. [Docs] Image styling on deployed site does not replicate local builds. (#3007)

* HDDS-6219. Switch to RATIS ReplicationType from STAND_ALONE in our tests. (#3014)

* HDDS-6192. feature/Observability.md translated to Chinese (#2994)

* HDDS-6205. Add CLI command to display the latest Replication Manager report (#3013)

* HDDS-6227. Test helpers should observe naming conditions (#3020)

* HDDS-6239. ozonesecure-mr failing with No URLs in mirrorlist (#3029)

* HDDS-6201. Fix NPE for DataScanner with scanned container deleted by others. (#3005)

* HDDS-5529. For any IOexception from @REPLicated method we should throw it (#2788)

* HDDS-6181. Change SCMHAInvocationHandler#invokeRatis() logging to TRACE (#2992)

* HDDS-6206. Application errors must not flood system log (#3001)

* HDDS-6245. Add BucketLayout logging to Audit Logs (#3040)

* HDDS-6238 Reduce memory requirements for list keys. (#3032)

* HDDS-2919. Intermittent failure in TestRDBStore (#3028)

* HDDS-6253. Unnecessary duplicate smoketest after defaulting to FSO (#3036)

* HDDS-6204. Cleanup handling malformed authorization header (#2999)

* HDDS-6169. Selective checks: skip junit tests on ozone-runner image update (#2974)

* HDDS-6270. Use a dedicated file instead of /etc/passwd for xcompat acceptance test (#3050)

* HDDS-6273. Amend doc SecuringTDE.md (#3047)

* HDDS-6140. Selective checks: skip unit check for integration-test changes (#2948)

* HDDS-6215. Recon get limited delta updates from OM (#3009)

* HDDS-6125. Recon get limited delta updates from OM

* HDDS-6215. Fix unit test

* trigger new CI check

* HDDS-6215. Fix typo

* trigger new CI check

Co-authored-by: Symious <[email protected]>

* HDDS-6226. Run tests for selective CI checks in CI (#3019)

* HDDS-6247. Avoid logging stack trace for user input problems (#3039)

* HDDS-6208. New checkstyle: WhitespaceAround (#3003)

* HDDS-6289. Upgrade acceptance test log flooded with parse error (#3063)

Co-authored-by: Siyao Meng <[email protected]>

* Trigger Build

* Fix integration test for added configuation field for selecting OmTransport for s3 gateway - TestOzoneConfigurationFields (added config key not in xml).

Co-authored-by: Doroszlai, Attila <[email protected]>
Co-authored-by: Lokesh Jain <[email protected]>
Co-authored-by: Aswin Shakil Balasubramanian <[email protected]>
Co-authored-by: Wei-Chiu Chuang <[email protected]>
Co-authored-by: Symious <[email protected]>
Co-authored-by: Bharat Viswanadham <[email protected]>
Co-authored-by: Stephen O'Donnell <[email protected]>
Co-authored-by: GeorgeJahad <[email protected]>
Co-authored-by: Siddhant Sangwan <[email protected]>
Co-authored-by: Jyotinder Singh <[email protected]>
Co-authored-by: Shashikant Banerjee <[email protected]>
Co-authored-by: Tsz-Wo Nicholas Sze <[email protected]>
Co-authored-by: Kiyoshi Mizumaru <[email protected]>
Co-authored-by: Ritesh H Shukla <[email protected]>
Co-authored-by: Nibiru <[email protected]>
Co-authored-by: Kaijie Chen <[email protected]>
Co-authored-by: Zita Dombi <[email protected]>
Co-authored-by: Istvan Fajth <[email protected]>
Co-authored-by: steinsgateted <[email protected]>
Co-authored-by: Gui Hecheng <[email protected]>
Co-authored-by: Jackson Yao <[email protected]>
Co-authored-by: Keyi Song <[email protected]>
Co-authored-by: UENISHI Kota <[email protected]>
Co-authored-by: Siyao Meng <[email protected]>
Co-authored-by: Symious <[email protected]>
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.

2 participants