Re: Storage Manager crash at mdwrite()

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Storage Manager crash at mdwrite()
Дата
Msg-id CAM-w4HP9jiHcOGxbep7D6ufH0F4fUzgtGNgK_G6ykf=RYHe9Ww@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Storage Manager crash at mdwrite()  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Storage Manager crash at mdwrite()
Re: Storage Manager crash at mdwrite()
Список pgsql-hackers
On Fri, Mar 16, 2012 at 11:29 PM, Jeff Davis <pgsql@j-davis.com> wrote:
> There is a lot of difference between those two. In particular, it looks
> like the problem you are seeing is coming from the background writer,
> which is not running during initdb.

The difference that comes to mind is that the postmaster forks. If the
library opens any connections prior to forking and then uses them
after forking that would work at first but it would get confused
quickly once more than one backend tries to use the same connection.
The data being sent would all be mixed together and they would see
responses to requests other processes sent.

You need to ensure that any network connections are opened up *after*
the new processes are forked.

There are other things going on that could cause problems. initdb
probably doesn't deal with many errors so it might not be casing any
longjmps that happen when Postgres handles errors. I suspect it
doesn't create any temporary files, etc.

There's also a long history of threads not playing well with Postgres.
I think that's overblown and I believe they should work fine. Most of
it was caused by a bug in an old version of libc. But you do have to
ensure that the other threads don't call any Postgres functions
because the Postgres code is very much not thread-aware.

-- 
greg


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

Предыдущее
От: Daniel Farina
Дата:
Сообщение: Re: pg_terminate_backend for same-role
Следующее
От: Noah Misch
Дата:
Сообщение: Re: [PATCH] Support for foreign keys with arrays