Thread: pgsql: Allow copydir() to be interrupted.

pgsql: Allow copydir() to be interrupted.

From
rhaas@postgresql.org (Robert Haas)
Date:
Log Message:
-----------
Allow copydir() to be interrupted.

This makes ALTER DATABASE .. SET TABLESPACE and CREATE DATABASE more
sensitive to interrupts.  Backpatch to 8.4, where ALTER DATABASE .. SET
TABLESPACE was introduced.  We could go back further, but in the absence
of complaints about the CREATE DATABASE case it doesn't seem worth it.

Guillaume Lelarge, with a small correction by me.

Modified Files:
--------------
    pgsql/src/port:
        copydir.c (r1.36 -> r1.37)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/port/copydir.c?r1=1.36&r2=1.37)

Re: pgsql: Allow copydir() to be interrupted.

From
Andrew Dunstan
Date:

Robert Haas wrote:
> Log Message:
> -----------
> Allow copydir() to be interrupted.
>
> This makes ALTER DATABASE .. SET TABLESPACE and CREATE DATABASE more
> sensitive to interrupts.  Backpatch to 8.4, where ALTER DATABASE .. SET
> TABLESPACE was introduced.  We could go back further, but in the absence
> of complaints about the CREATE DATABASE case it doesn't seem worth it.
>
> Guillaume Lelarge, with a small correction by me.
>
> Modified Files:
> --------------
>     pgsql/src/port:
>         copydir.c (r1.36 -> r1.37)
>         (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/port/copydir.c?r1=1.36&r2=1.37)
>
>

This appears to have broken MinGW and Cygwin builds on the buildfarm.

cheers

andrew

Re: pgsql: Allow copydir() to be interrupted.

From
Robert Haas
Date:
On Fri, Jul 2, 2010 at 8:10 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
> Robert Haas wrote:
>> Log Message:
>> -----------
>> Allow copydir() to be interrupted.
>>
>
> This appears to have broken MinGW and Cygwin builds on the buildfarm.

Well, that's not awesome. IM-ing with Magnus now.  I'm wondering if
this is a link-ordering problem of some kind.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: pgsql: Allow copydir() to be interrupted.

From
Magnus Hagander
Date:
On Fri, Jul 2, 2010 at 2:13 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Fri, Jul 2, 2010 at 8:10 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>> Robert Haas wrote:
>>> Log Message:
>>> -----------
>>> Allow copydir() to be interrupted.
>>>
>>
>> This appears to have broken MinGW and Cygwin builds on the buildfarm.
>
> Well, that's not awesome. IM-ing with Magnus now.  I'm wondering if
> this is a link-ordering problem of some kind.

We've seen something like this before, but I don't recall what it was.
It's probably something getting resolved too early when it's built
into libpgport_srv.a. That would explain why it's working fine on MSVC
- we don't actually bother building a server-side .lib there, we just
link the object files directly into postgres.exe. (We do build the
library for client side, of course, since it's used in many different
binaries)

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Re: pgsql: Allow copydir() to be interrupted.

From
Robert Haas
Date:
On Fri, Jul 2, 2010 at 9:19 AM, Magnus Hagander <magnus@hagander.net> wrote:
> On Fri, Jul 2, 2010 at 2:13 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Fri, Jul 2, 2010 at 8:10 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>>> Robert Haas wrote:
>>>> Log Message:
>>>> -----------
>>>> Allow copydir() to be interrupted.
>>>>
>>>
>>> This appears to have broken MinGW and Cygwin builds on the buildfarm.
>>
>> Well, that's not awesome. IM-ing with Magnus now.  I'm wondering if
>> this is a link-ordering problem of some kind.
>
> We've seen something like this before, but I don't recall what it was.
> It's probably something getting resolved too early when it's built
> into libpgport_srv.a. That would explain why it's working fine on MSVC
> - we don't actually bother building a server-side .lib there, we just
> link the object files directly into postgres.exe. (We do build the
> library for client side, of course, since it's used in many different
> binaries)

I wonder if we should just move copydir.c to someplace within the
backend, perhaps backend/storage/file or backend/utils/misc.  It's
already backend-specific code anyway, so I'm not sure there's much
point in having it in src/port.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: pgsql: Allow copydir() to be interrupted.

From
Tom Lane
Date:
Robert Haas <robertmhaas@gmail.com> writes:
>>> This appears to have broken MinGW and Cygwin builds on the buildfarm.
>
> Well, that's not awesome. IM-ing with Magnus now. �I'm wondering if
> this is a link-ordering problem of some kind.

Possibly an #ifndef FRONTEND will fix it.

            regards, tom lane

Re: pgsql: Allow copydir() to be interrupted.

From
Robert Haas
Date:
On Fri, Jul 2, 2010 at 10:18 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>>>> This appears to have broken MinGW and Cygwin builds on the buildfarm.
>>
>> Well, that's not awesome. IM-ing with Magnus now.  I'm wondering if
>> this is a link-ordering problem of some kind.
>
> Possibly an #ifndef FRONTEND will fix it.

What's failing to link is postgres.exe

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company