summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-01-15 09:19:10 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-01-15 09:19:10 +0000
commit40f908bdcdc726fc11912cd95dfd2f89603d1f37 (patch)
treefcbbda839e58184fc284d261cc5a0f5e8ac921f3 /src/backend/utils/misc/guc.c
parent4cbe473938779ec414d90c2063c4398e68a70838 (diff)
Introduce Streaming Replication.
This includes two new kinds of postmaster processes, walsenders and walreceiver. Walreceiver is responsible for connecting to the primary server and streaming WAL to disk, while walsender runs in the primary server and streams WAL from disk to the client. Documentation still needs work, but the basics are there. We will probably pull the replication section to a new chapter later on, as well as the sections describing file-based replication. But let's do that as a separate patch, so that it's easier to see what has been added/changed. This patch also adds a new section to the chapter about FE/BE protocol, documenting the protocol used by walsender/walreceivxer. Bump catalog version because of two new functions, pg_last_xlog_receive_location() and pg_last_xlog_replay_location(), for monitoring the progress of replication. Fujii Masao, with additional hacking by me
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 38d577f87bb..274030195fb 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.532 2010/01/07 04:53:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.533 2010/01/15 09:19:04 heikki Exp $
*
*--------------------------------------------------------------------
*/
@@ -55,6 +55,7 @@
#include "postmaster/postmaster.h"
#include "postmaster/syslogger.h"
#include "postmaster/walwriter.h"
+#include "replication/walsender.h"
#include "storage/bufmgr.h"
#include "storage/fd.h"
#include "tcop/tcopprot.h"
@@ -494,6 +495,8 @@ const char *const config_group_names[] =
gettext_noop("Write-Ahead Log / Settings"),
/* WAL_CHECKPOINTS */
gettext_noop("Write-Ahead Log / Checkpoints"),
+ /* WAL_REPLICATION */
+ gettext_noop("Write-Ahead Log / Replication"),
/* QUERY_TUNING */
gettext_noop("Query Tuning"),
/* QUERY_TUNING_METHOD */
@@ -1698,6 +1701,26 @@ static struct config_int ConfigureNamesInt[] =
},
{
+ /* see max_connections */
+ {"max_wal_senders", PGC_POSTMASTER, WAL_REPLICATION,
+ gettext_noop("Sets the maximum number of simultaneously running WAL sender processes."),
+ NULL
+ },
+ &MaxWalSenders,
+ 0, 0, INT_MAX / 4, NULL, NULL
+ },
+
+ {
+ {"wal_sender_delay", PGC_SIGHUP, WAL_REPLICATION,
+ gettext_noop("WAL sender sleep time between WAL replications."),
+ NULL,
+ GUC_UNIT_MS
+ },
+ &WalSndDelay,
+ 200, 1, 10000, NULL, NULL
+ },
+
+ {
{"commit_delay", PGC_USERSET, WAL_SETTINGS,
gettext_noop("Sets the delay in microseconds between transaction commit and "
"flushing WAL to disk."),