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 1lI9zk-0005Xa-Rx for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Mar 2021 12:55:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lI9zj-0004bt-O0 for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Mar 2021 12:55:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI9zj-0004bm-Hp for pgsql-bugs@lists.postgresql.org; Fri, 05 Mar 2021 12:55:51 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI9zf-0000CP-29 for pgsql-bugs@lists.postgresql.org; Fri, 05 Mar 2021 12:55:51 +0000 Received: from desktop.home.thelabyrinth.net (c-73-39-102-148.hsd1.va.comcast.net [73.39.102.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 896185466B; Fri, 5 Mar 2021 12:55:44 +0000 (UTC) Subject: Re: BUG #16894: PANIC: WAL contains references to invalid pages To: Michael Paquier Cc: =?UTF-8?B?0JDQvdGC0L7QvSDQmtGD0YDQvtGH0LrQuNC9?= , pgsql-bugs@lists.postgresql.org References: <16894-c29735df12727642@postgresql.org> <11b70b37-997e-8a2d-62f3-0f8398b7cafd@pgmasters.net> <188742f3-a8d0-20b1-2acb-a038a7d5727b@pgmasters.net> From: David Steele Message-ID: Date: Fri, 5 Mar 2021 07:55:43 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/4/21 11:32 PM, Michael Paquier wrote: > On Wed, Mar 03, 2021 at 06:49:02AM -0500, David Steele wrote: >> OK, but shouldn't we have a full page write for this page after the backup >> starts, rather than the partial we seem to be seeing here? Is there any >> condition where the full page write would be skipped legitimately, or does >> it point to a problem? > > That's how things work. If they don't work this way for physical > backups, we may have a problem. At replay, the full page will be > replayed if BKPIMAGE_APPLY is correctly set, as per > XLogReadBufferForRedoExtended(). And XLogRecordAssemble() > does the decision when building the record (just grep for > needs_backup). That's exactly the problem. This WAL record appears to be the only reference to the page the submitter could find in their WAL. Anton, could you confirm that? If we can confirm that there is no FPI for this page after the initial backup checkpoint, wouldn't that point to an issue? >> If Postgres is running correctly there is certainly no expectation for >> support of this unusual use case, but I do think that this possibly points >> to an issue in Postgres, which under normal circumstances would be very hard >> to detect. > > Well, the report tells that this is an issue that happens on those > fake files full of zeros, but are you sure that you have the sizing > right? I still don't see any evidence of anything broken based on the > information gathered for full backups, FWIW. This is the size we validate for normal restores so pretty sure it is accurate. Actually, postgres doesn't seem to care if the file is large enough as long as it is present. The reason we precreate the files at the correct size is because when postgres extends the file it is not sparse and uses more space. Regards, -- -David david@pgmasters.net