switchover: check for pending archive files on the demotion candidate

If the current primary (demotion candidate) still has any files to archive,
it will delay the shutdown until all files are archived. If there is a
substantial number of files, and/or the archive command executes slowly,
this will probably lead to an unwelcome delay in the switchover process.
This commit is contained in:
Ian Barwick
2017-08-08 00:37:20 +09:00
parent 068ecc963d
commit 2499b42ef8
12 changed files with 543 additions and 67 deletions

View File

@@ -72,6 +72,10 @@ typedef struct
char restore_command[MAXLEN];
TablespaceList tablespace_mapping;
/* node check settings */
int archiver_lag_warning;
int archiver_lag_critical;
/* repmgrd settings */
failover_mode_opt failover_mode;
char location[MAXLEN];
@@ -124,6 +128,8 @@ typedef struct
"", "", "", DEFAULT_LOG_STATUS_INTERVAL, \
/* standby clone settings */ \
false, "", "", "", "", { NULL, NULL }, \
/* node check settings */ \
DEFAULT_ARCHIVER_LAG_WARNING, DEFAULT_ARCHIVER_LAG_CRITICAL, \
/* repmgrd settings */ \
FAILOVER_MANUAL, DEFAULT_LOCATION, DEFAULT_PRIORITY, "", "", \
DEFAULT_MONITORING_INTERVAL, \