pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Nikhil Sontakke <nikhils@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: StandbyRecoverPreparedTransactions recovers subtrans links incorrectly
Date: Wed, 26 Apr 2017 13:25:39 -0400
Message-ID: <8663.1493227539@sss.pgh.pa.us> (raw)
In-Reply-To: <CANP8+jKDkG8J3ZKpqhUhJ8-k+ns0m-UYai3FwnRupp=EL_DKUg@mail.gmail.com>
References: <20110.1492905318@sss.pgh.pa.us>
	<20170423001931.wk4os4x6dwtdfwgd@alap3.anarazel.de>
	<CANP8+jLy1VdopsdCi3c0=msJCfu-oHAhgPJgtKJ84fFN_8EmOw@mail.gmail.com>
	<20170423232504.o454vbowwvivkuyn@alap3.anarazel.de>
	<CANP8+j+vcrgv6-KaY_1bdgF7nE2G0r12c398g=7QyazVXem3xg@mail.gmail.com>
	<20170424185944.bjpb3yizeybv75hd@alap3.anarazel.de>
	<CANP8+jLcfoCsJb8R57=haWVJewiAkGixpY6MaN-TNpNiaLTnYg@mail.gmail.com>
	<CAMGcDxfLxpb4iTQVeeJ3s=r4ZEtaHS5L4f_gj8CZtJ_69PcBzw@mail.gmail.com>
	<2049.1493216926@sss.pgh.pa.us>
	<CANP8+jKDkG8J3ZKpqhUhJ8-k+ns0m-UYai3FwnRupp=EL_DKUg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Simon Riggs <simon@2ndquadrant.com> 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



view thread (23+ messages)  latest in thread

Message-ID: <8663.1493227539@sss.pgh.pa.us>
Permalink:  ../8663.1493227539@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8663.1493227539@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com, nikhils@2ndquadrant.com, andres@anarazel.de
  Subject: Re: StandbyRecoverPreparedTransactions recovers subtrans links incorrectly
  In-Reply-To: <8663.1493227539@sss.pgh.pa.us>
  References: <20110.1492905318@sss.pgh.pa.us> <20170423001931.wk4os4x6dwtdfwgd@alap3.anarazel.de> <CANP8+jLy1VdopsdCi3c0=msJCfu-oHAhgPJgtKJ84fFN_8EmOw@mail.gmail.com> <20170423232504.o454vbowwvivkuyn@alap3.anarazel.de> <CANP8+j+vcrgv6-KaY_1bdgF7nE2G0r12c398g=7QyazVXem3xg@mail.gmail.com> <20170424185944.bjpb3yizeybv75hd@alap3.anarazel.de> <CANP8+jLcfoCsJb8R57=haWVJewiAkGixpY6MaN-TNpNiaLTnYg@mail.gmail.com> <CAMGcDxfLxpb4iTQVeeJ3s=r4ZEtaHS5L4f_gj8CZtJ_69PcBzw@mail.gmail.com> <2049.1493216926@sss.pgh.pa.us> <CANP8+jKDkG8J3ZKpqhUhJ8-k+ns0m-UYai3FwnRupp=EL_DKUg@mail.gmail.com> <8663.1493227539@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox