pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: fn ln <emuser20140816@gmail.com>
Cc: PostgreSQL Bugs <pgsql-bugs@lists.postgresql.org>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
Date: Thu, 29 Aug 2019 08:30:07 +0200 (CEST)
Message-ID: <alpine.DEB.2.21.1908290815110.28828@lancre> (raw)
In-Reply-To: <CA+99BHqXfKP=vbX4DmuGY3O8NP+nv-hu-fKLV6JgYj7-COE3CQ@mail.gmail.com>
References: <15977-f4eb49ebdcacc65b@postgresql.org>
	<alpine.DEB.2.21.1908251101540.9896@lancre>
	<CA+99BHqXfKP=vbX4DmuGY3O8NP+nv-hu-fKLV6JgYj7-COE3CQ@mail.gmail.com>


Hello,

> COMMIT AND CHAIN in implicit block leaves blockState as TBLOCK_STARTED, 
> which doesn't trigger the chaining. but ROLLBACK AND CHAIN sets the 
> blockState into TBLOCK_ABORT_PENDING, so the chaining is triggered.
>
> I think disabling s->chain beforehand should do the desired behavior.

Patch applies with "patch", although "git apply" complained because of 
CRLF line terminations forced by the octet-stream mime type.

Patch compiles cleanly. Make check ok.

Patch works for me, and solution seems appropriate. It should be committed 
for pg 12.0.

There could be a test added in "regress/sql/transactions.sql", I'd suggest 
something like:

-- implicit transaction and not chained.
COMMIT AND CHAIN;
COMMIT;
ROLLBACK AND CHAIN;
ROLLBACK;

which should show the appropriate "no transaction in progress" warnings.

Doc could be made a little clearer about what to expect when there is no 
explicit transaction in progress.

-- 
Fabien.





view thread (30+ messages)  latest in thread

Message-ID: <alpine.DEB.2.21.1908290815110.28828@lancre>
Permalink:  ../alpine.DEB.2.21.1908290815110.28828@lancre/
Also on:    postgresql.org/message-id/alpine.DEB.2.21.1908290815110.28828@lancre

 · 

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: coelho@cri.ensmp.fr, emuser20140816@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
  In-Reply-To: <alpine.DEB.2.21.1908290815110.28828@lancre>
  References: <15977-f4eb49ebdcacc65b@postgresql.org> <alpine.DEB.2.21.1908251101540.9896@lancre> <CA+99BHqXfKP=vbX4DmuGY3O8NP+nv-hu-fKLV6JgYj7-COE3CQ@mail.gmail.com> <alpine.DEB.2.21.1908290815110.28828@lancre>

* 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