Re: [pgsql-hackers-win32] Testing needed for recent

Lists: pgsql-hackerspgsql-hackers-win32
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Testing needed for recent tablespace hacking
Date: 2004-08-29 22:26:24
Message-ID: 16275.1093818384@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-hackers-win32

Would someone check that I didn't break the Windows port with this
recent commit:

Log Message:
-----------
Add WAL logging for CREATE/DROP DATABASE and CREATE/DROP TABLESPACE.
Fix TablespaceCreateDbspace() to be able to create a dummy directory
in place of a dropped tablespace's symlink. This eliminates the open
problem of a PANIC during WAL replay when a replayed action attempts
to touch a file in a since-deleted tablespace. It also makes for a
significant improvement in the usability of PITR replay.

I had to do some fooling around with platform-specific code, so it's
possible that things are broken. Please test that the above-mentioned
four commands still work. Also see if they work when WAL-replayed.
(The easy way to check this is to do one and then "kill -9" the backend
as soon as it completes.) One test case for the former PANIC bug is to
run the regression tests using "make installcheck", then immediately
start another backend and kill -9 it (you must do this before a
checkpoint occurs in order to exercise the bug case).

Some code I'm particularly worried about is in DROP TABLESPACE:

/*
* Okay, try to remove the symlink. We must however deal with the
* possibility that it's a directory instead of a symlink --- this
* could happen during WAL replay (see TablespaceCreateDbspace),
* and it is also the normal case on Windows.
*/
if (lstat(location, &st) == 0 && S_ISDIR(st.st_mode))
{
if (rmdir(location) < 0)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not remove directory \"%s\": %m",
location)));
}
else
{
if (unlink(location) < 0)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not unlink symbolic link \"%s\": %m",
location)));
}

Is there any reason lstat() wouldn't work on Windows?

regards, tom lane


From: markir(at)coretech(dot)co(dot)nz
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: Testing needed for recent tablespace
Date: 2004-08-31 07:22:01
Message-ID: 1093936921.5680205efa855@mail.coretech.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-hackers-win32

Hmmm... not entirely sure if this is related - but I get a compile failure on
win2000 pro :

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations
-L../../src/port -L/usr/local/lib -o postgres.exe
-Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o bootstrap/SUBSYS.o
catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o executor/SUBSYS.o
lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o optimizer/SUBSYS.o
port/SUBSYS.o postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o
storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o ../../src/timezone/SUBSYS.o
-lpgport -lz -lwsock32 -lm -lws2_32
commands/SUBSYS.o(.text+0x2a827):tablespace.c: undefined reference to `slat'
make[2]: *** [postgres] Error 1
make[2]: Leaving directory
`/home/Administrator/develop/c/postgresql-8.0.0beta1/src/backend'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/home/Administrator/develop/c/postgresql-8.0.0beta1/src'
make: *** [all] Error 2

regards

Mark

Quoting Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Would someone check that I didn't break the Windows port with this
> recent commit:
>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: markir(at)coretech(dot)co(dot)nz
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers-win32(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] Testing needed for recent tablespace
Date: 2004-08-31 11:31:36
Message-ID: 200408311131.i7VBVaj28094@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-hackers-win32


Yep, related. There was a typo in win32.h for lstat that was exposed by
the new tablespace changes. I also added the proper parameters rather
than just redefining the symbol.

Attached is the patch. Do we need to repackage beta2 for this? Tom did
ask for Win32 testers two days ago and it is just being tested now.

---------------------------------------------------------------------------

markir(at)coretech(dot)co(dot)nz wrote:
> Hmmm... not entirely sure if this is related - but I get a compile failure on
> win2000 pro :
>
> gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations
> -L../../src/port -L/usr/local/lib -o postgres.exe
> -Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o bootstrap/SUBSYS.o
> catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o executor/SUBSYS.o
> lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o optimizer/SUBSYS.o
> port/SUBSYS.o postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o
> storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o ../../src/timezone/SUBSYS.o
> -lpgport -lz -lwsock32 -lm -lws2_32
> commands/SUBSYS.o(.text+0x2a827):tablespace.c: undefined reference to `slat'
> make[2]: *** [postgres] Error 1
> make[2]: Leaving directory
> `/home/Administrator/develop/c/postgresql-8.0.0beta1/src/backend'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory
> `/home/Administrator/develop/c/postgresql-8.0.0beta1/src'
> make: *** [all] Error 2
>
> regards
>
> Mark
>
> Quoting Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>
> > Would someone check that I didn't break the Windows port with this
> > recent commit:
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 585 bytes

From: markir(at)coretech(dot)co(dot)nz
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers-win32(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] Testing needed for recent
Date: 2004-08-31 21:44:37
Message-ID: 1093988677.60f89c3865d0c@mail.coretech.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-hackers-win32

Quoting Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>:

>
> Yep, related. There was a typo in win32.h for lstat that was exposed by
> the new tablespace changes. I also added the proper parameters rather
> than just redefining the symbol.
>
> Attached is the patch. Do we need to repackage beta2 for this? Tom did
> ask for Win32 testers two days ago and it is just being tested now.
>
Apologies for the awful timing - cpu on my windows box died on Saturday, and
only got a replacement going yesterday (I know it sounds a bit like 'the dog
ate my homework'...)

regards

Mark