repmgr standby switchover: add sanity check for pg_rewind useability

pg_rewind will only be executed on a demoted primary if explictly
requested, to prevent transactions on the primary, which
were never replicated, from being automatically overwritten.

If --force-rewind is provided, we'll need to check pg_rewind
is actually useable before we need to use it.
This commit is contained in:
Ian Barwick
2017-08-04 00:38:07 +09:00
parent 0815accdef
commit 5948cf6cda
8 changed files with 122 additions and 21 deletions

View File

@@ -18,13 +18,10 @@ typedef struct
ControlFileData *control_file;
} ControlFileInfo;
extern DBState
get_db_state(char *data_directory);
DBState get_db_state(const char *data_directory);
const char * describe_db_state(DBState state);
int get_data_checksum_version(const char *data_directory);
extern const char *
describe_db_state(DBState state);
extern XLogRecPtr
get_latest_checkpoint_location(char *data_directory);
extern XLogRecPtr get_latest_checkpoint_location(const char *data_directory);
#endif /* _CONTROLDATA_H_ */