Bug #547: postmaster enters infinite loop if lock file creation fails?

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #547: postmaster enters infinite loop if lock file creation fails?
Date: 2002-01-01 21:25:11
Message-ID: 200201012125.g01LPBr86218@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Dickerson (mikey(at)singingtree(dot)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 generated even 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 permissions were 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 saved some 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 legitimate recovery 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-01-01 23:01:06 Re: Bug #547: postmaster enters infinite loop if lock file creation fails?
Previous Message Tom Lane 2001-12-31 17:16:36 Re: Bug #546: un-pg_restore-able pg_dump