From 36b8a8b444b318904c47848f53a200470755cfde Mon Sep 17 00:00:00 2001 From: Lemon-miaow Date: Sat, 26 Sep 2026 13:34:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(updater):=20PostgreSQL=20=E5=A4=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8F=90=E7=A4=BA=E6=94=B9=E4=B8=BA=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=86=8D=E6=81=A2=E5=A4=8D=E5=B9=B6=E6=9B=B4=E6=AD=A3=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=9B=B8=E5=85=B3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/bootstrap.sh | 11 +++++------ internal/updater/postgres.go | 2 +- internal/updater/postgres_test.go | 2 +- internal/watchdog/host.go | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/deploy/bootstrap.sh b/deploy/bootstrap.sh index e4e0707..00e972b 100644 --- a/deploy/bootstrap.sh +++ b/deploy/bootstrap.sh @@ -977,11 +977,10 @@ detect_node_ip() { fi } -# warn_dynamic_node_ip warns when NODE_IP is a DHCP lease. The address is written into -# the database connection string, pg_hba, the network policies, the panel certificate -# and the default nip.io domain, and nothing re-addresses a live install, so a lease -# that later comes back different takes the whole platform down (the watchdog then -# reports host-address). `ip -o addr` marks a leased address "dynamic". +# warn_dynamic_node_ip warns when NODE_IP is a DHCP lease. The address is the k3s node's +# and is written into the network policies, the panel certificate and the default nip.io +# domain, and nothing re-addresses a live install, so a lease that later comes back +# different takes the platform down (the watchdog then reports host-address). `ip -o addr` marks a leased address "dynamic". warn_dynamic_node_ip() { if ip -4 -o addr show 2>/dev/null | awk -v ip="$NODE_IP" ' { split($4, a, "/"); if (a[1] == ip && / dynamic /) found = 1 } @@ -3275,7 +3274,7 @@ deploy_postgres() { --postgres-image "$POSTGRES_IMAGE" | kube apply -f - if ! kube -n "$CONTROL_NS" rollout status "deployment/${PG_DEPLOYMENT}" --timeout=600s; then diagnose_rollout "deployment/${PG_DEPLOYMENT}" - die "${PG_DEPLOYMENT} did not become ready (docs/troubleshooting.md §13c)" + die "${PG_DEPLOYMENT} did not become ready (docs/troubleshooting.md §16)" fi ensure_postgres_role ok "${PG_DEPLOYMENT} ready: pods at ${PG_SERVICE_ADDR}, this host at 127.0.0.1:${PG_HOST_PORT}" diff --git a/internal/updater/postgres.go b/internal/updater/postgres.go index 7a99385..9806327 100644 --- a/internal/updater/postgres.go +++ b/internal/updater/postgres.go @@ -98,7 +98,7 @@ func (p postgresFeed) latest(ctx context.Context, current updates.Version) (post if !mine.Supported { rel.note = fmt.Sprintf("PostgreSQL %s reached end of life on %s and gets no more fixes", key, mine.EOLDate) if newest != "" { - rel.note += fmt.Sprintf("; the current major is %s (pg_upgrade, see docs/operations.md §4)", newest) + rel.note += fmt.Sprintf("; the current major is %s (a dump and restore, see docs/operations.md §4)", newest) } } return rel, nil diff --git a/internal/updater/postgres_test.go b/internal/updater/postgres_test.go index b6092f0..5ec1d57 100644 --- a/internal/updater/postgres_test.go +++ b/internal/updater/postgres_test.go @@ -37,7 +37,7 @@ func TestPostgresFeedComparesWithinTheMajor(t *testing.T) { }{ {"17.4", "17.10", nil}, {"18.6", "18.6", nil}, - {"13.22", "13.23", []string{"PostgreSQL 13 reached end of life on 2025-11-13", "current major is 18"}}, + {"13.22", "13.23", []string{"PostgreSQL 13 reached end of life on 2025-11-13", "current major is 18", "dump and restore"}}, {"9.6.3", "9.6.24", []string{"PostgreSQL 9.6 reached end of life"}}, } for _, c := range cases { diff --git a/internal/watchdog/host.go b/internal/watchdog/host.go index 2483bee..35e0ecc 100644 --- a/internal/watchdog/host.go +++ b/internal/watchdog/host.go @@ -8,8 +8,8 @@ import ( ) const ( - // addressFor is short: nothing reaches the database or the panel while the - // address is gone, so a DHCP renewal that lands on a new lease is an outage. + // addressFor is short: the cluster and the panel are down while the address + // is gone, so a DHCP renewal that lands on a new lease is an outage. addressFor = 5 * time.Minute // clockFor leaves room for an NTP daemon that was just enabled (by the // installer, or after a reboot) to reach its first synchronization.