github-actions[bot] commented on PR #39803: URL: https://github.com/apache/doris/pull/39803#issuecomment-2322928974
#### `sh-checker report` To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/10646279310") output. <details> <summary>shellcheck errors</summary> ``` 'shellcheck ' returned error 1 finding the following syntactical issues: ---------- In tools/fdb/fdb_ctr.sh line 305: rm -rf "${FDB_HOME}"/* ^-------------^ SC2115 (warning): Use "${var:?}" to ensure this never expands to /* . In tools/fdb/fdb_ctr.sh line 379: echo "Unknown cmd: ${cmd}\n" ^---------------------^ SC2028 (info): echo may not expand escape sequences. Use printf. In tools/fdb/fdb_vars.sh line 1: # Licensed to the Apache Software Foundation (ASF) under one ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In tools/fdb/fdb_vars.sh line 25: DATA_DIRS="/mnt/foundationdb/data1,/mnt/foundationdb/data2,/mnt/foundationdb/data3" ^-------^ SC2034 (warning): DATA_DIRS appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 33: FDB_CLUSTER_IPS="172.200.0.2,172.200.0.3,172.200.0.4" ^-------------^ SC2034 (warning): FDB_CLUSTER_IPS appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 38: FDB_HOME="/fdbhome" ^------^ SC2034 (warning): FDB_HOME appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 42: FDB_CLUSTER_ID="SAQESzbh" ^------------^ SC2034 (warning): FDB_CLUSTER_ID appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 45: FDB_CLUSTER_DESC="mycluster" ^--------------^ SC2034 (warning): FDB_CLUSTER_DESC appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 50: MEMORY_LIMIT_GB=16 ^-------------^ SC2034 (warning): MEMORY_LIMIT_GB appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 53: CPU_CORES_LIMIT=8 ^-------------^ SC2034 (warning): CPU_CORES_LIMIT appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 58: FDB_PORT=4500 ^------^ SC2034 (warning): FDB_PORT appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 61: FDB_VERSION="7.1.38" ^---------^ SC2034 (warning): FDB_VERSION appears unused. Verify use (or export if used externally). In tools/fdb/fdb_vars.sh line 64: USER=`whoami` ^------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`. Did you mean: USER=$(whoami) For more information: https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y... https://www.shellcheck.net/wiki/SC2034 -- CPU_CORES_LIMIT appears unused. V... https://www.shellcheck.net/wiki/SC2115 -- Use "${var:?}" to ensure this nev... ---------- 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: ---------- --- tools/fdb/fdb_ctr.sh.orig +++ tools/fdb/fdb_ctr.sh @@ -142,7 +142,7 @@ local data_dir_count # Convert comma-separated DATA_DIRS into an array - IFS=',' read -r -a DATA_DIR_ARRAY <<< "${DATA_DIRS}" + IFS=',' read -r -a DATA_DIR_ARRAY <<<"${DATA_DIRS}" data_dir_count=${#DATA_DIR_ARRAY[@]} # Stateless processes (at least 1, up to 1/4 of CPU cores) @@ -152,13 +152,13 @@ # Storage processes (must be a multiple of the number of data directories) local storage_processes=$((cpu_cores / 4)) [[ ${storage_processes} -lt ${data_dir_count} ]] && storage_processes=${data_dir_count} - storage_processes=$(( (storage_processes / data_dir_count) * data_dir_count )) + storage_processes=$(((storage_processes / data_dir_count) * data_dir_count)) # Transaction processes (must be a multiple of the number of data directories) local transaction_processes=$((cpu_cores / 8)) [[ ${transaction_processes} -lt ${min_processes} ]] && transaction_processes=${min_processes} [[ ${transaction_processes} -lt ${data_dir_count} ]] && transaction_processes=${data_dir_count} - transaction_processes=$(( (transaction_processes / data_dir_count) * data_dir_count )) + transaction_processes=$(((transaction_processes / data_dir_count) * data_dir_count)) # Return the values echo "${stateless_processes} ${storage_processes} ${transaction_processes}" @@ -175,9 +175,9 @@ CLUSTER_DESC="${FDB_CLUSTER_DESC:-${FDB_CLUSTER_ID}}" # Convert comma-separated DATA_DIRS into an array - IFS=',' read -r -a DATA_DIR_ARRAY <<< "${DATA_DIRS}" + IFS=',' read -r -a DATA_DIR_ARRAY <<<"${DATA_DIRS}" for DIR in "${DATA_DIR_ARRAY[@]}"; do - mkdir -p "${DIR}" || handle_error "Failed to create data directory ${DIR}" + mkdir -p "${DIR}" || handle_error "Failed to create data directory ${DIR}" done echo -e "\tCreate fdb.cluster, coordinator: $(get_coordinators)" @@ -210,13 +210,13 @@ CPU_CORES_LIMIT=${CPU_CORES_LIMIT:-1} # Calculate number of processes based on resources and data directories - read -r stateless_processes storage_processes transaction_processes <<< "$(calculate_process_numbers "${MEMORY_LIMIT_GB}" "${CPU_CORES_LIMIT}")" + read -r stateless_processes storage_processes transaction_processes <<<"$(calculate_process_numbers "${MEMORY_LIMIT_GB}" "${CPU_CORES_LIMIT}")" # Add stateless processes for ((i = 0; i < stateless_processes; i++)); do PORT=$((FDB_PORT + i)) echo "[fdbserver.${PORT}] -class = stateless" >> "${FDB_HOME}/conf/fdb.conf" +class = stateless" >>"${FDB_HOME}/conf/fdb.conf" done FDB_PORT=$((FDB_PORT + stateless_processes)) @@ -228,7 +228,7 @@ DIR_INDEX=$((i % STORAGE_DIR_COUNT)) echo "[fdbserver.${PORT}] class = storage -datadir = ${DATA_DIR_ARRAY[${DIR_INDEX}]}/${PORT}" | tee -a "${FDB_HOME}/conf/fdb.conf" > /dev/null +datadir = ${DATA_DIR_ARRAY[${DIR_INDEX}]}/${PORT}" | tee -a "${FDB_HOME}/conf/fdb.conf" >/dev/null done FDB_PORT=$((FDB_PORT + storage_processes)) @@ -239,12 +239,12 @@ DIR_INDEX=$((i % STORAGE_DIR_COUNT)) echo "[fdbserver.${PORT}] class = transaction -datadir = ${DATA_DIR_ARRAY[${DIR_INDEX}]}/${PORT}" | tee -a "${FDB_HOME}/conf/fdb.conf" > /dev/null +datadir = ${DATA_DIR_ARRAY[${DIR_INDEX}]}/${PORT}" | tee -a "${FDB_HOME}/conf/fdb.conf" >/dev/null done echo "[backup_agent] command = ${FDB_HOME}/backup_agent -logdir = ${LOG_DIR}" >> "${FDB_HOME}/conf/fdb.conf" +logdir = ${LOG_DIR}" >>"${FDB_HOME}/conf/fdb.conf" echo "Deploy FDB to: ${FDB_HOME}" } @@ -278,7 +278,7 @@ function clean_fdb() { if [[ -f "${FDB_HOME}/fdbmonitor.pid" ]]; then local fdb_pid - + fdb_pid=$(cat "${FDB_HOME}/fdbmonitor.pid") if ps -p "${fdb_pid}" >/dev/null; then echo "fdbmonitor with pid ${fdb_pid} is running, stop it first." @@ -326,7 +326,7 @@ if [[ ${init} =~ ^(all|fdb)$ ]]; then echo "Try create database ..." local fdb_mode - + fdb_mode=$(get_fdb_mode) "${FDB_HOME}/fdbcli" -C "${FDB_HOME}/conf/fdb.cluster" \ --exec "configure new ${fdb_mode} ssd" || true @@ -394,26 +394,25 @@ skip_config="false" case ${cmd} in - deploy) - deploy "${job}" "${skip_pkg}" "${skip_config}" - ;; - start) - start "${job}" "${init}" - ;; - stop) - stop "${job}" - ;; - clean) - clean "${job}" - ;; - fdbcli) - "${FDB_HOME}/fdbcli" -C "${FDB_HOME}/conf/fdb.cluster" "$@" - ;; - config) - generate_regression_config true - ;; - *) - unknown_cmd "${cmd}" - ;; +deploy) + deploy "${job}" "${skip_pkg}" "${skip_config}" + ;; +start) + start "${job}" "${init}" + ;; +stop) + stop "${job}" + ;; +clean) + clean "${job}" + ;; +fdbcli) + "${FDB_HOME}/fdbcli" -C "${FDB_HOME}/conf/fdb.cluster" "$@" + ;; +config) + generate_regression_config true + ;; +*) + unknown_cmd "${cmd}" + ;; esac - --- tools/fdb/fdb_vars.sh.orig +++ tools/fdb/fdb_vars.sh @@ -32,7 +32,6 @@ FDB_CLUSTER_IPS="172.200.0.2,172.200.0.3,172.200.0.4" - # Define the FoundationDB home directory, which contains the fdb binaries and logs. # default is /fdbhome and have to be absolute path. FDB_HOME="/fdbhome" @@ -61,4 +60,4 @@ FDB_VERSION="7.1.38" # Users who run the fdb processes, default is the current user -USER=`whoami` +USER=$(whoami) ---------- 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