Re: Replication slots and footguns

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Replication slots and footguns
Date: 2014-03-12 19:03:01
Message-ID: 20140312190301.GA26328@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

Greetings,

Andres Freund

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2014-03-12 19:03:07 Re: db_user_namespace a "temporary measure"
Previous Message Josh Berkus 2014-03-12 19:00:25 Replication slots and footguns