Thread: pgsql: Add archive_mode='always' option.
Add archive_mode='always' option. In 'always' mode, the standby independently archives all files it receives from the primary. Original patch by Fujii Masao, docs and review by me. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/ffd37740ee6fcd434416ec0c5461f7040e0a11de Modified Files -------------- doc/src/sgml/config.sgml | 13 +++++++-- doc/src/sgml/high-availability.sgml | 39 +++++++++++++++++++++++++ src/backend/access/transam/xlog.c | 22 ++++++++++++-- src/backend/access/transam/xlogarchive.c | 5 +++- src/backend/postmaster/postmaster.c | 37 +++++++++++++++++------ src/backend/replication/walreceiver.c | 10 +++++-- src/backend/utils/misc/guc.c | 21 ++++++------- src/backend/utils/misc/postgresql.conf.sample | 2 +- src/include/access/xlog.h | 13 +++++++-- 9 files changed, 133 insertions(+), 29 deletions(-)
On 05/15/2015 05:55 PM, Heikki Linnakangas wrote: > Add archive_mode='always' option. > > In 'always' mode, the standby independently archives all files it receives > from the primary. > > Original patch by Fujii Masao, docs and review by me. > > Branch > ------ > master > > Details > ------- > http://git.postgresql.org/pg/commitdiff/ffd37740ee6fcd434416ec0c5461f7040e0a11de > > Modified Files > -------------- > doc/src/sgml/config.sgml | 13 +++++++-- > doc/src/sgml/high-availability.sgml | 39 +++++++++++++++++++++++++ > src/backend/access/transam/xlog.c | 22 ++++++++++++-- > src/backend/access/transam/xlogarchive.c | 5 +++- > src/backend/postmaster/postmaster.c | 37 +++++++++++++++++------ > src/backend/replication/walreceiver.c | 10 +++++-- > src/backend/utils/misc/guc.c | 21 ++++++------- > src/backend/utils/misc/postgresql.conf.sample | 2 +- > src/include/access/xlog.h | 13 +++++++-- > 9 files changed, 133 insertions(+), 29 deletions(-) this broke the docs build: http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=guaibasaurus&dt=2015-05-15%2016%3A17%3A01 Stefan
On 05/15/2015 07:39 PM, Stefan Kaltenbrunner wrote: > this broke the docs build: > > http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=guaibasaurus&dt=2015-05-15%2016%3A17%3A01 Fixed, thanks. - Heikki
On Sat, May 16, 2015 at 12:55 AM, Heikki Linnakangas <heikki.linnakangas@iki.fi> wrote: > Add archive_mode='always' option. > > In 'always' mode, the standby independently archives all files it receives > from the primary. Thanks a lot!! - /* If we have lost the stats collector, try to start a new one */ - if (PgStatPID == 0 && pmState == PM_RUN) - PgStatPID = pgstat_start(); Seems the above code which should exist was removed accidentally. + be handled similarly, but the archive_command must test if the file + being archived exists already, and if the existing file has identical + contents. This requires more care in the archive_command, as it must Isn't it better to enclose archive_command with <varname> tags? Regards, -- Fujii Masao
On 05/18/2015 09:46 AM, Fujii Masao wrote: > On Sat, May 16, 2015 at 12:55 AM, Heikki Linnakangas > <heikki.linnakangas@iki.fi> wrote: > - /* If we have lost the stats collector, try to start a new one */ > - if (PgStatPID == 0 && pmState == PM_RUN) > - PgStatPID = pgstat_start(); > > Seems the above code which should exist was removed accidentally. Good catch! > + be handled similarly, but the archive_command must test if the file > + being archived exists already, and if the existing file has identical > + contents. This requires more care in the archive_command, as it must > > Isn't it better to enclose archive_command with <varname> tags? Fixed, thanks. - Heikki