!720 未搭建容灾关系的集群执行gs_sdr stop正常报错

Merge pull request !720 from 薛蒙恩/sdr_normal_stop
This commit is contained in:
opengauss_bot 2024-03-18 02:03:20 +00:00 committed by Gitee
commit 01fee11b9b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 11 additions and 2 deletions

View File

@ -414,11 +414,18 @@ class StreamingBase(object):
"""
Streaming step
"""
step = -1
if os.path.isfile(self.step_file_path):
step = 0
if not os.path.exists(os.path.dirname(self.step_file_path)):
# If streaming dir(streaming_cabin) does not exist,
# it means the cluster is not a DR cluster, return -1.
step = -1
elif os.path.isfile(self.step_file_path):
step_list = FileUtil.readFile(self.step_file_path)
if step_list:
step = int(step_list[0].split("_")[0])
# When streaming dir exists but the step file does not exist,
# it means the cluster is a DR cluster but it is in archive or recovery
# and not in any operation process(start, stop, failover, switchover), return 0.
if step == -1:
self.logger.log("Got the step for action:[%s]." % self.params.task)
else:

View File

@ -30,6 +30,8 @@ class StreamingStopHandler(StreamingBase):
"""
First step for streaming stop
"""
if step == -1:
self.logger.logExit("No need to stop because the cluster is not a disaster cluster.")
if step >= 2:
return
self.logger.debug("Start first step of streaming stop.")