Bug #547: postmaster enters infinite loop if lock file creation fails? - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #547: postmaster enters infinite loop if lock file creation fails?
Date
Msg-id 200201012125.g01LPBr86218@postgresql.org
Whole thread Raw
Responses Re: Bug #547: postmaster enters infinite loop if lock file creation fails?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Michael Dickerson (mikey@singingtree.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
postmaster enters infinite loop if lock file creation fails?

Long Description
I'm running PostgreSQL 7.1.1 on FreeBSD 4.4, installed from the FreeBSD ports tree.

Trying to start the server (using pg_ctl) after some filesystem corruption, postmaster hung using 100% CPU but no disk
activity. I let it run for 11 hours before giving up.  This happened consistently.  No error log messages were
generatedeven with '-d 2' (I didn't try any higher debug levels). 

Attaching truss to the postmaster PID revealed that it was trying repeatedly to create and open the file
/tmp/.s.PGSQL.5432.lock,which was failing with "Permission denied".  This then clued me in to the fact that my /tmp
permissionswere wrong--after chmod 777 /tmp postmaster starts up fine again. 

Of course it was my own fault for having screwed up the permissions on /tmp; I'm only reporting it since it would have
savedsome time if postmaster had printed an error and quit.  I couldn't find any hints in the documentation or
FAQ--unfortunately,the chapter on "Database Recovery" isn't written or I might have known sooner that I wasn't seeing a
legitimaterecovery process. 

Thanks very much for an excellent product..
M.D.


Sample Code
truss attached to postmaster's PID outputs:

open("/tmp/.s.PGSQL.5432.lock",2562,0600)        ERR#13 'Permission denied'
open("/tmp/.s.PGSQL.5432.lock",0,0600)           ERR#2 'No such file or directory'
open("/tmp/.s.PGSQL.5432.lock",2562,0600)        ERR#13 'Permission denied'
open("/tmp/.s.PGSQL.5432.lock",0,0600)           ERR#2 'No such file or directory'
...and so on and so forth


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug #546: un-pg_restore-able pg_dump
Next
From: Tom Lane
Date:
Subject: Re: Bug #547: postmaster enters infinite loop if lock file creation fails?