diff --git a/HISTORY b/HISTORY
index a5531ae5..052c962a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,4 +1,4 @@
-4.0.6 2018-06-??
+4.0.6 2018-06-14
repmgr: (witness register) prevent registration of a witness server with the
same name as an existing node (Ian)
repmgr: (standby follow) check node has actually connected to new primary
@@ -13,6 +13,8 @@
GitHub #442 (Ian)
repmgr: when using --dry-run, force log level to INFO to ensure output
will always be displayed; GitHub #441 (Ian)
+ repmgr: (cluster matrix/crosscheck) return non-zero exit code if node
+ connection issues detected; GitHub #447 (Ian)
repmgrd: ensure local node is counted as quorum member; GitHub #439 (Ian)
4.0.5 2018-05-02
diff --git a/doc/appendix-release-notes.sgml b/doc/appendix-release-notes.sgml
index e361c177..9b1d51b1 100644
--- a/doc/appendix-release-notes.sgml
+++ b/doc/appendix-release-notes.sgml
@@ -28,6 +28,40 @@
for more details.
+
+ Usability enhancements
+
+
+
+
+
+ repmgr cluster crosscheck and
+ repmgr cluster matrix:
+ return non-zero exit code if node connection issues detected (GitHub #447)
+
+
+
+
+
+ repmgr standby clone:
+ Improve handling of external configuration file copying, including consideration in
+ check
+ (GitHub #443)
+
+
+
+
+
+ When using , force log level to INFO
+ to ensure output will always be displayed
+ (GitHub #441)
+
+
+
+
+
+
+
Bug fixes
@@ -51,15 +85,6 @@
-
-
- repmgr standby clone:
- Improve handling of external configuration file copying, including consideration in
- check
- (GitHub #443)
-
-
-
repmgr standby clone:
@@ -84,14 +109,6 @@
-
-
- When using , force log level to INFO
- to ensure output will always be displayed
- (GitHub #441)
-
-
-
repmgrd: ensure local node is counted as quorum member
diff --git a/doc/repmgr-cluster-crosscheck.sgml b/doc/repmgr-cluster-crosscheck.sgml
index 77c98bc7..c3c0f2f2 100644
--- a/doc/repmgr-cluster-crosscheck.sgml
+++ b/doc/repmgr-cluster-crosscheck.sgml
@@ -38,5 +38,34 @@
and therefore determine the state of outbound connections from that node.
+
+
+ Exit codes
+
+ Following exit codes can be emitted by repmgr cluster crosscheck:
+
+
+
+
+
+
+
+ The check completed successfully and all nodes are reachable.
+
+
+
+
+
+
+
+
+ One or more nodes could not be reached.
+
+
+
+
+
+
+
diff --git a/doc/repmgr-cluster-matrix.sgml b/doc/repmgr-cluster-matrix.sgml
index 30c0b2a9..fbc8aff2 100644
--- a/doc/repmgr-cluster-matrix.sgml
+++ b/doc/repmgr-cluster-matrix.sgml
@@ -97,5 +97,35 @@
useful result.
+
+
+
+ Exit codes
+
+ Following exit codes can be emitted by repmgr cluster matrix:
+
+
+
+
+
+
+
+ The check completed successfully and all nodes are reachable.
+
+
+
+
+
+
+
+
+ One or more nodes could not be reached.
+
+
+
+
+
+
+
diff --git a/doc/repmgr-standby-switchover.sgml b/doc/repmgr-standby-switchover.sgml
index 485c6e10..e0165d6f 100644
--- a/doc/repmgr-standby-switchover.sgml
+++ b/doc/repmgr-standby-switchover.sgml
@@ -199,7 +199,7 @@
Exit codes
- Following exit codes can be emitted by repmgr standby switchover:
+ Following exit codes can be emitted by repmgr standby switchover:
@@ -227,7 +227,7 @@
The switchover was executed but a problem was encountered.
Typically this means the former primary could not be reattached
- as a standby.
+ as a standby. Check preceding log messages for more information.
diff --git a/errcode.h b/errcode.h
index 5cf39b7d..481c0fe5 100644
--- a/errcode.h
+++ b/errcode.h
@@ -46,5 +46,6 @@
#define ERR_SWITCHOVER_INCOMPLETE 22
#define ERR_FOLLOW_FAIL 23
#define ERR_REJOIN_FAIL 24
+#define ERR_CLUSTER_CHECK 25
#endif /* _ERRCODE_H_ */
diff --git a/repmgr-action-cluster.c b/repmgr-action-cluster.c
index 68c30be7..ba3f6674 100644
--- a/repmgr-action-cluster.c
+++ b/repmgr-action-cluster.c
@@ -569,6 +569,8 @@ do_cluster_crosscheck(void)
t_node_status_cube **cube;
+ bool error_found = false;
+
n = build_cluster_crosscheck(&cube, &name_length);
if (runtime_options.output_mode == OM_CSV)
{
@@ -648,9 +650,11 @@ do_cluster_crosscheck(void)
{
case -2:
c = '?';
+ error_found = true;
break;
case -1:
c = 'x';
+ error_found = true;
break;
case 0:
c = '*';
@@ -689,6 +693,11 @@ do_cluster_crosscheck(void)
free(cube);
}
+
+ if (error_found == true)
+ {
+ exit(ERR_CLUSTER_CHECK);
+ }
}
@@ -704,6 +713,8 @@ do_cluster_matrix()
t_node_matrix_rec **matrix_rec_list;
+ bool error_found = false;
+
n = build_cluster_matrix(&matrix_rec_list, &name_length);
if (runtime_options.output_mode == OM_CSV)
@@ -742,9 +753,11 @@ do_cluster_matrix()
{
case -2:
c = '?';
+ error_found = true;
break;
case -1:
c = 'x';
+ error_found = true;
break;
case 0:
c = '*';
@@ -770,6 +783,11 @@ do_cluster_matrix()
}
free(matrix_rec_list);
+
+ if (error_found == true)
+ {
+ exit(ERR_CLUSTER_CHECK);
+ }
}