Re: [PERFORM] Backup taking long time !!!

Поиск
Список
Период
Сортировка
От julyanto SUTANDANG
Тема Re: [PERFORM] Backup taking long time !!!
Дата
Msg-id CAGu3fERmj=3GMhGLh28YTwZscVMsM38-JdUw3AmOND4DRA-bpA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PERFORM] Backup taking long time !!!  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-performance
Dear Jeff, 

Thanks for the correction and by this email, we hope that myth has gone forever :)
Will do that to inform other about this matter.

And agree with all of us here that: using pg_basebackup is the best approach rather than do it manually through pg_start_backup, right? 

Thanks and Regards,

Jul. 



Julyanto SUTANDANG

Equnix Business Solutions, PT
(An Open Source and Open Mind Company)
www.equnix.co.id
Pusat Niaga ITC Roxy Mas Blok C2/42.  Jl. KH Hasyim Ashari 125, Jakarta Pusat
T: +6221 22866662 F: +62216315281 M: +628164858028


Caution: The information enclosed in this email (and any attachments) may be legally privileged and/or confidential and is intended only for the use of the addressee(s). No addressee should forward, print, copy, or otherwise reproduce this message in any manner that would allow it to be viewed by any individual not originally listed as a recipient. If the reader of this message is not the intended recipient, you are hereby notified that any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is strictly prohibited. If you have received this communication in error, please immediately notify the sender and delete this message.Unless it is made by the authorized person, any views expressed in this message are those of the individual sender and may not necessarily reflect the views of PT Equnix Business Solutions.

On Tue, Jan 24, 2017 at 12:12 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
On Sun, Jan 22, 2017 at 6:57 AM, Stephen Frost <sfrost@snowman.net> wrote:
Greetings,

* julyanto SUTANDANG (julyanto@equnix.co.id) wrote:
> CORRECTION:
>
> "you might you pg_start_backup to tell the server not to write into the
> DATADIR"
>
> become
>
> "you might *use* pg_start_backup to tell the server not to write into the
> *BASEDIR*, actually server still writes but only to XLOGDIR "

Just to make sure anyone reading the mailing list archives isn't
confused, running pg_start_backup does *not* make PG stop writing to
BASEDIR (or DATADIR, or anything, really).  PG *will* continue to write
data into BASEDIR after pg_start_backup has been called.


Correct.  Unfortunately it is a very common myth that it does cause PostgreSQL to stop writing to the base dir.
 

The only thing that pg_start_backup does is identify an entry in the WAL
stream, from which point all WAL must be replayed when restoring the
backup.  All WAL generated from that point (pg_start_backup point) until
the pg_stop_backup point *must* be replayed when restoring the backup or
the database will not be consistent.

pg_start_backup also forces full_page_writes to be effectively 'on' for the duration of the backup, if it is not already explicitly on (which it usually will already be).  This affects pg_xlog, of course, not base.  But it is an essential step for people who run with full_page_writes=off, as it ensures that anything in base which got changed mid-copy will be fixed up during replay of the WAL.

 
Cheers,

Jeff

В списке pgsql-performance по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PERFORM] Backup taking long time !!!
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: [PERFORM] optimizing immutable vs. stable function calls?