Re: Streaming base backups

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Streaming base backups
Date: 2011-01-07 14:47:16
Message-ID: AANLkTimSXEHY69hSho5GFXyWLTsdXcUBqmiL_ZKbxMqJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 7, 2011 at 01:47, Cédric Villemain
<cedric(dot)villemain(dot)debian(at)gmail(dot)com> wrote:
> 2011/1/5 Magnus Hagander <magnus(at)hagander(dot)net>:
>> On Wed, Jan 5, 2011 at 22:58, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr> wrote:
>>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>>>> * Stefan mentiond it might be useful to put some
>>>> posix_fadvise(POSIX_FADV_DONTNEED)
>>>>   in the process that streams all the files out. Seems useful, as long as that
>>>>   doesn't kick them out of the cache *completely*, for other backends as well.
>>>>   Do we know if that is the case?
>>>
>>> Maybe have a look at pgfincore to only tag DONTNEED for blocks that are
>>> not already in SHM?
>>
>> I think that's way more complex than we want to go here.
>>
>
> DONTNEED will remove the block from OS buffer everytime.

Then we definitely don't want to use it - because some other backend
might well want the file. Better leave it up to the standard logic in
the kernel.

> It should not be that hard to implement a snapshot(it needs mincore())
> and to restore previous state. I don't know how basebackup is
> performed exactly...so perhaps I am wrong.

Uh, it just reads the files out of the filesystem. Just like you'd to
today, except it's now integrated and streams the data across a
regular libpq connection.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-01-07 14:57:44 Re: pgsql: New system view pg_stat_replication displays activity of wal sen
Previous Message Magnus Hagander 2011-01-07 14:45:22 Re: Streaming base backups