From jd@commandprompt.com Mon Oct 29 17:31:56 2018 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 1gHBOY-0006cn-Lh for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 17:32:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHBOW-0000yX-Hp for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 17:32:04 +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 1gHBOW-0000v5-AS for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 17:32:04 +0000 Received: from lists.commandprompt.com ([69.168.55.30]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHBOS-0003hg-6U for pgsql-hackers@postgresql.org; Mon, 29 Oct 2018 17:32:03 +0000 Received: from [192.168.50.9] (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 10C1175E for ; Mon, 29 Oct 2018 10:31:57 -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 10:31:56 -0700 To: pgsql-hackers From: "Joshua D. Drake" Subject: replication_slots usability issue Organization: Command Prompt, Inc. Message-ID: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> Date: Mon, 29 Oct 2018 10:31:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------C14CFC3EA275B3CC0F69CFF8" Content-Language: en-US X-Assp-Version: 2.5.1(16177) on assp.commandprompt.com X-Assp-ID: assp.commandprompt.com m1-34316-12036 X-Assp-Session: 7F9C3075EC98 (mail 1) X-Assp-Original-Subject: replication_slots usability issue X-Assp-Client-SSL: yes List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------C14CFC3EA275B3CC0F69CFF8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit -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. 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. ***** --------------C14CFC3EA275B3CC0F69CFF8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

-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.


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.   *****
--------------C14CFC3EA275B3CC0F69CFF8-- From andres@anarazel.de Mon Oct 29 18:26:56 2018 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 1gHCFo-0000V0-Gb for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 18:27:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHCFn-0002c8-1y for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 18:27:07 +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 1gHCFl-0002c0-Vj for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 18:27:06 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHCFi-00055u-Ud for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 18:27:05 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8A3FA22299; Mon, 29 Oct 2018 14:27:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 29 Oct 2018 14:27:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:to:from:message-id; s=fm2; bh=BM8xPpd76wdYvjG4nSFIsxktGSqMktu5K1z4cjwIDXE=; b=mQCYzu1PvZ5V w2HPXw0oWqeLzdRW44hoIxyO/KZIKL2bYf/hSWsBZa72fsjIlM7kC5Je8Yh/4Sf2 JGRkQO9mvhbWcYJCzj379Fqx6TG+8rx/66oC9uq+g/LUpzg0nDh2Pon8vvTXo7if fAgozQiCzpu6ksg1m/9pcI6/pwAYKEhoSuQCv090SR7UrCsQMDMzFmeNayhNC2pR OzQTZKFvLr2Zo//HWCj4ragNIyP+McYuEHoFvtZPsedwZKxJC1rsidCWuH5Ateyd t/OAovONqBZN/dZb2BqzUoLgU0sVsLiBeJ7PqNj3yYVXtG/Ju3bWmeLxv+evHkui cBLbEAoySw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=BM8xPpd76wdYvjG4nSFIsxktGSqMktu5K1z4cjwID XE=; b=G78MgOgPxjFwlYASQR8hbHp+cVj4nYCsnVSxGgZjCH92gwMy42Dd4K+SS 2Ahw+f2sS3UYc4/oGE1+ewyfdvtFAh69KTvLEKYBnpaaeKSM7Ov/uCNXhnKdfcuO 51iM6DJYsddSIbQVS6QEn90J+iDF2fAAqB0i1yrQB6N7dLU5yt73eSVb29AolTjE VYZwpfKAhljxeAwWlWDfz/93uujNRRXJn0fRJ+IDu1an/VFjmQEoCYgtn+jtBGpH YjuGn1SCNXs2fSC7BkZhoV5lSHSisIqiAwT4/L0Zyr/2df7YOTCxnutLG1J9o2c8 7tzOi/5q0brodkORovvTJbu56uC4w== X-ME-Sender: X-ME-Proxy: Received: from [6.138.231.102] (unknown [172.58.232.178]) by mail.messagingengine.com (Postfix) with ESMTPA id 1BE7EE43AC; Mon, 29 Oct 2018 14:27:00 -0400 (EDT) Date: Mon, 29 Oct 2018 14:26:56 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: replication_slots usability issue To: pgsql-hackers@lists.postgresql.org,"Joshua D. Drake" ,pgsql-hackers From: Andres Freund Message-ID: <835C001D-7F0B-4C90-BFB3-5D6EE5E71A21@anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On October 29, 2018 1:31:56 PM EDT, "Joshua D=2E Drake" wrote: >-Hackers, > > >Working on 9=2E6 today (unsure if fixed in newer versions)=2E Had an issu= e=20 >where the wal was 280G despite max_wal_size being 8G=2E Found out there= =20 >were stale replication slots from a recent base backup=2E I went to drop= =20 >the replication slots and found that since the wal_level was set to=20 >minimal vs replica or higher, I couldn't drop the replication slot=2E=20 >Clearly that makes sense for creating a replication slot but it seems=20 >like an artificial limitation for dropping them=2E Uh, huh? How did you manage to start a server with existing slots with tha= t configuration? It should have errored out at start=2E=2E=2E Andres Andres --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E From alvherre@2ndquadrant.com Mon Oct 29 19:02:18 2018 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 1gHCo1-00020q-0p for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 19:02:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHCnz-0006Mg-Bf for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 19:02:27 +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 1gHCny-0006MZ-Vi for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 19:02:27 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gHCnv-0005zb-Ly for pgsql-hackers@postgresql.org; Mon, 29 Oct 2018 19:02:26 +0000 Received: by mail-qk1-x741.google.com with SMTP id d135so4606889qkc.12 for ; Mon, 29 Oct 2018 12:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=sNKvDFKn7j4Sfvneh6+/HZp5Y3uhhZcksOj91Ucj77k=; b=CdH768t+EQ5L9Ev3B+L438HvU6QUBxwisA0raRfa/1OOkOB3X4vYm3V2tW4V1wMLh5 pKUzG86jE915wHZVtG0ptst2Oi/DVHnB2/eX3iUBJznBQs6Vh3Vd6u+/uoyw4b9TlZMG SriNKt2g+eRS+BLddpMZ4ZFaijJyIcfI+/GH4d+wOwVB/trIIJ4Q36uCrQie5DIxVqvb rwSmzmDAst5cIgIiIYQwMT4hrX//KqZX33ksXuUMWGfUC79bCnDColgbc5FhVqdH+tGh /NiZnvhXfiyEKSFBnCC6CEaoLc3AitbWi5bj/9y3Il9HPLOddE37j1dDvFtycWEieXM1 FfGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sNKvDFKn7j4Sfvneh6+/HZp5Y3uhhZcksOj91Ucj77k=; b=rNx5Ji9tqeMq+JwP6/uX1NsVX6xfY7jr+zK15OOs2u/QgBuSU0i2FTD0K7R4BGwLel CxmTFNcYXwOtrrFk+ubBCwxl+DOkf+asxGyrADvkLbYi2LZO4QHjhzibyXsPDczpnI2t WO2VL0KuyFz7q8atqTuhu7SX2oqp6m8NGlUDsnLR0D8j2fSbHqzgc6lODv8xANgq5bHX jNKI/Tk733BmscqB0R6xj6aGF5RNXpQ0kgskg2lwWNFwwsdVPmN7uUuxgt312LjqBSvn 25h633DuHCa9BH3Y6CEIdKOFrtlahuhpLIWvxP10qZw8f1NJLf8vR2yNkdn9+pX5gWIy rvGQ== X-Gm-Message-State: AGRZ1gKWldSAaYPJYlZsMmZuVPZtrqAFwMdeP+nzsNCIgkBLPUmtTC4B hZxMsIbxn4+NaNXAqUpuWspJKw== X-Google-Smtp-Source: AJdET5dTYQpszFQ2JmqzeU4chgAJoGghvp8zNeTsTn8QWQHy8+nYyn6MiLOOseh5lKWOJ60EUp8+ow== X-Received: by 2002:a37:ba42:: with SMTP id k63-v6mr13448249qkf.103.1540839741489; Mon, 29 Oct 2018 12:02:21 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id z20-v6sm3564172qti.75.2018.10.29.12.02.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 12:02:20 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id ED87D84A; Mon, 29 Oct 2018 16:02:18 -0300 (-03) Date: Mon, 29 Oct 2018 16:02:18 -0300 From: Alvaro Herrera To: "Joshua D. Drake" Cc: pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Oct-29, 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. This sounds closely related to https://www.postgresql.org/message-id/20180508143725.mn3ivlyvgpul6ovr%40alvherre.pgsql (commit a1f680d962ff) wherein we made it possible to drop a slot in single-user mode. Seems worth fixing. Send a patch? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services From andres@anarazel.de Mon Oct 29 19:13:04 2018 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 1gHCya-0002UR-F8 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 19:13:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHCyY-0000MS-Fx for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Oct 2018 19:13:22 +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 1gHCyX-0000MF-Ba for pgsql-hackers@lists.postgresql.org; Mon, 29 Oct 2018 19:13:22 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHCyS-0006FH-A6 for pgsql-hackers@postgresql.org; Mon, 29 Oct 2018 19:13:20 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8CDBE2206B; Mon, 29 Oct 2018 15:13:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 29 Oct 2018 15:13:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=J9zRJ7sh1ApdXY6udi3hR5sh0fY +tm3gxm6vgYk5PIU=; b=wghFAu1RVbu45NLZGuwrcNZklabN/oB0MyB3TYy7d73 ScHOxPhzrjxi9jNH4078BFjf7vKY1/QCq7u8GodWB7yq//UUPgx1ipAcxYeyG3Uv 6FcehWTKyBBAH0OkTr9VLHty3pRzcJDgAgVWDCMxwIvCTVmnvGbNPaAK2LtnUvTy /fqtlYPof9KVzm0NO3XPFZJbeoSeLeH+xmBYNM9zMQ4st7K4cvoD8Vj6kCQUuV/o ZFl3tBtjVppGKfXvMLhEoS+Qyfg9jTlrJQ2x8lFDFz8DBstKYARYYgH4C7Am3Ige kQLbRubL0Qz3GlpSHTVBBUrhgzuCWRTojHzsLea6kAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=J9zRJ7 sh1ApdXY6udi3hR5sh0fY+tm3gxm6vgYk5PIU=; b=tHPL80pZ9DT/LKQzmk12MU r1kkVwYwVsHdJMgalyeDy4sWJuyI/JkwsCUNIWKzUkX5h9NCGmZi7bngQp/5snka eSKGJxD4lyGm2+qtLVzdjUn05tRiLnykC3qMuZTYeaSrRRhVyuhgFm2TtzPNWlZy +Wr8uyL/6tfUDV/4Vh+OQ1r/yTVBwd3Su7nP6oZu0TmyRU52f0e813X3dyL6QdTz lq2ZHI5G7aB5nGU8rJexMLLrP3EuMa/XQios598ABevdvWsW1L08zGwihr+khImA GGA3dbvUB/vJyact2cPVbuEfXAwCO62jNnHyb298l2Ii2M/m/FGdpyix8qE1mSuw == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (unknown [65.119.211.164]) by mail.messagingengine.com (Postfix) with ESMTPA id D493F102A0; Mon, 29 Oct 2018 15:13:13 -0400 (EDT) Date: Mon, 29 Oct 2018 12:13:04 -0700 From: Andres Freund To: Alvaro Herrera Cc: "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-10-29 16:02:18 -0300, Alvaro Herrera wrote: > On 2018-Oct-29, 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. > > This sounds closely related to > https://www.postgresql.org/message-id/20180508143725.mn3ivlyvgpul6ovr%40alvherre.pgsql > (commit a1f680d962ff) wherein we made it possible to drop a slot in > single-user mode. > > Seems worth fixing. Send a patch? I don't think this quite is the problem. ISTM the issue is rather that StartupReplicationSlots() *needs* to check whether wal_level > minimal, and doesn't. So you can create a slot, shutdown, change wal_level, startup. A slot exists but won't work correctly. Greetings, Andres Freund From jd@commandprompt.com Mon Oct 29 22:13:07 2018 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. ***** From michael@paquier.xyz Tue Oct 30 02:51:09 2018 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 1gHK7n-0007tq-Lq for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 02:51:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHK7m-0006L5-4T for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 02:51:22 +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 1gHK7l-0006Ky-TV for pgsql-hackers@lists.postgresql.org; Tue, 30 Oct 2018 02:51:21 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHK7h-0007tV-5D for pgsql-hackers@postgresql.org; Tue, 30 Oct 2018 02:51:21 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A76C921F54; Mon, 29 Oct 2018 22:51:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 29 Oct 2018 22:51:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=NmCvDRqYvTug9mpKv+DKWuWp+Ub e2wV61/XuMCfnhDg=; b=sOoXeZQYYHsuHqVZ09DT6AjK5IIuAp3HmZzEUocz56O CYpIkY0Q67XaSW3KJzIVfJTNZwG1OuUQaNe0rKwEwFxU5Owtm2xVc8VJrKfaVr6+ FIijoDpW05hAVMyxLD5lpkBRjBASbEVoWin7ii3xlx2JwgmztTOhc3+v8vQ6lJ5g JH88YTpbf9XWMJFShDIWS7rBeoXg1JX5tuF1QGxQy0golfW/jYXJnhPctw8GJw9S 3QzCj704K/kyYqkU71/q75CD58U7ePllvDOLF87xAp8XfMmOw/nynceipuPHT3iT OBvoBieV70sQhKkZ6612gPgJA3OvUc2NgGiL/Bq+0VA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=NmCvDR qYvTug9mpKv+DKWuWp+Ube2wV61/XuMCfnhDg=; b=B4H7QHW17pvv0GZPY+jL+6 vnhQAUlzCoYAMRjIye/PUpyYofEAuAGoUc2+FJZ4mx41By/e9cZPQe42JUqW5mPG l1K1ViQqY0QTMFjKGRAu+b/X1PP+IhCMn8bz95H8thrgkJgXiSz25ZaGxj4f6dhs DKz3K8JVpq/nlSwS4U7Bq2Lt61DU4aQXt8OGc4dy3o+cLHhSDDAit4wX+EXdGlkE TvGO6EqRJcT04yNGwRXCW5QvX7+Wnn2g366k8xPez9uEiz7B6BWobrrlSqvxQZQb 7FEbB4Obp5M4dwEeAHmunJ9lgskK5wdg7eAmlXyEPD/p4BbLk44+++w8h793AkKQ == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 75599102F3; Mon, 29 Oct 2018 22:51:12 -0400 (EDT) Date: Tue, 30 Oct 2018 11:51:09 +0900 From: Michael Paquier To: Andres Freund Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181030025109.GD1644@paquier.xyz> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DrWhICOqskFTAXiy" Content-Disposition: inline In-Reply-To: <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --DrWhICOqskFTAXiy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > I don't think this quite is the problem. ISTM the issue is rather that > StartupReplicationSlots() *needs* to check whether wal_level > minimal, > and doesn't. So you can create a slot, shutdown, change wal_level, > startup. A slot exists but won't work correctly. It seems to me that what we are looking for is just to complain at startup if we find any slot data and if trying to start up with wal_level = minimal. Er... At the same time, shouldn't RestoreSlotFromDisk() *not* use PANIC if more slots are found in pg_replslot than max_replication_slots can handle. A FATAL is fine at startup, PANIC blows up a core file, which is clearly overdoing it if the goal is to give a recommendation at the end. -- Michael --DrWhICOqskFTAXiy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvXxx0ACgkQnvQgOdby QH21fw//WgIP7NhLNlAE1nHLwC0RmG//ON16k/D3Tfg2hTS3A836jdQL8W8B+i6I IhREdyTtLf8zUN6oxICesZtET97UYdm7mGuQHauIAY2bVDn9LHYRmpNsaWmitbFY b0CfKm+aN0D+3+xzABXksvOiEghulKDsynGlWOhkpghccO4WE3TR7RqL7VVlVJYP XaWKMnfIFfDdDFp/OKzJPIfxGWNmuKiPXeHZvSX9QbUaBLhH0gfv4OwxQ9xI0MUY 3+9muxtgZe94dbjjkZwb+UpscpOjQ3BhNQ4DM58f5OIzHgU2npWEL5ggWV671IVI 2y2dsxGmiqi2J812pyTwKw7BPqG0oSmtTsrzeKJNT31tqf7Fa3llLRaK830FCzu4 PQLBg6rOov+XKCTdu5k0wPhVMZZDNg3EKfrmjhMZC2IFPfbZrrTTz+2mqW/fYSDH mZ3stb07Sx/TK+eEXA5ZrwGcjJGIUObHlPgHUUt4fJVtsPYoIOBt171wycWn4jaQ 71cj6KfDEXXvRp135rBABXQHGWu1KTx2gmGMnT5x0nhM3Y74vcaCOwLsMvAbX9Ii 1JuUoUEEd4mdi72zM7hk2rPD83S4DLXiGp80d+JTuKTr5sqJPAXGfFBQGAfHijvn En62eQFmZOZjZAnH18CgFq+GHA0Tic2TG0OWTnElPV3w63cvpyI= =C0a4 -----END PGP SIGNATURE----- --DrWhICOqskFTAXiy-- From andres@anarazel.de Tue Oct 30 17:52:54 2018 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 1gHYCL-0006Bt-Hh for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 17:53:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHYCJ-00023A-Ux for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 17:52:59 +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 1gHYCJ-000233-Nk for pgsql-hackers@lists.postgresql.org; Tue, 30 Oct 2018 17:52:59 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHYCH-00066R-V1 for pgsql-hackers@postgresql.org; Tue, 30 Oct 2018 17:52:59 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B6666220F8; Tue, 30 Oct 2018 13:52:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 30 Oct 2018 13:52:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=Kwe8flJitdCm/+Q/0qHfAzWMfTz +pVviP/qbfpxbZ3o=; b=qJ6JoIqWZJ6WDXT2sjbaxKfpq1ePyLq7uToczYJ1dSq 1Jp3HFNyKfFRn9wvyPuJLmEtL3lI6rj73kTeh6K9bzMKBUSxtcmkqfIizovlf7g4 G4JtTBKLpjeUWT24YipLAHow6jPw57KkGEteLDY4LePuzVhOBTN8kv5/x1LH0QDw RJSk5MWEm1P21MpemDGAP8IS+lZH4fBGqu/gvNRbU+6SRIe6FCnfdEIXv+pq+su2 1qyoo1/zhtXHO8yhRuYvQ5AAirhDPljsVPDdb/q6Sgh+bBcmi/yC8RB5+ntWDG8J sZF4fgQAAp7xFoP7Z62atXjE0UP2BZ136UG0ffJy+vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Kwe8fl JitdCm/+Q/0qHfAzWMfTz+pVviP/qbfpxbZ3o=; b=btlIbCPp+sOg/p18yBe5TD 3k5EjQvwnlZg5It57zWJAb/deaH7LcQN1KaTksc8Xg8Y6U71Mcnvbrl6KYTXXcNu W5KhSh8uoATFNjz+zhDnpxOxi4wy5PLXg03CG54Z8WXm9kUNw1nDsywf0CpEhZeo XdT56Ce+pJ/pEec+Ahc2wsboJXOxHjsg2wE/EQ9xnv28Vi9FmkG3SknmEfI3Vy0k vUi1q1R/oVj2beFnTn/WLqfH6nHODYudC1/OKPAwHfbey1/mqPZFSz+8xWpKTJnZ rXwLGFV9KTW9SO5tzLkOCaODeKCeVP6t+NDKVHwUrnxzUSyDTkglRQHQqzNCqFIg == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 7A219102F0; Tue, 30 Oct 2018 13:52:55 -0400 (EDT) Date: Tue, 30 Oct 2018 10:52:54 -0700 From: Andres Freund To: Michael Paquier Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181030025109.GD1644@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: > On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > > I don't think this quite is the problem. ISTM the issue is rather that > > StartupReplicationSlots() *needs* to check whether wal_level > minimal, > > and doesn't. So you can create a slot, shutdown, change wal_level, > > startup. A slot exists but won't work correctly. > > It seems to me that what we are looking for is just to complain at > startup if we find any slot data and if trying to start up with > wal_level = minimal. Right, we really should just call CheckSlotRequirements() before doing so. I'll make it so, once I'm actually awake and had some coffee. > Er... At the same time, shouldn't RestoreSlotFromDisk() *not* use PANIC > if more slots are found in pg_replslot than max_replication_slots can > handle. A FATAL is fine at startup, PANIC blows up a core file, which > is clearly overdoing it if the goal is to give a recommendation at the > end. I can't get particularly excited about this. I guess we can change it, but I'd only do so in master. Greetings, Andres Freund From jd@commandprompt.com Tue Oct 30 18:02:04 2018 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 1gHYLI-0006fH-UZ for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 18:02:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHYLH-00077y-7K for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 18:02:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHYLG-00077q-Sf for pgsql-hackers@lists.postgresql.org; Tue, 30 Oct 2018 18:02:15 +0000 Received: from lists.commandprompt.com ([2604:da00:2:2:5054:ff:fe07:7618]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHYL9-0006Mp-4l for pgsql-hackers@postgresql.org; Tue, 30 Oct 2018 18:02:13 +0000 Received: from [192.168.50.9] (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id F353A7C7; Tue, 30 Oct 2018 11:02:04 -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); 30 Oct 2018 11:02:04 -0700 Subject: Re: replication_slots usability issue To: Andres Freund , Michael Paquier Cc: Alvaro Herrera , pgsql-hackers References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> From: "Joshua D. Drake" Organization: Command Prompt, Inc. Message-ID: <47ff1ce0-498b-e305-9c72-b0cdcf41e1ce@commandprompt.com> Date: Tue, 30 Oct 2018 11:02:04 -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: <20181030175254.wqircsg36vblpmw5@alap3.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-22524-07470 X-Assp-Session: D0B2D20 (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/30/18 10:52 AM, Andres Freund wrote: > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: >> On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: >>> I don't think this quite is the problem. ISTM the issue is rather that >>> StartupReplicationSlots() *needs* to check whether wal_level > minimal, >>> and doesn't. So you can create a slot, shutdown, change wal_level, >>> startup. A slot exists but won't work correctly. >> It seems to me that what we are looking for is just to complain at >> startup if we find any slot data and if trying to start up with >> wal_level = minimal. > Right, we really should just call CheckSlotRequirements() before doing > so. I'll make it so, once I'm actually awake and had some coffee. Why not just disable the slot and report an INFO: line? JD > > >> Er... At the same time, shouldn't RestoreSlotFromDisk() *not* use PANIC >> if more slots are found in pg_replslot than max_replication_slots can >> handle. A FATAL is fine at startup, PANIC blows up a core file, which >> is clearly overdoing it if the goal is to give a recommendation at the >> end. > I can't get particularly excited about this. I guess we can change it, > but I'd only do so in master. > > > Greetings, > > Andres Freund > -- 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. ***** From andres@anarazel.de Tue Oct 30 18:08:55 2018 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 1gHYRs-0006wi-01 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 18:09:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHYRq-00058e-CO for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Oct 2018 18:09:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHYRq-00058X-1k for pgsql-hackers@lists.postgresql.org; Tue, 30 Oct 2018 18:09:02 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHYRn-0006VL-GC for pgsql-hackers@postgresql.org; Tue, 30 Oct 2018 18:09:00 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B6C03220E8; Tue, 30 Oct 2018 14:08:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 30 Oct 2018 14:08:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=Jpn8jpHp6qlVI0oFwY6Hrivvhjy s4WucszAI33ne/0M=; b=p/+qBAuNQHuE4hKzvBeFMPZZF8fl6uIPIaQXYpUjzzk 1bbuHv9BiAcRU8u5AJ84ZUIMnIB1yrGR22prRY3cHR/1nJEpd8lZhKMsq2A70/1h CTh5zDfFkUmWYfT80S7Sw9ZfNYfEhVgC5aPM833qVLXdQnUvvJnxFd1JVng6C097 TMh2jjwSgC0qHgUNd4zwDCWWk/6FQgU/Ds75KJAhQMQvSPp+MgUeA4pTFrrUUl5s BgnPZ88FTQkikUChrxFccfcDfE1COcEp1MdoZjfmQStVr9TqCu3xtWxiQHwomzBh YZ5bC2U/926fAlj4WxPdoCvz7Ny4XqWsDSam9JCHWhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Jpn8jp Hp6qlVI0oFwY6Hrivvhjys4WucszAI33ne/0M=; b=tPXn/e9HF72ioYXLjbutno IFLz6+sTYXczxCHx43uHrgg+3oUCjzvXUSOWEznZnm+LFIf/VIlHvDenANZFLEZJ 8vAb7eKXUC08ky9giYAVIvw4AxK8NmyHwa6yRNGQFDJW74OZV51HCqMYZkvbwWYw x1RnSEXO6V3hVmw/1W4kxy9G8TSjNhb9z6pByNyTsCT3j9XmBOKUmUjBZ82HeIZJ FFffzLEUm1QnDPwWAXKDe9DsOeQ0JRiusSb+HvCruFP6tdrgPbJTc6rNvCS/SlKM fFKS3Ixs+Nye3ViyJtP23FSAqWQdHG+U0annb5ZRfy+dSGfVygmGjl0xTlaxxJqg == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id CB130102F1; Tue, 30 Oct 2018 14:08:56 -0400 (EDT) Date: Tue, 30 Oct 2018 11:08:55 -0700 From: Andres Freund To: "Joshua D. Drake" Cc: Michael Paquier , Alvaro Herrera , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181030180855.htfctq232kc2i5au@alap3.anarazel.de> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> <47ff1ce0-498b-e305-9c72-b0cdcf41e1ce@commandprompt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47ff1ce0-498b-e305-9c72-b0cdcf41e1ce@commandprompt.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-10-30 11:02:04 -0700, Joshua D. Drake wrote: > On 10/30/18 10:52 AM, Andres Freund wrote: > > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: > > > On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > > > > I don't think this quite is the problem. ISTM the issue is rather that > > > > StartupReplicationSlots() *needs* to check whether wal_level > minimal, > > > > and doesn't. So you can create a slot, shutdown, change wal_level, > > > > startup. A slot exists but won't work correctly. > > > It seems to me that what we are looking for is just to complain at > > > startup if we find any slot data and if trying to start up with > > > wal_level = minimal. > > Right, we really should just call CheckSlotRequirements() before doing > > so. I'll make it so, once I'm actually awake and had some coffee. > > Why not just disable the slot and report an INFO: line? Because afterwards there'd be a slot with corrupted contents. Especially bad for logical slots. Which might look ok, but crash in weird ways. - Andres From michael@paquier.xyz Wed Oct 31 02:10:23 2018 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 1gHfxy-0001tf-Nr for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Oct 2018 02:10:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHfxv-0007SX-VI for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Oct 2018 02:10:39 +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 1gHfxu-0007SH-8e for pgsql-hackers@lists.postgresql.org; Wed, 31 Oct 2018 02:10:39 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHfxo-0001gW-5g for pgsql-hackers@postgresql.org; Wed, 31 Oct 2018 02:10:37 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 44B4A220A3; Tue, 30 Oct 2018 22:10:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 30 Oct 2018 22:10:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=UsR1OAXg8DptAiltIOfiH9yloW7 iq9WguBUuomNR8Xc=; b=YMq3cRNIb6RLQ0EVWe17rtWhr7XrgILDyG134/mjxnX iJ/oN8CqXWgC8DxloAcwXkAlGP37fOd83CvnR6tQ+pQvfpNtdHUMFzt9valrFGBQ fYWDMqCJ0BGk7Mg0j1Y3uNjGv2DRrSzUYRgpLWvDsW/g6EQ2RkEEoGYIJvSH2Ilq D+ZfsUe2SdAVisdH4JDAp3R7e3YQHd60cZ1FZ58EHoihhcqVekCjCyEXBPQ1+p+m riksWh8TmbuFD9oO54BQTcD3+NyJJTxV6Lv6yRv98PK6Tpyp8MjdhH139E0j1svu JFKuKj9IZ/U6Q5Yzq2HjsolsfApfY7Jh8gp0sbGdd7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=UsR1OA Xg8DptAiltIOfiH9yloW7iq9WguBUuomNR8Xc=; b=Hi1EYtjO28mObikt5431hx xs23q4jzJL5ZzJOyqnTOc+ttsQ9ojbcS55QNAKAC8doYo/5y0rjy3eVc5QROBAdS 9XZ1ecPNUNgZIMA+UU1q9vQMSsIr4Y97WMPZ4XgozsWE6rJfqU0BrqyT13pd5tH0 tVcTLPoyzTQaKIeNlnkoQ0HjSfEde94lKocBzEDY0QxZE/Op3/0Kg38YzTNYpckH q9BxYEJDsZ5EMQQ5wrdrMKLSulC1JwTUZl+9MG6/xu8BYsdzHZf1MZSP47rtoWTV dPlZ35loVPHJaZLqW9pBaxumpwVqmorWwUkKUXlGnRtqhMaNPBlP51pHp6MoGhDQ == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 83CA41030D; Tue, 30 Oct 2018 22:10:27 -0400 (EDT) Date: Wed, 31 Oct 2018 11:10:23 +0900 From: Michael Paquier To: Andres Freund Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181031021023.GA7862@paquier.xyz> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Content-Disposition: inline In-Reply-To: <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --61jdw2sOBCFtR2d/ Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 30, 2018 at 10:52:54AM -0700, Andres Freund wrote: > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: >> Er... At the same time, shouldn't RestoreSlotFromDisk() *not* use PANIC >> if more slots are found in pg_replslot than max_replication_slots can >> handle. A FATAL is fine at startup, PANIC blows up a core file, which >> is clearly overdoing it if the goal is to give a recommendation at the >> end. >=20 > I can't get particularly excited about this. This gets only used by the startup process to restore slot information, so for example if you have an instance with two slots, shut it down, reduce max_replication_slots to 1, and restart then you generate a core dump, which is a bit overdoing it to simply let the user know that he just needs to bump up one parameter and to give him a recommendation to do so :) For example: 2018-10-31 11:04:08 JST [9014]: [11-1] db=3D,user=3D,app=3D,client=3D DEBUG: starting up replication slots 2018-10-31 11:04:08 JST [9014]: [12-1] db=3D,user=3D,app=3D,client=3D DEBUG: restoring replication slot from "pg_replslot/popo3/state" 2018-10-31 11:04:08 JST [9014]: [13-1] db=3D,user=3D,app=3D,client=3D DEBUG: restoring replication slot from "pg_replslot/popo2/state" 2018-10-31 11:04:08 JST [9014]: [14-1] db=3D,user=3D,app=3D,client=3D PANIC: too many replication slots active before shutdown 2018-10-31 11:04:08 JST [9014]: [15-1] db=3D,user=3D,app=3D,client=3D HINT: Increase max_replication_slots and try again. > I guess we can change it, but I'd only do so in master. I won't fight hard for a back-patch, now I think that we should back-patch a fix. Generating a core file if a state is unexpected is fine because you expect the system to react so, being able to trigger one based on a parameter switch just to give a recommendation is not in my opinion. For example with the attached the system reacts as follows: 2018-10-31 11:07:23 JST [10063]: [14-1] db=3D,user=3D,app=3D,client=3D FATA= L: too many replication slots active before shutdown 2018-10-31 11:07:23 JST [10063]: [15-1] db=3D,user=3D,app=3D,client=3D HINT: Increase max_replication_slots and try again. 2018-10-31 11:07:23 JST [10061]: [6-1] db=3D,user=3D,app=3D,client=3D LOG: startup process (PID 10063) exited with exit code 1 2018-10-31 11:07:23 JST [10061]: [7-1] db=3D,user=3D,app=3D,client=3D LOG: aborting startup due to startup process failure -- Michael --EVF5PPMfhYS0aIcm Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="slot-restore-fatal.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index 800ca14488..4942613a5a 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -1533,7 +1533,7 @@ RestoreSlotFromDisk(const char *name) } =20 if (!restored) - ereport(PANIC, + ereport(FATAL, (errmsg("too many replication slots active before shutdown"), errhint("Increase max_replication_slots and try again."))); } --EVF5PPMfhYS0aIcm-- --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvZDw8ACgkQnvQgOdby QH1aew//YtYArrGhF1OIyNPJZ3kNhcUkCcq1FaZm9IGqlnjizZKIwbN5+2VPW0zi jcmILoXiXpgxDH9f0/yvve+sueIhQBnbtFwPBo3FtDw4WEXIt5qTiV/OusiZRe9d Ix4vQmlddz7b580onAn5qHE4KXy414FUXckZ2BrVrCeGLfasvv/92dXPp2oKeOO0 IOfm4WHhXop1paeNTouF16fNUDAxh3t12Ao+ISuypThmN3HJYvyNhDKZnmAAEXYu +nm9fM5n3Tq4EBsZsLXj1vGTFFnzsV7cV9mcrpe1RNj2dO2XEL90vgO6JLHz67OH QHKGO4vhdgaopTwCMoBGtpON9kEBQhfyh5jXfpMaGUUatlk1EoSJSEyfB56keLVt 5a70iIIutCh3QHRUY4XS/mqAmrvGnrrfhEm+RU+BNa8ZReTCa50m3ZfMArj2wulH /FG2Hvm3dMGlt1+ij0QZCW3FJE4ckcDg6wwUeLtS2RK6tuon+a4dcVz8bG3sJMbz ozspTXR4Gyg368+5WUlaEl019wXR1ScRNXXzBZRp9FZzAym5TTQpFyHceRvB+YVa bCYu1Le1GoM8SvwY5FVvvcbwPZIiO37TvSF5eR+2FK0xW9DYgvYkEwRugh1myX8p 7D3ccMGKUI8ofHAfHmvKOs1sDShrFH5eFXPQpR+EiMvs7uv7Pqg= =T0b1 -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/-- From andres@anarazel.de Wed Oct 31 22:48:02 2018 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 1gHzHX-0004tE-WB for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Oct 2018 22:48:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHzHV-00036G-6W for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Oct 2018 22:48:09 +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 1gHzHU-00035v-36 for pgsql-hackers@lists.postgresql.org; Wed, 31 Oct 2018 22:48:09 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHzHR-0005Qc-Bd for pgsql-hackers@postgresql.org; Wed, 31 Oct 2018 22:48:07 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3381B221BC; Wed, 31 Oct 2018 18:48:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 31 Oct 2018 18:48:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=HN/fwb0P3JtdHeXzU6fxSgZNh8E j7QJKyvnSpSICGZM=; b=uPQgIoXn7LEZIIV98CkS11+3Z+LiJQuyTnEFn9OINWH dj5CUNViMrQOeyEdtUg+psY5FcSROJJXQaUEao6e+9bdsWPj5B442MweoqKyY29F NqxezDtg3O4SI/PuQEZndS9V0Z0nQsPDAvv9pZErmRjtBGA4F+fSChANCSkWvdVf BmaOz5wvqPcb05kr/DbEeWLob3L3BFGFlmKBwx5dHd4y1IiMzBg+Orz2TZZ2Z0wJ vycmoP1NRrFVSB6juVAPM4OLqq9DOdgky9lDRvdctGZ3mXebpLDa/JIm14ZO90p3 CuG9Gf33pxnYqshB75HP9Gj1XpqwPEubCw4tVpzYBgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HN/fwb 0P3JtdHeXzU6fxSgZNh8Ej7QJKyvnSpSICGZM=; b=gP25zOWo1zmbL7sMF2lgLR RGWNKPcZAzCB0N/5g/5WH4L2BPnoF0KkAhi5WZtOSJisqnVLR1r1XNNrjvqgIsJn Mn5xFTowVSxtZitQXVBZWain7vJmg5ico9AB+5k9j0Bm+bBzO8sKBaodayoaSZPO SG2UM7H+GIki5ILy4xlZiWCh0geG3ATURcLTcUv83HDjbRRUhucOMiGAxiE6HjfB ItR9UgztQSv10DYZURKCuwNZtQFNhdAPR9jlRMgy1/8ogXRfkPsAYdPwuDv5231A X6jR9ar6HTcO5iQqWi7/v5uZdVa5ox/rKf8N9LL8O2sRuxu5Yp8SliRwJwbB25Lg == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 1E1EF102ED; Wed, 31 Oct 2018 18:48:03 -0400 (EDT) Date: Wed, 31 Oct 2018 15:48:02 -0700 From: Andres Freund To: Michael Paquier Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-10-30 10:52:54 -0700, Andres Freund wrote: > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: > > On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > > > I don't think this quite is the problem. ISTM the issue is rather that > > > StartupReplicationSlots() *needs* to check whether wal_level > minimal, > > > and doesn't. So you can create a slot, shutdown, change wal_level, > > > startup. A slot exists but won't work correctly. > > > > It seems to me that what we are looking for is just to complain at > > startup if we find any slot data and if trying to start up with > > wal_level = minimal. > > Right, we really should just call CheckSlotRequirements() before doing > so. I'll make it so, once I'm actually awake and had some coffee. And done. Thanks for the report JD. - Andres From michael@paquier.xyz Thu Nov 1 00:34:05 2018 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 1gI0wG-0001iB-Py for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Nov 2018 00:34:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gI0wF-0000tx-8e for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Nov 2018 00:34:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gI0wE-0000tq-Ta for pgsql-hackers@lists.postgresql.org; Thu, 01 Nov 2018 00:34:19 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gI0w8-0005p4-3y for pgsql-hackers@postgresql.org; Thu, 01 Nov 2018 00:34:17 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 65E6721F99; Wed, 31 Oct 2018 20:34:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 31 Oct 2018 20:34:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=73i8HfgRK59t5zryVkHuxQ9kpSE 35Q8OPt7Km/Ps1Kc=; b=g9bwzEPefHmPYPklPZ+WAaKC5EaOy4K1B8IVRXOkUFH 5cEKTN7L1uoAdX2DLSjCS82Rj+QjFu/pauaWGX39hSTq8Ynccw+QobEqxCl0RO5i AWW4I0ojDec+1ss1vVE91PK5DQ/LGxMtfk4O8vLJyBKV29N+xMOgYjWJpJoPf1wC 7vizcM5abo96TU0O6SC0K153R7WupcIUPLp/sVvzNcm00ZIeVMiTk0UNmR22aY0v 8SoXQkZxefsdK9xqJZABxWlu1TI9dtpm3A2SLbF9neHKOnSQvLRcLH5aElXzHLgt q0WKvYamqY4n1yV6vrYOW4AFL5acsgpH1/HaTb+8Iww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=73i8Hf gRK59t5zryVkHuxQ9kpSE35Q8OPt7Km/Ps1Kc=; b=tNjn/VLeFPmPZQDrg97J3u Y54Rd/wIglnf+9IbLXVRRPJBseW/CupKr+8LiNj7TLmRjY0gBezk1Vx9dMErFpGy VlXLhLBweJo8h4LbZgEl6X5iJB8fir3Fazh6JpDcfCVHbFsrDI5N117+XX/56h7B XUxaZVhzTVUuddMiBIf1DFdl1F+8ZZtPDrYl2eWKaZNIQ9c9tz911BkvDHg/fOPK m47/8H2vRFlwEVQunBCvp6eUPsjMNiwJ5vDkqyAP0JHt8xqRlic+4mhjLsm/YhD9 lxl2ilpEj2Y4+vDRa4kyQwqvCH3ExtOBm110aJPi5fkiW73onPRgp7gpgtlA5/7w == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 3AA73E454E; Wed, 31 Oct 2018 20:34:08 -0400 (EDT) Date: Thu, 1 Nov 2018 09:34:05 +0900 From: Michael Paquier To: Andres Freund Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181101003405.GB1727@paquier.xyz> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LyciRD1jyfeSSjG0" Content-Disposition: inline In-Reply-To: <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --LyciRD1jyfeSSjG0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline HI Andres, On Wed, Oct 31, 2018 at 03:48:02PM -0700, Andres Freund wrote: > And done. Thanks for the report JD. Shouldn't we also switch the PANIC to a FATAL in RestoreSlotFromDisk()? I don't mind doing so myself if you agree with the change, only on HEAD as you seemed to disagree about changing that on back-branches. Also, from 691d79a which you just committed: + ereport(FATAL, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("logical replication slots \"%s\" exists, but wal_level < logical", + NameStr(cp.slotdata.name)), I can see one grammar mistake here, as you refer to only one slot here. The error messages should read: "logical replication slot \"%s\" exists, but wal_level < logical" and: "physical replication slot \"%s\" exists, but wal_level < replica" Thanks, -- Michael --LyciRD1jyfeSSjG0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvaSf0ACgkQnvQgOdby QH1DqRAAgQOm6Ph56JvGA851ukFg6/35khKDnZ2iNQTTah3jCBPJNzzbIV8T2AJ5 puOORwdvWqF3c0cQWAtpH20uAIfbASZ2kG4GVWvuLZ43fmMU5c5n1K1zxkELoeAL hfdzb4kcgl7E+rBRnOjc2XDhhgi5LRJovKOm7+5NeQisnDtcircvYLtt7OUY2lch nS6oz31VaIN6dq1R7jCTx3EdboUBNSQUb2Euc1hjdkwbITuXo+cb/EBq1Ks6Kwap 7T1PL4c9tkG31Des1ea4GRyPAc+cjpSO3s767Ha11D5HXp/zXNiyUlYLoYVvEofA Vhw+gMPuBWniyo5kIOmnNMYBASwE6f3z9jfjYAYq0ly7STJwdkZ8MOP9subhcATd cJ6WD5uG4UZxi52kXwz3ghO+M/BBALZpycFBbIE7wBB8lHO/zK+WWFAOGtcmeEea Ol0XT1HwLMpvOATHIlmQQyX8nBDJ35JJqDBMyKOAxDgiZHQtzkW0k7z/s7BAelKz 8O9El5h9Pz/r8DCIJseq6gI1JaBMG35Gq45OkPVQ5ItPH8ueDCwnfc11Nd6NMX/E BzRWvdNDyjFXuihtpfhSlRaIYYDEo7NpgFREw/JoNf4ysRdfXe5O3bWKtF5B0Vgw yBKfYWTJ2tZZhOuubCSRTdTsimvTxFagPDNRbHGQxv3nK1e7Hck= =gC2h -----END PGP SIGNATURE----- --LyciRD1jyfeSSjG0-- From andres@anarazel.de Thu Nov 1 17:54:23 2018 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 1gIHB9-0000Yb-FP for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Nov 2018 17:54:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIHB7-0005CA-Bj for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Nov 2018 17:54:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIHAu-0003ue-Pv for pgsql-hackers@lists.postgresql.org; Thu, 01 Nov 2018 17:54:32 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIHAp-0004Gm-5d for pgsql-hackers@postgresql.org; Thu, 01 Nov 2018 17:54:30 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 47E7321E09; Thu, 1 Nov 2018 13:54:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 01 Nov 2018 13:54:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=4cXVBTjZeRusvtFLHBMmV2mjrl9 tzC7U/Z8IvC4MJ58=; b=TqmAiJbUvI5KsfVfSsGxl6+SMyQ3jbMnmL6Lxvit2JP zWvnaxDFrZ9G3tdllGv6IM26AWAXrPDKJKnvmuOscDEowGIZ4h6GdLOmc6qgdEtN 1laqiCSCe7VSdobry5PdYTcLhajvvxkgWhkR6tJut8TebeYyj/BwJeAO30Vd0ASw TxyKMohEtBxTTEDQWPFtdHM5Yn3BRgiSOJeM8S3OTQIDW2HUIGUfeciRT4GLex88 GqlSoEArTT5p9UGMBCQPtYVvsH0J7Sg8l/QkQdBkqXBPoQHu31ev+GcSHMD8s2Qa WynrIrYMzWw1FXyeO/dHyoM5wISlJBqUuOsBZ8TfxJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=4cXVBT jZeRusvtFLHBMmV2mjrl9tzC7U/Z8IvC4MJ58=; b=XV+je29BgpBz4ayMs5I8/o TFf4N+7IKLP5pGbQW0AOsDT2m7LpgKzoniRqdcHS0ZT0r8yj6EgAJzkQFUbwD3+6 Cy8c0+QhvDW/TyNvHkYI5yPo88TpbKxJccdYfpiXy72TuDYgkIDitV2K/3CQiESH kDdCrFBwg0Dr48Wvrp1NKc9MeMo9URGSK14yjK/UYy8o9a/LIQwiz7HC2Cen9+CE zjoxTOeC1pbQKl1IX1PDbAhulKw49sq8Z7HMndJ2IqZ2re0GRLNjwEOWjC4Sc37f h68XD3UDSQXf5bFKEKUw6t7F3gDL64Pa2G8BS6PReJ8OI2ZnT8VEFWKeEV6lYJHg == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 63F8FE40E6; Thu, 1 Nov 2018 13:54:25 -0400 (EDT) Date: Thu, 1 Nov 2018 10:54:23 -0700 From: Andres Freund To: Michael Paquier Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181101175423.7kbdn4n2w4vg6qzf@alap3.anarazel.de> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> <20181101003405.GB1727@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181101003405.GB1727@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-11-01 09:34:05 +0900, Michael Paquier wrote: > HI Andres, > > On Wed, Oct 31, 2018 at 03:48:02PM -0700, Andres Freund wrote: > > And done. Thanks for the report JD. > > Shouldn't we also switch the PANIC to a FATAL in > RestoreSlotFromDisk()? That has absolutely nothing to do with the issue at hand though, so I don't think it'd have made much sense to do it at the same time. Nor do I think it's particularly important. > I don't mind doing so myself if you agree with the change, only on > HEAD as you seemed to disagree about changing that on back-branches. Cool. And yes, I don't think a cosmetic log level adjustment that could affect people's scripts should be backpatched without need. Even if not particularly likely to break something. > Also, from 691d79a which you just committed: > + ereport(FATAL, > + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), > + errmsg("logical replication slots \"%s\" exists, but wal_level < logical", > + NameStr(cp.slotdata.name)), > I can see one grammar mistake here, as you refer to only one slot here. > The error messages should read: > "logical replication slot \"%s\" exists, but wal_level < logical" > and: > "physical replication slot \"%s\" exists, but wal_level < replica" Darnit. Fixed. Thanks. Greetings, Andres Freund From michael@paquier.xyz Thu Nov 1 23:01:28 2018 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 1gILy9-0005qZ-Eu for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Nov 2018 23:01:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gILy7-0001tF-73 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Nov 2018 23:01:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gILy5-0001s0-UN for pgsql-hackers@lists.postgresql.org; Thu, 01 Nov 2018 23:01:38 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gILy2-0002oC-Rs for pgsql-hackers@postgresql.org; Thu, 01 Nov 2018 23:01:36 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2442B221E8; Thu, 1 Nov 2018 19:01:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 01 Nov 2018 19:01:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=uHzph5Fre8eH2H2Zg31kWkybJaz CvlyDdm7kW+KSGdw=; b=FwLo4WF1cI8KEN1F4CtbNoeUx6+8DxVy093DvV6igCT 8lGOF3LbRiu2aFfnEgYelmI+sUj33sXAMAdPmCqdSjdF+3MMXVnOtAXsP5r5f2eW ObouhodjyqiWTNUZmP+cKFBf0/WniXArjaOe+SwRlTaEWhWj0JBrnqpET/fo32Pz scwBmnyMYu8ZXCoFhxl8mdwBT3LykNFMqfxl99ltnoZd6+cg7T2TpmM7p5d7H25c Q2ganqcDHavWHYc7YPii+ajagPXTUMyHYvBcE+o/Dr/Jwv7ocibitif2ElTfBbAr L7kLPEBpunOcxTFID2tfFc5duLJEeAsXsmKCiBBcBjg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=uHzph5 Fre8eH2H2Zg31kWkybJazCvlyDdm7kW+KSGdw=; b=Oy1A3kuiLaKPRzPCj82VuK 2vmYGKRHxL2r9mtCDK6hILNp7ph+ihYFNbi9ziPgQPLCfZ0XIJmOGCEye1U+qw56 T1Bap0gIRpR8gSptRVAv5OgN8rtIFCvV6XHgh6l1FnNFKBDzzrzKvBho0ORa7UrR j81wjQMdZJji3oKXmmVh5D8Fl3zRR7jryXvhTRfLVtEd30NA+zXZFrWUFxxPLC3s VMwsYRqdyugQD6CUT7OBQr1wbGbpCwOLobuVUOIjY8Att/U+k+dxPbm6upPVOFXp lr3TE6faufbJP+LkJAjD912WNgJ9EFOTbvE85aKWpRMdpMR9nxY8QmJjLn2cpG4w == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 98314E427A; Thu, 1 Nov 2018 19:01:31 -0400 (EDT) Date: Fri, 2 Nov 2018 08:01:28 +0900 From: Michael Paquier To: Andres Freund Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181101230128.GI1727@paquier.xyz> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> <20181101003405.GB1727@paquier.xyz> <20181101175423.7kbdn4n2w4vg6qzf@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cN519qCC4CN1mUcX" Content-Disposition: inline In-Reply-To: <20181101175423.7kbdn4n2w4vg6qzf@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --cN519qCC4CN1mUcX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 01, 2018 at 10:54:23AM -0700, Andres Freund wrote: > On 2018-11-01 09:34:05 +0900, Michael Paquier wrote: > That has absolutely nothing to do with the issue at hand though, so I > don't think it'd have made much sense to do it at the same time. Nor do > I think it's particularly important. Thanks for the confirmation. >> I don't mind doing so myself if you agree with the change, only on >> HEAD as you seemed to disagree about changing that on back-branches. >=20 > Cool. And yes, I don't think a cosmetic log level adjustment that could > affect people's scripts should be backpatched without need. Even if not > particularly likely to break something. No issues with your arguments. I did the change this way. >> Also, from 691d79a which you just committed: >> + ereport(FATAL, >> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), >> + errmsg("logical replication slots \"%s\" exists, but wa= l_level < logical", >> + NameStr(cp.slotdata.name)), >> I can see one grammar mistake here, as you refer to only one slot here. >> The error messages should read: >> "logical replication slot \"%s\" exists, but wal_level < logical" >> and: >> "physical replication slot \"%s\" exists, but wal_level < replica" >=20 > Darnit. Fixed. Thanks. And thanks for fixing that. -- Michael --cN519qCC4CN1mUcX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvbhcgACgkQnvQgOdby QH3ibg/9EHNQ7kZZyOaaO02nEpWruOlUpupKzHZlK0u99h+/i2UFiXmII8bYaf/x 9zNClNoi7azpve3WrbWlQqwL2n9SlzvIoIBTHHd73/67e5M5BVKllfBB0zDP8KPj iTQmlX2jxkrF3UdL6HOOBIwKUSh7wPq4ahQLHDzgqcHpfm4Fw2/smPS+2Xw4uvf1 AJOZ8hmm6tO5LYgqGed43HYbylOo/mu8C+rASYia9U8zmjKMoyzwY+mk0roIrJiu WS3dZov9iSPrHjKOguWFKpoGjdDWUSo1a13zQNhc9VIyeGmMPiH/+X+iSPbxoujz nc0nUCI6bHHqRrTWk0ylj19ljbNhUKzoNFomBuEOTqyT8/5qU0icCDES4ySsfo6g FogDnCu0vCzyAjxFAhoDXqRjVzdVKE5LT9WVVU4oIRluk/DgH2e+tIEScnt/xo/a Of4+Krqpw5H+J8ZkfhzZ1R7WRZgVKqtVS7b4IXmLYjMsMki6FAQQDlJiYEf+3XpK EggEs534dJzLppqX+wfzpKsthr5CN6eyK5bS0YYLfJQxsgpNGtHrMIlYbNx1bRUU LF81zrf1OYQ8rRMUgf80DYyUugDLnIZD21L0xBTfzrStr/pHZc8gl3ulq8MK0AaG aUQbUmM2JHuZ/vQFhsm3yVRbH5d91UfSBaUvO85LRMl+553ODcM= =r/ie -----END PGP SIGNATURE----- --cN519qCC4CN1mUcX-- From petr.jelinek@2ndquadrant.com Fri Nov 2 14:51:34 2018 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 1gIanc-0006Oj-HO for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Nov 2018 14:51:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIanb-0005na-1f for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Nov 2018 14:51:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIana-0005nT-Ad for pgsql-hackers@lists.postgresql.org; Fri, 02 Nov 2018 14:51:46 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gIanS-000770-R9 for pgsql-hackers@postgresql.org; Fri, 02 Nov 2018 14:51:45 +0000 Received: by mail-wm1-x343.google.com with SMTP id h2-v6so2231866wmb.0 for ; Fri, 02 Nov 2018 07:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X1P14cd7wPSn/h/AhNpunMF40Q7STJXGYJSI/wRg4/c=; b=bjz7GOEpxHRQUcCuYed1kUAyNphGUTzZzNdi6kiAtC3pLex7V2JvUjYNa8b8ly+kTD baAP4DdNF4PbDqQ5pibm0Ren7oww+nZ3OTvGsNnA1iBdB4nHdRKojCEyHYhSwKu7ju/i zMp8pMIehesTCgCzhmfEQ3DWNHRamd5749EaDd6WU/g+nOgPdnB5W5BL97Q9hHAj4wbS xl1d64GSSB33y/5N8p/fvsJYnBEMN1FF58vW/Bm3NcchtrErsA5ucrMAfFqbpN5/mUwh 0Bsp5Gxr6yQzBbEnAsClNYYrgPEFoCm5aI48BE6HzS5ZH30ZDoCKrlo3eCiLL4p4kguq 3uiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=X1P14cd7wPSn/h/AhNpunMF40Q7STJXGYJSI/wRg4/c=; b=IWIsbvRlipSMKtdFhr31InvDYayYqafC25ifneQXhrV5FolbxfPYW+KHGEh0bUX0Bm 7RmtkzcQxmPkFua6gNOKkzb9qRRBnkEo7l1v/zKb03QKitp/02gpk7KMItyOKe6m9qKG GBmOnbabKzxazNyVTF+UTmpa7osAsH7FWcKNUF7tNANE7jVImjL7VSeka3wLRTsfWjV9 vGeY9XWcR25vkXCRcCYXywcDEjqfZTljsIGv0INFvpYMouQro6oHBnJKod7xcXw5/Xwk BpbQcS5aZGSFbFcJKI5+5eyA/BYI39nAmNLKzcSTX8FN+zPoBJ8zveOqmxX++RwmVdbZ ZDpA== X-Gm-Message-State: AGRZ1gKOcp31pA3savooSxoGg1Y4BrhZTkqZrgdp1gtarz04LNcn5gZH S+I7yNoqrBkXyJb1PQULcpO8BOIGFpgwfZddxQfIRmIW8ztJZ7dBANBf3uRtLnDSRBpa06RKfTW kSQB4Tff0XJJv/Ac8pm833W5Yoa+wzVE9zBUJv3l5hiUFOJW4SeLtZ1+ycCr2N3zEEPvDU71Z8w 7edhBS0+ePgBY= X-Google-Smtp-Source: AJdET5cODWVZxXHi/UWEXL3YXWhWlVEqMmfzx5hSppzsUrFcnlkuK33UTFlcpAsfHybbVCxJxMhHvQ== X-Received: by 2002:a1c:880e:: with SMTP id k14-v6mr43595wmd.88.1541170296155; Fri, 02 Nov 2018 07:51:36 -0700 (PDT) Received: from [192.168.0.237] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id z16-v6sm19912237wmc.0.2018.11.02.07.51.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 07:51:35 -0700 (PDT) Subject: Re: replication_slots usability issue To: Andres Freund , Michael Paquier Cc: Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> <20181101003405.GB1727@paquier.xyz> <20181101175423.7kbdn4n2w4vg6qzf@alap3.anarazel.de> From: Petr Jelinek Openpgp: preference=signencrypt Autocrypt: addr=petr.jelinek@2ndquadrant.com; prefer-encrypt=mutual; keydata= xsFNBFawwSABEAC45Vua8rSggpM2kkMMmoOHz51a+fi3OXFfnrStVh80pM2/J9nSzjrIKQKf H5PtRnoYzSKnoUDoLOkLwDYitK3HzUUWXma+AWAqef2Y0GSZ7A3jJkD+JHOfkpS1CIpkEB/e WjA8Wqegwzc/OEE5111/l0Q1e6jxgZI86h8MMnm35Of1Y6Lz4kqWCyxHhaTJKTCkq66ICQ2C VJkbvuUoEE+Hr/I38dPHTAqIlCnycVnJPLHBQ/UYGHR/USF8qI/qJJx6tJcNAEqz69QZ/VlY 31UyJHdYe5NtBVz+rYZCOVWfpe3crbHuq9FjAPT+xcZefdxridmMKuW8eBmmXI9iZ3EG+X8J IsdLWL8QoqW0lnO1otYz1QDjdOvbEpq+u5/TAU8pgtaYH2J+6/GaQ6hMLyLBkaIAtnqlLCzq pxXcxMsFT14P5/rZA7EbBI8RS1ZIWJBlS2oO+dtVuENLJUC0SpptaRyn/uyOIopt7hSmBekL SzFnet7P9qofFJY+fQEz84v0G1gvwonHGHiCGgLpbMdPtnfPzda1aiTURvvOD7w/RmX1/ogk TqSGO4ejVNO/28QYouxmxzy8jbbIEiLCbHpLR/M/TvYHHPURxcx+MxVl3G+d/4Ihy4abxOdW pe9zLIcVMvqiUFQO28/79Gfhb7G4K+L21ORB82QYkzm3M7ebXQARAQABzSNQZXRyIEplbMOt bmVrIDxwam1vZG9zQHBqbW9kb3MubmV0PsLBgAQTAQoAKgIbAwUJBaOagAULCQgHAwUVCgkI CwUWAgMBAAIeAQIXgAUCVrDBqwIZAQAKCRBci2l0giH4y/QJEACfiLHyvxlwMvo3Y88Qa9QI i7Hu3ZW+xxojojdRd7do0nBnf2a4YstD9u6ZOLJx4f5Ijb/8LxY10NgLugmfQ7sw2W8ui6wT NiAeNHpr4wpT3IV+V53psOMRYPdq2zNTLO4iNxqPFPgNufR/m4FqcGe0Wo7U0wd1p0MErXTg EXJDVmjPDkYnzE9ejSCOxF57+o3xs6+eW9Al2m3nqP8JCzpauCr0gqpQzCaw0VZ05aLL0t9E B0fdm90+ydVe10Wg+I348005smuSSckBCHZqUfjjWvjwE6v/6dZ3/50ycAbi6cTe7Fo4kOSO sXBFXkzYGWYrEFPkzK0zDH65D98gL1+l9uokCR2t/OYVwudbUCV3cS3xRd0eFgHbXuzV+aZc jRjqkPfpCA2loKtrX2U739mpVSHnpIfSBf48fLg7O5dVn5ZCrydGkEzgvyynPo7IikQrIA02 91IoSp4RisKsJpaXHwHu6DH2rDCbYFumAMgXk2osLFX6VMPoSWKVRkr87A0VLafCtwaqr6Hy sFE6Lmu7jP4/BDr+9A2MXK+v0yYrXqqsZN6V9856ywlZrWK3MB6jc2bKpKS2YshneKxpitNV 0ITs2Li0OlAXOEHE0eXwI93POgLoyH+8JiNbem3orw3Mnc+7XpIY86AejwUiYl8T7EO/2tIx HDaXLK3BPNOdH87BTQRWsMEgARAA6Z3NrDLdcFF/P3TD/F7WQtMALEEKn5TXSF/K2VHt21GD 8tGY1DZhbxjLuQJeheY/2L4F4Y5WCkAoUdBXQs7nIauN+63EL88/qPdH6f3+/HZ+cmPG1E5o dBABCkC42eGcI5O8/9TAaFQcSzg86pdAE8v927tnc6aH4W4/Mj7RJNlQiZaz2ngCC9mr5uu+ CysOTfKCS0llNUkExZOJzZsQU3zDkcg3+xmgtHkCjglJ006KuytHj55HR6TzaKaAW8coHGoS OI/BQ9KAzvlj+32/zS8FSISZSTY3spMpraADsYklejCeJOmqQ3nTrCtwlX3hTSggfr4eelKA hdZKs1rIimNBtX90jJc0u2A/GmC959aTSrCUcfaPRweKUuexg7jxuhXyg9br2GscD2G6W7EV c+3s4dOHgoJFVMBBIqTtZviaNJ63IsZIFTYJzGKKMHOioZ3naoBVav0w63waDzj82nPYMIPj TxnClKiecuBQQPzMaG0jTmK0lis6rO0nIXrCwca8e/3Xzvi7sykOdcz9t4ef8HrDCCkG0yDO o8qHy1e7EtmJD7kWffIXZMt4TZVxpiOqgWtv+heJAfmqzr8pkNLUubmgvNdnakXJOJT41Lui 50C5OhpU9mfFCIDOeZXTQLsHA4KYaL8W/qcjv/YDmvpJtnK24y6tByWuTu7r/SMAEQEAAcLB ZQQYAQoADwUCVrDBIAIbDAUJBaOagAAKCRBci2l0giH4yyWpD/91jd4BMN2CDYqLtU7kaoAa aXnRVpf0z+R8rJ4LZJX1UNbHjsdClMQLfdBuZeDsdYar4iMfwScz6fiCiRwaRpr3XT6znaM0 wba6fjzEqVSHr3WB1jrb/TMiNaNgQJaRPhI5C7VsLuPrv5/L8gFmyjl712q7F3busGFBKrjK qTESMu+sHNvVeC3QyBFCe2fudbAJdaaRsUoTbAZYiowVoQHOow8eBoWY+RzQoYGuw1fls5Ck 85N73pYHXzjfk1s49sDKTYI263h9wbGGA234biHRI3NQN6sSYWRr/u5GOwTm/tzyadRj0pnZ S6KyLSEL4qx8jiyniD/XLoftlvR4YWQ0BXveEElx2n3TThLL1cVtOI4qE9BZKm32euBqwLta k9Jc659hmZB9E9aWLo8KcLjngwqSZupoHRPZ3yAlgZkpDoTIZpMCGxGEuuxgnosRbNpOJ1fE nNXenYYfi87tHRUCRKeHhoKkfGZEgC9zv9Y97j75npqV2tQyh4fNQT1tGdBigtvzI4nHM1/1 PLJtJBdRHucP76vUH9RlP9EE/Sg5DFQqsfSYPqxLW9r+ZfSEeT0APdz7TQC9MzNzUhyXvA5a RQQCRMXKbGaYhKkYEYiYOGqtTxN+PmyvNUBmFEcagBX2TXqEkgnI6zOnN13mB4SihJ2lne2r 9RNiPYs/hmRxYg== Message-ID: Date: Fri, 2 Nov 2018 15:51:34 +0100 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: <20181101175423.7kbdn4n2w4vg6qzf@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 01/11/2018 18:54, Andres Freund wrote:> >> Also, from 691d79a which you just committed: >> + ereport(FATAL, >> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), >> + errmsg("logical replication slots \"%s\" exists, but wal_level < logical", >> + NameStr(cp.slotdata.name)), >> I can see one grammar mistake here, as you refer to only one slot here. >> The error messages should read: >> "logical replication slot \"%s\" exists, but wal_level < logical" >> and: >> "physical replication slot \"%s\" exists, but wal_level < replica" > > Darnit. Fixed. Thanks. > Since we are fixing this message, shouldn't the hint for logical slot say "Change wal_level to be logical or higher" rather than "replica or higher" :) -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services From andres@anarazel.de Mon Nov 5 20:10:44 2018 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 1gJlD6-0000O4-Kh for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Nov 2018 20:10:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJlD2-00082C-HS for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Nov 2018 20:10:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJlD2-000821-6C for pgsql-hackers@lists.postgresql.org; Mon, 05 Nov 2018 20:10:52 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJlCy-0002aK-3o for pgsql-hackers@postgresql.org; Mon, 05 Nov 2018 20:10:50 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5AFF022C32; Mon, 5 Nov 2018 15:10:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 05 Nov 2018 15:10:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to:from; s=fm3; bh=K3RGUAmXf6JouYJCCfpool Uczags9QUjAbrlfvPLbIc=; b=BT8AMUVrhTchuIl9B7PdVHGPmetDw1GECaRlUX cRx3MYsmXQX+RVMtc4w0hPY/jlfXYqTwq0VwSZN+ZuBzxVJxgE5Ln1VbBXs2evwW 3QO0Tfz/TM4uFNvZfdfRsIFK2CrtAm+BeGYuQz43e8T6os+Qv9SHYq+9Vc9bwwUv TSvoV8LfO3wTNYkmt8G3NAp4HvwYRJ9eOYO5/xKlGXn98mKi4giykYbHFyuVvQxF q6ldraAD/1NtCWs9pO5wgtq94RDMa1amyK0pQoRlvynfrtgbWrYA2MdYwHDBQNLm S2/XGz4cuH/NkIK3HORaG0tFFZRCnFbkapBc1HmbV+2A7weQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=K3RGUA mXf6JouYJCCfpoolUczags9QUjAbrlfvPLbIc=; b=X02RVe4t8c1G7ocJb1X8HJ cFKk7S4qb3QceVe/Nvd7/ZFCO8zVTXCFZSYHQHqTvpAdmxfm6o1LecxhGAzLDyuA pRitu5wXtVDegw3nZvsRaADpfOKtOEBFGUxYKeFjno9w+aO5XvttsohSkn1P1vKr FSLNlh91yksktzodABCa+i+cIy4l8jQqLV973Mr2ywwUwlEtUp/SU6AZk42oW3+U YUa5oz971HBKvtcDfqQrhyKrkV0s3lT75Yy7moM/9ZvK0FYgx6xeSNa02tT5KG2c LEex5Ln3P+c7ZBPPq9LzuI+/EN1OmD62ugLHjJIw0YwHkXHXpjV8/Yd92PqqQ0pA == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 162B2102F2; Mon, 5 Nov 2018 15:10:46 -0500 (EST) Date: Mon, 5 Nov 2018 12:10:44 -0800 To: Petr Jelinek Cc: Michael Paquier , Alvaro Herrera , "Joshua D. Drake" , pgsql-hackers Subject: Re: replication_slots usability issue Message-ID: <20181105201044.ipagdwcjda5mjlmb@alap3.anarazel.de> References: <56672097-711c-126a-a63e-04e7940110ad@commandprompt.com> <20181029190218.uejy5cvgzygwrguy@alvherre.pgsql> <20181029191304.lbsmhshkyymhw22w@alap3.anarazel.de> <20181030025109.GD1644@paquier.xyz> <20181030175254.wqircsg36vblpmw5@alap3.anarazel.de> <20181031224802.lamhfjil7uwpfiee@alap3.anarazel.de> <20181101003405.GB1727@paquier.xyz> <20181101175423.7kbdn4n2w4vg6qzf@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 65;5401;1cFrom: Andres Freund From: Andres Freund List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-11-02 15:51:34 +0100, Petr Jelinek wrote: > On 01/11/2018 18:54, Andres Freund wrote:> > >> Also, from 691d79a which you just committed: > >> + ereport(FATAL, > >> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), > >> + errmsg("logical replication slots \"%s\" exists, but wal_level < logical", > >> + NameStr(cp.slotdata.name)), > >> I can see one grammar mistake here, as you refer to only one slot here. > >> The error messages should read: > >> "logical replication slot \"%s\" exists, but wal_level < logical" > >> and: > >> "physical replication slot \"%s\" exists, but wal_level < replica" > > > > Darnit. Fixed. Thanks. > > > > Since we are fixing this message, shouldn't the hint for logical slot > say "Change wal_level to be logical or higher" rather than "replica or > higher" :) Gah. I really wasn't firing on all cylinders here. Darned jetlag (let's just assume that's what it was). Greetings, Andres Freund