pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>
Cc: pgsql-hackers@postgresql.org
Subject: Re: rmgr hooks and contrib/rmgr_hook
Date: Mon, 15 Sep 2008 10:26:40 +0100
Message-ID: <1221470800.3913.1229.camel@ebony.2ndQuadrant> (raw)
In-Reply-To: <48CB72C8.1070700@enterprisedb.com>
References: <20080901121833.4A18.52131E4D@oss.ntt.co.jp>
	<1220345064.4371.275.camel@ebony.2ndQuadrant>
	<20080902174613.76B2.52131E4D@oss.ntt.co.jp>
	<1220348980.4371.316.camel@ebony.2ndQuadrant>
	<14451.1220369969@sss.pgh.pa.us>
	<1220372673.4371.465.camel@ebony.2ndQuadrant>
	<48CB72C8.1070700@enterprisedb.com>


On Sat, 2008-09-13 at 10:59 +0300, Heikki Linnakangas wrote:

> The importance of the WAL will only increase as more people start to
> use it for PITR, replication etc.

Agreed.

> The 2nd use case, however, I find pretty unconvincing. I can't think of 
> a good example of that. Anything that needs to define its own resource 
> manager is very low-level stuff, and probably needs to go into the core 
> anyway.

New indexes are a big one, but I listed others also.

Indexes have always been able to be added dynamically. Now they can be
recovered correctly as well.

Other data structures can be maintained by trigger code that writes new
types of WAL. That was always possible before, now they can be
recoverable too.

If we have extensible functions, triggers, indexes, why not WAL? What is
the problem with making WAL extensible? It carries no penalty at all for
standard WAL records, since the internal design for WAL already caters
for exactly this.

> So, let's focus on the 1st use case. 

No, lets look at both...you can't just wave away half the use cases. If
you look at all of the use cases the argument for doing it externally
quickly falls apart since it severely limits what can be achieved.

> I think a better approach for that 
> is to implement the filters as external programs, like pglesslog. It 
> allows more flexibility, although it also means that you can't rely on 
> existing backend functions to manipulate the WAL. I'd love to see a "WAL 
> toolkit" on pgfoundry, with tools like the filter to only restore a 
> single database, pglesslog, a WAL record viewer etc. A while ago, you 
> also talked about replacing the Slony triggers in the master with a tool 
> that reads the WAL; another good example of an external tool that needs 
> to read WAL. The toolkit could provide some sort of a framework and 
> common user interface to read and write WAL files for all those tools.

This patch provides exactly the toolkit you describe, just internally. 

As you point out, doing it other ways means you can't access internal
functions easily and can't maintain internal data structures correctly
either. So doing it externally is *not* a substitute and this is not a
simple discussion of include/exclude from core.

I'm lost as to why suggesting we limit the functionality is going to be
a good thing? If external tools really are so good, then we can do that
*as well*.

But this is only a plugin API, so the tools will be developed externally
anyway.

> A while ago, you 
> also talked about replacing the Slony triggers in the master with a tool 
> that reads the WAL

Writes the WAL you mean? Slony triggers could write data to WAL rather
than log tables and the slon daemon can be implemented as an rmgr
plugin. Or many other options.

> Another tool like that is pglesslog, although that 
> one couldn't actually be implemented with these hooks. 

Sounds like we'll want to integrate that into synch replication some
how, so suggestions as to how to do that welcome - if you're not already
doing it via some other plugin in synch rep code?

> I'm sure there's 
> more tricks like that people would find useful, if the tools existed. 

Agreed. So lets make them exist.


If there's an argument against doing this, I've not heard it made
clearly by anybody. When we discussed it first on hackers there was no
objection, so I wrote the patch. If people want to see this blocked now,
we need some good reasons. 

I've got nothing riding on the acceptance of this patch, I just think
its a good thing. That's why I deprioritised it. If there's some hidden
threat to national security or whatever, tell me off list.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support




view thread (23+ messages)  latest in thread

Message-ID: <1221470800.3913.1229.camel@ebony.2ndQuadrant>
Permalink:  ../1221470800.3913.1229.camel@ebony.2ndQuadrant/
Also on:    postgresql.org/message-id/1221470800.3913.1229.camel@ebony.2ndQuadrant

 · 

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-patches@postgresql.org
  Cc: simon@2ndQuadrant.com, heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us, itagaki.takahiro@oss.ntt.co.jp, pgsql-hackers@postgresql.org
  Subject: Re: rmgr hooks and contrib/rmgr_hook
  In-Reply-To: <1221470800.3913.1229.camel@ebony.2ndQuadrant>
  References: <20080901121833.4A18.52131E4D@oss.ntt.co.jp> <1220345064.4371.275.camel@ebony.2ndQuadrant> <20080902174613.76B2.52131E4D@oss.ntt.co.jp> <1220348980.4371.316.camel@ebony.2ndQuadrant> <14451.1220369969@sss.pgh.pa.us> <1220372673.4371.465.camel@ebony.2ndQuadrant> <48CB72C8.1070700@enterprisedb.com> <1221470800.3913.1229.camel@ebony.2ndQuadrant>

* 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