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/03/21 08:49:29 UTC

[GitHub] [druid] maytasm3 opened a new pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

maytasm3 opened a new pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553
 
 
   Fixes Hadoop ingestion fails due to error "JavaScript is disabled", if determine partition map reduce job is run and "mapreduce.reduce.java.opts" + "mapreduce.map.java.opts" is not set with druid.javascript.enabled=true
   
   ### Description
   
   The root cause of the failure is depending on if the determine_partitions map reduce job needs to be run or not. If the determine_partitions map reduce job needs to be run, then it will fail with the "JavaScript is disabled" error if "mapreduce.reduce.java.opts" + "mapreduce.map.java.opts" is not set with druid.javascript.enabled=true. This is due to peon not sending the druid.javascript.enabled value (that is set in the _common/common.runtime.properties) to hadoop when running the determine_partitions map reduce job
   
   The determine_partitions is run for many configuration settings. For example, if "maxRowsPerSegment" is null but numShard is also null, then maxRowsPerSegment is internally set to default value of 5000000 and the determine_partitions job is run.
   
   The fix is simply to include the druid.javascript.enabled prop when running the determine_partitions map reduce job (similar to how we do when we send the index-generator map reduce job. (Note that the druid.javascript.enabled is inject correctly for index-generator job).
   
   Current workaround is to pass the druid.javascript.enabled=true in "mapreduce.map.java.opts" and "mapreduce.reduce.java.opts" in addition to setting druid.javascript.enabled=true in _common/common.runtime.properties
   
   This PR has:
   - [x] been self-reviewed.
   - [ ] 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)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths.
   - [ ] 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


With regards,
Apache Git Services

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


[GitHub] [druid] maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396742590
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopDruidIndexerConfig.java
 ##########
 @@ -138,6 +138,20 @@
     ROWS_THROWN_AWAY_COUNTER
   }
 
+  public static Map<String, String> getAllowedProperties(List<String> listOfAllowedPrefix)
 
 Review comment:
   I like that. Done

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396732492
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopDruidIndexerConfig.java
 ##########
 @@ -138,6 +138,20 @@
     ROWS_THROWN_AWAY_COUNTER
   }
 
+  public static Map<String, String> getAllowedProperties(List<String> listOfAllowedPrefix)
 
 Review comment:
   I guess you can make this method non-static while keeping those methods as static if they accept `HadoopDruidIndexerConfig` instead of `listOfAllowedPrefix`?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
jihoonson merged pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553
 
 
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396711214
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopDruidIndexerConfig.java
 ##########
 @@ -138,6 +138,20 @@
     ROWS_THROWN_AWAY_COUNTER
   }
 
+  public static Map<String, String> getAllowedProperties(List<String> listOfAllowedPrefix)
 
 Review comment:
   `listOfAllowedPrefix` seems to always be the `allowedHadoopPrefix` of this class. Can it be a non-static method?

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


With regards,
Apache Git Services

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


[GitHub] [druid] maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396730194
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopDruidIndexerConfig.java
 ##########
 @@ -138,6 +138,20 @@
     ROWS_THROWN_AWAY_COUNTER
   }
 
+  public static Map<String, String> getAllowedProperties(List<String> listOfAllowedPrefix)
 
 Review comment:
   JobHelper.injectSystemProperties and JobHelper.injectDruidProperties methods are static. If we change those to non-static then yes, getAllowedProperties can be non-static since listOfAllowedPrefix are always allowedHadoopPrefix. But maybe leaving it like this is more flexible as the caller might pass something other than allowedHadoopPrefix for listOfAllowedPrefix

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396677290
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/JobHelper.java
 ##########
 @@ -343,11 +338,18 @@ public static void injectDruidProperties(Configuration configuration, List<Strin
     }
   }
 
-  public static Configuration injectSystemProperties(Configuration conf)
+  public static Configuration injectSystemProperties(Configuration conf, List<String> listOfAllowedPrefix)
   {
     for (String propName : HadoopDruidIndexerConfig.PROPERTIES.stringPropertyNames()) {
       if (propName.startsWith("hadoop.")) {
         conf.set(propName.substring("hadoop.".length()), HadoopDruidIndexerConfig.PROPERTIES.getProperty(propName));
+      } else {
+        for (String prefix : listOfAllowedPrefix) {
+          if (propName.equals(prefix) || propName.startsWith(prefix + ".")) {
+            conf.set(propName, HadoopDruidIndexerConfig.PROPERTIES.getProperty(propName));
+            break;
+          }
+        }
 
 Review comment:
   `injectDruidProperties` has an almost same block with this. How about adding a new method `HadoopDruidIndexerConfig.getAllowedProperties()` which returns a map of a property name to a property? And this new method can be used both in `injectDruidProperties()` and this method.

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


With regards,
Apache Git Services

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


[GitHub] [druid] maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396700381
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/JobHelper.java
 ##########
 @@ -343,11 +338,18 @@ public static void injectDruidProperties(Configuration configuration, List<Strin
     }
   }
 
-  public static Configuration injectSystemProperties(Configuration conf)
+  public static Configuration injectSystemProperties(Configuration conf, List<String> listOfAllowedPrefix)
   {
     for (String propName : HadoopDruidIndexerConfig.PROPERTIES.stringPropertyNames()) {
       if (propName.startsWith("hadoop.")) {
         conf.set(propName.substring("hadoop.".length()), HadoopDruidIndexerConfig.PROPERTIES.getProperty(propName));
+      } else {
+        for (String prefix : listOfAllowedPrefix) {
+          if (propName.equals(prefix) || propName.startsWith(prefix + ".")) {
+            conf.set(propName, HadoopDruidIndexerConfig.PROPERTIES.getProperty(propName));
+            break;
+          }
+        }
 
 Review comment:
   Done

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


With regards,
Apache Git Services

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


[GitHub] [druid] maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
maytasm3 commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396731043
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopDruidIndexerConfig.java
 ##########
 @@ -138,6 +138,20 @@
     ROWS_THROWN_AWAY_COUNTER
   }
 
+  public static Map<String, String> getAllowedProperties(List<String> listOfAllowedPrefix)
 
 Review comment:
   Leaving as is unless you have strong opinion on changing all those to non-static and having JobHelper instances. @jihoonson 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #9553: fix Hadoop ingestion fails due to error 'JavaScript is disabled' on certain config
URL: https://github.com/apache/druid/pull/9553#discussion_r396732492
 
 

 ##########
 File path: indexing-hadoop/src/main/java/org/apache/druid/indexer/HadoopDruidIndexerConfig.java
 ##########
 @@ -138,6 +138,20 @@
     ROWS_THROWN_AWAY_COUNTER
   }
 
+  public static Map<String, String> getAllowedProperties(List<String> listOfAllowedPrefix)
 
 Review comment:
   I guess you can make this method non-static while keeping those methods as static if they accept `HadoopDruidIndexerConfig` instead of `listOfAllowedPrefix`?

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


With regards,
Apache Git Services

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