mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Clarify calls to check_primary_status()
Use a constant rather than a magic number to indicate non-provision of elapsed degraded monitoring time.
This commit is contained in:
1
repmgr.h
1
repmgr.h
@@ -63,6 +63,7 @@
|
|||||||
#define ELECTION_RERUN_NOTIFICATION -2
|
#define ELECTION_RERUN_NOTIFICATION -2
|
||||||
#define VOTING_TERM_NOT_SET -1
|
#define VOTING_TERM_NOT_SET -1
|
||||||
#define ARCHIVE_STATUS_DIR_ERROR -1
|
#define ARCHIVE_STATUS_DIR_ERROR -1
|
||||||
|
#define NO_DEGRADED_MONITORING_ELAPSED -1
|
||||||
|
|
||||||
#define BDR2_REPLICATION_SET_NAME "repmgr"
|
#define BDR2_REPLICATION_SET_NAME "repmgr"
|
||||||
|
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ monitor_streaming_primary(void)
|
|||||||
* check that the local node is still primary, otherwise switch
|
* check that the local node is still primary, otherwise switch
|
||||||
* to standby monitoring
|
* to standby monitoring
|
||||||
*/
|
*/
|
||||||
if (check_primary_status(-1) == false)
|
if (check_primary_status(NO_DEGRADED_MONITORING_ELAPSED) == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
goto loop;
|
goto loop;
|
||||||
@@ -423,7 +423,7 @@ monitor_streaming_primary(void)
|
|||||||
loop:
|
loop:
|
||||||
|
|
||||||
/* check node is still primary, if not restart monitoring */
|
/* check node is still primary, if not restart monitoring */
|
||||||
if (check_primary_status(-1) == false)
|
if (check_primary_status(NO_DEGRADED_MONITORING_ELAPSED) == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* emit "still alive" log message at regular intervals, if requested */
|
/* emit "still alive" log message at regular intervals, if requested */
|
||||||
|
|||||||
Reference in New Issue
Block a user