From 20bbdb6a39ed83167fa8c15cb56a3dead4e4f584 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 18 Sep 2026 06:29:18 +0800 Subject: [PATCH] chore: remove log-shipping code that has been broken for a while --- .../pg_upgrade_scripts/common.sh | 36 ------------------- .../pg_upgrade_scripts/complete.sh | 8 ----- .../pg_upgrade_scripts/initiate.sh | 2 -- 3 files changed, 46 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh index 297a234bad..e099d102a5 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -2,14 +2,6 @@ # Common functions and variables used by initiate.sh and complete.sh -REPORTING_PROJECT_REF="ihmaxnjpcccasmrbkpvo" -REPORTING_CREDENTIALS_FILE="/root/upgrade-reporting-credentials" - -REPORTING_ANON_KEY="" -if [ -f "$REPORTING_CREDENTIALS_FILE" ]; then - REPORTING_ANON_KEY=$(cat "$REPORTING_CREDENTIALS_FILE") -fi - function log { echo "$(date -u '+%Y-%m-%d %H:%M:%S UTC') $*" } @@ -81,34 +73,6 @@ function conninfo_for_db { printf "dbname='%s'" "$d" } -function ship_logs { - LOG_FILE=$1 - - if [ -z "$REPORTING_ANON_KEY" ]; then - log "No reporting key found. Skipping log upload." - return 0 - fi - - if [ ! -f "$LOG_FILE" ]; then - log "No log file found. Skipping log upload." - return 0 - fi - - if [ ! -s "$LOG_FILE" ]; then - log "Log file is empty. Skipping log upload." - return 0 - fi - - HOSTNAME=$(hostname) - DERIVED_REF="${HOSTNAME##*-}" - - printf -v BODY '{ "ref": "%s", "step": "%s", "content": %s }' "$DERIVED_REF" "completion" "$(cat "$LOG_FILE" | jq -Rs '.')" - curl -sf -X POST "https://$REPORTING_PROJECT_REF.supabase.co/rest/v1/error_logs" \ - -H "apikey: ${REPORTING_ANON_KEY}" \ - -H 'Content-type: application/json' \ - -d "$BODY" -} - # Aborts if / has less than required_kb free. Nix realizes the new pg_upgrade # store path onto / before the mounted data disk is touched, so a full root # partition otherwise fails the upgrade mid-flight instead of at the start. diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index add5ac232a..a94db71718 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -47,9 +47,6 @@ function cleanup { # would skip ship_logs and lose the diagnostics for the actual failure. enable_conflicting_timers || log "WARNING: failed to re-enable one or more timers; check 'systemctl list-timers --all' on this host" fi - - ship_logs "$LOG_FILE" || true - exit "$EXIT_CODE" } @@ -387,11 +384,6 @@ function complete_pg_upgrade { fi log "Upgrade job completed" - - # Clean runs ship nothing — only warn-but-completed upgrades are reported (hard failures ship via the ERR-trap cleanup) - if [ "$warnings" = 1 ]; then - ship_logs "$LOG_FILE" || true - fi } function copy_configs { diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index ccbe7503eb..d6d7dd1c68 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -110,9 +110,7 @@ cleanup() { cp -R "${MOUNT_POINT}/pgdata/pg_upgrade_output.d/" /var/log/ || true chown -R postgres:postgres /var/log/pg_upgrade_output.d/ chmod -R 0750 /var/log/pg_upgrade_output.d/ - ship_logs "$LOG_FILE" || true tail -n +1 /var/log/pg_upgrade_output.d/*/* >/var/log/pg_upgrade_output.d/pg_upgrade.log || true - ship_logs "/var/log/pg_upgrade_output.d/pg_upgrade.log" || true fi if [ -L "/usr/share/postgresql/${PGVERSION}" ]; then