Merge branch 'conninfo-fixes'

Refactor recovery.conf generation to take into account the node being
cloned from might not be the intended upstream node, e.g. "grandchild"
node being cloned direct from the master ("grandparent") rather than
the intended parent node.

This extends functionality introduced with Barman support and ensures
that behaviour of cascaded standby cloning is consistent, regardless
of cloning method.
This commit is contained in:
Ian Barwick
2016-09-05 13:16:31 +09:00
4 changed files with 644 additions and 274 deletions

View File

@@ -1584,6 +1584,7 @@ exit:
* ERR_MONITORING_FAIL (16) Unrecoverable error encountered during monitoring (repmgrd only)
* ERR_BAD_BACKUP_LABEL (17) Corrupt or unreadable backup label encountered (repmgr only)
* ERR_SWITCHOVER_FAIL (18) Error encountered during switchover (repmgr only)
* ERR_BARMAN (19) Unrecoverable error while accessing the barman server (repmgr only)
Support and Assistance

View File

@@ -38,5 +38,6 @@
#define ERR_MONITORING_FAIL 16
#define ERR_BAD_BACKUP_LABEL 17
#define ERR_SWITCHOVER_FAIL 18
#define ERR_BARMAN 19
#endif /* _ERRCODE_H_ */

905
repmgr.c

File diff suppressed because it is too large Load Diff

View File

@@ -58,6 +58,7 @@
#define OPT_CSV 8
#define OPT_NODE 9
#define OPT_WITHOUT_BARMAN 10
#define OPT_NO_UPSTREAM_CONNECTION 11
/* deprecated command line options */
#define OPT_INITDB_NO_PWPROMPT 999
@@ -85,6 +86,7 @@ typedef struct
bool ignore_external_config_files;
bool csv_mode;
bool without_barman;
bool no_upstream_connection;
char masterport[MAXLEN];
/*
* configuration file parameters which can be overridden on the
@@ -108,7 +110,7 @@ typedef struct
char recovery_min_apply_delay[MAXLEN];
} t_runtime_options;
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, false, false, false, false, false, false, "", "", "", "", "fast", "", 0, 0, "", ""}
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, false, false, false, false, false, false, false, "", "", "", "", "fast", "", 0, 0, "", ""}
struct BackupLabel
{
@@ -131,4 +133,11 @@ typedef struct
#define T_BASEBACKUP_OPTIONS_INITIALIZER { "", "" }
typedef struct
{
int size;
char **keywords;
char **values;
} t_conninfo_param_list;
#endif