Re: Move tablespace

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Move tablespace
Date: 2010-04-21 06:50:50
Message-ID: 1271832650.8305.26864.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2010-04-20 at 21:03 -0400, Tom Lane wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> > Following patch writes a new WAL record that just says "copy foo to
> > newts" and during replay we flush buffers and then re-execute the copy
> > (but only when InArchiveRecovery). So the copy happens locally on the
> > standby, not copying from primary to standby. We do this just with a
> > little refactoring and a simple new WAL message.
>
> And what happens to crash-recovery replay? You can't have it both ways,
> either the data is in WAL or it's missing.

The patch changes nothing in the case of crash recovery.

There is no WAL written if !XLogIsNeeded, so we *must* have already made
the decision that the absence of WAL is not a problem for crash
recovery. Note that currently we flush the new table to disk just like
we do for heap_sync(), whether or not WAL is written.

> > Objections?
>
> This is NOT the time to be rushing in marginal performance
> optimizations. I don't think you've thought through all the corner
> cases anyway.

The performance gain isn't marginal, otherwise I wouldn't have bothered
writing it

* We avoid writing GB of unnecessary WAL data on primary
* We avoid streaming that WAL data to the standby

If you can see a corner case that I do not, please say.

--
Simon Riggs www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2010-04-21 06:54:56 Re: shared_buffers documentation
Previous Message Simon Riggs 2010-04-21 06:39:16 Re: testing HS/SR - 1 vs 2 performance