Re: How does pg_basebackup manage to create a snapshot of thefilesystem? - Mailing list pgsql-general

From Christophe Pettus
Subject Re: How does pg_basebackup manage to create a snapshot of thefilesystem?
Date
Msg-id 5842F57D-C8AE-4B73-9B4F-F8810174461E@thebuild.com
Whole thread Raw
In response to How does pg_basebackup manage to create a snapshot of the filesystem?  (Dennis Jacobfeuerborn <dennisml@conversis.de>)
List pgsql-general

> On Mar 19, 2020, at 15:19, Dennis Jacobfeuerborn <dennisml@conversis.de> wrote:
> I'm currently trying to understand how backups work. In the
> documentation in section "25.2. File System Level Backup" it says that
> filesystem level backups can only be made when the database if offline
> yet pg_basebackup seems to do just that but works while the database is
> online. Am I misunderstanding something here or does pg_basebackup use
> some particular features of Postgres to accomplish this?

pg_basebackup does, indeed, take an inconsistent copy of the file system while it is running; what allows it to bring
thedatabase back up to consistency is the write-ahead log segments that are created while pg_basebackup is running.
That'swhy it is important to have all of the WAL segments created during the run (which is what --wal-method=stream
providesyou). 
--
-- Christophe Pettus
   xof@thebuild.com




pgsql-general by date:

Previous
From: Dave Hughes
Date:
Subject: Passwordcheck configuration
Next
From: pabloa98
Date:
Subject: Re: Could postgres12 support millions of sequences? (like 10 million)