Re: Hot Standby WAL reply uses heavyweight session locks, but doesn't have enough infrastructure set up

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Hot Standby WAL reply uses heavyweight session locks, but doesn't have enough infrastructure set up
Дата
Msg-id 20150130203429.GA13118@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Hot Standby WAL reply uses heavyweight session locks, but doesn't have enough infrastructure set up  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Hot Standby WAL reply uses heavyweight session locks, but doesn't have enough infrastructure set up  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On 2015-01-29 11:01:51 -0500, Robert Haas wrote:
> On Wed, Jan 28, 2015 at 2:41 AM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
> > Andres Freund wrote:
> >> I think this isn't particularly pretty, but it seems to be working well
> >> enough, and changing it would be pretty invasive. So keeping in line
> >> with all that code seems to be easier.
> > OK, I'm convinced with this part to remove the call of
> > LockSharedObjectForSession that uses dontWait and replace it by a loop
> > in ResolveRecoveryConflictWithDatabase.
>
> That seems right to me, too.

It's slightly more complicated than that. The lock conflict should
actually be resolved using ResolveRecoveryConflictWithLock()... That,
combined with the race of connecting a actually already deleted database
(see the XXXs I removed) seem to make the approach in here.

Attached are two patches:
1) Infrastructure for attaching more kinds of locks on the startup
   process.
2) Use that infrastructure for database locks during replay.

I'm not sure 2) alone would be sufficient justification for 1), but the
nearby thread about basebackups also require similar infrastructure...

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proposal: knowing detail of config files via SQL
Следующее
От: Andres Freund
Дата:
Сообщение: Re: basebackups during ALTER DATABASE ... SET TABLESPACE ... not safe?