github-actions[bot] commented on PR #16528:
URL: https://github.com/apache/doris/pull/16528#issuecomment-1422549886

   #### `sh-checker report`
   
   To get the full details, please check in the 
[job]("https://github.com/apache/doris/actions/runs/4124297309";) output.
   
   <details>
   <summary>shellcheck errors</summary>
   
   ```
   
   'shellcheck ' returned error 1 finding the following syntactical issues:
   
   ----------
   
   In docker/runtime/be/resource/entry_point.sh line 33:
     if [ "$#" -eq 0 ]; then text="$(cat)"; fi
        ^------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in 
Bash/Ksh.
   
   Did you mean: 
     if [[ "$#" -eq 0 ]]; then text="$(cat)"; fi
   
   
   In docker/runtime/be/resource/entry_point.sh line 34:
     local dt="$(date -Iseconds)"
           ^-- SC2155 (warning): Declare and assign separately to avoid masking 
return values.
   
   
   In docker/runtime/be/resource/entry_point.sh line 35:
     printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
                                          ^-^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
                                                ^---^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
                                                        ^---^ SC2250 (style): 
Prefer putting braces around variable references even when not strictly 
required.
   
   Did you mean: 
     printf '%s [%s] [Entrypoint]: %s\n' "${dt}" "${type}" "${text}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 50:
     [ "${#FUNCNAME[@]}" -ge 2 ] &&
     ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for 
tests in Bash/Ksh.
   
   Did you mean: 
     [[ "${#FUNCNAME[@]}" -ge 2 ]] &&
   
   
   In docker/runtime/be/resource/entry_point.sh line 51:
       [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
       ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
   
   Did you mean: 
       [[ "${FUNCNAME[0]}" = '_is_sourced' ]] &&
   
   
   In docker/runtime/be/resource/entry_point.sh line 52:
       [ "${FUNCNAME[1]}" = 'source' ]
       ^-----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
   
   Did you mean: 
       [[ "${FUNCNAME[1]}" = 'source' ]]
   
   
   In docker/runtime/be/resource/entry_point.sh line 57:
     if [ -d "${DORIS_HOME}/be/storage/data" ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
              ^-----------^ SC2154 (warning): DORIS_HOME is referenced but not 
assigned.
   
   Did you mean: 
     if [[ -d "${DORIS_HOME}/be/storage/data" ]]; then
   
   
   In docker/runtime/be/resource/entry_point.sh line 63:
     local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); print 
$0}'))
                          ^-- SC2207 (warning): Prefer mapfile or read -a to 
split command output (or quote to avoid splitting).
   
   
   In docker/runtime/be/resource/entry_point.sh line 69:
       feIpArray[$tmpFeId]=${tmpFeIp}
                 ^------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       feIpArray[${tmpFeId}]=${tmpFeIp}
   
   
   In docker/runtime/be/resource/entry_point.sh line 75:
     BE_HOST_IP=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
                        ^--------^ SC2154 (warning): BE_ADDR is referenced but 
not assigned.
   
   
   In docker/runtime/be/resource/entry_point.sh line 86:
     mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" 2>/dev/null
                           ^-------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
   
   Did you mean: 
     mysql -uroot -P9030 -h"${MASTER_FE_IP}" --comments "$@" 2>/dev/null
   
   
   In docker/runtime/be/resource/entry_point.sh line 93:
       if [[ $(( $i % 20 )) == 1 ]]; then
                 ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                 ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/be/resource/entry_point.sh line 103:
         if [[ $(( $i % 20 )) == 1 ]]; then
                   ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                   ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/be/resource/entry_point.sh line 109:
     if ! [[ $is_fe_start ]]; then
             ^----------^ SC2244 (style): Prefer explicit -n to check non-empty 
string (or use =/-ne to check boolean/integer).
             ^----------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if ! [[ -n $is_fe_start ]]; then
   
   
   In docker/runtime/be/resource/entry_point.sh line 120:
       case "$f" in
             ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       case "${f}" in
   
   
   In docker/runtime/be/resource/entry_point.sh line 122:
         if [ -x "$f" ]; then
            ^---------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in 
Bash/Ksh.
                  ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         if [[ -x "${f}" ]]; then
   
   
   In docker/runtime/be/resource/entry_point.sh line 123:
           doris_note "$0: running $f"
                                   ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
           doris_note "$0: running ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 124:
           "$f"
            ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
           "${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 126:
           doris_note "$0: sourcing $f"
                                    ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
           doris_note "$0: sourcing ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 127:
           . "$f"
             ^--^ SC1090 (warning): ShellCheck can't follow non-constant 
source. Use a directive to specify location.
              ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
           . "${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 131:
         doris_note "$0: running $f"
                                 ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
         doris_note "$0: running ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 132:
         docker_process_sql <"$f"
                              ^-- SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
         docker_process_sql <"${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 136:
         doris_note "$0: running $f"
                                 ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
         doris_note "$0: running ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 137:
         bunzip2 -c "$f" | docker_process_sql
                     ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         bunzip2 -c "${f}" | docker_process_sql
   
   
   In docker/runtime/be/resource/entry_point.sh line 141:
         doris_note "$0: running $f"
                                 ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
         doris_note "$0: running ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 142:
         gunzip -c "$f" | docker_process_sql
                    ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         gunzip -c "${f}" | docker_process_sql
   
   
   In docker/runtime/be/resource/entry_point.sh line 146:
         doris_note "$0: running $f"
                                 ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
         doris_note "$0: running ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 147:
         xzcat "$f" | docker_process_sql
                ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         xzcat "${f}" | docker_process_sql
   
   
   In docker/runtime/be/resource/entry_point.sh line 151:
         doris_note "$0: running $f"
                                 ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
         doris_note "$0: running ${f}"
   
   
   In docker/runtime/be/resource/entry_point.sh line 152:
         zstd -dc "$f" | docker_process_sql
                   ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         zstd -dc "${f}" | docker_process_sql
   
   
   In docker/runtime/be/resource/entry_point.sh line 155:
       *) doris_warn "$0: ignoring $f" ;;
                                   ^-- SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
       *) doris_warn "$0: ignoring ${f}" ;;
   
   
   In docker/runtime/be/resource/entry_point.sh line 172:
     if [ -z ${DATABASE_ALREADY_EXISTS} ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
             ^------------------------^ SC2248 (style): Prefer double quoting 
even when variables don't contain special characters.
   
   Did you mean: 
     if [[ -z "${DATABASE_ALREADY_EXISTS}" ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 35:
     if [ "$#" -eq 0 ]; then text="$(cat)"; fi
        ^------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in 
Bash/Ksh.
   
   Did you mean: 
     if [[ "$#" -eq 0 ]]; then text="$(cat)"; fi
   
   
   In docker/runtime/be/resource/init_be.sh line 36:
     local dt="$(date -Iseconds)"
           ^-- SC2155 (warning): Declare and assign separately to avoid masking 
return values.
   
   
   In docker/runtime/be/resource/init_be.sh line 37:
     printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
                                          ^-^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
                                                ^---^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
                                                        ^---^ SC2250 (style): 
Prefer putting braces around variable references even when not strictly 
required.
   
   Did you mean: 
     printf '%s [%s] [Entrypoint]: %s\n' "${dt}" "${type}" "${text}"
   
   
   In docker/runtime/be/resource/init_be.sh line 52:
     [ "${#FUNCNAME[@]}" -ge 2 ] &&
     ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for 
tests in Bash/Ksh.
   
   Did you mean: 
     [[ "${#FUNCNAME[@]}" -ge 2 ]] &&
   
   
   In docker/runtime/be/resource/init_be.sh line 53:
       [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
       ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
   
   Did you mean: 
       [[ "${FUNCNAME[0]}" = '_is_sourced' ]] &&
   
   
   In docker/runtime/be/resource/init_be.sh line 54:
       [ "${FUNCNAME[1]}" = 'source' ]
       ^-----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
   
   Did you mean: 
       [[ "${FUNCNAME[1]}" = 'source' ]]
   
   
   In docker/runtime/be/resource/init_be.sh line 59:
     if [ -d "${DORIS_HOME}/be/storage/data" ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
   
   Did you mean: 
     if [[ -d "${DORIS_HOME}/be/storage/data" ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 66:
     if [[ $FE_SERVERS =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
           ^---------^ SC2154 (warning): FE_SERVERS is referenced but not 
assigned.
           ^---------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if [[ ${FE_SERVERS} =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 67:
       doris_warn "FE_SERVERS" $FE_SERVERS
                               ^---------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                               ^---------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
       doris_warn "FE_SERVERS" "$FE_SERVERS"
   
   
   In docker/runtime/be/resource/init_be.sh line 71:
     if [[ $BE_ADDR =~ 
^[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}$
 ]]; then
           ^------^ SC2154 (warning): BE_ADDR is referenced but not assigned.
           ^------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if [[ ${BE_ADDR} =~ 
^[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}$
 ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 72:
       doris_warn "BE_ADDR" $BE_ADDR
                            ^------^ SC2086 (info): Double quote to prevent 
globbing and word splitting.
                            ^------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
       doris_warn "BE_ADDR" "$BE_ADDR"
   
   
   In docker/runtime/be/resource/init_be.sh line 79:
     local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); print 
$0}'))
                          ^-- SC2207 (warning): Prefer mapfile or read -a to 
split command output (or quote to avoid splitting).
   
   
   In docker/runtime/be/resource/init_be.sh line 86:
       check_arg "tmpFeIp" $tmpFeIp
                           ^------^ SC2086 (info): Double quote to prevent 
globbing and word splitting.
                           ^------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
       check_arg "tmpFeIp" "$tmpFeIp"
   
   
   In docker/runtime/be/resource/init_be.sh line 87:
       feIpArray[$tmpFeId]=${tmpFeIp}
                 ^------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       feIpArray[${tmpFeId}]=${tmpFeIp}
   
   
   In docker/runtime/be/resource/init_be.sh line 88:
       check_arg "tmpFeEditLogPort" $tmpFeEditLogPort
                                    ^---------------^ SC2086 (info): Double 
quote to prevent globbing and word splitting.
                                    ^---------------^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
   
   Did you mean: 
       check_arg "tmpFeEditLogPort" "$tmpFeEditLogPort"
   
   
   In docker/runtime/be/resource/init_be.sh line 89:
       feEditLogPortArray[$tmpFeId]=${tmpFeEditLogPort}
                          ^------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       feEditLogPortArray[${tmpFeId}]=${tmpFeEditLogPort}
   
   
   In docker/runtime/be/resource/init_be.sh line 94:
     check_arg "MASTER_FE_IP" $MASTER_FE_IP
                              ^-----------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                              ^-----------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "MASTER_FE_IP" "$MASTER_FE_IP"
   
   
   In docker/runtime/be/resource/init_be.sh line 96:
     check_arg "BE_HOST_IP" $BE_HOST_IP
                            ^---------^ SC2086 (info): Double quote to prevent 
globbing and word splitting.
                            ^---------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "BE_HOST_IP" "$BE_HOST_IP"
   
   
   In docker/runtime/be/resource/init_be.sh line 98:
     check_arg "BE_HEARTBEAT_PORT" $BE_HEARTBEAT_PORT
                                   ^----------------^ SC2086 (info): Double 
quote to prevent globbing and word splitting.
                                   ^----------------^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "BE_HEARTBEAT_PORT" "$BE_HEARTBEAT_PORT"
   
   
   In docker/runtime/be/resource/init_be.sh line 101:
     check_arg "priority_networks" $PRIORITY_NETWORKS
                                   ^----------------^ SC2086 (info): Double 
quote to prevent globbing and word splitting.
                                   ^----------------^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "priority_networks" "$PRIORITY_NETWORKS"
   
   
   In docker/runtime/be/resource/init_be.sh line 114:
     echo "priority_networks = ${1}" >>${DORIS_HOME}/be/conf/be.conf
                                       ^-----------^ SC2248 (style): Prefer 
double quoting even when variables don't contain special characters.
   
   Did you mean: 
     echo "priority_networks = ${1}" >>"${DORIS_HOME}"/be/conf/be.conf
   
   
   In docker/runtime/be/resource/init_be.sh line 121:
     mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" >2&1>/dev/null
                           ^-------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                                                           ^-- SC2210 
(warning): This is a file redirection. Was it supposed to be a comparison or fd 
operation?
                                                              ^---------^ 
SC2188 (warning): This redirection doesn't have a command. Move to its command 
(or use 'true' as no-op).
   
   Did you mean: 
     mysql -uroot -P9030 -h"${MASTER_FE_IP}" --comments "$@" >2&1>/dev/null
   
   
   In docker/runtime/be/resource/init_be.sh line 129:
       if [[ $(( $i % 20 )) == 1 ]]; then
                 ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                 ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 134:
       if [[ $register_be_status == 0 ]]; then
             ^-----------------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       if [[ ${register_be_status} == 0 ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 140:
         if [ -n "$BE_ALREADY_EXISTS" ]; then
            ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
                  ^----------------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
         if [[ -n "${BE_ALREADY_EXISTS}" ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 144:
         if [[ $(( $i % 20 )) == 1 ]]; then
                   ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                   ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 151:
     if ! [[ $is_fe_start ]]; then
             ^----------^ SC2244 (style): Prefer explicit -n to check non-empty 
string (or use =/-ne to check boolean/integer).
             ^----------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if ! [[ -n $is_fe_start ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 159:
     if [ -z $2 ]; then
        ^-------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
             ^-- SC2086 (info): Double quote to prevent globbing and word 
splitting.
   
   Did you mean: 
     if [[ -z "$2" ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 168:
       if [[ $(( $i % 20 )) == 1 ]]; then
                 ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                 ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 199:
     if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
              ^----------------------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
     if [[ -z "${DATABASE_ALREADY_EXISTS}" ]]; then
   
   
   In docker/runtime/be/resource/init_be.sh line 200:
       add_priority_networks $PRIORITY_NETWORKS
                             ^----------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                             ^----------------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
       add_priority_networks "$PRIORITY_NETWORKS"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 35:
     if [ "$#" -eq 0 ]; then text="$(cat)"; fi
        ^------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in 
Bash/Ksh.
   
   Did you mean: 
     if [[ "$#" -eq 0 ]]; then text="$(cat)"; fi
   
   
   In docker/runtime/fe/resource/init_fe.sh line 36:
     local dt="$(date -Iseconds)"
           ^-- SC2155 (warning): Declare and assign separately to avoid masking 
return values.
   
   
   In docker/runtime/fe/resource/init_fe.sh line 37:
     printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
                                          ^-^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
                                                ^---^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
                                                        ^---^ SC2250 (style): 
Prefer putting braces around variable references even when not strictly 
required.
   
   Did you mean: 
     printf '%s [%s] [Entrypoint]: %s\n' "${dt}" "${type}" "${text}"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 52:
     [ "${#FUNCNAME[@]}" -ge 2 ] &&
     ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for 
tests in Bash/Ksh.
   
   Did you mean: 
     [[ "${#FUNCNAME[@]}" -ge 2 ]] &&
   
   
   In docker/runtime/fe/resource/init_fe.sh line 53:
       [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
       ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
   
   Did you mean: 
       [[ "${FUNCNAME[0]}" = '_is_sourced' ]] &&
   
   
   In docker/runtime/fe/resource/init_fe.sh line 54:
       [ "${FUNCNAME[1]}" = 'source' ]
       ^-----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
   
   Did you mean: 
       [[ "${FUNCNAME[1]}" = 'source' ]]
   
   
   In docker/runtime/fe/resource/init_fe.sh line 59:
     if [ -d "${DORIS_HOME}/fe/doris-meta/image" ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
   
   Did you mean: 
     if [[ -d "${DORIS_HOME}/fe/doris-meta/image" ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 66:
     if [[ $FE_SERVERS =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
           ^---------^ SC2154 (warning): FE_SERVERS is referenced but not 
assigned.
           ^---------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if [[ ${FE_SERVERS} =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 67:
       doris_warn "FE_SERVERS" $FE_SERVERS
                               ^---------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                               ^---------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
       doris_warn "FE_SERVERS" "$FE_SERVERS"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 71:
     if [[ $FE_ID =~ ^[1-9]{1}$ ]]; then
           ^----^ SC2154 (warning): FE_ID is referenced but not assigned.
           ^----^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if [[ ${FE_ID} =~ ^[1-9]{1}$ ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 72:
       doris_warn "FE_ID" $FE_ID
                          ^----^ SC2086 (info): Double quote to prevent 
globbing and word splitting.
                          ^----^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       doris_warn "FE_ID" "$FE_ID"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 79:
     local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); print 
$0}'))
                          ^-- SC2207 (warning): Prefer mapfile or read -a to 
split command output (or quote to avoid splitting).
   
   
   In docker/runtime/fe/resource/init_fe.sh line 86:
       check_arg "TMP_FE_NAME" $tmpFeName
                               ^--------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                               ^--------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
       check_arg "TMP_FE_NAME" "$tmpFeName"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 87:
       feIpArray[$tmpFeName]=${tmpFeIp}
                 ^--------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       feIpArray[${tmpFeName}]=${tmpFeIp}
   
   
   In docker/runtime/fe/resource/init_fe.sh line 88:
       check_arg "TMP_FE_EDIT_LOG_PORT" $tmpFeEditLogPort
                                        ^---------------^ SC2086 (info): Double 
quote to prevent globbing and word splitting.
                                        ^---------------^ SC2250 (style): 
Prefer putting braces around variable references even when not strictly 
required.
   
   Did you mean: 
       check_arg "TMP_FE_EDIT_LOG_PORT" "$tmpFeEditLogPort"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 89:
       feEditLogPortArray[$tmpFeName]=${tmpFeEditLogPort}
                          ^--------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
       feEditLogPortArray[${tmpFeName}]=${tmpFeEditLogPort}
   
   
   In docker/runtime/fe/resource/init_fe.sh line 94:
     check_arg "MASTER_FE_IP" $MASTER_FE_IP
                              ^-----------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                              ^-----------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "MASTER_FE_IP" "$MASTER_FE_IP"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 96:
     check_arg "MASTER_FE_EDIT_PORT" $MASTER_FE_EDIT_PORT
                                     ^------------------^ SC2086 (info): Double 
quote to prevent globbing and word splitting.
                                     ^------------------^ SC2250 (style): 
Prefer putting braces around variable references even when not strictly 
required.
   
   Did you mean: 
     check_arg "MASTER_FE_EDIT_PORT" "$MASTER_FE_EDIT_PORT"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 98:
     check_arg "CURRENT_FE_IP" $CURRENT_FE_IP
                               ^------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                               ^------------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "CURRENT_FE_IP" "$CURRENT_FE_IP"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 100:
     check_arg "CURRENT_FE_EDIT_PORT" $CURRENT_FE_EDIT_PORT
                                      ^-------------------^ SC2086 (info): 
Double quote to prevent globbing and word splitting.
                                      ^-------------------^ SC2250 (style): 
Prefer putting braces around variable references even when not strictly 
required.
   
   Did you mean: 
     check_arg "CURRENT_FE_EDIT_PORT" "$CURRENT_FE_EDIT_PORT"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 102:
     if [ ${MASTER_FE_IP} == ${CURRENT_FE_IP} ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
          ^-------------^ SC2086 (info): Double quote to prevent globbing and 
word splitting.
                             ^--------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
   
   Did you mean: 
     if [[ "${MASTER_FE_IP}" == "${CURRENT_FE_IP}" ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 109:
     check_arg "PRIORITY_NETWORKS" $PRIORITY_NETWORKS
                                   ^----------------^ SC2086 (info): Double 
quote to prevent globbing and word splitting.
                                   ^----------------^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
   
   Did you mean: 
     check_arg "PRIORITY_NETWORKS" "$PRIORITY_NETWORKS"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 122:
     echo "priority_networks = ${1}" >>${DORIS_HOME}/fe/conf/fe.conf
                                       ^-----------^ SC2248 (style): Prefer 
double quoting even when variables don't contain special characters.
   
   Did you mean: 
     echo "priority_networks = ${1}" >>"${DORIS_HOME}"/fe/conf/fe.conf
   
   
   In docker/runtime/fe/resource/init_fe.sh line 129:
     mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" 2>/dev/null
                           ^-------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
   
   Did you mean: 
     mysql -uroot -P9030 -h"${MASTER_FE_IP}" --comments "$@" 2>/dev/null
   
   
   In docker/runtime/fe/resource/init_fe.sh line 136:
     if [ ${CURRENT_FE_IS_MASTER} == true ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
          ^---------------------^ SC2248 (style): Prefer double quoting even 
when variables don't contain special characters.
   
   Did you mean: 
     if [[ "${CURRENT_FE_IS_MASTER}" == true ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 141:
       if [[ $(( $i % 20 )) == 1 ]]; then
                 ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                 ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 146:
       if [[ $register_fe_status == 0 ]]; then
             ^-----------------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       if [[ ${register_fe_status} == 0 ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 152:
         if [ -n "$CURRENT_FE_ALREADY_EXISTS" ]; then
            ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
                  ^------------------------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
         if [[ -n "${CURRENT_FE_ALREADY_EXISTS}" ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 156:
         if [[ $(( $i % 20 )) == 1 ]]; then
                   ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                   ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 163:
     if ! [[ $is_fe_start ]]; then
             ^----------^ SC2244 (style): Prefer explicit -n to check non-empty 
string (or use =/-ne to check boolean/integer).
             ^----------^ SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
     if ! [[ -n $is_fe_start ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 171:
     if [ -z $2 ]; then
        ^-------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
             ^-- SC2086 (info): Double quote to prevent globbing and word 
splitting.
   
   Did you mean: 
     if [[ -z "$2" ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 180:
     if [ ${CURRENT_FE_IS_MASTER} == true ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
          ^---------------------^ SC2248 (style): Prefer double quoting even 
when variables don't contain special characters.
   
   Did you mean: 
     if [[ "${CURRENT_FE_IS_MASTER}" == true ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 185:
       if [[ $(( $i % 20 )) == 1 ]]; then
                 ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                 ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
       if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 203:
         if [[ $(( $i % 20 )) == 1 ]]; then
                   ^-- SC2004 (style): $/${} is unnecessary on arithmetic 
variables.
                   ^-- SC2250 (style): Prefer putting braces around variable 
references even when not strictly required.
   
   Did you mean: 
         if [[ $(( ${i} % 20 )) == 1 ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 220:
     if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
              ^----------------------^ SC2250 (style): Prefer putting braces 
around variable references even when not strictly required.
   
   Did you mean: 
     if [[ -z "${DATABASE_ALREADY_EXISTS}" ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 221:
       add_priority_networks $PRIORITY_NETWORKS
                             ^----------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                             ^----------------^ SC2250 (style): Prefer putting 
braces around variable references even when not strictly required.
   
   Did you mean: 
       add_priority_networks "$PRIORITY_NETWORKS"
   
   
   In docker/runtime/fe/resource/init_fe.sh line 228:
     if [ $CURRENT_FE_IS_MASTER == true ]; then
        ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
          ^-------------------^ SC2248 (style): Prefer double quoting even when 
variables don't contain special characters.
          ^-------------------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
     if [[ "$CURRENT_FE_IS_MASTER" == true ]]; then
   
   
   In docker/runtime/fe/resource/init_fe.sh line 231:
       start_fe.sh --helper ${MASTER_FE_IP}:${MASTER_FE_EDIT_PORT}
                            ^-------------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
                                            ^--------------------^ SC2086 
(info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
       start_fe.sh --helper "${MASTER_FE_IP}":"${MASTER_FE_EDIT_PORT}"
   
   For more information:
     https://www.shellcheck.net/wiki/SC1090 -- ShellCheck can't follow 
non-const...
     https://www.shellcheck.net/wiki/SC2154 -- BE_ADDR is referenced but not 
ass...
     https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to 
...
   ----------
   
   You can address the above issues in one of three ways:
   1. Manually correct the issue in the offending shell script;
   2. Disable specific issues by adding the comment:
     # shellcheck disable=NNNN
   above the line that contains the issue, where NNNN is the error code;
   3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.
   
   
   
   ```
   </details>
   
   <details>
   <summary>shfmt errors</summary>
   
   ```
   
   'shfmt ' returned error 1 finding the following formatting issues:
   
   ----------
   --- docker/runtime/be/resource/entry_point.sh.orig
   +++ docker/runtime/be/resource/entry_point.sh
   @@ -26,55 +26,55 @@
    #    ie: doris_warn "task may be risky!"
    #   out: 2023-01-08T19:08:16+08:00 [Warn] [Entrypoint]: task may be risky!
    doris_log() {
   -  local type="$1"
   -  shift
   -  # accept argument string or stdin
   -  local text="$*"
   -  if [ "$#" -eq 0 ]; then text="$(cat)"; fi
   -  local dt="$(date -Iseconds)"
   -  printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
   +    local type="$1"
   +    shift
   +    # accept argument string or stdin
   +    local text="$*"
   +    if [ "$#" -eq 0 ]; then text="$(cat)"; fi
   +    local dt="$(date -Iseconds)"
   +    printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
    }
    doris_note() {
   -  doris_log Note "$@"
   +    doris_log Note "$@"
    }
    doris_warn() {
   -  doris_log Warn "$@" >&2
   +    doris_log Warn "$@" >&2
    }
    doris_error() {
   -  doris_log ERROR "$@" >&2
   -  exit 1
   +    doris_log ERROR "$@" >&2
   +    exit 1
    }
    
    # check to see if this file is being run or sourced from another script
    _is_sourced() {
   -  [ "${#FUNCNAME[@]}" -ge 2 ] &&
   -    [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
   -    [ "${FUNCNAME[1]}" = 'source' ]
   +    [ "${#FUNCNAME[@]}" -ge 2 ] &&
   +        [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
   +        [ "${FUNCNAME[1]}" = 'source' ]
    }
    
    docker_setup_env() {
   -  declare -g DATABASE_ALREADY_EXISTS
   -  if [ -d "${DORIS_HOME}/be/storage/data" ]; then
   -    DATABASE_ALREADY_EXISTS='true'
   -  fi
   +    declare -g DATABASE_ALREADY_EXISTS
   +    if [ -d "${DORIS_HOME}/be/storage/data" ]; then
   +        DATABASE_ALREADY_EXISTS='true'
   +    fi
    }
    
    get_doris_args() {
   -  local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); print 
$0}'))
   -  for i in "${feServerArray[@]}"; do
   -    val=${i}
   -    val=${val// /}
   -    tmpFeId=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, ""); 
print$1}')
   -    tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
   -    feIpArray[$tmpFeId]=${tmpFeIp}
   -  done
   +    local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); 
print $0}'))
   +    for i in "${feServerArray[@]}"; do
   +        val=${i}
   +        val=${val// /}
   +        tmpFeId=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, 
""); print$1}')
   +        tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
   +        feIpArray[$tmpFeId]=${tmpFeIp}
   +    done
    
   -  declare -g MASTER_FE_IP BE_HOST_IP BE_HEARTBEAT_PORT
   -  MASTER_FE_IP=${feIpArray[1]}
   -  doris_note "masterFe = ${MASTER_FE_IP}"
   -  BE_HOST_IP=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
   -  BE_HEARTBEAT_PORT=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); 
print$2}')
   -  doris_note "be_addr = ${BE_HOST_IP}:${BE_HEARTBEAT_PORT}"
   +    declare -g MASTER_FE_IP BE_HOST_IP BE_HEARTBEAT_PORT
   +    MASTER_FE_IP=${feIpArray[1]}
   +    doris_note "masterFe = ${MASTER_FE_IP}"
   +    BE_HOST_IP=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
   +    BE_HEARTBEAT_PORT=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); 
print$2}')
   +    doris_note "be_addr = ${BE_HOST_IP}:${BE_HEARTBEAT_PORT}"
    }
    
    # Execute sql script, passed via stdin
   @@ -82,103 +82,103 @@
    #    ie: docker_process_sql --database=mydb <<<'INSERT ...'
    #    ie: docker_process_sql --database=mydb <my-file.sql
    docker_process_sql() {
   -  set +e
   -  mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" 2>/dev/null
   +    set +e
   +    mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" 2>/dev/null
    }
    
    check_be_status() {
   -  set +e
   -  local is_fe_start=false
   -  for i in {1..300}; do
   -    if [[ $(( $i % 20 )) == 1 ]]; then
   -      doris_warn "start check be status~"
   +    set +e
   +    local is_fe_start=false
   +    for i in {1..300}; do
   +        if [[ $(($i % 20)) == 1 ]]; then
   +            doris_warn "start check be status~"
   +        fi
   +        docker_process_sql <<<"show backends;" | grep 
"[[:space:]]${BE_HOST_IP}[[:space:]]" | grep 
"[[:space:]]${BE_HEARTBEAT_PORT}[[:space:]]" | grep "[[:space:]]true[[:space:]]"
   +        be_join_status=$?
   +        if [[ "${be_join_status}" == 0 ]]; then
   +            doris_note "Verify that BE is registered to FE successfully"
   +            is_fe_start=true
   +            break
   +        else
   +            if [[ $(($i % 20)) == 1 ]]; then
   +                doris_note "register is failed, wait next~"
   +            fi
   +        fi
   +        sleep 1
   +    done
   +    if ! [[ $is_fe_start ]]; then
   +        doris_error "Failed to register BE to FE!Tried 30 times!Maybe FE 
Start Failed!"
        fi
   -    docker_process_sql <<<"show backends;" | grep 
"[[:space:]]${BE_HOST_IP}[[:space:]]" | grep 
"[[:space:]]${BE_HEARTBEAT_PORT}[[:space:]]" | grep "[[:space:]]true[[:space:]]"
   -    be_join_status=$?
   -    if [[ "${be_join_status}" == 0 ]]; then
   -      doris_note "Verify that BE is registered to FE successfully"
   -      is_fe_start=true
   -      break
   -    else
   -      if [[ $(( $i % 20 )) == 1 ]]; then
   -        doris_note "register is failed, wait next~"
   -      fi
   -    fi
   -    sleep 1
   -  done
   -  if ! [[ $is_fe_start ]]; then
   -    doris_error "Failed to register BE to FE!Tried 30 times!Maybe FE Start 
Failed!"
   -  fi
    }
    
    # usage: docker_process_init_files [file [file [...]]]
    #    ie: docker_process_init_files /always-initdb.d/*
    # process initializer files, based on file extensions
    docker_process_init_files() {
   -  local f
   -  for f; do
   -    case "$f" in
   -    *.sh)
   -      if [ -x "$f" ]; then
   -        doris_note "$0: running $f"
   -        "$f"
   -      else
   -        doris_note "$0: sourcing $f"
   -        . "$f"
   -      fi
   -      ;;
   -    *.sql)
   -      doris_note "$0: running $f"
   -      docker_process_sql <"$f"
   -      echo
   -      ;;
   -    *.sql.bz2)
   -      doris_note "$0: running $f"
   -      bunzip2 -c "$f" | docker_process_sql
   -      echo
   -      ;;
   -    *.sql.gz)
   -      doris_note "$0: running $f"
   -      gunzip -c "$f" | docker_process_sql
   -      echo
   -      ;;
   -    *.sql.xz)
   -      doris_note "$0: running $f"
   -      xzcat "$f" | docker_process_sql
   -      echo
   -      ;;
   -    *.sql.zst)
   -      doris_note "$0: running $f"
   -      zstd -dc "$f" | docker_process_sql
   -      echo
   -      ;;
   -    *) doris_warn "$0: ignoring $f" ;;
   -    esac
   -    echo
   -  done
   +    local f
   +    for f; do
   +        case "$f" in
   +        *.sh)
   +            if [ -x "$f" ]; then
   +                doris_note "$0: running $f"
   +                "$f"
   +            else
   +                doris_note "$0: sourcing $f"
   +                . "$f"
   +            fi
   +            ;;
   +        *.sql)
   +            doris_note "$0: running $f"
   +            docker_process_sql <"$f"
   +            echo
   +            ;;
   +        *.sql.bz2)
   +            doris_note "$0: running $f"
   +            bunzip2 -c "$f" | docker_process_sql
   +            echo
   +            ;;
   +        *.sql.gz)
   +            doris_note "$0: running $f"
   +            gunzip -c "$f" | docker_process_sql
   +            echo
   +            ;;
   +        *.sql.xz)
   +            doris_note "$0: running $f"
   +            xzcat "$f" | docker_process_sql
   +            echo
   +            ;;
   +        *.sql.zst)
   +            doris_note "$0: running $f"
   +            zstd -dc "$f" | docker_process_sql
   +            echo
   +            ;;
   +        *) doris_warn "$0: ignoring $f" ;;
   +        esac
   +        echo
   +    done
    }
    
    _main() {
   -  docker_setup_env
   -  # get init args
   -  get_doris_args
   -  # Start Doris BE
   -  {
   -    set +e
   -    bash init_be.sh 2>/dev/null
   -  } &
   -  # check BE started status
   -  check_be_status
   -  if [ -z ${DATABASE_ALREADY_EXISTS} ]; then
   -    # run script
   -    docker_process_init_files /docker-entrypoint-initdb.d/*
   -  fi
   +    docker_setup_env
   +    # get init args
   +    get_doris_args
   +    # Start Doris BE
   +    {
   +        set +e
   +        bash init_be.sh 2>/dev/null
   +    } &
   +    # check BE started status
   +    check_be_status
   +    if [ -z ${DATABASE_ALREADY_EXISTS} ]; then
   +        # run script
   +        docker_process_init_files /docker-entrypoint-initdb.d/*
   +    fi
    
   -  # keep BE started status
   -  wait
   -  exec "$@"
   +    # keep BE started status
   +    wait
   +    exec "$@"
    }
    
    if ! _is_sourced; then
   -  _main "$@"
   +    _main "$@"
    fi
   --- docker/runtime/be/resource/init_be.sh.orig
   +++ docker/runtime/be/resource/init_be.sh
   @@ -28,185 +28,186 @@
    #    ie: doris_warn "task may be risky!"
    #   out: 2023-01-08T19:08:16+08:00 [Warn] [Entrypoint]: task may be risky!
    doris_log() {
   -  local type="$1"
   -  shift
   -  # accept argument string or stdin
   -  local text="$*"
   -  if [ "$#" -eq 0 ]; then text="$(cat)"; fi
   -  local dt="$(date -Iseconds)"
   -  printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
   +    local type="$1"
   +    shift
   +    # accept argument string or stdin
   +    local text="$*"
   +    if [ "$#" -eq 0 ]; then text="$(cat)"; fi
   +    local dt="$(date -Iseconds)"
   +    printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
    }
    doris_note() {
   -  doris_log Note "$@"
   +    doris_log Note "$@"
    }
    doris_warn() {
   -  doris_log Warn "$@" >&2
   +    doris_log Warn "$@" >&2
    }
    doris_error() {
   -  doris_log ERROR "$@" >&2
   -  exit 1
   +    doris_log ERROR "$@" >&2
   +    exit 1
    }
    
    # check to see if this file is being run or sourced from another script
    _is_sourced() {
   -  [ "${#FUNCNAME[@]}" -ge 2 ] &&
   -    [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
   -    [ "${FUNCNAME[1]}" = 'source' ]
   +    [ "${#FUNCNAME[@]}" -ge 2 ] &&
   +        [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
   +        [ "${FUNCNAME[1]}" = 'source' ]
    }
    
    docker_setup_env() {
   -  declare -g DATABASE_ALREADY_EXISTS
   -  if [ -d "${DORIS_HOME}/be/storage/data" ]; then
   -    DATABASE_ALREADY_EXISTS='true'
   -  fi
   +    declare -g DATABASE_ALREADY_EXISTS
   +    if [ -d "${DORIS_HOME}/be/storage/data" ]; then
   +        DATABASE_ALREADY_EXISTS='true'
   +    fi
    }
    
    # Check the variables required for startup
    docker_required_variables_env() {
   -  if [[ $FE_SERVERS =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
   -    doris_warn "FE_SERVERS" $FE_SERVERS
   -  else
   -    doris_error "FE_SERVERS rule error!example: 
\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT[,\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT]..."
   -  fi
   -  if [[ $BE_ADDR =~ 
^[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}$
 ]]; then
   -    doris_warn "BE_ADDR" $BE_ADDR
   -  else
   -    doris_error "BE_ADDR rule error!example: 
\$BE_HOST_IP:\$HEARTBEAT_SERVICE_PORT"
   -  fi
   +    if [[ $FE_SERVERS =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
   +        doris_warn "FE_SERVERS" $FE_SERVERS
   +    else
   +        doris_error "FE_SERVERS rule error!example: 
\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT[,\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT]..."
   +    fi
   +    if [[ $BE_ADDR =~ 
^[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}$
 ]]; then
   +        doris_warn "BE_ADDR" $BE_ADDR
   +    else
   +        doris_error "BE_ADDR rule error!example: 
\$BE_HOST_IP:\$HEARTBEAT_SERVICE_PORT"
   +    fi
    }
    
    get_doris_be_args() {
   -  local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); print 
$0}'))
   -  for i in "${feServerArray[@]}"; do
   -    val=${i}
   -    val=${val// /}
   -    tmpFeId=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, ""); 
print$1}')
   -    tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
   -    tmpFeEditLogPort=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); 
print$3}')
   -    check_arg "tmpFeIp" $tmpFeIp
   -    feIpArray[$tmpFeId]=${tmpFeIp}
   -    check_arg "tmpFeEditLogPort" $tmpFeEditLogPort
   -    feEditLogPortArray[$tmpFeId]=${tmpFeEditLogPort}
   -  done
   +    local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); 
print $0}'))
   +    for i in "${feServerArray[@]}"; do
   +        val=${i}
   +        val=${val// /}
   +        tmpFeId=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, 
""); print$1}')
   +        tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
   +        tmpFeEditLogPort=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); 
print$3}')
   +        check_arg "tmpFeIp" $tmpFeIp
   +        feIpArray[$tmpFeId]=${tmpFeIp}
   +        check_arg "tmpFeEditLogPort" $tmpFeEditLogPort
   +        feEditLogPortArray[$tmpFeId]=${tmpFeEditLogPort}
   +    done
    
   -  declare -g MASTER_FE_IP BE_HOST_IP BE_HEARTBEAT_PORT PRIORITY_NETWORKS
   -  MASTER_FE_IP=${feIpArray[1]}
   -  check_arg "MASTER_FE_IP" $MASTER_FE_IP
   -  BE_HOST_IP=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
   -  check_arg "BE_HOST_IP" $BE_HOST_IP
   -  BE_HEARTBEAT_PORT=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); 
print$2}')
   -  check_arg "BE_HEARTBEAT_PORT" $BE_HEARTBEAT_PORT
   +    declare -g MASTER_FE_IP BE_HOST_IP BE_HEARTBEAT_PORT PRIORITY_NETWORKS
   +    MASTER_FE_IP=${feIpArray[1]}
   +    check_arg "MASTER_FE_IP" $MASTER_FE_IP
   +    BE_HOST_IP=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
   +    check_arg "BE_HOST_IP" $BE_HOST_IP
   +    BE_HEARTBEAT_PORT=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); 
print$2}')
   +    check_arg "BE_HEARTBEAT_PORT" $BE_HEARTBEAT_PORT
    
   -  PRIORITY_NETWORKS=$(echo "${BE_HOST_IP}" | awk -F '.' 
'{print$1"."$2"."$3".0/24"}')
   -  check_arg "priority_networks" $PRIORITY_NETWORKS
   +    PRIORITY_NETWORKS=$(echo "${BE_HOST_IP}" | awk -F '.' 
'{print$1"."$2"."$3".0/24"}')
   +    check_arg "priority_networks" $PRIORITY_NETWORKS
    
   -  doris_note "feIpArray = ${feIpArray[*]}"
   -  doris_note "feEditLogPortArray = ${feEditLogPortArray[*]}"
   -  doris_note "masterFe = ${feIpArray[1]}:${feEditLogPortArray[1]}"
   -  doris_note "be_addr = ${BE_HOST_IP}:${BE_HEARTBEAT_PORT}"
   -  doris_note "priority_networks = ${PRIORITY_NETWORKS}"
   -  # wait fe start
   -  check_be_status true
   +    doris_note "feIpArray = ${feIpArray[*]}"
   +    doris_note "feEditLogPortArray = ${feEditLogPortArray[*]}"
   +    doris_note "masterFe = ${feIpArray[1]}:${feEditLogPortArray[1]}"
   +    doris_note "be_addr = ${BE_HOST_IP}:${BE_HEARTBEAT_PORT}"
   +    doris_note "priority_networks = ${PRIORITY_NETWORKS}"
   +    # wait fe start
   +    check_be_status true
    }
    
    add_priority_networks() {
   -  doris_note "add priority_networks ${1} to ${DORIS_HOME}/be/conf/be.conf"
   -  echo "priority_networks = ${1}" >>${DORIS_HOME}/be/conf/be.conf
   +    doris_note "add priority_networks ${1} to ${DORIS_HOME}/be/conf/be.conf"
   +    echo "priority_networks = ${1}" >>${DORIS_HOME}/be/conf/be.conf
    }
    
    # Execute sql script, passed via stdin
    # usage: docker_process_sql sql_script
    docker_process_sql() {
   -  set +e
   -  mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" >2&1>/dev/null
   +    set +e
   +    mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" >2 &
   +    1>/dev/null
    }
    
    register_be_to_fe() {
   -  set +e
   -  # check fe status
   -  local is_fe_start=false
   -  for i in {1..300}; do
   -    if [[ $(( $i % 20 )) == 1 ]]; then
   -      doris_note "Register BE to FE is failed. retry."
   +    set +e
   +    # check fe status
   +    local is_fe_start=false
   +    for i in {1..300}; do
   +        if [[ $(($i % 20)) == 1 ]]; then
   +            doris_note "Register BE to FE is failed. retry."
   +        fi
   +        docker_process_sql <<<"alter system add backend 
'${BE_HOST_IP}:${BE_HEARTBEAT_PORT}'"
   +        register_be_status=$?
   +        if [[ $register_be_status == 0 ]]; then
   +            doris_note "BE successfully registered to FE!"
   +            is_fe_start=true
   +            break
   +        else
   +            check_be_status
   +            if [ -n "$BE_ALREADY_EXISTS" ]; then
   +                doris_warn "Same backend already exists! No need to 
register again!"
   +                break
   +            fi
   +            if [[ $(($i % 20)) == 1 ]]; then
   +                doris_warn "register_be_status: ${register_be_status}"
   +                doris_warn "BE failed registered to FE!"
   +            fi
   +        fi
   +        sleep 1
   +    done
   +    if ! [[ $is_fe_start ]]; then
   +        doris_error "Failed to register BE to FE!Tried 30 times!Maybe FE 
Start Failed!"
        fi
   -    docker_process_sql <<<"alter system add backend 
'${BE_HOST_IP}:${BE_HEARTBEAT_PORT}'"
   -    register_be_status=$?
   -    if [[ $register_be_status == 0 ]]; then
   -      doris_note "BE successfully registered to FE!"
   -      is_fe_start=true
   -      break
   -    else
   -      check_be_status
   -      if [ -n "$BE_ALREADY_EXISTS" ]; then
   -        doris_warn "Same backend already exists! No need to register again!"
   -        break
   -      fi
   -      if [[ $(( $i % 20 )) == 1 ]]; then
   -          doris_warn "register_be_status: ${register_be_status}"
   -          doris_warn "BE failed registered to FE!"
   -      fi
   -    fi
   -    sleep 1
   -  done
   -  if ! [[ $is_fe_start ]]; then
   -    doris_error "Failed to register BE to FE!Tried 30 times!Maybe FE Start 
Failed!"
   -  fi
    }
    
    # Check whether the passed parameters are empty to avoid subsequent task 
execution failures. At the same time,
    # enumeration checks can be added, such as checking whether a certain 
parameter appears repeatedly, etc.
    check_arg() {
   -  if [ -z $2 ]; then
   -    doris_error "$1 is null!"
   -  fi
   +    if [ -z $2 ]; then
   +        doris_error "$1 is null!"
   +    fi
    }
    
    # 这里可用 docker_process_sql() 函数封装,为了方便调试,暂未封装
    check_be_status() {
   -  set +e
   -  for i in {1..300}; do
   -    if [[ $(( $i % 20 )) == 1 ]]; then
   -      if [[ $1 == true ]]; then
   -        doris_note "MASTER FE is not started. retry."
   -      else
   -        doris_note "BE is not register. retry."
   -      fi
   -    fi
   -    if [[ $1 == true ]]; then
   -      docker_process_sql <<<"show frontends" | grep 
"[[:space:]]${MASTER_FE_IP}[[:space:]]"
   -    else
   -      docker_process_sql <<<"show backends" | grep 
"[[:space:]]${BE_HOST_IP}[[:space:]]" | grep 
"[[:space:]]${BE_HEARTBEAT_PORT}[[:space:]]"
   -    fi
   -    be_join_status=$?
   -    if [[ "${be_join_status}" == 0 ]]; then
   -      if [[ $1 == true ]]; then
   -        doris_note "MASTER FE is started!"
   -      else
   -        doris_note "Init Check - Verify that BE is registered to FE 
successfully"
   -        BE_ALREADY_EXISTS=true
   -      fi
   -      break
   -    fi
   -    sleep 1
   -  done
   +    set +e
   +    for i in {1..300}; do
   +        if [[ $(($i % 20)) == 1 ]]; then
   +            if [[ $1 == true ]]; then
   +                doris_note "MASTER FE is not started. retry."
   +            else
   +                doris_note "BE is not register. retry."
   +            fi
   +        fi
   +        if [[ $1 == true ]]; then
   +            docker_process_sql <<<"show frontends" | grep 
"[[:space:]]${MASTER_FE_IP}[[:space:]]"
   +        else
   +            docker_process_sql <<<"show backends" | grep 
"[[:space:]]${BE_HOST_IP}[[:space:]]" | grep 
"[[:space:]]${BE_HEARTBEAT_PORT}[[:space:]]"
   +        fi
   +        be_join_status=$?
   +        if [[ "${be_join_status}" == 0 ]]; then
   +            if [[ $1 == true ]]; then
   +                doris_note "MASTER FE is started!"
   +            else
   +                doris_note "Init Check - Verify that BE is registered to FE 
successfully"
   +                BE_ALREADY_EXISTS=true
   +            fi
   +            break
   +        fi
   +        sleep 1
   +    done
    }
    
    _main() {
   -  docker_setup_env
   -  docker_required_variables_env
   -  get_doris_be_args
   +    docker_setup_env
   +    docker_required_variables_env
   +    get_doris_be_args
    
   -  if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
   -    add_priority_networks $PRIORITY_NETWORKS
   -  fi
   +    if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
   +        add_priority_networks $PRIORITY_NETWORKS
   +    fi
    
   -  register_be_to_fe
   -  check_be_status
   -  doris_note "Ready to start BE!"
   -  start_be.sh
   -  exec "$@"
   +    register_be_to_fe
   +    check_be_status
   +    doris_note "Ready to start BE!"
   +    start_be.sh
   +    exec "$@"
    }
    
    if ! _is_sourced; then
   -  _main "$@"
   +    _main "$@"
    fi
   --- docker/runtime/fe/resource/init_fe.sh.orig
   +++ docker/runtime/fe/resource/init_fe.sh
   @@ -28,212 +28,212 @@
    #    ie: doris_warn "task may fe risky!"
    #   out: 2023-01-08T19:08:16+08:00 [Warn] [Entrypoint]: task may fe risky!
    doris_log() {
   -  local type="$1"
   -  shift
   -  # accept argument string or stdin
   -  local text="$*"
   -  if [ "$#" -eq 0 ]; then text="$(cat)"; fi
   -  local dt="$(date -Iseconds)"
   -  printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
   +    local type="$1"
   +    shift
   +    # accept argument string or stdin
   +    local text="$*"
   +    if [ "$#" -eq 0 ]; then text="$(cat)"; fi
   +    local dt="$(date -Iseconds)"
   +    printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
    }
    doris_note() {
   -  doris_log Note "$@"
   +    doris_log Note "$@"
    }
    doris_warn() {
   -  doris_log Warn "$@" >&2
   +    doris_log Warn "$@" >&2
    }
    doris_error() {
   -  doris_log ERROR "$@" >&2
   -  exit 1
   +    doris_log ERROR "$@" >&2
   +    exit 1
    }
    
    # check to see if this file is being run or sourced from another script
    _is_sourced() {
   -  [ "${#FUNCNAME[@]}" -ge 2 ] &&
   -    [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
   -    [ "${FUNCNAME[1]}" = 'source' ]
   +    [ "${#FUNCNAME[@]}" -ge 2 ] &&
   +        [ "${FUNCNAME[0]}" = '_is_sourced' ] &&
   +        [ "${FUNCNAME[1]}" = 'source' ]
    }
    
    docker_setup_env() {
   -  declare -g DATABASE_ALREADY_EXISTS
   -  if [ -d "${DORIS_HOME}/fe/doris-meta/image" ]; then
   -    DATABASE_ALREADY_EXISTS='true'
   -  fi
   +    declare -g DATABASE_ALREADY_EXISTS
   +    if [ -d "${DORIS_HOME}/fe/doris-meta/image" ]; then
   +        DATABASE_ALREADY_EXISTS='true'
   +    fi
    }
    
    # Check the variables required for startup
    docker_required_variables_env() {
   -  if [[ $FE_SERVERS =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
   -    doris_warn "FE_SERVERS" $FE_SERVERS
   -  else
   -    doris_error "FE_SERVERS rule error!example: 
\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT[,\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT]..."
   -  fi
   -  if [[ $FE_ID =~ ^[1-9]{1}$ ]]; then
   -    doris_warn "FE_ID" $FE_ID
   -  else
   -    doris_error "FE_ID rule error!If FE is the role of Master, please set 
FE_ID=1, and ensure that all IDs correspond to the IP of the current node."
   -  fi
   +    if [[ $FE_SERVERS =~ 
^.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4}(,.+:[1-2]{0,1}[0-9]{0,1}[0-9]{1}(\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}){3}:[1-6]{0,1}[0-9]{1,4})*$
 ]]; then
   +        doris_warn "FE_SERVERS" $FE_SERVERS
   +    else
   +        doris_error "FE_SERVERS rule error!example: 
\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT[,\$FE_NAME:\$FE_HOST_IP:\$FE_EDIT_LOG_PORT]..."
   +    fi
   +    if [[ $FE_ID =~ ^[1-9]{1}$ ]]; then
   +        doris_warn "FE_ID" $FE_ID
   +    else
   +        doris_error "FE_ID rule error!If FE is the role of Master, please 
set FE_ID=1, and ensure that all IDs correspond to the IP of the current node."
   +    fi
    }
    
    get_doris_fe_args() {
   -  local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); print 
$0}'))
   -  for i in "${feServerArray[@]}"; do
   -    val=${i}
   -    val=${val// /}
   -    tmpFeName=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, ""); 
print$1}')
   -    tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
   -    tmpFeEditLogPort=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); 
print$3}')
   -    check_arg "TMP_FE_NAME" $tmpFeName
   -    feIpArray[$tmpFeName]=${tmpFeIp}
   -    check_arg "TMP_FE_EDIT_LOG_PORT" $tmpFeEditLogPort
   -    feEditLogPortArray[$tmpFeName]=${tmpFeEditLogPort}
   -  done
   +    local feServerArray=($(echo "${FE_SERVERS}" | awk '{gsub (/,/," "); 
print $0}'))
   +    for i in "${feServerArray[@]}"; do
   +        val=${i}
   +        val=${val// /}
   +        tmpFeName=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, 
""); print$1}')
   +        tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
   +        tmpFeEditLogPort=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); 
print$3}')
   +        check_arg "TMP_FE_NAME" $tmpFeName
   +        feIpArray[$tmpFeName]=${tmpFeIp}
   +        check_arg "TMP_FE_EDIT_LOG_PORT" $tmpFeEditLogPort
   +        feEditLogPortArray[$tmpFeName]=${tmpFeEditLogPort}
   +    done
    
   -  declare -g MASTER_FE_IP CURRENT_FE_IP MASTER_FE_EDIT_PORT 
CURRENT_FE_EDIT_PORT PRIORITY_NETWORKS CURRENT_FE_IS_MASTER
   -  MASTER_FE_IP=${feIpArray[1]}
   -  check_arg "MASTER_FE_IP" $MASTER_FE_IP
   -  MASTER_FE_EDIT_PORT=${feEditLogPortArray[1]}
   -  check_arg "MASTER_FE_EDIT_PORT" $MASTER_FE_EDIT_PORT
   -  CURRENT_FE_IP=${feIpArray[FE_ID]}
   -  check_arg "CURRENT_FE_IP" $CURRENT_FE_IP
   -  CURRENT_FE_EDIT_PORT=${feEditLogPortArray[FE_ID]}
   -  check_arg "CURRENT_FE_EDIT_PORT" $CURRENT_FE_EDIT_PORT
   +    declare -g MASTER_FE_IP CURRENT_FE_IP MASTER_FE_EDIT_PORT 
CURRENT_FE_EDIT_PORT PRIORITY_NETWORKS CURRENT_FE_IS_MASTER
   +    MASTER_FE_IP=${feIpArray[1]}
   +    check_arg "MASTER_FE_IP" $MASTER_FE_IP
   +    MASTER_FE_EDIT_PORT=${feEditLogPortArray[1]}
   +    check_arg "MASTER_FE_EDIT_PORT" $MASTER_FE_EDIT_PORT
   +    CURRENT_FE_IP=${feIpArray[FE_ID]}
   +    check_arg "CURRENT_FE_IP" $CURRENT_FE_IP
   +    CURRENT_FE_EDIT_PORT=${feEditLogPortArray[FE_ID]}
   +    check_arg "CURRENT_FE_EDIT_PORT" $CURRENT_FE_EDIT_PORT
    
   -  if [ ${MASTER_FE_IP} == ${CURRENT_FE_IP} ]; then
   -    CURRENT_FE_IS_MASTER=true
   -  else
   -    CURRENT_FE_IS_MASTER=false
   -  fi
   +    if [ ${MASTER_FE_IP} == ${CURRENT_FE_IP} ]; then
   +        CURRENT_FE_IS_MASTER=true
   +    else
   +        CURRENT_FE_IS_MASTER=false
   +    fi
    
   -  PRIORITY_NETWORKS=$(echo "${CURRENT_FE_IP}" | awk -F '.' 
'{print$1"."$2"."$3".0/24"}')
   -  check_arg "PRIORITY_NETWORKS" $PRIORITY_NETWORKS
   +    PRIORITY_NETWORKS=$(echo "${CURRENT_FE_IP}" | awk -F '.' 
'{print$1"."$2"."$3".0/24"}')
   +    check_arg "PRIORITY_NETWORKS" $PRIORITY_NETWORKS
    
   -  doris_note "FE_IP_ARRAY = ${feIpArray[*]}"
   -  doris_note "FE_EDIT_LOG_PORT_ARRAY = ${feEditLogPortArray[*]}"
   -  doris_note "MASTER_FE = ${feIpArray[1]}:${feEditLogPortArray[1]}"
   -  doris_note "CURRENT_FE = ${CURRENT_FE_IP}:${CURRENT_FE_EDIT_PORT}"
   -  doris_note "PRIORITY_NETWORKS = ${PRIORITY_NETWORKS}"
   -  # wait fe start
   -  check_fe_status true
   +    doris_note "FE_IP_ARRAY = ${feIpArray[*]}"
   +    doris_note "FE_EDIT_LOG_PORT_ARRAY = ${feEditLogPortArray[*]}"
   +    doris_note "MASTER_FE = ${feIpArray[1]}:${feEditLogPortArray[1]}"
   +    doris_note "CURRENT_FE = ${CURRENT_FE_IP}:${CURRENT_FE_EDIT_PORT}"
   +    doris_note "PRIORITY_NETWORKS = ${PRIORITY_NETWORKS}"
   +    # wait fe start
   +    check_fe_status true
    }
    
    add_priority_networks() {
   -  doris_note "add priority_networks ${1} to ${DORIS_HOME}/fe/conf/fe.conf"
   -  echo "priority_networks = ${1}" >>${DORIS_HOME}/fe/conf/fe.conf
   +    doris_note "add priority_networks ${1} to ${DORIS_HOME}/fe/conf/fe.conf"
   +    echo "priority_networks = ${1}" >>${DORIS_HOME}/fe/conf/fe.conf
    }
    
    # Execute sql script, passed via stdin
    # usage: docker_process_sql sql_script
    docker_process_sql() {
   -  set +e
   -  mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" 2>/dev/null
   +    set +e
   +    mysql -uroot -P9030 -h${MASTER_FE_IP} --comments "$@" 2>/dev/null
    }
    
    docker_setup_db() {
   -  set +e
   -  # check fe status
   -  local is_fe_start=false
   -  if [ ${CURRENT_FE_IS_MASTER} == true ]; then
   -      doris_note "Current FE is Master FE!  No need to register again!"
   -      return
   -  fi
   -  for i in {1..300}; do
   -    if [[ $(( $i % 20 )) == 1 ]]; then
   -      doris_note "ADD FOLLOWER failed, retry."
   +    set +e
   +    # check fe status
   +    local is_fe_start=false
   +    if [ ${CURRENT_FE_IS_MASTER} == true ]; then
   +        doris_note "Current FE is Master FE!  No need to register again!"
   +        return
        fi
   -    docker_process_sql <<<"alter system add FOLLOWER 
'${CURRENT_FE_IP}:${CURRENT_FE_EDIT_PORT}'"
   -    register_fe_status=$?
   -    if [[ $register_fe_status == 0 ]]; then
   -      doris_note "FE successfully registered!"
   -      is_fe_start=true
   -      break
   -    else
   -      check_fe_status
   -      if [ -n "$CURRENT_FE_ALREADY_EXISTS" ]; then
   -        doris_warn "Same frontend already exists! No need to register 
again!"
   -        break
   -      fi
   -      if [[ $(( $i % 20 )) == 1 ]]; then
   -        doris_warn "register_fe_status: ${register_fe_status}"
   -        doris_warn "FE failed registered!"
   -      fi
   +    for i in {1..300}; do
   +        if [[ $(($i % 20)) == 1 ]]; then
   +            doris_note "ADD FOLLOWER failed, retry."
   +        fi
   +        docker_process_sql <<<"alter system add FOLLOWER 
'${CURRENT_FE_IP}:${CURRENT_FE_EDIT_PORT}'"
   +        register_fe_status=$?
   +        if [[ $register_fe_status == 0 ]]; then
   +            doris_note "FE successfully registered!"
   +            is_fe_start=true
   +            break
   +        else
   +            check_fe_status
   +            if [ -n "$CURRENT_FE_ALREADY_EXISTS" ]; then
   +                doris_warn "Same frontend already exists! No need to 
register again!"
   +                break
   +            fi
   +            if [[ $(($i % 20)) == 1 ]]; then
   +                doris_warn "register_fe_status: ${register_fe_status}"
   +                doris_warn "FE failed registered!"
   +            fi
   +        fi
   +        sleep 1
   +    done
   +    if ! [[ $is_fe_start ]]; then
   +        doris_error "Failed to register CURRENT_FE to FE!Tried 30 
times!Maybe FE Start Failed!"
        fi
   -    sleep 1
   -  done
   -  if ! [[ $is_fe_start ]]; then
   -    doris_error "Failed to register CURRENT_FE to FE!Tried 30 times!Maybe 
FE Start Failed!"
   -  fi
    }
    
    # Check whether the passed parameters are empty to avoid subsequent task 
execution failures. At the same time,
    # enumeration checks can fe added, such as checking whether a certain 
parameter appears repeatedly, etc.
    check_arg() {
   -  if [ -z $2 ]; then
   -    doris_error "$1 is null!"
   -  fi
   +    if [ -z $2 ]; then
   +        doris_error "$1 is null!"
   +    fi
    }
    
    # 这里可用 docker_process_sql() 函数封装,为了方便调试,暂未封装
    check_fe_status() {
   -  set +e
   -  declare -g CURRENT_FE_ALREADY_EXISTS
   -  if [ ${CURRENT_FE_IS_MASTER} == true ]; then
   -    doris_note "Current FE is Master FE!  No need check fe status!"
   -    return
   -  fi
   -  for i in {1..300}; do
   -    if [[ $(( $i % 20 )) == 1 ]]; then
   -      doris_note "try session Master FE."
   +    set +e
   +    declare -g CURRENT_FE_ALREADY_EXISTS
   +    if [ ${CURRENT_FE_IS_MASTER} == true ]; then
   +        doris_note "Current FE is Master FE!  No need check fe status!"
   +        return
        fi
   -    if [[ $1 == true ]]; then
   -      docker_process_sql <<<"show frontends" | grep 
"[[:space:]]${MASTER_FE_IP}[[:space:]]" | grep 
"[[:space:]]${MASTER_FE_EDIT_PORT}[[:space:]]"
   -    else
   -      docker_process_sql <<<"show frontends" | grep 
"[[:space:]]${CURRENT_FE_IP}[[:space:]]" | grep 
"[[:space:]]${CURRENT_FE_EDIT_PORT}[[:space:]]"
   -    fi
   -    fe_join_status=$?
   -    if [[ "${fe_join_status}" == 0 ]]; then
   -      if [[ $1 == true ]]; then
   -        doris_note "Master FE is started!"
   -      else
   -        doris_note "Verify that CURRENT_FE is registered to FE successfully"
   -      fi
   -      CURRENT_FE_ALREADY_EXISTS=true
   -      break
   -    else
   -      if [[ $(( $i % 20 )) == 1 ]]; then
   +    for i in {1..300}; do
   +        if [[ $(($i % 20)) == 1 ]]; then
   +            doris_note "try session Master FE."
   +        fi
            if [[ $1 == true ]]; then
   -          doris_note "Master FE is not started, retry."
   +            docker_process_sql <<<"show frontends" | grep 
"[[:space:]]${MASTER_FE_IP}[[:space:]]" | grep 
"[[:space:]]${MASTER_FE_EDIT_PORT}[[:space:]]"
            else
   -          doris_warn "Verify that CURRENT_FE is registered to FE failed, 
retry."
   +            docker_process_sql <<<"show frontends" | grep 
"[[:space:]]${CURRENT_FE_IP}[[:space:]]" | grep 
"[[:space:]]${CURRENT_FE_EDIT_PORT}[[:space:]]"
            fi
   -      fi
   -    fi
   -    sleep 1
   -  done
   +        fe_join_status=$?
   +        if [[ "${fe_join_status}" == 0 ]]; then
   +            if [[ $1 == true ]]; then
   +                doris_note "Master FE is started!"
   +            else
   +                doris_note "Verify that CURRENT_FE is registered to FE 
successfully"
   +            fi
   +            CURRENT_FE_ALREADY_EXISTS=true
   +            break
   +        else
   +            if [[ $(($i % 20)) == 1 ]]; then
   +                if [[ $1 == true ]]; then
   +                    doris_note "Master FE is not started, retry."
   +                else
   +                    doris_warn "Verify that CURRENT_FE is registered to FE 
failed, retry."
   +                fi
   +            fi
   +        fi
   +        sleep 1
   +    done
    }
    
    _main() {
   -  docker_setup_env
   -  docker_required_variables_env
   -  get_doris_fe_args
   +    docker_setup_env
   +    docker_required_variables_env
   +    get_doris_fe_args
    
   -  if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
   -    add_priority_networks $PRIORITY_NETWORKS
   -  fi
   +    if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
   +        add_priority_networks $PRIORITY_NETWORKS
   +    fi
    
   -  docker_setup_db
   -  check_fe_status
   -  doris_note "Ready to start CURRENT_FE!"
   +    docker_setup_db
   +    check_fe_status
   +    doris_note "Ready to start CURRENT_FE!"
    
   -  if [ $CURRENT_FE_IS_MASTER == true ]; then
   -    start_fe.sh
   -  else
   -    start_fe.sh --helper ${MASTER_FE_IP}:${MASTER_FE_EDIT_PORT}
   -  fi
   +    if [ $CURRENT_FE_IS_MASTER == true ]; then
   +        start_fe.sh
   +    else
   +        start_fe.sh --helper ${MASTER_FE_IP}:${MASTER_FE_EDIT_PORT}
   +    fi
    
   -  exec "$@"
   +    exec "$@"
    }
    
    if ! _is_sourced; then
   -  _main "$@"
   +    _main "$@"
    fi
   ----------
   
   You can reformat the above files to meet shfmt's requirements by typing:
   
     shfmt  -w filename
   
   
   ```
   </details>
   
   
   


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

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to