Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3Qil-0001K5-C9 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2017 17:27:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d3Qik-0005tM-Eq for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2017 17:27:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3QhE-0002DU-Oa for pgsql-hackers@postgresql.org; Wed, 26 Apr 2017 17:25:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3QhC-0008M1-Cj for pgsql-hackers@postgresql.org; Wed, 26 Apr 2017 17:25:43 +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 v3QHPdAk008664; Wed, 26 Apr 2017 13:25:39 -0400 From: Tom Lane To: Simon Riggs cc: Nikhil Sontakke , Andres Freund , PostgreSQL-development Subject: Re: StandbyRecoverPreparedTransactions recovers subtrans links incorrectly In-reply-to: References: <20110.1492905318@sss.pgh.pa.us> <20170423001931.wk4os4x6dwtdfwgd@alap3.anarazel.de> <20170423232504.o454vbowwvivkuyn@alap3.anarazel.de> <20170424185944.bjpb3yizeybv75hd@alap3.anarazel.de> <2049.1493216926@sss.pgh.pa.us> Comments: In-reply-to Simon Riggs message dated "Wed, 26 Apr 2017 18:01:28 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8662.1493227539.1@sss.pgh.pa.us> Date: Wed, 26 Apr 2017 13:25:39 -0400 Message-ID: <8663.1493227539@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've added code following Michael and Tom's comments to the previous > patch. New patch attached. Couple of minor suggestions: * Rather than deleting the comment for SubTransSetParent entirely, maybe make it say "It's possible that the parent was already recorded. However, we should never be asked to change an already-set entry to something else." * In SubTransGetTopmostTransaction, maybe it'd be better to spell "TransactionIdFollowsOrEquals" as "!TransactionIdPrecedes" to make it look more like the test just above. Matter of taste though. * Less a matter of taste is that I think that should be just elog(ERROR); there's no good reason to make it FATAL. * Also, I think there should be a comment there, along the lines of "check for reversed linkage to ensure this isn't an infinite loop". 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