From 4df132895016c6a99355776a8df284ff011a2e94 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 18 May 2015 10:18:46 +0300 Subject: [PATCH] Put back stats-collector restarting code, removed accidentally. Removed that code snippet accidentally in the archive_mode='always' patch. Also, use varname-tags for archive_command in the docs. Fujii Masao --- doc/src/sgml/high-availability.sgml | 7 ++++--- src/backend/postmaster/postmaster.c | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index d950100239..d2f7fec523 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -1237,9 +1237,10 @@ primary_slot_name = 'node_a_slot' to always, and the standby will call the archive command for every WAL segment it receives, whether it's by restoring from the archive or by streaming replication. The shared archive can - 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 + 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 be careful to not overwrite an existing file with different contents, but return success if the exactly same file is archived twice. And all that must be done free of race conditions, if two servers attempt diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 36440cbdcc..6e2ba08a93 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -1645,6 +1645,10 @@ ServerLoop(void) start_autovac_launcher = false; /* signal processed */ } + /* If we have lost the stats collector, try to start a new one */ + if (PgStatPID == 0 && pmState == PM_RUN) + PgStatPID = pgstat_start(); + /* * If we have lost the archiver, try to start a new one. *