mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
optional fast checkpointing
commandline -X/--fast-checkpoint
This commit is contained in:
1
HISTORY
1
HISTORY
@@ -1,6 +1,7 @@
|
|||||||
2.0.3 2015-??-??
|
2.0.3 2015-??-??
|
||||||
Add option "--initdb-no-pwprompt" (Ian)
|
Add option "--initdb-no-pwprompt" (Ian)
|
||||||
Add -S/--superuser option for witness database creation Ian)
|
Add -S/--superuser option for witness database creation Ian)
|
||||||
|
Add -X/--fast-checkpoint option for cloning (Christoph)
|
||||||
|
|
||||||
2.0.2 2015-02-17
|
2.0.2 2015-02-17
|
||||||
Add "--checksum" in rsync when using "--force" (Jaime)
|
Add "--checksum" in rsync when using "--force" (Jaime)
|
||||||
|
|||||||
12
repmgr.c
12
repmgr.c
@@ -110,6 +110,7 @@ main(int argc, char **argv)
|
|||||||
{"wait", no_argument, NULL, 'W'},
|
{"wait", no_argument, NULL, 'W'},
|
||||||
{"ignore-rsync-warning", no_argument, NULL, 'I'},
|
{"ignore-rsync-warning", no_argument, NULL, 'I'},
|
||||||
{"verbose", no_argument, NULL, 'v'},
|
{"verbose", no_argument, NULL, 'v'},
|
||||||
|
{"fast-checkpoint", no_argument, NULL, 'X'},
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -134,7 +135,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "d:h:p:U:D:l:f:R:w:k:FWIv", long_options,
|
while ((c = getopt_long(argc, argv, "d:h:p:U:D:l:f:R:w:k:FWIvX", long_options,
|
||||||
&optindex)) != -1)
|
&optindex)) != -1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -187,6 +188,9 @@ main(int argc, char **argv)
|
|||||||
case 'v':
|
case 'v':
|
||||||
runtime_options.verbose = true;
|
runtime_options.verbose = true;
|
||||||
break;
|
break;
|
||||||
|
case 'X':
|
||||||
|
runtime_options.fast_checkpoint = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
@@ -1106,8 +1110,9 @@ do_standby_clone(void)
|
|||||||
*/
|
*/
|
||||||
sqlquery_snprintf(
|
sqlquery_snprintf(
|
||||||
sqlquery,
|
sqlquery,
|
||||||
"SELECT pg_xlogfile_name(pg_start_backup('repmgr_standby_clone_%ld'))",
|
"SELECT pg_xlogfile_name(pg_start_backup('repmgr_standby_clone_%ld', '%c'))",
|
||||||
time(NULL));
|
time(NULL),
|
||||||
|
runtime_options.fast_checkpoint ? 't' : 'f');
|
||||||
log_debug(_("standby clone: %s\n"), sqlquery);
|
log_debug(_("standby clone: %s\n"), sqlquery);
|
||||||
res = PQexec(conn, sqlquery);
|
res = PQexec(conn, sqlquery);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
@@ -1944,6 +1949,7 @@ help(const char *progname)
|
|||||||
printf(_(" -F, --force force potentially dangerous operations\n" \
|
printf(_(" -F, --force force potentially dangerous operations\n" \
|
||||||
" to happen\n"));
|
" to happen\n"));
|
||||||
printf(_(" -W, --wait wait for a master to appear\n"));
|
printf(_(" -W, --wait wait for a master to appear\n"));
|
||||||
|
printf(_(" -X, --fast-checkpoint force immediate checkpoint when cloning\n"));
|
||||||
|
|
||||||
printf(_("\n%s performs some tasks like clone a node, promote it or making follow\n"), progname);
|
printf(_("\n%s performs some tasks like clone a node, promote it or making follow\n"), progname);
|
||||||
printf(_("another node and then exits.\n\n"));
|
printf(_("another node and then exits.\n\n"));
|
||||||
|
|||||||
3
repmgr.h
3
repmgr.h
@@ -61,6 +61,7 @@ typedef struct
|
|||||||
bool force;
|
bool force;
|
||||||
bool wait_for_master;
|
bool wait_for_master;
|
||||||
bool ignore_rsync_warn;
|
bool ignore_rsync_warn;
|
||||||
|
bool fast_checkpoint;
|
||||||
|
|
||||||
char masterport[MAXLEN];
|
char masterport[MAXLEN];
|
||||||
char localport[MAXLEN];
|
char localport[MAXLEN];
|
||||||
@@ -69,6 +70,6 @@ typedef struct
|
|||||||
int keep_history;
|
int keep_history;
|
||||||
} t_runtime_options;
|
} t_runtime_options;
|
||||||
|
|
||||||
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, "", "", 0 }
|
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, "", "", 0 }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user