PostgreSQL 9.2 beta1's pg_upgrade fails on Windows XP

From: Edmund Horner <ejrh00(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: PostgreSQL 9.2 beta1's pg_upgrade fails on Windows XP
Date: 2012-05-22 05:45:55
Message-ID: CAMyN-kD76ptQ8pMDGw7ci_fLPUx-Z03gAdALX8dTvTdQ7GurEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

(Sending this again to pgsql-bugs with no attachments; hopefully it'll
be accepted. Apologies for any duplicates! I'll provide the
attachments if you need them, though I suspect things may become clear
without them.)

Hello,

I'm forwarding this to pgsql-bugs after sending it to pgsql-testers.
I've been a bit confused about how to file it -- the release notes for
the 9.2 beta point to "More information on how to test and report
issues" here: http://www.postgresql.org/developer/beta/ which could
possibly use a bit more explanation. Between the beta not being a
normal release, and me not been an official tester, I opted to send it
there anyway since it wasn't a bug in an *existing* release. But
there is little traffic to pgsql-testers so I have sought advice on
IRC and been advised to send it here too. :-)

I'm not an official tester but I thought I would briefly experiment
with the beta. I run PostgreSQL as a normal user on Windows XP
at work, which may be an unusual (and increasingly obsolete) case not
covered as much by other
testers.

I ran into a bit of trouble running pg_upgrade to upgrade from my
9.1.3 cluster. This is the first time I have run pg_upgrade. It is
entirely possible I've done something wrong.

As a control, I was able to successfully "upgrade" the Postgresql
9.1.3 cluster into a second, new 9.1.3 cluster, using the 9.1.3
version of pg_upgrade. Similar command lines and no issues.

If this does look like a bug, I will help to resolve it (though I
might need some guidance). I have attached some basic information
below. Let me know if you need more information.

Regards,
Edmund.

Environment
Windows XP Service Pack 3
32-bit mode on Intel Core2 Duo
Data, binaries, and pg_upgrade working files are on an NTFS
partition with 4k cluster size.
User has a domain login and local admin rights.

Old cluster
Version: PostgreSQL 9.1.3
Binaries: C:\ehorner\pgsql
Data: C:\ehorner\pgdata
Locale: C
Encoding: UTF8

New cluster
Version: PostgreSQL 9.2 beta1
Binaries: C:\ehorner\pgsql92
Data: C:\ehorner\pgdata92
Locale: C
Encoding: UTF8

Sequence of steps

Unzip the PostgreSQL 9.2 demo1 binaries into c:\ehorner\pgsql92

Shut down the PostgreSQL 9.1.3 cluster (in c:\ehorner\pgsql\bin):

pg_ctl.exe stop -D c:\ehorner\pgsql

Create a new 9.2 cluster (in C:\ehorner\pgsql92\bin):

initdb.exe --no-locale -E UTF8 c:\ehorner\pgdata92

Run pg_upgrade (in C:\):

c:\ehorner\pgsql92\bin\pg_upgrade -b c:\ehorner\pgsql\bin -B
c:\ehorner\pgsql92\bin -d c:\ehorner\pgdata -D c:\ehorner\pgdata92

Expected output

A message indicating successful upgrade of the old cluster into the new one.

Actual output

Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories ok
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Creating catalog dump The
process cannot access the file because it is being used by another
process.
*failure*

Consult the last few lines of "pg_upgrade_utility.log" for
the probable cause of the failure.
Failure, exiting
The process cannot access the file because it is being used by
another process.
*failure*
Consult the last few lines of "pg_upgrade_utility.log" for
the probable cause of the failure.

These files are also created (attached, except for
pg_upgrade_dump_all.sql which was 0 bytes):

pg_upgrade_dump_all.sql
pg_upgrade_internal.log
pg_upgrade_restore.log
pg_upgrade_server.log
pg_upgrade_utility.log

Running again with -v gives the output shown in output-verbose.txt.
The two lines "The process cannot access the file because it is being
used by another process." appear on stderr, which I piped along with
stdout into that file.

Finally, I have also run it using the "Filemon" program to monitor
file system calls. Filtering on pg_upgrade gets the result shown in
filemon-output.txt. There is some cruft from antivirus and other
bloatware which I have removed (since I shouldn't publicise the work
environment too much). The antivirus does
query the directory information of some of the files, but does not
appear to open them.

There are some SHARING VIOLATION errors on accessing
pg_upgrade_utility.log. My guess is that's what causes the error.
It's possible the antivirus is interfering with the file (since it
does touch it) but I do not think it explains the problem since the
9.1.3 -> 9.1.3 upgrade had no problems. I think it could be due to
the change in dump.c where this log file name is used as a pipe
destination in another exec'd program. Maybe Windows XP is more
sensitive to that than other OSs?

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=717f6d60859cc2d1d7dfd57520531a50bd78df9c

As mentioned in another message, I have also run pg_upgrade on Windows
7 64-bit. It was on a different database cluster though. On Windows
7, pg_upgrade did not appear to have a sharing violation and proceeded
to make a complete dump of the SQL. It later ran into trouble with an
oid conflict, but I think that's due to me messing around with the
cluster in question, and in any case is a separate issue.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Craig Ringer 2012-05-22 06:49:22 Re: PostgreSQL 9.2 beta1's pg_upgrade fails on Windows XP
Previous Message Craig Ringer 2012-05-22 04:54:35 Re: PostgreSQL 9.2 beta1's pg_upgrade fails on Windows XP