Re: PATCH: Add 'pid' column to pg_replication_slots

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: PATCH: Add 'pid' column to pg_replication_slots
Дата
Msg-id 4A878F16-A067-4176-8BF7-70286B3560D3@anarazel.de
обсуждение исходный текст
Ответ на Re: PATCH: Add 'pid' column to pg_replication_slots  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
On April 21, 2015 1:17:32 PM GMT+03:00, Craig Ringer <craig@2ndquadrant.com> wrote:
>On 21 April 2015 at 15:19, Andres Freund <andres@anarazel.de> wrote:
>
>> On 2015-04-07 18:41:59 +0800, Craig Ringer wrote:
>> > @@ -331,8 +331,8 @@ ReplicationSlotAcquire(const char *name)
>> >                       volatile ReplicationSlot *vslot = s;
>> >
>> >                       SpinLockAcquire(&s->mutex);
>> > -                     active = vslot->active;
>> > -                     vslot->active = true;
>> > +                     active = vslot->active_pid != 0;
>> > +                     vslot->active_pid = MyProcPid;
>> >                       SpinLockRelease(&s->mutex);
>> >                       slot = s;
>> >                       break;
>>
>> Uh. You're overwriting the existing pid here. Not good if the slot is
>> currently in use.
>>
>
>Isn't that the point? We're acquiring the slot there, per the comment:

Read the rest of the function. We're checking for conflicts...

--- 
Please excuse brevity and formatting - I am writing this on my mobile phone.



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: PATCH: Add 'pid' column to pg_replication_slots
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Streaming replication and WAL archive interactions