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 1poRUD-0004Wv-Cy for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Apr 2023 16:13:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1poRUC-00071S-2I for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Apr 2023 16:13:48 +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 1poRUB-00071J-Oh for pgsql-hackers@lists.postgresql.org; Mon, 17 Apr 2023 16:13:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1poRU9-000LRS-CN for pgsql-hackers@postgresql.org; Mon, 17 Apr 2023 16:13:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33HGDfFY2444562; Mon, 17 Apr 2023 12:13:41 -0400 From: Tom Lane To: Matthias van de Meent cc: Justin Pryzby , pgsql-hackers@postgresql.org Subject: Re: v16dev: TRAP: failed Assert("size > SizeOfXLogRecord"), File: "xlog.c", Line: 1055, PID: 13564 In-reply-to: References: Comments: In-reply-to Matthias van de Meent message dated "Mon, 17 Apr 2023 18:50:40 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2444560.1681748021.1@sss.pgh.pa.us> Date: Mon, 17 Apr 2023 12:13:41 -0400 Message-ID: <2444561.1681748021@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthias van de Meent writes: > Looking at log_newpage_range, it seems like we're always trying to log > a record if startblk < endblk; but don't register the PageIsNew() > buffers in the range. That means that if the last buffers in the range > are new, this can result in no buffers being registered in the last > iteration of the main loop (if the number of non-new buffers in the > range is 0 (mod 32)). Yeah, I just came to the same conclusion. One thing I don't understand yet: log_newpage_range is old (it looks like this back to v12), and that Assert is older, so why doesn't this reproduce further back? Maybe the state where all the pages are new didn't happen before? Is that telling us there's a bug somewhere else? Seems like a job for git bisect. To be clear: log_newpage_range is certainly broken, and your fix looks appropriate. I'm just wondering what else we need to learn here. regards, tom lane