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 1sRrOe-001fPb-9M for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jul 2024 10:51:32 +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 1sRrOc-00D9IY-Uv for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jul 2024 10:51:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRrOc-00D9IQ-LW for pgsql-hackers@lists.postgresql.org; Thu, 11 Jul 2024 10:51:30 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRrOZ-001XkD-LN for pgsql-hackers@lists.postgresql.org; Thu, 11 Jul 2024 10:51:30 +0000 Received: from [172.20.10.7] (sp49-97-70-197.msc.spmode.ne.jp [49.97.70.197]) by oss.nttdata.com (Postfix) with ESMTPSA id 855F66083D; Thu, 11 Jul 2024 19:51:21 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Thu, 11 Jul 2024 19:51:20 +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: Robert Haas Cc: Nathan Bossart , 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/11 1:35, Robert Haas wrote: > On Wed, Jul 10, 2024 at 10:10 AM Robert Haas wrote: >> On Wed, Jul 10, 2024 at 1:56 AM Fujii Masao wrote: >>> I believe this issue occurs when the server is shut down cleanly. >>> The shutdown-checkpoint record retains the wal_level value used >>> before the shutdown. If wal_level is changed after this, >>> the wal_level that indicated by the shutdown-checkpoint record >>> and that the WAL data generated afterwards depends on may not match. >> >> Oh, that's a problem. I'll have to think about that. > > Here is an attempt at fixing this problem. Thanks for updating the patch! + * fast_forward is normally false, but is true when we have encountered + * WAL generated with wal_level=minimal and are skipping over it without + * emitting summary files. In this case, summarized_tli and summarized_lsn + * will advance even though nothing is being written to disk, until we + * again reach a point where wal_level>minimal. + * * summarizer_pgprocno is the proc number of the summarizer process, if * one is running, or else INVALID_PROC_NUMBER. * @@ -83,6 +89,7 @@ typedef struct TimeLineID summarized_tli; XLogRecPtr summarized_lsn; bool lsn_is_exact; + bool fast_forward; It looks like the fast_forward field in WalSummarizerData is no longer necessary. So far, I haven't found any other issues with the patch. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION