dbTalk Databases Forums  

[BUGS] stopping server does not remove external_pid_file

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] stopping server does not remove external_pid_file in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] stopping server does not remove external_pid_file - 06-05-2006 , 12:55 PM







--gneEPciiIl/aKvOT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi PostgreSQL developers,

I just played around with external_pid_file in 8.1.4. I noticed that
the file is created and filled properly, but it is not removed again
when the server is stopped.

Thank you,

Martin
--=20
Martin Pitt http://www.piware.de
Ubuntu Developer http://www.ubuntu.com
Debian Developer http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?

--gneEPciiIl/aKvOT
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEhGpMDecnbV4Fd/IRAuvJAJwO8v+fpkMNvOqLcQM4kz8cZdrpCACg2q6L
du1sDN9ok1igOid5VbZPp5M=
=wq2N
-----END PGP SIGNATURE-----

--gneEPciiIl/aKvOT--

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-06-2006 , 08:45 PM






Martin Pitt wrote:

Quote:
I just played around with external_pid_file in 8.1.4. I noticed that
the file is created and filled properly, but it is not removed again
when the server is stopped.

Looking at the code I see this comment in
src/backend/postmaster/postmaster.c

/* Should we remove the pid file on postmaster exit? */

IMHO, yes. It's not useful anymore.

Maybe some simple test in pmdie(). I'm too tired to code something now.



--
Euler Taveira de Oliveira
http://www.timbira.com/


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-06-2006 , 09:53 PM



Euler Taveira de Oliveira <euler (AT) timbira (DOT) com> writes:
Quote:
Martin Pitt wrote:
I just played around with external_pid_file in 8.1.4. I noticed that
the file is created and filled properly, but it is not removed again
when the server is stopped.

Looking at the code I see this comment in
src/backend/postmaster/postmaster.c

/* Should we remove the pid file on postmaster exit? */

IMHO, yes. It's not useful anymore.
[ shrug... ] If the postmaster crashes, it would certainly fail to
remove the pidfile. So I'd argue that your unnamed external script
that is expecting the pidfile to go away needs work: if it's not
verifying the PID given in the file, it's broken.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-06-2006 , 10:27 PM



Tom Lane wrote:
Quote:
Euler Taveira de Oliveira <euler (AT) timbira (DOT) com> writes:
Martin Pitt wrote:
I just played around with external_pid_file in 8.1.4. I noticed that
the file is created and filled properly, but it is not removed again
when the server is stopped.

Looking at the code I see this comment in
src/backend/postmaster/postmaster.c

/* Should we remove the pid file on postmaster exit? */

IMHO, yes. It's not useful anymore.

[ shrug... ] If the postmaster crashes, it would certainly fail to
remove the pidfile. So I'd argue that your unnamed external script
that is expecting the pidfile to go away needs work: if it's not
verifying the PID given in the file, it's broken.
Doesn't removing the file reduce the chances of failing to start later
in case another postmaster already has that pid? Why do we keep it
around?

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #5  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-06-2006 , 10:34 PM



Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes:
Quote:
Doesn't removing the file reduce the chances of failing to start later
in case another postmaster already has that pid?
No, because the external pidfile has zero to do with Postgres' internal
behavior.

Personally I always thought that the external pidfile was a "feature"
we should have rejected. It can never be a particularly reliable guide
to what PG is doing, the more especially so if the program looking at it
isn't doing any cross-checking, as the OP seems not to be doing.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #6  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-06-2006 , 10:36 PM



Tom Lane wrote:
Quote:
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes:
Doesn't removing the file reduce the chances of failing to start later
in case another postmaster already has that pid?

No, because the external pidfile has zero to do with Postgres' internal
behavior.

Personally I always thought that the external pidfile was a "feature"
we should have rejected. It can never be a particularly reliable guide
to what PG is doing, the more especially so if the program looking at it
isn't doing any cross-checking, as the OP seems not to be doing.
Oh, it is the "external" file, not the one we automatically create in the
/data directory.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #7  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-07-2006 , 06:06 PM



On Tue, Jun 06, 2006 at 11:32:53PM -0400, Tom Lane wrote:
Quote:
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes:
Doesn't removing the file reduce the chances of failing to start later
in case another postmaster already has that pid?

No, because the external pidfile has zero to do with Postgres' internal
behavior.

Personally I always thought that the external pidfile was a "feature"
we should have rejected. It can never be a particularly reliable guide
to what PG is doing, the more especially so if the program looking at it
isn't doing any cross-checking, as the OP seems not to be doing.
Has anyone considered allowing $PGDATA to be mode 701 and our pid file
being 644? ISTM that would remove the need for external_pid_file, though
of course people would still need to do the same kinds of checking.

Even if they do need to do the checking though, ISTM it'd be better to
remove the external PID file on shutdown...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby (AT) pervasive (DOT) com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #8  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] stopping server does not remove external_pid_file - 06-07-2006 , 06:26 PM



Tom Lane wrote:

Quote:
No, because the external pidfile has zero to do with Postgres' internal
behavior.

+1. So we have two options: have external_pid_file mimics the internal
behavior or deprecates it.

I couldn't find the discussion about it; just the patch [1]. IIRC this
'feature' was proposed to permit another home to postmaster.pid file. Am
I wrong? But seems to duplicate the pid file information.


[1] http://archives.postgresql.org/pgsql...6/msg00006.php

--
Euler Taveira de Oliveira
http://www.timbira.com/


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.