[ 
https://issues.apache.org/jira/browse/DRILL-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16807277#comment-16807277
 ] 

Abhishek Girish commented on DRILL-7147:
----------------------------------------

[~Paul.Rogers], thanks for taking a look! I remember this did work as expected 
when it was first added during DoY. So I was a bit confused to see the ordering 
in drill-config.sh. So, I knew you'll have an answer :)

Your explanation makes sense, but from what I've seen, users often set values 
in drill-env.sh in the form you first mention (export key=value). And that 
causes the issue of values not being correctly overridden by Drill during 
startup. 

I understand that the right way to set variables is with the latter form 
(export key=${key:-"val"}). I think this should be more clearly documented in 
our user facing docs - especially because it's not very intuitive to 
troubleshoot. We should see if there is a way from the start-up scripts to help 
with that. 

> Source order of "drill-env.sh" and "distrib-env.sh" should be swapped
> ---------------------------------------------------------------------
>
>                 Key: DRILL-7147
>                 URL: https://issues.apache.org/jira/browse/DRILL-7147
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.15.0
>            Reporter: Hao Zhu
>            Assignee: Abhishek Girish
>            Priority: Minor
>             Fix For: 1.16.0
>
>
> In bin/drill-config.sh, the description of the source order is:
> {code:java}
> # Variables may be set in one of four places:
> #
> #   Environment (per run)
> #   drill-env.sh (per site)
> #   distrib-env.sh (per distribution)
> #   drill-config.sh (this file, Drill defaults)
> #
> # Properties "inherit" from items lower on the list, and may be "overridden" 
> by items
> # higher on the list. In the environment, just set the variable:
> {code}
> However actually bin/drill-config.sh sources drill-env.sh firstly, and then 
> distrib-env.sh.
> {code:java}
> drillEnv="$DRILL_CONF_DIR/drill-env.sh"
> if [ -r "$drillEnv" ]; then
>   . "$drillEnv"
> fi
> ...
> distribEnv="$DRILL_CONF_DIR/distrib-env.sh"
> if [ -r "$distribEnv" ]; then
>   . "$distribEnv"
> else
>   distribEnv="$DRILL_HOME/conf/distrib-env.sh"
>   if [ -r "$distribEnv" ]; then
>     . "$distribEnv"
>   fi
> fi
> {code}
> We need to swap the source order of drill-env.sh and distrib-env.sh.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to