Skip to content

Commit d9e98c0

Browse files
committed
Change log level from INFO to DEBUG for various API logging messages in dbjobs_new.sh
- Updated log level for MariaDB and MySQL binary usage messages. - Changed log level for config send requests and connection messages. - Adjusted log level for TCP listener and config file reception messages. - Modified extraction success and failure messages to DEBUG level. - Updated logging for output sent to receiver and dry run completion messages. - Changed log level for fetching config receiver information and related details.
1 parent 915fdfe commit d9e98c0

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

share/opensvc/moduleset_mariadb.svc.mrm.db.json

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

share/scripts/dbjobs_new.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ select_database_binaries() {
124124
BINARY_CLIENT="$MARIADB_CLIENT $DB_CONN_PARAMETERS"
125125
BINARY_CHECK="$MARIADB_CHECK"
126126
BINARY_DUMP="$MARIADB_DUMP"
127-
send_lines_to_api "Using MariaDB binaries." "main" "$LVL_INFO"
127+
send_lines_to_api "Using MariaDB binaries." "main" "$LVL_DEBUG"
128128
elif [[ -x "$MYSQL_CLIENT" ]]; then
129129
# Use command-line params to preserve existing my.cnf SSL/TLS settings
130130
BINARY_CLIENT="$MYSQL_CLIENT $DB_CONN_PARAMETERS"
131131
BINARY_CHECK="$MYSQL_CHECK"
132132
BINARY_DUMP="$MYSQL_DUMP"
133-
send_lines_to_api "Using MySQL binaries." "main" "$LVL_INFO"
133+
send_lines_to_api "Using MySQL binaries." "main" "$LVL_DEBUG"
134134
else
135135
send_lines_to_api "Neither MariaDB nor MySQL binaries available. Exiting." "main" "$LVL_ERROR"
136136
return 1
@@ -541,7 +541,7 @@ fetch_and_extract_config() {
541541
local token="${2:-}"
542542
local config_sender_url="/api/clusters/$CLUSTER_NAME/servers/$MYSQL_SERVER/$MYSQL_PORT/config-dummy-sender"
543543

544-
send_lines_to_api "Requesting config send via cookie-based push mechanism..." "print-defaults" "$LVL_INFO"
544+
send_lines_to_api "Requesting config send via cookie-based push mechanism..." "print-defaults" "$LVL_DEBUG"
545545

546546
# Remove existing directory and create new one
547547
rm -rf "$extract_dir"
@@ -550,7 +550,7 @@ fetch_and_extract_config() {
550550
# Step 1: POST to queue the config send and get SST port info
551551
local request_timeout=10 # API should respond quickly (just queues request)
552552

553-
send_lines_to_api "Connecting to: $REPLICATION_MANAGER_HOST:$REPLICATION_MANAGER_PORT" "print-defaults" "$LVL_INFO"
553+
send_lines_to_api "Connecting to: $REPLICATION_MANAGER_HOST:$REPLICATION_MANAGER_PORT" "print-defaults" "$LVL_DEBUG"
554554

555555
local response
556556
if [[ -n "$token" ]]; then
@@ -596,13 +596,13 @@ fetch_and_extract_config() {
596596
fi
597597

598598
send_lines_to_api "Config send queued (status: $status)" "print-defaults" "$LVL_INFO"
599-
send_lines_to_api "Config will be sent to $sst_host:$sst_port" "print-defaults" "$LVL_INFO"
599+
send_lines_to_api "Config will be sent to $sst_host:$sst_port" "print-defaults" "$LVL_DEBUG"
600600

601601
# Step 2: Open TCP listener on the SST port to receive the config
602602
local config_file="$extract_dir/config.tar.gz"
603603
local listener_timeout=300 # 5 minutes timeout for config delivery
604604

605-
send_lines_to_api "Opening TCP listener on port $sst_port..." "print-defaults" "$LVL_INFO"
605+
send_lines_to_api "Opening TCP listener on port $sst_port..." "print-defaults" "$LVL_DEBUG"
606606

607607
# Use socat to listen and save received data to file
608608
# Format: socat -u TCP-LISTEN:port,reuseaddr,fork OPEN:file,creat,trunc
@@ -615,7 +615,7 @@ fetch_and_extract_config() {
615615
timeout "$listener_timeout" socat -u "TCP-LISTEN:$sst_port,reuseaddr" "OPEN:$config_file,creat,trunc" > "$LOG_DIR/socat_listener.log" 2>&1 &
616616
local socat_pid=$!
617617

618-
send_lines_to_api "Listener started (PID: $socat_pid), waiting for config delivery (timeout: ${listener_timeout}s)..." "print-defaults" "$LVL_INFO"
618+
send_lines_to_api "Listener started (PID: $socat_pid), waiting for config delivery (timeout: ${listener_timeout}s)..." "print-defaults" "$LVL_DEBUG"
619619

620620
# Wait for socat to complete or timeout
621621
wait $socat_pid
@@ -640,7 +640,7 @@ fetch_and_extract_config() {
640640
fi
641641

642642
local filesize=$(stat -c%s "$config_file" 2>/dev/null || echo 0)
643-
send_lines_to_api "Received config file: $filesize bytes" "print-defaults" "$LVL_INFO"
643+
send_lines_to_api "Received config file: $filesize bytes" "print-defaults" "$LVL_DEBUG"
644644

645645
# Check file type before extraction
646646
local file_type=$(file -b "$config_file" 2>/dev/null || echo "unknown")
@@ -662,15 +662,15 @@ fetch_and_extract_config() {
662662
send_lines_to_api "Attempting gzip extraction (tar xzf)..." "print-defaults" "$LVL_DEBUG"
663663

664664
if tar_output=$(tar xzf "$config_file" -C "$extract_dir" 2>&1); then
665-
send_lines_to_api "Successfully extracted as gzip compressed tar" "print-defaults" "$LVL_INFO"
665+
send_lines_to_api "Successfully extracted as gzip compressed tar" "print-defaults" "$LVL_DEBUG"
666666
else
667667
send_lines_to_api "Gzip extraction failed: $tar_output" "print-defaults" "$LVL_WARN"
668668

669669
# Try without gzip (maybe it's already uncompressed)
670670
send_lines_to_api "Trying uncompressed extraction (tar xf)..." "print-defaults" "$LVL_DEBUG"
671671

672672
if tar_output=$(tar xf "$config_file" -C "$extract_dir" 2>&1); then
673-
send_lines_to_api "Successfully extracted as uncompressed tar" "print-defaults" "$LVL_INFO"
673+
send_lines_to_api "Successfully extracted as uncompressed tar" "print-defaults" "$LVL_DEBUG"
674674
else
675675
send_lines_to_api "ERROR: All extraction methods failed" "print-defaults" "$LVL_ERROR"
676676
send_lines_to_api "Final tar error: $tar_output" "print-defaults" "$LVL_ERROR"
@@ -761,7 +761,7 @@ send_mariadb_defaults() {
761761
# Log output
762762
echo "$processed_output" > "$log_file"
763763

764-
send_lines_to_api "Output sent to $receiver_addr and logged to $log_file" "print-defaults" "$LVL_INFO"
764+
send_lines_to_api "Output sent to $receiver_addr and logged to $log_file" "print-defaults" "$LVL_DEBUG"
765765
return 0
766766
}
767767

@@ -848,7 +848,7 @@ print_defaults_for_fetch() {
848848

849849
# Run mariadbd with dummy configuration
850850
if send_mariadb_defaults "$extract_dir/dummy.cnf" "$monitor_addr:$dummy_port" "$log_file"; then
851-
send_lines_to_api "Dry run (dummy) completed successfully" "print-defaults" "$LVL_INFO"
851+
send_lines_to_api "Dry run (dummy) completed successfully" "print-defaults" "$LVL_DEBUG"
852852
return 0
853853
else
854854
send_lines_to_api "ERROR: Dry run (dummy) failed" "print-defaults" "$LVL_ERROR"
@@ -865,7 +865,7 @@ parse_json_field() {
865865

866866
# Main function to run config print jobs
867867
run_config_print_jobs() {
868-
send_lines_to_api "Fetching config receiver information..." "print-defaults" "$LVL_INFO"
868+
send_lines_to_api "Fetching config receiver information..." "print-defaults" "$LVL_DEBUG"
869869

870870
# Fetch receiver info
871871
local receiver_json=$(fetch_config_receiver) || return 1
@@ -877,7 +877,7 @@ run_config_print_jobs() {
877877
local current_pid_file=$(parse_json_field "$receiver_json" "current_pid_file")
878878
local default_config_path=$(parse_json_field "$receiver_json" "default_config_dir")
879879

880-
send_lines_to_api "Monitor Address: $monitor_address, Dummy Port: $dummy_config_port, Current Port: $current_config_port" "print-defaults" "$LVL_INFO"
880+
send_lines_to_api "Monitor Address: $monitor_address, Dummy Port: $dummy_config_port, Current Port: $current_config_port" "print-defaults" "$LVL_DEBUG"
881881

882882
# Prepare log files
883883
local dummy_log="$LOG_DIR/dummy.log"
@@ -1637,4 +1637,4 @@ for job in "${JOBS[@]}"; do
16371637
fi
16381638
done
16391639

1640-
# EOF
1640+
# EOF

0 commit comments

Comments
 (0)