pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedLingering replication slots
3+ messages / 2 participants
[nested] [flat]
* Lingering replication slots
@ 2019-04-03 16:01 Lou Tseng <ltseng@advancedpricing.com>
0 siblings, 1 reply; 3+ messages in thread
From: Lou Tseng @ 2019-04-03 16:01 UTC (permalink / raw)
To: pgsql-general
Hi,
A newbie question: how do I delete lingering replication slots? When creating Subscription for logical replication, the CREATE SUBSCRIPTION stuck and didn't return. After ctrl-c and aborted the command, the master database have lingering replication slots that I can't delete because the active is true. Do I just kill the pid?
Thanks!
SELECT * FROM pg_replication_slots ;
slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin | restart_lsn | confirmed_flush_lsn
--------------+----------+-----------+----------+----------------+-----------+--------+------------+------+--------------+--------------+---------------------
support_sub2 | pgoutput | logical | 28384483 | dragon_support | f | t | 29566 | | 96562907 | 5108/29C1610 |
support_sub | pgoutput | logical | 28384483 | dragon_support | f | t | 27253 | | 96562907 | 5108/2858880 |
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Lingering replication slots
@ 2019-04-03 16:27 Adrian Klaver <adrian.klaver@aklaver.com>
parent: Lou Tseng <ltseng@advancedpricing.com>
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Klaver @ 2019-04-03 16:27 UTC (permalink / raw)
To: Lou Tseng <ltseng@advancedpricing.com>; pgsql-general
On 4/3/19 9:01 AM, Lou Tseng wrote:
> Hi,
>
> A newbie question: how do I delete lingering replication slots? When
> creating Subscription for logical replication, the CREATE SUBSCRIPTION
> stuck and didn't return. After ctrl-c and aborted the command, the
> master database have lingering replication slots that I can't delete
> because the active is true. Do I just kill the pid?
>
> Thanks!
>
>
> SELECT * FROM pg_replication_slots ;
>
> slot_name |plugin| slot_type |datoid|database| temporary | active |
> active_pid | xmin | catalog_xmin | restart_lsn| confirmed_flush_lsn
>
> --------------+----------+-----------+----------+----------------+-----------+--------+------------+------+--------------+--------------+---------------------
>
> support_sub2 | pgoutput | logical | 28384483 | dragon_support | f |
> t|29566 || 96562907 | 5108/29C1610 |
>
> support_sub| pgoutput | logical | 28384483 | dragon_support | f |
> t|27253 || 96562907 | 5108/2858880 |
>
See below(read full description at link):
https://www.postgresql.org/docs/11/functions-admin.html#FUNCTIONS-REPLICATION
pg_drop_replication_slot(slot_name name)
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Lingering replication slots
@ 2019-04-03 16:34 Lou Tseng <ltseng@advancedpricing.com>
parent: Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 3+ messages in thread
From: Lou Tseng @ 2019-04-03 16:34 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general
Thank you. Wasn't able to drop replication slot because it's still active. Arjun suggested pg_terminate_backend() and it did the trick.
Thanks a lot!
Lou Tseng
ltseng@advancedpricing.com<mailto:ltseng@advancedpricing.com>
[http://advancedpricing.com/wp-content/uploads/logo_AMPS_email.png]<http://www.advancedpricing.com/;
Advanced Medical Pricing Solutions<http://advancedpricing.com/;
35 Technology Parkway South, Suite. 100
Peachtree Corners, GA 30092
________________________________
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Wednesday, April 3, 2019 11:27 AM
To: Lou Tseng; pgsql-general@postgresql.org
Subject: Re: Lingering replication slots
On 4/3/19 9:01 AM, Lou Tseng wrote:
> Hi,
>
> A newbie question: how do I delete lingering replication slots? When
> creating Subscription for logical replication, the CREATE SUBSCRIPTION
> stuck and didn't return. After ctrl-c and aborted the command, the
> master database have lingering replication slots that I can't delete
> because the active is true. Do I just kill the pid?
>
> Thanks!
>
>
> SELECT * FROM pg_replication_slots ;
>
> slot_name |plugin| slot_type |datoid|database| temporary | active |
> active_pid | xmin | catalog_xmin | restart_lsn| confirmed_flush_lsn
>
> --------------+----------+-----------+----------+----------------+-----------+--------+------------+------+--------------+--------------+---------------------
>
> support_sub2 | pgoutput | logical | 28384483 | dragon_support | f |
> t|29566 || 96562907 | 5108/29C1610 |
>
> support_sub| pgoutput | logical | 28384483 | dragon_support | f |
> t|27253 || 96562907 | 5108/2858880 |
>
See below(read full description at link):
https://www.postgresql.org/docs/11/functions-admin.html#FUNCTIONS-REPLICATION
pg_drop_replication_slot(slot_name name)
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-04-03 16:34 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 16:01 Lingering replication slots Lou Tseng <ltseng@advancedpricing.com>
2019-04-03 16:27 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-04-03 16:34 ` Lou Tseng <ltseng@advancedpricing.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox