You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/21 18:00:19 UTC

[GitHub] [hadoop-ozone] vivekratnavel opened a new pull request #854: HDDS-3393. Recon throws NPE in clusterState endpoint

vivekratnavel opened a new pull request #854:
URL: https://github.com/apache/hadoop-ozone/pull/854


   ## What changes were proposed in this pull request?
   
   - Perform a null check on tables before calling getEstimatedKeyCount() on them.
   - Update mock api response to match the expected json structure.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-3393
   
   ## How was this patch tested?
   
   Patch was tested with docker-compose and verified that there is no NPE thrown in Recon logs after hitting the clusterState endpoint before first snapshot from OM. 
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] vivekratnavel commented on a change in pull request #854: HDDS-3393. Recon throws NPE in clusterState endpoint

Posted by GitBox <gi...@apache.org>.
vivekratnavel commented on a change in pull request #854:
URL: https://github.com/apache/hadoop-ozone/pull/854#discussion_r412542919



##########
File path: hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json
##########
@@ -378,11 +378,11 @@
           }
         ],
         "missingSince": 1578491371528,
-        "pipelineId": "05e3d908-ff01-4ce6-ad75-f3ec79bcc7982"
+        "pipelineID": "05e3d908-ff01-4ce6-ad75-f3ec79bcc7982"
       },
       {
-        "id": 2,
-        "keys": 5943,
+        "containerID": 2,

Review comment:
       @bharatviswa504 These are not related to the change. But, I noticed that the json structure of missing containers api mock response does not match with what is expected by the UI and thought of fixing them along with this change. Since, these are mock responses, they will not affect any behavior of Recon, except when starting a local mock development server to serve mock responses from this db.json file.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] vivekratnavel commented on a change in pull request #854: HDDS-3393. Recon throws NPE in clusterState endpoint

Posted by GitBox <gi...@apache.org>.
vivekratnavel commented on a change in pull request #854:
URL: https://github.com/apache/hadoop-ozone/pull/854#discussion_r412412225



##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ClusterStateEndpoint.java
##########
@@ -81,20 +82,26 @@ public Response getClusterState() {
             stats.getScmUsed().get(), stats.getRemaining().get());
     ClusterStateResponse.Builder builder = ClusterStateResponse.newBuilder();
     try {
-      builder.setVolumes(
-          omMetadataManager.getVolumeTable().getEstimatedKeyCount());
+      Table volumeTable = omMetadataManager.getVolumeTable();

Review comment:
       Thanks for the review! I added a boolean flag to keep track of the initialized state to ReconOMMetadataManager.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] bharatviswa504 commented on issue #854: HDDS-3393. Recon throws NPE in clusterState endpoint

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on issue #854:
URL: https://github.com/apache/hadoop-ozone/pull/854#issuecomment-617506943


   Thank You @vivekratnavel for the contribution.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #854: HDDS-3393. Recon throws NPE in clusterState endpoint

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #854:
URL: https://github.com/apache/hadoop-ozone/pull/854#discussion_r412395406



##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ClusterStateEndpoint.java
##########
@@ -81,20 +82,26 @@ public Response getClusterState() {
             stats.getScmUsed().get(), stats.getRemaining().get());
     ClusterStateResponse.Builder builder = ClusterStateResponse.newBuilder();
     try {
-      builder.setVolumes(
-          omMetadataManager.getVolumeTable().getEstimatedKeyCount());
+      Table volumeTable = omMetadataManager.getVolumeTable();

Review comment:
       Instead of not null checks, can we have a state in MetadataManager like INITIALIZED, STOPPED? This will help be future proof, and if anywhere this check is required it will be generic.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #854: HDDS-3393. Recon throws NPE in clusterState endpoint

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #854:
URL: https://github.com/apache/hadoop-ozone/pull/854#discussion_r412395406



##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ClusterStateEndpoint.java
##########
@@ -81,20 +82,26 @@ public Response getClusterState() {
             stats.getScmUsed().get(), stats.getRemaining().get());
     ClusterStateResponse.Builder builder = ClusterStateResponse.newBuilder();
     try {
-      builder.setVolumes(
-          omMetadataManager.getVolumeTable().getEstimatedKeyCount());
+      Table volumeTable = omMetadataManager.getVolumeTable();

Review comment:
       Instead of not null checks, can we have a state in MetadataManager like INITIALIZED, STOPPED? This will help be future proof, and if anywhere this check is required it will be generic to use state, instead of not null check




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #854: HDDS-3393. Recon throws NPE in clusterState endpoint

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #854:
URL: https://github.com/apache/hadoop-ozone/pull/854#discussion_r412537904



##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/recovery/ReconOmMetadataManagerImpl.java
##########
@@ -120,4 +122,11 @@ public long getLastSequenceNumberFromDB() {
     }
   }
 
+  /**
+   * Check if OM tables are initialized.
+   * @return if OM Tables are initialized
+   */
+  public boolean isOmTablesInitialized() {

Review comment:
       Missed `@override` notion, and same comment as above related to Javadoc or it can be completely removed.

##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/recovery/ReconOMMetadataManager.java
##########
@@ -41,4 +41,10 @@
    * Database.
    */
   long getLastSequenceNumberFromDB();
+
+  /**
+   * Check if OM tables are initialized.
+   * @return if OM Tables are initialized

Review comment:
       Minor NIT: return true if OM Tables are initialized, otherwise false.

##########
File path: hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json
##########
@@ -378,11 +378,11 @@
           }
         ],
         "missingSince": 1578491371528,
-        "pipelineId": "05e3d908-ff01-4ce6-ad75-f3ec79bcc7982"
+        "pipelineID": "05e3d908-ff01-4ce6-ad75-f3ec79bcc7982"
       },
       {
-        "id": 2,
-        "keys": 5943,
+        "containerID": 2,

Review comment:
       Not understood why these are changed, and how it is related to this change.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org