!1363 新增版本控制,在版本号比备机归档版本的版本号要小的时候不允许创建归档槽

Merge pull request !1363 from Cross-罗/version_ctl
This commit is contained in:
opengauss-bot 2021-11-19 01:29:28 +00:00 committed by Gitee
commit 78af441670
3 changed files with 8 additions and 1 deletions

View File

@ -59,7 +59,7 @@ bool open_join_children = true;
bool will_shutdown = false;
/* hard-wired binary version number */
const uint32 GRAND_VERSION_NUM = 92298;
const uint32 GRAND_VERSION_NUM = 92299;
const uint32 MATVIEW_VERSION_NUM = 92213;
const uint32 PARTIALPUSH_VERSION_NUM = 92087;
@ -77,6 +77,7 @@ const uint32 RANGE_LIST_DISTRIBUTION_VERSION_NUM = 92272;
const uint32 BACKUP_SLOT_VERSION_NUM = 92282;
const uint32 ML_OPT_MODEL_VERSION_NUM = 92284;
const uint32 FIX_SQL_ADD_RELATION_REF_COUNT = 92291;
const uint32 STANDBY_ARCHIVING_VERSION_NUM = 92299;
/* This variable indicates wheather the instance is in progress of upgrade as a whole */
uint32 volatile WorkingGrandVersionNum = GRAND_VERSION_NUM;

View File

@ -1807,6 +1807,11 @@ ObsArchiveConfig* formObsConfigFromStr(char *content, bool encrypted)
goto FAILURE;
}
/* cannot create archive slot when the version number is not larger than the standby archive version */
if ((param_num == 4 || param_num == 8) && t_thrd.proc->workingVersionNum < STANDBY_ARCHIVING_VERSION_NUM) {
goto FAILURE;
}
if (param_num == 7) {
obs_config->media_type = ARCHIVE_OBS;
} else {

View File

@ -53,6 +53,7 @@ extern const uint32 PRIVS_VERSION_NUM;
extern const uint32 ML_OPT_MODEL_VERSION_NUM;
extern const uint32 RANGE_LIST_DISTRIBUTION_VERSION_NUM;
extern const uint32 FIX_SQL_ADD_RELATION_REF_COUNT;
extern const uint32 STANDBY_ARCHIVING_VERSION_NUM;
#define INPLACE_UPGRADE_PRECOMMIT_VERSION 1