Re: Transaction Snapshots and Hot Standby - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: Transaction Snapshots and Hot Standby
Date
Msg-id 1221222323.17270.170.camel@PCD12478
Whole thread Raw
In response to Re: Transaction Snapshots and Hot Standby  (Hannu Krosing <hannu@2ndQuadrant.com>)
List 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.




pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: New FSM patch
Next
From: David Fetter
Date:
Subject: Re: Better auth errors from libpq