Re: Hot Standby (v9d)

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, jd(at)commandprompt(dot)com, Simon Riggs <simon(at)2ndQuadrant(dot)com>, Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hot Standby (v9d)
Date: 2009-02-03 14:42:42
Message-ID: 1233672162.7999.18.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2009-02-03 at 13:50 +0000, Gregory Stark wrote:
> Hannu Krosing <hannu(at)krosing(dot)net> writes:
>
> > Actually we came up with a solution to this - use filesystem level
> > snapshots (like LVM2+XFS or ZFS), and redirect backends with
> > long-running queries to use fs snapshot mounted to a different
> > mountpoint.
>
> Uhm, how do you determine which snapshot to direct the backend to? There could
> have been several generations of tuples in that tid since your query started.
> Do you take a snapshot every time there's a vacuum-snapshot conflict and
> record which snapshot goes with that snapshot?

The most sensible thing to do seems to wait for some configurable period
(say a few seconds or a few minutes), delaying WAL apply, and then to do
the snaphot, mount it and redirect all running transactions to use
_current_ filesystem snapshot, and then resume WAL application.

As each of the transactions running on saved fs snapshots complete, they
are switced back to main/live fs view.

When the last there transaction ends, the snapshot is unmounted and
released.

--
------------------------------------------
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2009-02-03 14:46:52 Re: pgevent warnings on mingw
Previous Message Simon Riggs 2009-02-03 14:40:26 Re: Hot Standby (v9d)