Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 310BCB53E85 for ; Fri, 25 May 2012 10:10:38 -0300 (ADT) Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SXuHr-0001Cu-DB for pgsql-bugs@postgresql.org; Fri, 25 May 2012 13:10:37 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1SXuHd-0004MJ-C6; Fri, 25 May 2012 09:10:21 -0400 Date: Fri, 25 May 2012 09:10:21 -0400 From: Bruce Momjian To: Edmund Horner Cc: pgsql-bugs@postgresql.org Subject: Re: PostgreSQL 9.2 beta1's pg_upgrade fails on Windows XP Message-ID: <20120525131021.GA11374@momjian.us> References: <4FBB36F2.6060601@ringerc.id.au> <20120524003302.GF10306@momjian.us> <20120524135956.GH10306@momjian.us> <20120525003401.GA25460@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <20120525003401.GA25460@momjian.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/199 X-Sequence-Number: 33170 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 24, 2012 at 08:34:01PM -0400, Bruce Momjian wrote: > On Fri, May 25, 2012 at 11:48:53AM +1200, Edmund Horner wrote: > > It still fails (when run in verbose mode): > > > > Creating catalog dump > > ""c:\ehorner\pgsql\bin/pg_dumpall" --port 50432 --username "ehorner" > > --schema-only --binary-upgrade --verbose > "pg_upgrade_dump_all.sql" > > 2>> "pg_upgrade_utility.log"" > > ok > > ""c:\ehorner\pgsql-old\bin/pg_ctl" -w -l "pg_upgrade_server2.log" > > -D "c:\ehorner\pgdata-old" -o"" stop >> "pg_upgrade_server2.log" > > 2>&1" > > The process cannot access the file because it is being used by > > another process. > > *failure* > > There were problems executing """c:\ehorner\pgsql-old\bin/pg_ctl" > > -w -l "pg_upgrade_server2.log" -D "c:\ehorner\pgdata-old" -o "" stop > > >> "pg_upgrade_server2.log" 2>&1"" > > Bingo, this is exactly where I expected it to fail. I am attaching a > new, applied patch that creates files pg_upgrade_server_start.log and > pg_upgrade_server_stop.log to log the pg_ctl start/stop stdout > seperately. This should fix the error. Thanks so much for testing. I > believe someone will generate a new binary for testing. > > > I.e. I think pg_ctl wrote the last couple of lines, and then the two > > cmd.exe were unable to write anything more since presumably it's still > > open. > > > > So is this the problem you predicted above with pg_ctl stop? > > Yep, I think we are good now. I never expected this behavior, but it > now makes sense. Ah, turns out I only need one extra log file on Windows, not two, because I can reuse the utility file for pg_ctl stop. The original beta1 code usesd the utility file for pg_ctl stop and start, which is what caused the problem. Applied patch attached. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --EeQfGwPcQSOJBaQU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pg_upgrade.diff" diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c new file mode 100644 index 3df3836..465ecdd *** a/contrib/pg_upgrade/pg_upgrade.c --- b/contrib/pg_upgrade/pg_upgrade.c *************** OSInfo os_info; *** 58,65 **** char *output_files[] = { SERVER_LOG_FILE, #ifdef WIN32 SERVER_START_LOG_FILE, - SERVER_STOP_LOG_FILE, #endif RESTORE_LOG_FILE, UTILITY_LOG_FILE, --- 58,65 ---- char *output_files[] = { SERVER_LOG_FILE, #ifdef WIN32 + /* unique file for pg_ctl start */ SERVER_START_LOG_FILE, #endif RESTORE_LOG_FILE, UTILITY_LOG_FILE, diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h new file mode 100644 index 5891997..26aa7bb *** a/contrib/pg_upgrade/pg_upgrade.h --- b/contrib/pg_upgrade/pg_upgrade.h *************** extern char *output_files[]; *** 63,69 **** #define SERVER_STOP_LOG_FILE SERVER_LOG_FILE #else #define SERVER_START_LOG_FILE "pg_upgrade_server_start.log" ! #define SERVER_STOP_LOG_FILE "pg_upgrade_server_stop.log" #endif --- 63,70 ---- #define SERVER_STOP_LOG_FILE SERVER_LOG_FILE #else #define SERVER_START_LOG_FILE "pg_upgrade_server_start.log" ! /* pg_ctl stop doesn't keep the log file open, so reuse UTILITY_LOG_FILE */ ! #define SERVER_STOP_LOG_FILE UTILITY_LOG_FILE #endif --EeQfGwPcQSOJBaQU--