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 1lH4Q0-0004RU-1g for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Mar 2021 12:46:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lH4Py-0000mf-WD for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Mar 2021 12:46:27 +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 1lH4Py-0000mX-Q6 for pgsql-bugs@lists.postgresql.org; Tue, 02 Mar 2021 12:46:26 +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 1lH4Pw-0000Lx-NT for pgsql-bugs@lists.postgresql.org; Tue, 02 Mar 2021 12:46:26 +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 63C815488F; Tue, 2 Mar 2021 12:46:22 +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> From: David Steele Message-ID: <11b70b37-997e-8a2d-62f3-0f8398b7cafd@pgmasters.net> Date: Tue, 2 Mar 2021 07:46:21 -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: Precedence: bulk Hi Michael, On 2/28/21 11:31 PM, Michael Paquier wrote: > On Thu, Feb 25, 2021 at 12:53:44PM -0500, David Steele wrote: >> For context, when a user performs selective restore all the relations for >> databases *not* selected are restored as sparse zero files with the correct >> size. WAL replay will update those relations but they are not expected to >> be consistent, and in fact we make it impossible to logon to those databases >> so the only option is to drop them. > > What is a selective restore? Is that a pgbackrest restore mode from a > full physical backup where only a portion of the database folders are > physically put back into the data folder restored before doing WAL > replay up to the consistent point of the full physical backup? Then, > you emulate the absence of the files from the other database folders > using files full of zeros but with the same size as the original > backup to trick WAL replay? That summarizes the process very well. My concern here is that we appear to have a partial page write as the first write to a page after the backup start checkpoint. At least, that's what this error seems to be indicating from my reading of the code. The question is -- are there valid circumstances under which this might be happening or is it a bug? I have not submitted a bug before this because I am not able to reproduce it in a test environment, but perhaps somebody can weigh in on whether this behavior seems normal. Regards, -- -David david@pgmasters.net