FATAL: bogus data in lock file "postmaster.pid": ""

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема FATAL: bogus data in lock file "postmaster.pid": ""
Дата
Msg-id 4F05A338.7000409@enterprisedb.com
обсуждение исходный текст
Ответы Re: FATAL: bogus data in lock file "postmaster.pid": ""  (Magnus Hagander <magnus@hagander.net>)
Re: FATAL: bogus data in lock file "postmaster.pid": ""  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
My laptop ran out of battery and turned itself off while I was just 
starting up postmaster. After plugging in the charger and rebooting, I 
got the following error when I tried to restart PostgreSQL:

FATAL:  bogus data in lock file "postmaster.pid": ""

postmaster.pid file was present in the data directory, but had zero 
length. Looking at the way the file is created and written, that can 
happen if you crash after the file is created, but before it's 
written/fsync'd (my laptop might have write-cache enabled, which would 
make the window larger).

I was a bit surprised by that. That's probably not a big deal in 
practice, but I wonder if there was some easy way to avoid that. First I 
thought we could create the new postmaster.pid file with a temporary 
name and rename it in place, but rename(2) will merrily overwrite any 
existing file which is not what we want. We could use link(2), I guess.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: ALTER DOMAIN DROP CONSTRAINT doesn't catch errors
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: FATAL: bogus data in lock file "postmaster.pid": ""