Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHFok-0002Ha-CW for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 22:15:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHFmd-0001nm-Ar for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 22:13:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHFmd-0001lf-3H for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 22:13:15 +0000 Received: from lists.commandprompt.com ([2604:da00:2:2:5054:ff:fe07:7618]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHFmZ-0001pY-Da for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 22:13:14 +0000 Received: from [192.168.50.9] (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 9522D75D; Mon, 29 Oct 2018 15:13:07 -0700 (PDT) Received: from c-73-97-49-9.hsd1.wa.comcast.net ([73.97.49.9] helo=[192.168.50.9]) by assp.commandprompt.com with SMTPSA(TLSv1_2 ECDHE-RSA-AES128-GCM-SHA256) (2.5.1); 29 Oct 2018 15:13:07 -0700 Subject: Re: replication_slots usability issue To: Andres Freund , pgsql-hackers@lists.postgresql.org, pgsql-hackers References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <835C001D-7F0B-4C90-BFB3-5D6EE5E71A21@anarazel.de> From: "Joshua D. Drake" Organization: Command Prompt, Inc. Message-ID: Date: Mon, 29 Oct 2018 15:13:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <835C001D-7F0B-4C90-BFB3-5D6EE5E71A21@anarazel.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Assp-Version: 2.5.1(16177) on assp.commandprompt.com X-Assp-ID: assp.commandprompt.com m1-51187-08226 X-Assp-Session: 7F9BFC42C8F0 (mail 1) X-Assp-Original-Subject: Re: replication_slots usability issue X-Assp-Client-SSL: yes List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/29/18 11:26 AM, Andres Freund wrote: > > On October 29, 2018 1:31:56 PM EDT, "Joshua D. Drake" wrote: >> -Hackers, >> >> >> Working on 9.6 today (unsure if fixed in newer versions). Had an issue >> where the wal was 280G despite max_wal_size being 8G. Found out there >> were stale replication slots from a recent base backup. I went to drop >> the replication slots and found that since the wal_level was set to >> minimal vs replica or higher, I couldn't drop the replication slot. >> Clearly that makes sense for creating a replication slot but it seems >> like an artificial limitation for dropping them. > Uh, huh? How did you manage to start a server with existing slots with that configuration? It should have errored out at start... Well, this is the recovery.conf: standby_mode = 'on' recovery_target = 'immediate' primary_slot_name = 'testing_db01' primary_conninfo = 'user=replication passfile=/var/lib/postgresql/.pgpass host=db01 port=5432 sslmode=prefer sslcompression=1 krbsrvname=postgres target_session_attrs=any' recovery_target_action = 'promote' The machine came up clean and the only reason I noticed the problem is that it ran out of disk space. I cleared enough disk space to get it to come up again and noticed that there were replication slots that were identical to the primary. JD -- Command Prompt, Inc. || http://the.postgres.company/ || @cmdpromptinc *** A fault and talent of mine is to tell it exactly how it is. *** PostgreSQL centered full stack support, consulting and development. Advocate: @amplifypostgres || Learn: https://postgresconf.org ***** Unless otherwise stated, opinions are my own. *****