Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRZm6-00GdVO-Mg for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 16:02:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sRZm5-006sVP-AU for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 16:02:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRZm5-006sVH-0m for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 16:02:33 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRZm1-001OfJ-Rw for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 16:02:31 +0000 Received: from [192.168.11.2] (p3952216-ipxg13501funabasi.chiba.ocn.ne.jp [122.16.205.216]) by oss.nttdata.com (Postfix) with ESMTPSA id 606BA619B6; Thu, 11 Jul 2024 01:02:25 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <523cc094-0fe1-4e2c-9653-a3cf9cde0c49@oss.nttdata.com> Date: Thu, 11 Jul 2024 01:02:25 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal To: Nathan Bossart , Robert Haas Cc: pgsql-hackers@lists.postgresql.org References: <6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com> <802ff3d5-fdc7-4b08-9046-2e9fc5fdae0e@oss.nttdata.com> <7c1b48d8-0f08-4733-a4e6-d55f04581db7@oss.nttdata.com> Content-Language: en-US From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024/07/10 23:18, Nathan Bossart wrote: > On Wed, Jul 10, 2024 at 10:10:30AM -0400, Robert Haas wrote: >> On Wed, Jul 10, 2024 at 1:56 AM Fujii Masao wrote: >>> I'm sure this patch is necessary as a safeguard for WAL summarization. >>> OTOH, I also think we should apply the patch I proposed earlier >>> in this thread, which prevents summarize_wal from being enabled >>> when wal_level is set to minimal. This way, if there's >>> a misconfiguration, users will see an error message and >>> can quickly identify and fix the issue. Thought? >> >> I interpreted these emails as meaning that we should not proceed with >> that approach: >> >> https://www.postgresql.org/message-id/CAGECzQR2r-rHFLQr5AonFehVP8DiFH+==R2yqdBvunYnwxsXNA@mail.gmail.com >> http://postgr.es/m/3253790.1720019802@sss.pgh.pa.us > > Yeah. I initially thought this patch might be okay, at least as a stopgap, > but Jelte pointed out a case where it doesn't work, namely when you have > something like the following in the config file: > > wal_level = 'minimal' > summarize_wal = 'true' > wal_level = 'logical' Unless I'm mistaken, the patch works fine in this case. If the check_hook triggered every time a parameter appears in the configuration file, it would mistakenly detect wal_level=minimal and summarize_wal=on together and raise an error. However, this isn't the case. The check_hook is designed to trigger after duplicate parameters are deduplicated. Am I missing something? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION