From 91d2dfd761485926234e5451598257c87102ddbe Mon Sep 17 00:00:00 2001 From: luozihao <1165977584@qq.com> Date: Thu, 18 Nov 2021 20:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=BD=92=E6=A1=A3=E6=A7=BD=E7=9A=84?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/init/globals.cpp | 3 ++- src/gausskernel/storage/replication/slot.cpp | 5 +++++ src/include/miscadmin.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/backend/utils/init/globals.cpp b/src/common/backend/utils/init/globals.cpp index fecd9de7c..099d4c783 100644 --- a/src/common/backend/utils/init/globals.cpp +++ b/src/common/backend/utils/init/globals.cpp @@ -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; diff --git a/src/gausskernel/storage/replication/slot.cpp b/src/gausskernel/storage/replication/slot.cpp index 917e74817..90504fab1 100644 --- a/src/gausskernel/storage/replication/slot.cpp +++ b/src/gausskernel/storage/replication/slot.cpp @@ -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 { diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index d37304209..4db86ca83 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -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