Add an option for "no-history" mode, where repmgrd just checks the

conectivity of master but don't INSERT any data into it
This commit is contained in:
Jaime Casanova
2012-07-04 10:07:31 -05:00
parent ac5a9d1fd6
commit f5e57aa433

View File

@@ -65,6 +65,7 @@ const char *progname;
char *config_file = DEFAULT_CONFIG_FILE;
bool verbose = false;
bool no_history = false;
char repmgr_schema[MAXLEN];
/*
@@ -113,6 +114,7 @@ main(int argc, char **argv)
{
{"config", required_argument, NULL, 'f'},
{"verbose", no_argument, NULL, 'v'},
{"no-history", no_argument, NULL, 'N'},
{NULL, 0, NULL, 0}
};
@@ -137,7 +139,7 @@ main(int argc, char **argv)
}
}
while ((c = getopt_long(argc, argv, "f:v", long_options, &optindex)) != -1)
while ((c = getopt_long(argc, argv, "f:v:N", long_options, &optindex)) != -1)
{
switch (c)
{
@@ -147,6 +149,9 @@ main(int argc, char **argv)
case 'v':
verbose = true;
break;
case 'N':
no_history = true;
break;
default:
usage();
exit(ERR_BAD_CONFIG);
@@ -352,6 +357,10 @@ WitnessMonitor(void)
exit(0);
}
/* Fast path for the case where no history is requested */
if (no_history)
return;
/*
* Cancel any query that is still being executed,
* so i can insert the current record
@@ -469,6 +478,10 @@ StandbyMonitor(void)
exit(ERR_PROMOTED);
}
/* Fast path for the case where no history is requested */
if (no_history)
return;
/*
* Cancel any query that is still being executed,
* so i can insert the current record