mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Decouple extension version check from binary version
Until now the extension version has always moved in lock-step with the binary version, but that doesn't always need to be the case, so make it possible to have an extension version which does not match the binary version.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#define REPMGR_VERSION_DATE ""
|
||||
#define REPMGR_VERSION "5.3dev"
|
||||
#define REPMGR_VERSION_NUM 50300
|
||||
#define REPMGR_EXTENSION_VERSION "5.2"
|
||||
#define REPMGR_EXTENSION_NUM 50200
|
||||
#define REPMGR_RELEASE_DATE "2021-XX-XX"
|
||||
#define PG_ACTUAL_VERSION_NUM
|
||||
|
||||
14
repmgrd.c
14
repmgrd.c
@@ -396,13 +396,14 @@ main(int argc, char **argv)
|
||||
* extension is the latest available according to "pg_available_extensions" -
|
||||
* - does our (major) version match that?
|
||||
*/
|
||||
log_verbose(LOG_DEBUG, "binary version: %i; extension version: %i",
|
||||
REPMGR_VERSION_NUM, extversions.installed_version_num);
|
||||
if ((REPMGR_VERSION_NUM/100) < (extversions.installed_version_num / 100))
|
||||
log_verbose(LOG_DEBUG, "expected extension version: %i; extension version: %i",
|
||||
REPMGR_EXTENSION_NUM, extversions.installed_version_num);
|
||||
if ((REPMGR_EXTENSION_NUM/100) < (extversions.installed_version_num / 100))
|
||||
{
|
||||
log_error(_("this \"repmgr\" version is older than the installed \"repmgr\" extension version"));
|
||||
log_detail(_("\"repmgr\" version %s is installed but extension is version %s"),
|
||||
log_detail(_("\"repmgr\" version %s providing extension version %s is installed but extension is version %s"),
|
||||
REPMGR_VERSION,
|
||||
REPMGR_EXTENSION_VERSION,
|
||||
extversions.installed_version);
|
||||
log_hint(_("update the repmgr binaries to match the installed extension version"));
|
||||
|
||||
@@ -410,11 +411,12 @@ main(int argc, char **argv)
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
if ((REPMGR_VERSION_NUM/100) > (extversions.installed_version_num / 100))
|
||||
if ((REPMGR_EXTENSION_NUM/100) > (extversions.installed_version_num / 100))
|
||||
{
|
||||
log_error(_("this \"repmgr\" version is newer than the installed \"repmgr\" extension version"));
|
||||
log_detail(_("\"repmgr\" version %s is installed but extension is version %s"),
|
||||
log_detail(_("\"repmgr\" version %s providing extension version %s is installed but extension is version %s"),
|
||||
REPMGR_VERSION,
|
||||
REPMGR_EXTENSION_VERSION,
|
||||
extversions.installed_version);
|
||||
log_hint(_("update the installed extension version by executing \"ALTER EXTENSION repmgr UPDATE\""));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user