pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Rearranging ALTER TABLE to avoid multi-operations bugs
Date: Tue, 29 Oct 2019 22:10:39 -0300
Message-ID: <20191030011039.GA9097@alvherre.pgsql> (raw)
In-Reply-To: <30897.1572373085@sss.pgh.pa.us>

On 2019-Oct-29, Tom Lane wrote:

> The thing I think you are actually worried about is the interaction
> with event triggers, which is already a pretty horrid mess in this
> code today.  I don't really follow the comment here about
> "ordering of queued commands".  It looks like that comment dates to
> Alvaro's commit b488c580a ... can either of you elucidate that?

The point of that comment is that if you enqueue the commands as they
are returned by pg_event_trigger_ddl_commands() (say by writing them to
a table) they must be emitted in an order that allows them to be
re-executed in a remote server that duplicates this one, and the final
state should be "the same".

> Now, if we move things around like that, it will have some effects
> on what event triggers see --- certainly the order of operations
> at least.  But do we feel a need to retain the same sort of
> "encapsulation" that is currently happening due to the aforesaid
> logic in utility.c?  I don't fully understand what that's for.

Sadly, the DDL replay logic is not being used for anything at present,
so I don't have a good test case to ensure that a proposed change is
good in this regard.  I've been approached by a couple people interested
in finishing the DDL conversion thing, but no takers so far.  I know
there's people using code based on the src/test/modules/test_ddl_deparse
module, but not for replicating a server's state to a different server, as
far as I know.

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





view thread (23+ messages)  latest in thread

Message-ID: <20191030011039.GA9097@alvherre.pgsql>
Permalink:  ../20191030011039.GA9097@alvherre.pgsql/
Also on:    postgresql.org/message-id/20191030011039.GA9097@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-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: Rearranging ALTER TABLE to avoid multi-operations bugs
  In-Reply-To: <20191030011039.GA9097@alvherre.pgsql>
  References: <30897.1572373085@sss.pgh.pa.us> <20191030011039.GA9097@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