You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/07/14 02:24:17 UTC

[GitHub] [druid] jihoonson opened a new pull request #10183: Fix sys.servers table to not throw NPE and handle brokers/indexers/peons properly for broadcast segments

jihoonson opened a new pull request #10183:
URL: https://github.com/apache/druid/pull/10183


   ### Description
   
   The servers table can throw NPE if you have a historical that announced its node role, but not itself in the server view (`server` can be null [at here](https://github.com/apache/druid/blob/master/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java#L502)). This PR fixes this NPE and cleans up some unnecessary method calls. It also fixes the servers table to handle optional data servers which can serve broadcast segments. After this PR, the servers table will return all fields properly if they are found in the server view. Otherwise, some fields such as `tier`, `maxSize`, and `currentSize` will be filled with nulls.
   
   The web console changes are not included in this PR. There will be a follow-up for it.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
   - [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [x] been tested in a test Druid 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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson merged pull request #10183: Fix sys.servers table to not throw NPE and handle brokers/indexers/peons properly for broadcast segments

Posted by GitBox <gi...@apache.org>.
jihoonson merged pull request #10183:
URL: https://github.com/apache/druid/pull/10183


   


----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #10183: Fix sys.servers table to not throw NPE and handle brokers/indexers/peons properly for broadcast segments

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #10183:
URL: https://github.com/apache/druid/pull/10183#discussion_r457677752



##########
File path: server/src/main/java/org/apache/druid/discovery/DiscoveryDruidNode.java
##########
@@ -80,6 +84,16 @@ public DruidNode getDruidNode()
     return druidNode;
   }
 
+  public boolean isDiscoverableDataServer()
+  {
+    final DruidService druidService = services.get(DataNodeService.DISCOVERY_SERVICE_KEY);
+    if (druidService == null) {
+      return false;
+    }
+    final DataNodeService dataNodeService = (DataNodeService) druidService;
+    return dataNodeService.isDiscoverable();
+  }
+
   public DruidServer toDruidServer()
   {
     return new DruidServer(

Review comment:
       should this precondition check `isDiscoverableDataServer`?




----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on a change in pull request #10183: Fix sys.servers table to not throw NPE and handle brokers/indexers/peons properly for broadcast segments

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #10183:
URL: https://github.com/apache/druid/pull/10183#discussion_r457758527



##########
File path: server/src/main/java/org/apache/druid/discovery/DiscoveryDruidNode.java
##########
@@ -80,6 +84,16 @@ public DruidNode getDruidNode()
     return druidNode;
   }
 
+  public boolean isDiscoverableDataServer()
+  {
+    final DruidService druidService = services.get(DataNodeService.DISCOVERY_SERVICE_KEY);
+    if (druidService == null) {
+      return false;
+    }
+    final DataNodeService dataNodeService = (DataNodeService) druidService;
+    return dataNodeService.isDiscoverable();
+  }
+
   public DruidServer toDruidServer()
   {
     return new DruidServer(

Review comment:
       Yes, it should. Looking at this and `isDiscoverableDataServer` closely, it seems better to have them as util methods. I moved them into static methods in `ServersTable`.




----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org