pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: cg@osss.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done
Date: Wed, 15 Oct 2014 08:18:15 +0200
Message-ID: <20141015061815.GF7242@alap3.anarazel.de> (raw)
In-Reply-To: <CAB7nPqTsZUnDNYgLZ8OO5T4rQY+=XSe7uomiv=OVQnJvVzzHJg@mail.gmail.com>
References: <20141010181433.25463.5856@wrigleys.postgresql.org>
	<20141010191401.GA18020@awork2.anarazel.de>
	<CAB7nPqRsXPPNaFXDHZPbBESYR_EJPvQP6eKmhp-p13mJDpGgXw@mail.gmail.com>
	<20141015051254.GC7242@alap3.anarazel.de>
	<CAB7nPqTsZUnDNYgLZ8OO5T4rQY+=XSe7uomiv=OVQnJvVzzHJg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2014-10-15 15:02:43 +0900, Michael Paquier wrote:
> On Wed, Oct 15, 2014 at 2:12 PM, Andres Freund <andres@2ndquadrant.com>
> wrote:
> 
> > I'm not sure which danger you're seeing here. Imo we need to choose
> > between heap_inplace/heap_update for VACUUM/ANALYZE because one is
> > allowed to run in a transaction, and the other is not. It simply *can't*
> > be safe for ANALYZE to set things like relhastriggers = false using
> > heap_inplace().
> > There's problems with both it rolling back and thus undoing the action
> > that allowed relhastriggers = false to be set and scenarios where it's
> > not ok that other backends can see that value before the transaction
> > committed.
> 
> Hm, I was wondering about the potential effects of VACUUM FULL or VACUUM
> ANALYZE, but as they cannot run in a tx block...

Also they all take ShareUpdateExclusive locks preventing them from
running concurrently.

> Btw, I have just put my hands on this code and made the attached to
> make vac_update_relstats able to do a transactional update. It looks
> to work fine with only a check on the flags of vacuum statement.

Have you tested that the problem's now fixed?

Imo this is complex enough to deserve a regression test. Can you add
one?

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (19+ messages)  latest in thread

Message-ID: <20141015061815.GF7242@alap3.anarazel.de>
Permalink:  ../20141015061815.GF7242@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20141015061815.GF7242@alap3.anarazel.de

 · 

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: andres@2ndquadrant.com, michael.paquier@gmail.com, cg@osss.net
  Subject: Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done
  In-Reply-To: <20141015061815.GF7242@alap3.anarazel.de>
  References: <20141010181433.25463.5856@wrigleys.postgresql.org> <20141010191401.GA18020@awork2.anarazel.de> <CAB7nPqRsXPPNaFXDHZPbBESYR_EJPvQP6eKmhp-p13mJDpGgXw@mail.gmail.com> <20141015051254.GC7242@alap3.anarazel.de> <CAB7nPqTsZUnDNYgLZ8OO5T4rQY+=XSe7uomiv=OVQnJvVzzHJg@mail.gmail.com> <20141015061815.GF7242@alap3.anarazel.de>

* 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