{"action":"created","issue":{"url":"https://api.github.com/repos/zalando/patroni/issues/656","repository_url":"https://api.github.com/repos/zalando/patroni","labels_url":"https://api.github.com/repos/zalando/patroni/issues/656/labels{/name}","comments_url":"https://api.github.com/repos/zalando/patroni/issues/656/comments","events_url":"https://api.github.com/repos/zalando/patroni/issues/656/events","html_url":"https://github.com/zalando/patroni/issues/656","id":311666174,"number":656,"title":"Allow 'permanent' replication slots that don't correspond to the cluster members","user":{"login":"alexeyklyukin","id":339913,"avatar_url":"https://avatars0.githubusercontent.com/u/339913?v=4","gravatar_id":"","url":"https://api.github.com/users/alexeyklyukin","html_url":"https://github.com/alexeyklyukin","followers_url":"https://api.github.com/users/alexeyklyukin/followers","following_url":"https://api.github.com/users/alexeyklyukin/following{/other_user}","gists_url":"https://api.github.com/users/alexeyklyukin/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeyklyukin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeyklyukin/subscriptions","organizations_url":"https://api.github.com/users/alexeyklyukin/orgs","repos_url":"https://api.github.com/users/alexeyklyukin/repos","events_url":"https://api.github.com/users/alexeyklyukin/events{/privacy}","received_events_url":"https://api.github.com/users/alexeyklyukin/received_events","type":"User","site_admin":false},"labels":[{"id":233785761,"url":"https://api.github.com/repos/zalando/patroni/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-05T15:46:53Z","updated_at":"2018-04-05T16:10:36Z","closed_at":null,"author_association":"MEMBER","body":"When Patroni syncs its replication slots, it removes all slots except for those corresponding to the known members of the cluster.\r\n\r\nThat may break some useful features that rely on replication slots (i.e. logical decoding via a replication slot, logical replication or even pg_basebackup from the replica in newer versions of PostgreSQL). \r\n\r\nThere are at least two ways to resolve this:\r\n\r\n- Define some slots in the patroni configuration (in DCS) to be permanent, Patroni will create them and never remove. The downside of this approach is that it requires the user to let Patroni know of such slots explicitly.\r\n- Avoid deleting replication slots that were not created by Patroni, leaving the task of creating actual slots to the user. This is suboptimal since replication slots itself are not replicated and would have to be created anew after each promotion.\r\n\r\nPerhaps it would be good to combine both approaches and tag those slots created by Patroni (including permanent one, defined in the configuration) in some way or another, and drop only those slots when necessary. Since there are no comments on replication slots, the obvious way is to use some naming convention with a possible risk of the user naming their slots the same way and confusing Patroni.\r\n"},"comment":{"url":"https://api.github.com/repos/zalando/patroni/issues/comments/378990366","html_url":"https://github.com/zalando/patroni/issues/656#issuecomment-378990366","issue_url":"https://api.github.com/repos/zalando/patroni/issues/656","id":378990366,"user":{"login":"bradnicholson","id":20094007,"avatar_url":"https://avatars2.githubusercontent.com/u/20094007?v=4","gravatar_id":"","url":"https://api.github.com/users/bradnicholson","html_url":"https://github.com/bradnicholson","followers_url":"https://api.github.com/users/bradnicholson/followers","following_url":"https://api.github.com/users/bradnicholson/following{/other_user}","gists_url":"https://api.github.com/users/bradnicholson/gists{/gist_id}","starred_url":"https://api.github.com/users/bradnicholson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradnicholson/subscriptions","organizations_url":"https://api.github.com/users/bradnicholson/orgs","repos_url":"https://api.github.com/users/bradnicholson/repos","events_url":"https://api.github.com/users/bradnicholson/events{/privacy}","received_events_url":"https://api.github.com/users/bradnicholson/received_events","type":"User","site_admin":false},"created_at":"2018-04-05T16:10:36Z","updated_at":"2018-04-05T16:10:36Z","author_association":"CONTRIBUTOR","body":"> Avoid deleting replication slots that were not created by Patroni, leaving the task of creating actual slots to the user. This is suboptimal since replication slots itself are not replicated and would have to be created anew after each promotion.\r\n\r\nThis seems like a cleaner approach to me though.  This is a limitation in Postgres at the time, and trying to have Patroni work around that seems less than optimal.\r\n\r\nWhen the replication slot gets recreated on another member, it will have lost the place the former slot was on, and the end user will possibly/probably need to take special action to resync anyway."}}
{"actor":{"display_login":"bradnicholson"}}