Re: Replication slots and footguns

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Replication slots and footguns
Дата
Msg-id CA+TgmoZms5WUmswU9T0Tesipqz0nsmA6-TzuJ_aN15Eo2dCZ5A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Replication slots and footguns  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On Wed, Mar 12, 2014 at 3:25 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2014-03-12 15:18:04 -0400, Robert Haas wrote:
>> On Wed, Mar 12, 2014 at 3:03 PM, Andres Freund <andres@2ndquadrant.com> wrote:
>> > Hi,
>> >
>> > On 2014-03-12 12:00:25 -0700, Josh Berkus wrote:
>> >> I was just reading Michael's explanation of replication slots
>> >> (http://michael.otacoo.com/postgresql-2/postgres-9-4-feature-highlight-replication-slots/)
>> >> and realized there was something which had completely escaped me in the
>> >> pre-commit discussion:
>> >>
>> >> select pg_drop_replication_slot('slot_1');
>> >> ERROR:  55006: replication slot "slot_1" is already active
>> >> LOCATION:  ReplicationSlotAcquire, slot.c:339
>> >>
>> >> What defines an "active" slot?
>> >
>> > One with a connected walsender.
>> >
>> >> It seems like there's no way for a DBA to drop slots from the master if
>> >> it's rapidly running out of disk WAL space without doing a restart, and
>> >> there's no way to drop the slot for a replica which the DBA knows is
>> >> permanently offline but was connected earlier.  Am I missing something?
>> >
>> > It's sufficient to terminate the walsender and then drop the slot. That
>> > seems ok for now?
>>
>> Urgh.  That error message looks susceptible to improvement.  How about:
>>
>> replication slot "%s" cannot be dropped because it is currently in use
>
> I think that'd require duplicating some code between acquire and drop,
> but how about "replication slot "%s" is in use by another backend"?

Sold.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: jsonb and nested hstore