Re: Transaction Snapshots and Hot Standby

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Richard Huxton <dev(at)archonet(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transaction Snapshots and Hot Standby
Date: 2008-09-12 12:25:23
Message-ID: 1221222323.17270.170.camel@PCD12478
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2008-09-12 at 15:08 +0300, Hannu Krosing wrote:
> > * how will the buffers keep 2 different versions of the same page ?
>
> As the FS snapshot is mounted as a different directory, it will have
> it's own buffer pages.

Lack of knowledge about this shows my ignorance about the implementation
of the page buffers...

> > * how will you handle the creation of snapshots ?
>
> probably an external command, possibly shell script.
> similar to current "archive_command" for wal copying
>
> maybe 'create_fs_snapshot_command' and 'destroy_fs_snapshot_command'
[snip]
> Yes, the simplest one being external command. As FS snapshots are
> supposed to happen not-too often, at least not every second, just having
> external commands may be enough.

You could restrict the creation of snapshots to some minimum amount of
time between them, and maybe also restrict the maximum number of
concurrent snapshots possible. Then if the time limit (as calculated
from the last open snapshot) is currently not met, any new query could
reuse that last snapshot. The time intervals do not need to be evenly
distributed BTW, it could be a function of the already opened snapshots,
like increase the minimum interval exponentially with the number of
already opened snapshots. That would help to catch more long running
queries to just a few snapshots.

> > I hope my continuous questioning is not too annoying...
>
> On the contrary, much appreciated. :)

Ok, then I'll continue :-) I would like to see this feature succeed, but
there's slim chance I'll ever code well in C...

Cheers,
Csaba.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-09-12 12:29:24 Re: Better auth errors from libpq
Previous Message Zdenek Kotala 2008-09-12 12:13:46 Re: New FSM patch