Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TfBQC-0000zK-S6 for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Dec 2012 15:25:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TfBQB-0006J3-Sx for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Dec 2012 15:25:31 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TfBQA-0006Ix-Vs for pgsql-bugs@postgresql.org; Sun, 02 Dec 2012 15:25:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TfBQ5-00074m-Rl for pgsql-bugs@postgresql.org; Sun, 02 Dec 2012 15:25:30 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qB2FPLOh011811; Sun, 2 Dec 2012 10:25:21 -0500 (EST) From: Tom Lane To: Simon Riggs cc: tarvip@gmail.com, pgsql-bugs@postgresql.org, Andres Freund Subject: Re: BUG #7710: Xid epoch is not updated properly during checkpoint In-reply-to: References: <24367.1354402593@sss.pgh.pa.us> Comments: In-reply-to Simon Riggs message dated "Sun, 02 Dec 2012 15:08:35 +0000" Date: Sun, 02 Dec 2012 10:25:20 -0500 Message-ID: <11810.1354461920@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Simon Riggs writes: > I've applied an absolutely minimal fix on this, which introduces no > other changes that could cause unforeseen consequences. This is not what we'd agreed to do, I thought. Now that I've thought more about this bug, the existing coding is flat out wrong, with or without correction of the epoch. As you yourself just wrote in a comment, the checkpoint record logically belongs to the "redo" point in the WAL stream, not to where it's physically located. Having it carry a nextXid that belongs to the later point is simply wrong. Having it carry different nextXids depending on wal_level is even more wrong. I can point right now to one misbehavior this causes: if you run a point-in-time recovery with a stop point somewhere in the middle of the checkpoint, you should end up with a nextXid corresponding to the stop point. This hack in LogStandbySnapshot causes you to end up with a much later nextXid, if you were running hot-standby. > Others may wish to go further, overriding my patches, as they choose. Okay, I will take the responsibility for changing this, but it needs to change. This coding was ill-considered from the word go. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs