[ https://issues.apache.org/jira/browse/HIVE-24707?focusedWorklogId=547128&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-547128 ]
ASF GitHub Bot logged work on HIVE-24707: ----------------------------------------- Author: ASF GitHub Bot Created on: 03/Feb/21 17:05 Start Date: 03/Feb/21 17:05 Worklog Time Spent: 10m Work Description: belugabehr commented on a change in pull request #1933: URL: https://github.com/apache/hive/pull/1933#discussion_r569580552 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/MemoryInfo.java ########## @@ -34,9 +37,8 @@ private Configuration conf; private boolean isTez; private boolean isLlap; - private long maxExecutorMemory; - private long mapJoinMemoryThreshold; - private long dynPartJoinMemoryThreshold; + private long maxExecutorMemory; // value in Bytes Review comment: Sorry to nit, but can we make these 'final' instance variables? Also, can you please move the 'value in bytes' into a proper Javadoc on the getter method? ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java ########## @@ -700,13 +700,26 @@ public int getPartition(Object key, Object value, int numPartitions) { * container size isn't set. */ public static Resource getContainerResource(Configuration conf) { - int memory = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) : - conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); - int cpus = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) : - conf.getInt(MRJobConfig.MAP_CPU_VCORES, MRJobConfig.DEFAULT_MAP_CPU_VCORES); - return Resource.newInstance(memory, cpus); + int memorySizeMb = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE); + if (memorySizeMb <= 0) { + LOG.warn("Falling back to MapReduce container MB {}", MRJobConfig.MAP_MEMORY_MB); + memorySizeMb = conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); + // When config is explicitly set to "-1" defaultValue does not work! + if (memorySizeMb <= 0) { + LOG.warn("Falling back to default container MB {}", MRJobConfig.DEFAULT_MAP_MEMORY_MB); + memorySizeMb = MRJobConfig.DEFAULT_MAP_MEMORY_MB; + } + } + int cpuCores = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES); + if (cpuCores <= 0) { + LOG.warn("Falling back to MapReduce container VCores {}", MRJobConfig.MAP_CPU_VCORES); Review comment: Can we please update to say: ```java LOG.warn("No Tez VCore size specified by {}. Falling back...", HiveConf.ConfVars.HIVETEZCPUVCORES, MRJobConfig.MAP_CPU_VCORES); ``` ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java ########## @@ -700,13 +700,26 @@ public int getPartition(Object key, Object value, int numPartitions) { * container size isn't set. */ public static Resource getContainerResource(Configuration conf) { - int memory = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) : - conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); - int cpus = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) : - conf.getInt(MRJobConfig.MAP_CPU_VCORES, MRJobConfig.DEFAULT_MAP_CPU_VCORES); - return Resource.newInstance(memory, cpus); + int memorySizeMb = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE); + if (memorySizeMb <= 0) { + LOG.warn("Falling back to MapReduce container MB {}", MRJobConfig.MAP_MEMORY_MB); Review comment: Can we please update to say: ```java LOG.warn("No Tez container size specified by {}. Falling back...", HiveConf.ConfVars.HIVETEZCONTAINERSIZE, MRJobConfig.MAP_MEMORY_MB); ``` ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 547128) Time Spent: 3h 20m (was: 3h 10m) > Apply Sane Default for Tez Containers as Last Resort > ---------------------------------------------------- > > Key: HIVE-24707 > URL: https://issues.apache.org/jira/browse/HIVE-24707 > Project: Hive > Issue Type: Improvement > Reporter: David Mollitor > Assignee: Panagiotis Garefalakis > Priority: Trivial > Labels: pull-request-available > Time Spent: 3h 20m > Remaining Estimate: 0h > > {code:java|title=DagUtils.java} > public static Resource getContainerResource(Configuration conf) { > int memory = HiveConf.getIntVar(conf, > HiveConf.ConfVars.HIVETEZCONTAINERSIZE) > 0 ? > HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) : > conf.getInt(MRJobConfig.MAP_MEMORY_MB, > MRJobConfig.DEFAULT_MAP_MEMORY_MB); > int cpus = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) > > 0 ? > HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) : > conf.getInt(MRJobConfig.MAP_CPU_VCORES, > MRJobConfig.DEFAULT_MAP_CPU_VCORES); > return Resource.newInstance(memory, cpus); > } > {code} > If Tez Container Size or VCores is an invalid value ( <= 0 ) then it falls > back onto the MapReduce configurations, but if the MapReduce configurations > have invalid values ( <= 0 ), they are excepted regardless and this will > cause failures down the road. > This code should also check the MapReduce values and fall back to MapReduce > default values if they are <= 0. > Also, some logging would be nice here too, reporting about where the > configuration values came from. > -- This message was sent by Atlassian Jira (v8.3.4#803005)