pg_upgrade bug in Windows on PG 9.2

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: pg_upgrade bug in Windows on PG 9.2
Date: 2012-08-07 17:10:52
Message-ID: 20120807171051.GA20040@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I just got a bug report from EnterpriseDB saying pg_upgrade generates a
file share violation on PG 9.2. I was initially confused because I know
we fixed this in a May commit. Well, it turns out that this commit
re-added the same failure:

commit 4741e9afb93f0d769655b2d18c2b73b86f281010
Author: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Date: Thu Jun 28 23:27:00 2012 -0400

Make the pg_upgrade log files contain actual commands

Now the log file not only contains the output from commands executed by
system(), but also what command it was in the first place. This
arrangement makes debugging a lot simpler.

The commit was certainly a good idea, but exec_prog's log_file
specification was designed as for use in an error string, meaning that
the creation on an error string at one call sight would cause pg_upgrade
to erroneously create a log file named "file1 or file2" on Windows. The
bigger problem is that the log file was opened at the start of the
function (with no error return check), and kept open until the end,
causing the file to be opened while the command string was run --- this
was causing the share violation.

I have applied the attached patch to head and 9.2 to fix all these
issues.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
pg_upgrade.diff text/x-diff 12.8 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2012-08-07 17:13:34 Re: [PATCH] Docs: Make notes on sequences and rollback more obvious
Previous Message Fujii Masao 2012-08-07 17:09:32 Re: Pg_ctl promote -- wait for slave to be promoted fully ?