!82 校验enable_stream_replication参数为off的时候 升级抛出异常
Merge pull request !82 from gyt0221/master
This commit is contained in:
commit
5b90d9cded
@ -124,7 +124,9 @@ BACKUP_DIR_LIST = ['global', 'pg_clog', 'pg_xlog', 'pg_multixact',
|
||||
BACKUP_DIR_LIST_BASE = ['global', 'pg_clog', 'pg_csnlog']
|
||||
BACKUP_DIR_LIST_64BIT_XID = ['pg_multixact', 'pg_replslot', 'pg_notify',
|
||||
'pg_subtrans', 'pg_twophase']
|
||||
|
||||
VALUE_OFF = ["off", "false", "0", "no"]
|
||||
VALUE_ON = ["on", "true", "1", "yes"]
|
||||
DN_GUC = ["upgrade_mode", "enable_stream_replication"]
|
||||
FIRST_GREY_UPGRADE_NUM = 92
|
||||
|
||||
UPGRADE_PRECOMMIT_NUM = 0.001
|
||||
@ -156,3 +158,5 @@ COMBIN_NUM = 30
|
||||
ON_INPLACE_UPGRADE = "IsInplaceUpgrade"
|
||||
MAX_APP_SIZE = 2000
|
||||
UPGRADE_VERSION_64bit_xid = 91.208
|
||||
ENABLE_STREAM_REPLICATION_VERSION = "92.149"
|
||||
ENABLE_STREAM_REPLICATION_NAME = "enable_stream_replication"
|
||||
|
@ -4484,6 +4484,11 @@ class UpgradeImpl:
|
||||
self.context.logger.log("Failed to check upgrade environment.",
|
||||
"constant")
|
||||
raise Exception(str(e))
|
||||
if not self.context.forceRollback:
|
||||
if self.context.oldClusterNumber >= \
|
||||
Const.ENABLE_STREAM_REPLICATION_VERSION:
|
||||
self.check_gucval_is_inval_given(
|
||||
Const.ENABLE_STREAM_REPLICATION_NAME, Const.VALUE_ON)
|
||||
try:
|
||||
if self.context.action == Const.ACTION_INPLACE_UPGRADE:
|
||||
self.context.logger.log(
|
||||
@ -4500,6 +4505,19 @@ class UpgradeImpl:
|
||||
self.context.logger.log(
|
||||
"Successfully checked upgrade environment.", "constant")
|
||||
|
||||
def check_gucval_is_inval_given(self, guc_name, val_list):
|
||||
"""
|
||||
Checks whether a given parameter is a given value list in a
|
||||
given instance list.
|
||||
"""
|
||||
self.context.logger.debug("checks whether the parameter:{0} is "
|
||||
"the value:{1}.".format(guc_name, val_list))
|
||||
guc_str = "{0}:{1}".format(guc_name, ",".join(val_list))
|
||||
self.checkParam(guc_str)
|
||||
self.context.logger.debug("Success to check the parameter:{0} value "
|
||||
"is in the value:{1}.".format(guc_name,
|
||||
val_list))
|
||||
|
||||
def checkDifferentVersion(self):
|
||||
"""
|
||||
if the cluster has only one version. no need to check
|
||||
|
@ -1813,12 +1813,11 @@ def checkGucValue():
|
||||
"""
|
||||
key = g_opts.gucStr.split(':')[0].strip()
|
||||
value = g_opts.gucStr.split(':')[1].strip()
|
||||
if key == "upgrade_from":
|
||||
instances = g_dbNode.cmagents
|
||||
fileName = "cm_agent.conf"
|
||||
elif key == "upgrade_mode":
|
||||
#instances = g_dbNode.coordinators
|
||||
#instances.extend(g_dbNode.datanodes)
|
||||
if value in const.VALUE_OFF:
|
||||
value = const.VALUE_OFF
|
||||
if value in const.VALUE_ON:
|
||||
value = const.VALUE_ON
|
||||
if key in const.DN_GUC:
|
||||
instances = g_dbNode.datanodes
|
||||
fileName = "postgresql.conf"
|
||||
else:
|
||||
@ -1849,7 +1848,7 @@ def checkGucValue():
|
||||
realValue = realValue.split('#')[0].strip()
|
||||
g_logger.debug("[key:%s]: Realvalue %s, ExpectValue %s" % (
|
||||
key, str(realValue), str(value)))
|
||||
if str(value) != str(realValue):
|
||||
if str(realValue) not in str(value):
|
||||
raise Exception(
|
||||
ErrorCode.GAUSS_521["GAUSS_52102"] % key
|
||||
+ " Real value %s, expect value %s"
|
||||
|
Loading…
x
Reference in New Issue
Block a user