Add initial code for remaining "repmgr standby" commands

This commit is contained in:
Ian Barwick
2017-05-09 22:52:56 +09:00
parent 0a8e9c2a32
commit 1aa6df95a9
3 changed files with 64 additions and 2 deletions

View File

@@ -1009,9 +1009,41 @@ do_standby_unregister(void)
log_info(_("standby unregistration complete"));
return;
}
void
do_standby_promote(void)
{
return;
}
void
do_standby_follow(void)
{
return;
}
void
do_standby_switchover(void)
{
return;
}
void
do_standby_archive_config(void)
{
return;
}
void
do_standby_restore_config(void)
{
return;
}
static void
check_source_server()
{

View File

@@ -9,6 +9,11 @@
extern void do_standby_clone(void);
extern void do_standby_register(void);
extern void do_standby_unregister(void);
extern void do_standby_promote(void);
extern void do_standby_follow(void);
extern void do_standby_switchover(void);
extern void do_standby_archive_config(void);
extern void do_standby_restore_config(void);
typedef struct
{

View File

@@ -1,5 +1,5 @@
/*
* repmgr.c - Command interpreter for the repmgr package
* repmgr-client.c - Command interpreter for the repmgr package
*
* Copyright (c) 2ndQuadrant, 2010-2017
*
@@ -561,6 +561,16 @@ main(int argc, char **argv)
action = STANDBY_REGISTER;
else if(strcasecmp(repmgr_action, "UNREGISTER") == 0)
action = STANDBY_UNREGISTER;
else if (strcasecmp(repmgr_action, "PROMOTE") == 0)
action = STANDBY_PROMOTE;
else if (strcasecmp(repmgr_action, "FOLLOW") == 0)
action = STANDBY_FOLLOW;
else if (strcasecmp(repmgr_action, "SWITCHOVER") == 0)
action = STANDBY_SWITCHOVER;
else if (strcasecmp(repmgr_action, "ARCHIVE-CONFIG") == 0)
action = STANDBY_ARCHIVE_CONFIG;
else if (strcasecmp(repmgr_action, "RESTORE-CONFIG") == 0)
action = STANDBY_RESTORE_CONFIG;
}
else if(strcasecmp(repmgr_node_type, "CLUSTER") == 0)
@@ -820,6 +830,21 @@ main(int argc, char **argv)
case STANDBY_UNREGISTER:
do_standby_unregister();
break;
case STANDBY_PROMOTE:
do_standby_promote();
break;
case STANDBY_FOLLOW:
do_standby_follow();
break;
case STANDBY_SWITCHOVER:
do_standby_switchover();
break;
case STANDBY_ARCHIVE_CONFIG:
do_standby_archive_config();
break;
case STANDBY_RESTORE_CONFIG:
do_standby_restore_config();
break;
case CLUSTER_EVENT:
do_cluster_event();