Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d32Q7-000335-8C for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Apr 2017 15:30:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d32Q6-0007Eu-On for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Apr 2017 15:30:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d32Oa-0003aN-Mw for pgsql-hackers@postgresql.org; Tue, 25 Apr 2017 15:28:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d32OY-0008CF-FU for pgsql-hackers@postgresql.org; Tue, 25 Apr 2017 15:28:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v3PFSmQn018172; Tue, 25 Apr 2017 11:28:48 -0400 From: Tom Lane To: Simon Riggs cc: PostgreSQL-development Subject: Re: StandbyRecoverPreparedTransactions recovers subtrans links incorrectly In-reply-to: References: <20110.1492905318@sss.pgh.pa.us> <357.1492964232@sss.pgh.pa.us> Comments: In-reply-to Simon Riggs message dated "Tue, 25 Apr 2017 07:47:38 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18170.1493134128.1@sss.pgh.pa.us> Date: Tue, 25 Apr 2017 11:28:48 -0400 Message-ID: <18171.1493134128@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Simon Riggs writes: > I can't see any reason now why overwriteOK should exist at all. I'm > guessing that the whole "overwriteOK" idea was an incorrect response > to xids appearing where they shouldn't have done because of the > mistake you just corrected. So I will now remove the parameter from > the call. Seems reasonable, but I don't like the logic change you made in SubTransSetParent; you broke the former invariant, for non-Assert builds, that the target pg_subtrans entry is guaranteed to have the correct value on exit. I do like fixing it to not dirty the page unnecessarily, but I'd suggest that we write it like if (*ptr != parent) { Assert(*ptr == InvalidTransactionId); *ptr = parent; SubTransCtl->shared->page_dirty[slotno] = true; } regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers