Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiY7o-0000Y5-Rl for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2020 06:52:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiY7n-0004kE-OL for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2020 06:52:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiY7m-0004k7-Rm for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2020 06:52:43 +0000 Received: from [66.111.4.238] (helo=forward4-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiY7j-0002Xv-Vd for pgsql-hackers@postgresql.org; Tue, 09 Jun 2020 06:52:41 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id CC9471940930; Tue, 9 Jun 2020 02:52:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 09 Jun 2020 02:52:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm3; bh=O80fufLar46DaOVZKP/2egq/BUgH3Dc+4MUhUG9Eh Lk=; b=ZhGxpOEZMcASptG4NGPlRabDc4A3G23UUKcJeZYdTlO9MtRHkCY/KZoi6 6dy13YTCA9pWpyFxQ8TJVzIcQWIGnxgjE7esmzhRG7B6Z17x6SLz9P6Nn6s1OyRZ y0cQYz+Z9Pcf2ThCxAA1CYAECL/SvrNX7AQgCifPUUK8JaTo+IcgOgAxuXWQzgF9 +VPeQONnRt2Zv4M0fnr05dT6tQKJRgzx43WVerjRjbtn7YpCcXhXAv2DUjQ/TGKM clvQc24DpuFcpbSuiSbKr9YayXb/KGc08vmKG6NWTEDWQXKuCyL/VVA9BLClNB5t i7CAQz0Xc4n/S5hKG7hU8w6+TdxCg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudehfedgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnh guqhhurggurhgrnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpedtveeghedtjedvvedv leejueevjeejtdellefgkeelfeeikeejlefgkedtudeuvdenucffohhmrghinhepvdhnug hquhgrughrrghnthdrtghomhenucfkphepleefrddvgeefrdekvddrvdegieenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvih hsvghnthhrrghuthesvdhnughquhgrughrrghnthdrtghomh X-ME-Proxy: Received: from april.pezone.net (p5df352f6.dip0.t-ipconnect.de [93.243.82.246]) by mail.messagingengine.com (Postfix) with ESMTPA id A947F3061CCB; Tue, 9 Jun 2020 02:52:25 -0400 (EDT) Subject: Re: Bump default wal_level to logical To: Andres Freund , Tom Lane References: <20200608171619.GA11063@alvherre.pgsql> <2021525.1591637270@sss.pgh.pa.us> <20200608213215.mgk3cctlzvfuaqm6@alap3.anarazel.de> Cc: Alvaro Herrera , Tomas Vondra , Magnus Hagander , Michael Paquier , Amit Kapila , David Fetter , PostgreSQL Development From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <977b6922-9e5c-eb6e-778d-9b19c0145b54@2ndquadrant.com> Date: Tue, 9 Jun 2020 08:52:24 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200608213215.mgk3cctlzvfuaqm6@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.238 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-06-08 23:32, Andres Freund wrote: > On 2020-06-08 13:27:50 -0400, Tom Lane wrote: >> If we can allow wal_level to be changed on the fly, I agree that would >> help reduce the pressure to make the default setting more expensive. >> I don't recall why it's PGC_POSTMASTER right now, but I suppose there >> was a reason for that ... > > There's reasons, but IIRC they're all solvable with reasonable effort. I > think most of it boils down to only being able to rely on the new > wal_level after a while. For minimal->recovery we basically need a > checkpoint started after the change in configuration, and for > recovery->logical we need to wait until all sessions have a) read the > new config setting b) finished the transaction that used the old > setting. The best behavior from a user's perspective would be if the WAL level automatically switched to logical if logical replication slots are present. You might not even need 'logical' as an actual value of wal_level anymore, you just need to keep a flag in shared memory that records whether at least one logical slot exists. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services