Re: [GENERAL] Snapshot backups

2013-08-09 Thread Bruce Momjian
On Wed, Jul 31, 2013 at 08:24:46AM -0400, Tom Lane wrote: > Alban Hertroys writes: > > That begs the question what happens in case of a crash or (worse) a partial > > crash when multiple file systems are involved. > > As long as the OS+hardware honors the contract of fsync(), everything's > fine

Re: [GENERAL] Snapshot backups

2013-08-01 Thread James Sewell
Thank you Tom! This is what I was after! So, to get this straight in my head. - pg_start_backup forces a checkpoint and writes the information from this checkpoint to the backup_label file - - pg_stop_backup removes the backup_label file - - - Database starts and determin

Re: [GENERAL] Snapshot backups

2013-07-31 Thread Tom Lane
Alban Hertroys writes: > That begs the question what happens in case of a crash or (worse) a partial > crash when multiple file systems are involved. As long as the OS+hardware honors the contract of fsync(), everything's fine. If the storage system loses data that it claims to have fsync'd to

Re: [GENERAL] Snapshot backups

2013-07-31 Thread Alban Hertroys
On Jul 31, 2013, at 7:13, Tom Lane wrote: > Jeff Janes writes: >> On Tuesday, July 30, 2013, James Sewell wrote: >>> I understand what you are saying, and I understand how the backup_label >>> works - but I still don't understand why the pg_start and pg_stop commands >>> are REQUIRED when doing

Re: [GENERAL] Snapshot backups

2013-07-30 Thread Tom Lane
Jeff Janes writes: > On Tuesday, July 30, 2013, James Sewell wrote: >> I understand what you are saying, and I understand how the backup_label >> works - but I still don't understand why the pg_start and pg_stop commands >> are REQUIRED when doing a snapshot backup to ensure data integrity. >> >>

Re: [GENERAL] Snapshot backups

2013-07-30 Thread Jeff Janes
On Tuesday, July 30, 2013, James Sewell wrote: > I understand what you are saying, and I understand how the backup_label > works - but I still don't understand why the pg_start and pg_stop commands > are REQUIRED when doing a snapshot backup to ensure data integrity. > > Surely not using them and

Re: [GENERAL] Snapshot backups

2013-07-30 Thread James Sewell
I understand what you are saying, and I understand how the backup_label works - but I still don't understand why the pg_start and pg_stop commands are REQUIRED when doing a snapshot backup to ensure data integrity. Surely not using them and restoring a snapshot is the same as starting after a cras

Re: [GENERAL] Snapshot backups

2013-07-28 Thread Amit Langote
On Mon, Jul 29, 2013 at 3:32 PM, James Sewell wrote: > Hey all, > > I understand that I have already been given an answer here, but I am still > curious as to why this is the case (perhaps I should ask this on the > hackers list though, if so let me know). > > More importantly I'd like to understa

Re: [GENERAL] Snapshot backups

2013-07-28 Thread James Sewell
Hey all, I understand that I have already been given an answer here, but I am still curious as to why this is the case (perhaps I should ask this on the hackers list though, if so let me know). More importantly I'd like to understand why I would need to use the start/stop backup commands to ensur

Re: [GENERAL] Snapshot backups

2013-06-20 Thread James Sewell
Thanks Magnus, Could you elaborate a bit more on this? I've been having a look at do_pg_start_backup() and I can't really see anything apart from enabling full page writes and running a checkpoint to avoid getting a torn page. I could be missing something easily though, as I'm not familiar with t

Re: [GENERAL] Snapshot backups

2013-06-20 Thread Magnus Hagander
On Thu, Jun 20, 2013 at 8:45 AM, James Sewell wrote: > Hey All, > > This is a message to confirm my thoughts / validate a possible approach. > > In a situation where PGDATA and {XLOG, ARCHIVELOG} are on different > SAN/NAS volumes and a backup is to be initiated do pg_start_backup and > pg_stop_ba