Re: Cygwin-Postgres-IpcMemoryCreate

Lists: pgsql-cygwin
From: Saravanan Bellan <SBellan(at)jareva(dot)com>
To: 'Jason Tishler' <jason(at)tishler(dot)net>
Cc: "'pgsql-cygwin(at)postgresql(dot)org'" <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Cygwin-Postgres-IpcMemoryCreate
Date: 2002-04-23 00:33:14
Message-ID: A37D6E7E941A1E498B4B98F3E4AFA92035CAF9@MAIL.design2deploy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Sorry to get back so late on this one.

I'm using
Cygwin dll - 1.3.10
Cygipc 1.11-1
Postgres 7.2.1
Windows 2000 Professional (SP 1, Build 2195)
NTFS

I'm running a non standard postgres-cygwin installation. Using only parital
Cygwin installation and do not have a separate Windows User for postgres.
I'm starting initdb with the -U option(I think this was introduced in 7.2)
and use that user name for further connections.

The change I had to make was in src/backend/access/transam/xlog.c

In InstallXLogFileSegment, just commented link() and use the rename()
section, after reading the commnets that "rename() is an acceptable
substiute except for the truly paranoid" . I'm sure it is not a valid fix,
but seem to work for me in my setup.

On a side note, I used to see multiple 'postgres' processes in 'Windows Task
Manager' , but now because of this change or some other setup change I see
multiple 'postmaster' processes. Is there a explanation?

Thanks,

-----Original Message-----
From: Jason Tishler [mailto:jason(at)tishler(dot)net]
Sent: Wednesday, April 17, 2002 1:48 PM
To: Saravanan Bellan
Cc: 'pgsql-cygwin(at)postgresql(dot)org'
Subject: Re: [CYGWIN] Cygwin-Postgres-IpcMemoryCreate

On Tue, Apr 16, 2002 at 02:34:08PM -0700, Saravanan Bellan wrote:
> This was initially posted in comp.databases.postgresql.ports.cygwin.
>
> Updates:
>
> If using the rename() instead of link() the following error is not
> experienced anymore.
>
> > 1) FATAL 2: link from /cygdrive/C/pg/data/pg_xlog/0000000000000004 to
> > /cygdrive/C/pg/data/pg_xlog/0000000000000007 (initialization of log
> > file 0, segment 7) failed: Permission denied

Please post your patch for the above, so we know precisely what change
you needed to make to solve your problem. If the patch looks good,
then the next step would be to post it to pgsql-patches for consideration.

Note, however, that I have never seen an error message like the above.
What is your system info?

Cygwin version
cygipc version
Windows version
CYGWIN environment variable setting
filesystem type (i.e., NTFS, FAT, etc.)

> But the following error,I think, is independent of the above one.
>
> > DEBUG: all server processes terminated; reinitializing shared memory
> > and semaphores
> > IpcMemoryCreate: shmget(key=5432001, size=1441792, 03600) failed: Not
> > enough memory

I have seen the above error message when the permissions of the following
files were incorrect:

/tmp/cygipc*
/tmp/MultiFile*

Try removing them to see if this is your problem.

> Please the read the following initial post anyway.
>
> [snip]

BTW, I just built and tested PostgreSQL 7.2.1 under Cygwin 1.3.10. make
installcheck passed all tests.

Jason


From: Jason Tishler <jason(at)tishler(dot)net>
To: Saravanan Bellan <SBellan(at)jareva(dot)com>
Cc: "'pgsql-cygwin(at)postgresql(dot)org'" <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Cygwin-Postgres-IpcMemoryCreate
Date: 2002-04-23 11:49:58
Message-ID: 20020423114958.GC1500@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

On Mon, Apr 22, 2002 at 05:33:14PM -0700, Saravanan Bellan wrote:
> Sorry to get back so late on this one.

No problem.

> I'm using
> Cygwin dll - 1.3.10
> Cygipc 1.11-1
> Postgres 7.2.1
> Windows 2000 Professional (SP 1, Build 2195)
> NTFS

The above is my setup too.

> I'm running a non standard postgres-cygwin installation. Using only parital
> Cygwin installation and do not have a separate Windows User for postgres.

Why?

> I'm starting initdb with the -U option(I think this was introduced in 7.2)
> and use that user name for further connections.

Are the user running postmaster and the owner of the data files the
same? Can you reproduce this problem with either the basic or NT
service setup as described in the README?

> The change I had to make was in src/backend/access/transam/xlog.c
>
> In InstallXLogFileSegment, just commented link() and use the rename()
> section, after reading the commnets that "rename() is an acceptable
> substiute except for the truly paranoid" . I'm sure it is not a valid fix,
> but seem to work for me in my setup.

I was looking for a patch. Instead of the above, what about the attached
*untested* patch?

Someone should figure out why Cygwin link() fails in this situation,
but rename() succeeds. If so and it makes sense, then I will post a
patch to pgsql-patches.

> On a side note, I used to see multiple 'postgres' processes in 'Windows Task
> Manager' , but now because of this change or some other setup change I see
> multiple 'postmaster' processes. Is there a explanation?

Did you replace the postmaster symlink to postgres.exe with a copy of
postgres.exe? For example:

$ rm /usr/bin/postmaster
$ cp /usr/bin/postgres.exe /usr/bin/postmaster.exe

If so, then this explains the above.

Jason

Attachment Content-Type Size
xlog.c.diff text/plain 511 bytes