mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
Allow 'primary' as synonym for 'master'.
"Primary" is the term preferred in the PostgreSQL documentation, so we should at least support it. Practically this means it's possible to write "rempgr primary register" in place of "repmgr master register". The next feature-release should replace "master" with "primary" in the documentation and log messages. Per gripe in Github #112.
This commit is contained in:
@@ -453,6 +453,8 @@ its port if is different from the default one.
|
||||
Registers a master in a cluster. This command needs to be executed before any
|
||||
standby nodes are registered.
|
||||
|
||||
`primary register` can be used as an alias for `master register`.
|
||||
|
||||
* `standby register`
|
||||
|
||||
Registers a standby with `repmgr`. This command needs to be executed to enable
|
||||
|
||||
6
repmgr.c
6
repmgr.c
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* Commands implemented are:
|
||||
*
|
||||
* MASTER REGISTER
|
||||
* [ MASTER | PRIMARY ] REGISTER
|
||||
*
|
||||
* STANDBY REGISTER
|
||||
* STANDBY UNREGISTER
|
||||
@@ -316,6 +316,8 @@ main(int argc, char **argv)
|
||||
server_mode = argv[optind++];
|
||||
if (strcasecmp(server_mode, "STANDBY") != 0 &&
|
||||
strcasecmp(server_mode, "MASTER") != 0 &&
|
||||
/* allow PRIMARY as synonym for MASTER */
|
||||
strcasecmp(server_mode, "PRIMARY") != 0 &&
|
||||
strcasecmp(server_mode, "WITNESS") != 0 &&
|
||||
strcasecmp(server_mode, "CLUSTER") != 0)
|
||||
{
|
||||
@@ -330,7 +332,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
server_cmd = argv[optind++];
|
||||
/* check posibilities for all server modes */
|
||||
if (strcasecmp(server_mode, "MASTER") == 0)
|
||||
if (strcasecmp(server_mode, "MASTER") == 0 || strcasecmp(server_mode, "PRIMARY") == 0 )
|
||||
{
|
||||
if (strcasecmp(server_cmd, "REGISTER") == 0)
|
||||
action = MASTER_REGISTER;
|
||||
|
||||
Reference in New Issue
Block a user