pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Reorderbuffer crash during recovery
Date: Fri, 27 Dec 2019 12:07:06 -0300
Message-ID: <20191227150706.GA24311@alvherre.pgsql> (raw)
In-Reply-To: <CALDaNm2Xe5OK8MeSv_=1U7+p8-p3bA2qiWh8CbtmmmemYKGcyA@mail.gmail.com>

On 2019-Dec-27, vignesh C wrote:

> I felt amit solution also solves the problem. Attached patch has the
> fix based on the solution proposed.
> Thoughts?

This seems a sensible fix to me, though I didn't try to reproduce the
failure.

> @@ -2472,6 +2457,7 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
>  		}
>  
>  		ReorderBufferSerializeChange(rb, txn, fd, change);
> +		txn->final_lsn = change->lsn;
>  		dlist_delete(&change->node);
>  		ReorderBufferReturnChange(rb, change);

Should this be done insider ReorderBufferSerializeChange itself, instead
of in its caller?  Also, would it be sane to verify that the TXN
doesn't already have a newer final_lsn?  Maybe as an Assert.

> @@ -188,8 +188,7 @@ typedef struct ReorderBufferTXN
>  	 * * plain abort record
>  	 * * prepared transaction abort
>  	 * * error during decoding
> -	 * * for a crashed transaction, the LSN of the last change, regardless of
> -	 *   what it was.
> +	 * * last serialized lsn
>  	 * ----

I propose "for a transaction with serialized changes, the LSN of the
latest serialized one, unless one of the above cases."

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (22+ messages)  latest in thread

Message-ID: <20191227150706.GA24311@alvherre.pgsql>
Permalink:  ../20191227150706.GA24311@alvherre.pgsql/
Also on:    postgresql.org/message-id/20191227150706.GA24311@alvherre.pgsql

 · 

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-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, vignesh21@gmail.com, amit.kapila16@gmail.com, andres@anarazel.de, tomas.vondra@2ndquadrant.com, dilipbalaut@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Reorderbuffer crash during recovery
  In-Reply-To: <20191227150706.GA24311@alvherre.pgsql>
  References: <CALDaNm2Xe5OK8MeSv_=1U7+p8-p3bA2qiWh8CbtmmmemYKGcyA@mail.gmail.com> <20191227150706.GA24311@alvherre.pgsql>

* 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