mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 14:46:29 +00:00
Remove --bdr-only configuration option
This was required for a specific use case during pre-release development and is no longer needed now the physical streaming replication handling is implemented.
This commit is contained in:
@@ -1,4 +1,2 @@
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Only build repmgr for BDR */
|
||||
#undef BDR_ONLY
|
||||
|
||||
20
configure
vendored
20
configure
vendored
@@ -633,7 +633,6 @@ SHELL'
|
||||
ac_subst_files=''
|
||||
ac_user_opts='
|
||||
enable_option_checking
|
||||
with_bdr_only
|
||||
'
|
||||
ac_precious_vars='build_alias
|
||||
host_alias
|
||||
@@ -1244,11 +1243,6 @@ if test -n "$ac_init_help"; then
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||
--with-bdr-only BDR-only build
|
||||
|
||||
Some influential environment variables:
|
||||
PG_CONFIG Location to find pg_config for target PostgreSQL (default PATH)
|
||||
|
||||
@@ -1694,20 +1688,6 @@ ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-bdr_only was given.
|
||||
if test "${with_bdr_only+set}" = set; then :
|
||||
withval=$with_bdr_only;
|
||||
fi
|
||||
|
||||
if test "x$with_bdr_only" != "x"; then :
|
||||
|
||||
$as_echo "#define BDR_ONLY \"1\"" >>confdefs.h
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
|
||||
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
|
||||
if ${ac_cv_path_SED+:} false; then :
|
||||
|
||||
@@ -6,12 +6,6 @@ AC_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_ARG_VAR([PG_CONFIG], [Location to find pg_config for target PostgreSQL (default PATH)])
|
||||
|
||||
AC_ARG_WITH([bdr_only], [AS_HELP_STRING([--with-bdr-only], [BDR-only build])])
|
||||
AS_IF([test "x$with_bdr_only" != "x"],
|
||||
[AC_DEFINE([BDR_ONLY], ["1"], [Only build repmgr for BDR])]
|
||||
)
|
||||
|
||||
|
||||
AC_PROG_SED
|
||||
|
||||
if test -z "$PG_CONFIG"; then
|
||||
|
||||
@@ -737,7 +737,6 @@ main(int argc, char **argv)
|
||||
|
||||
if (repmgr_command != NULL)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
if (strcasecmp(repmgr_command, "PRIMARY") == 0 || strcasecmp(repmgr_command, "MASTER") == 0)
|
||||
{
|
||||
if (help_option == true)
|
||||
@@ -794,9 +793,6 @@ main(int argc, char **argv)
|
||||
action = WITNESS_UNREGISTER;
|
||||
}
|
||||
else if (strcasecmp(repmgr_command, "BDR") == 0)
|
||||
#else
|
||||
if (strcasecmp(repmgr_command, "BDR") == 0)
|
||||
#endif
|
||||
{
|
||||
if (help_option == true)
|
||||
{
|
||||
@@ -1157,7 +1153,6 @@ main(int argc, char **argv)
|
||||
|
||||
switch (action)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
/* PRIMARY */
|
||||
case PRIMARY_REGISTER:
|
||||
do_primary_register();
|
||||
@@ -1193,21 +1188,6 @@ main(int argc, char **argv)
|
||||
case WITNESS_UNREGISTER:
|
||||
do_witness_unregister();
|
||||
break;
|
||||
#else
|
||||
/* we won't ever reach here, but stop the compiler complaining */
|
||||
case PRIMARY_REGISTER:
|
||||
case PRIMARY_UNREGISTER:
|
||||
case STANDBY_CLONE:
|
||||
case STANDBY_REGISTER:
|
||||
case STANDBY_UNREGISTER:
|
||||
case STANDBY_PROMOTE:
|
||||
case STANDBY_FOLLOW:
|
||||
case STANDBY_SWITCHOVER:
|
||||
case WITNESS_REGISTER:
|
||||
case WITNESS_UNREGISTER:
|
||||
break;
|
||||
|
||||
#endif
|
||||
/* BDR */
|
||||
case BDR_REGISTER:
|
||||
do_bdr_register();
|
||||
@@ -1793,10 +1773,8 @@ do_help(void)
|
||||
print_help_header();
|
||||
|
||||
printf(_("Usage:\n"));
|
||||
#ifndef BDR_ONLY
|
||||
printf(_(" %s [OPTIONS] primary {register|unregister}\n"), progname());
|
||||
printf(_(" %s [OPTIONS] standby {register|unregister|clone|promote|follow}\n"), progname());
|
||||
#endif
|
||||
printf(_(" %s [OPTIONS] bdr {register|unregister}\n"), progname());
|
||||
printf(_(" %s [OPTIONS] node status\n"), progname());
|
||||
printf(_(" %s [OPTIONS] cluster {show|event|matrix|crosscheck}\n"), progname());
|
||||
|
||||
8
repmgr.c
8
repmgr.c
@@ -288,7 +288,6 @@ standby_get_last_updated(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
notify_follow_primary(PG_FUNCTION_ARGS)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
int primary_node_id = UNKNOWN_NODE_ID;
|
||||
|
||||
if (!shared_state)
|
||||
@@ -316,7 +315,7 @@ notify_follow_primary(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
LWLockRelease(shared_state->lock);
|
||||
#endif
|
||||
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
@@ -329,14 +328,12 @@ get_new_primary(PG_FUNCTION_ARGS)
|
||||
if (!shared_state)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
#ifndef BDR_ONLY
|
||||
LWLockAcquire(shared_state->lock, LW_SHARED);
|
||||
|
||||
if (shared_state->follow_new_primary == true)
|
||||
new_primary_node_id = shared_state->candidate_node_id;
|
||||
|
||||
LWLockRelease(shared_state->lock);
|
||||
#endif
|
||||
|
||||
if (new_primary_node_id == UNKNOWN_NODE_ID)
|
||||
PG_RETURN_NULL();
|
||||
@@ -348,7 +345,6 @@ get_new_primary(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
reset_voting_status(PG_FUNCTION_ARGS)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
if (!shared_state)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
@@ -366,7 +362,7 @@ reset_voting_status(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
LWLockRelease(shared_state->lock);
|
||||
#endif
|
||||
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ typedef enum
|
||||
static PGconn *upstream_conn = NULL;
|
||||
static PGconn *primary_conn = NULL;
|
||||
|
||||
#ifndef BDR_ONLY
|
||||
static FailoverState failover_state = FAILOVER_STATE_UNKNOWN;
|
||||
|
||||
static int primary_node_id = UNKNOWN_NODE_ID;
|
||||
@@ -85,15 +84,12 @@ static void update_monitoring_history(void);
|
||||
|
||||
static const char * format_failover_state(FailoverState failover_state);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* perform some sanity checks on the node's configuration */
|
||||
|
||||
void
|
||||
do_physical_node_check(void)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
/*
|
||||
* Check if node record is active - if not, and `failover=automatic`, the
|
||||
* node won't be considered as a promotion candidate; this often happens
|
||||
@@ -163,7 +159,6 @@ do_physical_node_check(void)
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +169,6 @@ do_physical_node_check(void)
|
||||
void
|
||||
monitor_streaming_primary(void)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
instr_time log_status_interval_start;
|
||||
PQExpBufferData event_details;
|
||||
|
||||
@@ -485,14 +479,12 @@ loop:
|
||||
|
||||
sleep(config_file_options.monitor_interval_secs);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
monitor_streaming_standby(void)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
RecordStatus record_status;
|
||||
instr_time log_status_interval_start;
|
||||
PQExpBufferData event_details;
|
||||
@@ -1019,14 +1011,12 @@ loop:
|
||||
|
||||
sleep(config_file_options.monitor_interval_secs);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
monitor_streaming_witness(void)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
instr_time log_status_interval_start;
|
||||
instr_time witness_sync_interval_start;
|
||||
|
||||
@@ -1351,13 +1341,12 @@ loop:
|
||||
|
||||
sleep(config_file_options.monitor_interval_secs);
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifndef BDR_ONLY
|
||||
static bool
|
||||
do_primary_failover(void)
|
||||
{
|
||||
@@ -2722,7 +2711,6 @@ format_failover_state(FailoverState failover_state)
|
||||
return "UNKNOWN_FAILOVER_STATE";
|
||||
}
|
||||
|
||||
#endif /* #ifndef BDR_ONLY */
|
||||
|
||||
void
|
||||
close_connections_physical()
|
||||
|
||||
@@ -400,7 +400,6 @@ start_monitoring(void)
|
||||
{
|
||||
switch (local_node_info.type)
|
||||
{
|
||||
#ifndef BDR_ONLY
|
||||
case PRIMARY:
|
||||
monitor_streaming_primary();
|
||||
break;
|
||||
@@ -409,12 +408,6 @@ start_monitoring(void)
|
||||
break;
|
||||
case WITNESS:
|
||||
monitor_streaming_witness();
|
||||
break;
|
||||
#else
|
||||
case PRIMARY:
|
||||
case STANDBY:
|
||||
return;
|
||||
#endif
|
||||
case BDR:
|
||||
monitor_bdr();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user