From 76d8e4bd5f45394e38dc807c0132a45cc736c39d Mon Sep 17 00:00:00 2001 From: hf0 Date: Thu, 22 Jul 2021 10:58:16 +0800 Subject: [PATCH] optimize ps->check_can_start_service() interface. --- refactor.sh | 1 + src/storage/ob_partition_service.cpp | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 refactor.sh diff --git a/refactor.sh b/refactor.sh new file mode 100644 index 0000000000..a9bf588e2f --- /dev/null +++ b/refactor.sh @@ -0,0 +1 @@ +#!/bin/bash diff --git a/src/storage/ob_partition_service.cpp b/src/storage/ob_partition_service.cpp index f500dcf9a1..86e3f7981d 100644 --- a/src/storage/ob_partition_service.cpp +++ b/src/storage/ob_partition_service.cpp @@ -10358,6 +10358,7 @@ int ObPartitionService::check_can_start_service( ObPartitionKey tmp_key; int64_t timestamp = 0; bool is_all_unreachable_partition = true; + can_start_service = true; if (OB_UNLIKELY(!is_inited_)) { ret = OB_NOT_INIT; @@ -10365,6 +10366,9 @@ int ObPartitionService::check_can_start_service( } else if (!is_running_) { ret = OB_NOT_RUNNING; TRANS_LOG(WARN, "partition service not running", K(ret)); + } else if (is_service_started()) { + // already start service + can_start_service = true; } else if (is_empty()) { // observer is starting... can_start_service = true; -- GitLab