[PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

From: Pavel Raiskup <praiskup(at)redhat(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-bugs(at)postgresql(dot)org, bruce(at)momjian(dot)us, tgl(at)sss(dot)pgh(dot)pa(dot)us, giomac(at)gmail(dot)com
Subject: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve
Date: 2013-08-12 10:37:29
Message-ID: 1376303849-17344-1-git-send-email-praiskup@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The latest update on original bug report at Red Hat bugzilla shows that the
reproducer is just disable the peer access for 'postgres' user in
pg_hba.conf. So — the old server was most probably still running for OP
(not shut down properly as was originally said).

But basically, this fix is relevant to this thread so posting here.

8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8< 8<

From f2df7fb281b6346f3feeb5f0f8d2d0ee7fb13f6c Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup(at)redhat(dot)com>
Date: Mon, 12 Aug 2013 10:45:08 +0200
Subject: [PATCH] pg_upgrade: stop postmaster properly

Setup the os_info.running_cluster little bit earlier just to allow the
stop_postmaster_atexit callback success when error occurs during the
authentication checks.

https://bugzilla.redhat.com/show_bug.cgi?id=896161
http://www.postgresql.org/message-id/E1TwKHs-0005yp-39@wrigleys.postgresql.org
---
contrib/pg_upgrade/server.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
index c1d459d..c082d0e 100644
--- a/contrib/pg_upgrade/server.c
+++ b/contrib/pg_upgrade/server.c
@@ -239,6 +239,8 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
if (!pg_ctl_return && !throw_error)
return false;

+ os_info.running_cluster = cluster;
+
/* Check to see if we can connect to the server; if not, report it. */
if ((conn = get_db_conn(cluster, "template1")) == NULL ||
PQstatus(conn) != CONNECTION_OK)
@@ -258,8 +260,6 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
pg_log(PG_FATAL, "pg_ctl failed to start the %s server, or connection failed\n",
CLUSTER_NAME(cluster));

- os_info.running_cluster = cluster;
-
return true;
}

--
1.8.3.1

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message ascot.moss@gmail.com 2013-08-12 11:18:14 Re: Enable WAL Archive in Replication server
Previous Message ascot.moss@gmail.com 2013-08-12 10:34:23 Recovery.conf PITR by recovery_target_time

Browse pgsql-hackers by date

  From Date Subject
Next Message ascot.moss@gmail.com 2013-08-12 11:17:49 Re: Replication delay
Previous Message Romain Billon-Grand 2013-08-12 06:01:44 Re: BUG #8335: trim() un-document behaviour