summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/syncrep.c2
-rw-r--r--src/backend/utils/misc/guc.c2
-rw-r--r--src/include/replication/syncrep.h5
3 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c
index 0033b5559f3..ff6b328b382 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -62,7 +62,7 @@
#include "utils/ps_status.h"
/* User-settable parameters for sync rep */
-bool sync_rep_mode = false; /* Only set in user backends */
+bool synchronous_replication = false; /* Only set in user backends */
char *SyncRepStandbyNames;
static bool sync_standbys_defined = false; /* Is there at least one name? */
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 0bf18455995..d1b1c174277 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -759,7 +759,7 @@ static struct config_bool ConfigureNamesBool[] =
gettext_noop("Requests synchronous replication."),
NULL
},
- &sync_rep_mode,
+ &synchronous_replication,
false, NULL, NULL
},
{
diff --git a/src/include/replication/syncrep.h b/src/include/replication/syncrep.h
index 1c6d39238c4..9171eb61766 100644
--- a/src/include/replication/syncrep.h
+++ b/src/include/replication/syncrep.h
@@ -19,7 +19,8 @@
#include "storage/spin.h"
#include "utils/guc.h"
-#define SyncRepRequested() (sync_rep_mode)
+#define SyncRepRequested() \
+ (synchronous_replication && max_wal_senders > 0)
/* syncRepState */
#define SYNC_REP_NOT_WAITING 0
@@ -28,7 +29,7 @@
#define SYNC_REP_MUST_DISCONNECT 3
/* user-settable parameters for synchronous replication */
-extern bool sync_rep_mode;
+extern bool synchronous_replication;
extern char *SyncRepStandbyNames;
/* called by user backend */