diff --git a/src/rootserver/CMakeLists.txt b/src/rootserver/CMakeLists.txt index 5a41b02bab..d3945da6e7 100644 --- a/src/rootserver/CMakeLists.txt +++ b/src/rootserver/CMakeLists.txt @@ -50,7 +50,6 @@ ob_set_subtarget(ob_rootserver common ob_inner_table_monitor.cpp ob_locality_util.cpp ob_resource_weight_parser.cpp - ob_restore_point_service.cpp ob_root_balancer.cpp ob_root_minor_freeze.cpp ob_root_utils.cpp diff --git a/src/rootserver/ob_restore_point_service.cpp b/src/rootserver/ob_restore_point_service.cpp deleted file mode 100644 index 96f8536e37..0000000000 --- a/src/rootserver/ob_restore_point_service.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#define USING_LOG_PREFIX RS -#include "ob_restore_point_service.h" -#include "share/ob_snapshot_table_proxy.h" -#include "rootserver/ob_snapshot_info_manager.h" -#include "storage/tx/ob_ts_mgr.h" - -namespace oceanbase -{ -namespace rootserver -{ - -ObRestorePointService::ObRestorePointService() - : is_inited_(false), - ddl_service_(NULL)/*, - freeze_info_mgr_(NULL)*/ -{ -} - -ObRestorePointService::~ObRestorePointService() -{ -} - - -int ObRestorePointService::init( - rootserver::ObDDLService &ddl_service/*, - rootserver::ObFreezeInfoManager &freeze_info_mgr*/) -{ - int ret = OB_SUCCESS; - - if (is_inited_) { - ret = OB_INIT_TWICE; - LOG_WARN("restore point service init twice", K(ret)); - } else { - ddl_service_ = &ddl_service; - //freeze_info_mgr_ = &freeze_info_mgr; - is_inited_ = true; - } - return ret; -} - -int ObRestorePointService::create_restore_point(const uint64_t tenant_id, const char *name) -{ - int ret = OB_SUCCESS; - palf::SCN snapshot_version; - int64_t snapshot_count = 0; - int64_t retry_cnt = 0; - share::ObSnapshotInfo tmp_info; - int get_snapshot_ret = OB_SUCCESS; - share::schema::ObSchemaGetterGuard schema_guard; - int64_t schema_version = 0; - - if (!is_inited_) { - ret = OB_NOT_INIT; - LOG_WARN("restore point service do not init", K(ret)); - } else if (OB_ISNULL(name) || OB_INVALID_ID == tenant_id) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("create recovery point get invalid argument", K(ret), KP(name)); - } else if (OB_FAIL(ddl_service_->get_snapshot_mgr().get_snapshot_count(ddl_service_->get_sql_proxy(), - tenant_id, - share::ObSnapShotType::SNAPSHOT_FOR_RESTORE_POINT, - snapshot_count))) { - LOG_WARN("fail to get snapshot count", K(ret), K(tenant_id), K(name)); - } else if (snapshot_count >= MAX_RESTORE_POINT) { - ret = OB_ERR_RESTORE_POINT_TOO_MANY; - LOG_INFO("too many restore points", K(tenant_id), K(snapshot_count)); - } else if (FALSE_IT(get_snapshot_ret = ddl_service_->get_snapshot_mgr().get_snapshot(ddl_service_->get_sql_proxy(), - tenant_id, - share::ObSnapShotType::SNAPSHOT_FOR_RESTORE_POINT, - name, - tmp_info))) { - } else if (OB_SUCCESS == get_snapshot_ret) { - ret = OB_ERR_RESTORE_POINT_EXIST; - char tmp_name[OB_MAX_RESERVED_POINT_NAME_LENGTH + 2]; - convert_name(name, tmp_name, OB_MAX_RESERVED_POINT_NAME_LENGTH + 2); - LOG_USER_ERROR(OB_ERR_RESTORE_POINT_EXIST, tmp_name); - } else if (OB_ITER_END != get_snapshot_ret) { - ret = get_snapshot_ret; - LOG_WARN("failed to get snapshot", K(ret), K(name), K(tenant_id)); - } else if (OB_FAIL(ddl_service_->get_tenant_schema_guard_with_version_in_inner_table(tenant_id, schema_guard))) { - LOG_WARN("failed to get schema", K(ret), K(tenant_id)); - } else if (OB_FAIL(schema_guard.get_schema_version(tenant_id, schema_version))) { - LOG_WARN("failed to get schema version", K(ret), K(tenant_id)); - } else { - const transaction::MonotonicTs stc = transaction::MonotonicTs::current_time(); - transaction::MonotonicTs ts; - ret = OB_SNAPSHOT_DISCARDED; - while (OB_SNAPSHOT_DISCARDED == ret || OB_EAGAIN == ret) { - if (THIS_WORKER.get_timeout_remain() < 0) { - ret = OB_TIMEOUT; - LOG_WARN("create restore point timeout", K(ret), K(tenant_id), K(name)); - } else if (OB_FAIL(OB_TS_MGR.get_gts(tenant_id, stc, NULL, snapshot_version, ts))) { - LOG_WARN("failed to get publish version", K(ret), K(tenant_id)); - } else { - if (retry_cnt > RETRY_CNT) { - snapshot_version.convert_from_ts(ObTimeUtility::current_time()); - } - share::ObSnapshotInfo info; - const uint64_t tablet_id = 0; - ObMySQLTransaction trans; - common::ObMySQLProxy &proxy = ddl_service_->get_sql_proxy(); - - if (OB_FAIL(info.init(tenant_id, tablet_id, share::ObSnapShotType::SNAPSHOT_FOR_RESTORE_POINT, - snapshot_version, schema_version, name))) { - LOG_WARN("fail to init snapshot_info", KR(ret), K(tenant_id), K(schema_version), K(snapshot_version)); - } else if (OB_FAIL(trans.start(&proxy, tenant_id))) { - LOG_WARN("fail to start trans", K(ret)); - } else if (OB_FAIL(ddl_service_->get_snapshot_mgr().acquire_snapshot( - trans, tenant_id, info))) { - if (OB_SNAPSHOT_DISCARDED != ret) { - LOG_WARN("fail to acquire snapshot", K(ret), K(tenant_id), K(info)); - } else { - retry_cnt++; - } - } - if (trans.is_started()) { - bool is_commit = (ret == OB_SUCCESS); - int tmp_ret = trans.end(is_commit); - if (OB_SUCCESS != tmp_ret) { - LOG_WARN("fail to end trans", K(ret), K(is_commit)); - if (OB_SUCC(ret)) { - ret = tmp_ret; - } - } - } - } - } - if (OB_SUCC(ret) && retry_cnt > RETRY_CNT) { - if (OB_FAIL(OB_TS_MGR.wait_gts_elapse(tenant_id, snapshot_version))) { - LOG_WARN("failed to wait gts elapse", K(ret), K(tenant_id), K(snapshot_version)); - } - } - } - return ret; -} - -int ObRestorePointService::create_backup_point( - const uint64_t tenant_id, - const char *name, - const int64_t snapshot_version, - const int64_t schema_version) -{ - int ret = OB_SUCCESS; - share::ObSnapshotInfo tmp_info; - int64_t snapshot_gc_ts = 0; - int get_snapshot_ret = OB_SUCCESS; - palf::SCN snapshot_scn; - - if (!is_inited_) { - ret = OB_NOT_INIT; - LOG_WARN("restore point service do not init", K(ret)); - } else if (OB_ISNULL(name) || OB_INVALID_ID == tenant_id || snapshot_version <= 0) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("create recovery point get invalid argument", K(ret), KP(name), K(snapshot_version)); - } else if (OB_FAIL(snapshot_scn.convert_for_lsn_allocator((uint64_t)snapshot_version))) { - LOG_WARN("fail to convert_for_lsn_allocator", KR(ret), K(snapshot_version)); - } else if (FALSE_IT(get_snapshot_ret = ddl_service_->get_snapshot_mgr().get_snapshot(ddl_service_->get_sql_proxy(), - tenant_id, - share::ObSnapShotType::SNAPSHOT_FOR_BACKUP_POINT, - snapshot_scn, - tmp_info))) { - } else if (OB_SUCCESS == get_snapshot_ret) { - ret = OB_ERR_BACKUP_POINT_EXIST; - char tmp_name[OB_MAX_RESERVED_POINT_NAME_LENGTH + 2]; - convert_name(name, tmp_name, OB_MAX_RESERVED_POINT_NAME_LENGTH + 2); - LOG_USER_ERROR(OB_ERR_BACKUP_POINT_EXIST, tmp_name); - } else if (OB_ITER_END != get_snapshot_ret) { - ret = get_snapshot_ret; - LOG_WARN("failed to get snapshot", K(ret), K(name), K(tenant_id)); - } /*else if (OB_FAIL(freeze_info_mgr_->get_latest_snapshot_gc_ts(snapshot_gc_ts))) { - LOG_WARN("failed to get latest snapshot gc ts", K(ret)); - } */else if (snapshot_gc_ts >= snapshot_version) { - ret = OB_BACKUP_CAN_NOT_START; - LOG_WARN("can not create backup point", K(ret), K(snapshot_gc_ts), K(snapshot_version)); - } else { - share::ObSnapshotInfo info; - const uint64_t tablet_id = 0; - ObMySQLTransaction trans; - common::ObMySQLProxy &proxy = ddl_service_->get_sql_proxy(); - - if (OB_FAIL(info.init(tenant_id, tablet_id, share::SNAPSHOT_FOR_BACKUP_POINT, snapshot_scn, - schema_version, name))) { - LOG_WARN("fail to init snapshot_info", KR(ret), K(tenant_id), K(schema_version), K(snapshot_version)); - } else if (OB_FAIL(trans.start(&proxy, tenant_id))) { - LOG_WARN("fail to start trans", K(ret)); - } else if (OB_FAIL(ddl_service_->get_snapshot_mgr().acquire_snapshot( - trans, tenant_id, info))) { - LOG_WARN("fail to acquire snapshot", K(ret), K(tenant_id), K(info)); - } - if (trans.is_started()) { - bool is_commit = (ret == OB_SUCCESS); - int tmp_ret = trans.end(is_commit); - if (OB_SUCCESS != tmp_ret) { - LOG_WARN("fail to end trans", K(ret), K(is_commit)); - if (OB_SUCC(ret)) { - ret = tmp_ret; - } - } - } - } - return ret; -} - -int ObRestorePointService::drop_restore_point(const uint64_t tenant_id, const char *name) -{ - int ret = OB_SUCCESS; - share::ObSnapshotInfo tmp_info; - int get_snapshot_ret = OB_SUCCESS; - - if (!is_inited_) { - ret = OB_NOT_INIT; - LOG_WARN("restore point service do not init", K(ret)); - } else if (NULL == name || OB_INVALID_ID == tenant_id) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(tenant_id), KP(name)); - } else if (FALSE_IT(get_snapshot_ret = ddl_service_->get_snapshot_mgr().get_snapshot(ddl_service_->get_sql_proxy(), - tenant_id, - share::SNAPSHOT_FOR_RESTORE_POINT, - name, - tmp_info))) { - } else if (OB_ITER_END == get_snapshot_ret) { - ret = OB_ERR_RESTORE_POINT_NOT_EXIST; - LOG_WARN("entry not exist", K(ret), K(tmp_info)); - char tmp_name[OB_MAX_RESERVED_POINT_NAME_LENGTH + 2]; - convert_name(name, tmp_name, OB_MAX_RESERVED_POINT_NAME_LENGTH + 2); - LOG_USER_ERROR(OB_ERR_RESTORE_POINT_NOT_EXIST, tmp_name); - } else if (OB_SUCCESS != get_snapshot_ret) { - ret = get_snapshot_ret; - LOG_WARN("failed to get snapshot", K(ret), K(name), K(tenant_id)); - } - - ObMySQLTransaction trans; - common::ObMySQLProxy &proxy = ddl_service_->get_sql_proxy(); - if (OB_FAIL(ret)) { - } else if (OB_FAIL(trans.start(&proxy, tenant_id))) { - LOG_WARN("fail to start trans", K(ret)); - } else if (OB_FAIL(ddl_service_->get_snapshot_mgr().release_snapshot( - trans, tenant_id, tmp_info))) { - LOG_WARN("fail to release snapshot", K(ret), K(tenant_id), K(tmp_info)); - } - if (trans.is_started()) { - bool is_commit = (ret == OB_SUCCESS); - int tmp_ret = trans.end(is_commit); - if (OB_SUCCESS != tmp_ret) { - LOG_WARN("fail to end trans", K(ret), K(is_commit)); - if (OB_SUCC(ret)) { - ret = tmp_ret; - } - } - } - return ret; -} - -int ObRestorePointService::drop_backup_point( - const uint64_t tenant_id, - const int64_t snapshot_version) -{ - int ret = OB_SUCCESS; - share::ObSnapshotInfo tmp_info; - int get_snapshot_ret = OB_SUCCESS; - palf::SCN snapshot_scn; - if (!is_inited_) { - ret = OB_NOT_INIT; - LOG_WARN("restore point service do not init", K(ret)); - } else if (OB_INVALID_ID == tenant_id || snapshot_version <= 0) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid argument", K(ret), K(tenant_id), K(snapshot_version)); - } else if (OB_FAIL(snapshot_scn.convert_for_lsn_allocator((uint64_t)snapshot_version))) { - LOG_WARN("fail to convert_for_lsn_allocator", KR(ret), K(snapshot_version)); - } else if (FALSE_IT(get_snapshot_ret = ddl_service_->get_snapshot_mgr().get_snapshot(ddl_service_->get_sql_proxy(), - tenant_id, - share::SNAPSHOT_FOR_BACKUP_POINT, - snapshot_scn, - tmp_info))) { - } else if (OB_ITER_END == get_snapshot_ret) { - ret = OB_ERR_BACKUP_POINT_NOT_EXIST; - LOG_WARN("entry not exist", K(ret), K(tmp_info), K(snapshot_version)); - } else if (OB_SUCCESS != get_snapshot_ret) { - ret = get_snapshot_ret; - LOG_WARN("failed to get snapshot", K(ret), K(snapshot_version), K(tenant_id)); - } - - ObMySQLTransaction trans; - common::ObMySQLProxy &proxy = ddl_service_->get_sql_proxy(); - if (OB_FAIL(ret)) { - } else if (OB_FAIL(trans.start(&proxy, tenant_id))) { - LOG_WARN("fail to start trans", K(ret)); - } else if (OB_FAIL(ddl_service_->get_snapshot_mgr().release_snapshot( - trans, tenant_id, tmp_info))) { - LOG_WARN("fail to release snapshot", K(ret), K(tenant_id), K(tmp_info)); - } - if (trans.is_started()) { - bool is_commit = (ret == OB_SUCCESS); - int tmp_ret = trans.end(is_commit); - if (OB_SUCCESS != tmp_ret) { - LOG_WARN("fail to end trans", K(ret), K(is_commit)); - if (OB_SUCC(ret)) { - ret = tmp_ret; - } - } - } - return ret; -} - -void ObRestorePointService::convert_name(const char *name, char *tmp_name, const int64_t length) -{ - int tmp_ret = OB_SUCCESS; - const int64_t name_length = strlen(name); - memset(tmp_name, 0, length); - if (name_length + 2 > length) { - tmp_ret = OB_SIZE_OVERFLOW; - LOG_ERROR("name size overflow", K(tmp_ret), K(name_length), K(length)); - } else if (OB_SUCCESS != (tmp_ret = databuff_printf(tmp_name, length, "\'%s\'", name))) { - LOG_ERROR("failed to create name", K(tmp_ret), K(name), K(tmp_name), K(length)); - } -} - - -} -} diff --git a/src/rootserver/ob_restore_point_service.h b/src/rootserver/ob_restore_point_service.h deleted file mode 100644 index f6e9a77f8f..0000000000 --- a/src/rootserver/ob_restore_point_service.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#ifndef OB_RESTORE_POINT_SERVICE_H_ -#define OB_RESTORE_POINT_SERVICE_H_ -#include "rootserver/ob_ddl_service.h" -//#include "ob_freeze_info_manager.h" -namespace oceanbase -{ -namespace rootserver -{ - -//not used in 4.0, SCN ignore this -//TODO(cangjun) need change file name ob_recovery_point maybe better -class ObRestorePointService -{ -static const int64_t RETRY_CNT = 10; -static const int64_t MAX_RESTORE_POINT = 10; -public: - ObRestorePointService(); - ~ObRestorePointService(); - int init( - rootserver::ObDDLService &ddl_service/*, - rootserver::ObFreezeInfoManager &freeze_info_mgr*/); - int create_restore_point(const uint64_t tenant_id, const char *name); - int create_backup_point( - const uint64_t tenant_id, - const char *name, - const int64_t snapshot_version, - const int64_t schema_version); - int drop_restore_point(const uint64_t tenant_id, const char *name); - int drop_backup_point( - const uint64_t tenant_id, - const int64_t snapshot_version); -private: - void convert_name( - const char *name, char *tmp_name, const int64_t length); -private: - bool is_inited_; - rootserver::ObDDLService *ddl_service_; - //ObFreezeInfoManager *freeze_info_mgr_; - DISALLOW_COPY_AND_ASSIGN(ObRestorePointService); -}; - -} //rootserver -} //oceanbase -#endif diff --git a/src/rootserver/ob_root_service.cpp b/src/rootserver/ob_root_service.cpp index 83980d4626..2f598cc6a6 100644 --- a/src/rootserver/ob_root_service.cpp +++ b/src/rootserver/ob_root_service.cpp @@ -672,7 +672,6 @@ ObRootService::ObRootService() rs_status_(), fail_count_(0), schema_history_recycler_(), - restore_point_service_(), backup_lease_service_(), disaster_recovery_task_executor_(), disaster_recovery_task_mgr_(), @@ -926,8 +925,6 @@ int ObRootService::init(ObServerConfig &config, FLOG_WARN("fail to init schema history recycler failed", KR(ret)); } else if (OB_FAIL(backup_lease_service_.start())) { FLOG_WARN("start backup lease task failed", KR(ret)); - } else if (OB_FAIL(restore_point_service_.init(ddl_service_))) { - FLOG_WARN("init restore point service failed", KR(ret)); } else if (OB_FAIL(dbms_job::ObDBMSJobMaster::get_instance().init(&server_manager_, &sql_proxy_, schema_service_))) { @@ -9332,49 +9329,17 @@ int ObRootService::send_physical_restore_result(const obrpc::ObPhysicalRestoreRe int ObRootService::create_restore_point(const obrpc::ObCreateRestorePointArg &arg) { - int ret = OB_SUCCESS; - - ObSchemaGetterGuard schema_guard; - ObArray index_ids; - uint64_t tenant_id = arg.tenant_id_; - - LOG_DEBUG("receive create restore point arg", K(arg)); - if (!inited_) { - ret = OB_NOT_INIT; - LOG_WARN("not init", K(ret)); - } else if (!arg.is_valid()) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid arg", K(arg), K(ret)); - } else if (OB_FAIL(ddl_service_.get_tenant_schema_guard_with_version_in_inner_table( - tenant_id, schema_guard))) { - LOG_WARN("failed to get schema guard", K(ret), K(tenant_id)); - } else if (OB_FAIL(schema_guard.get_tenant_unavailable_index(tenant_id, index_ids))) { - LOG_WARN("fail to get tenant unavailable index", K(ret), K(tenant_id)); - } else if (0 != index_ids.count()) { - ret = OB_NOT_SUPPORTED; - LOG_WARN("unavailable index exists, cannot create restore point", KR(ret), K(index_ids)); - LOG_USER_ERROR(OB_NOT_SUPPORTED, "unavailable index exists, create restore point"); - } else if (OB_FAIL(restore_point_service_.create_restore_point(arg.tenant_id_, - arg.name_.ptr()))) { - LOG_WARN("failed to create restore point", K(ret), K(arg)); - } + int ret = OB_NOT_SUPPORTED; + UNUSED(arg); + LOG_WARN("craete restpre point is not supported now", K(ret)); return ret; } int ObRootService::drop_restore_point(const obrpc::ObDropRestorePointArg &arg) { - int ret = OB_SUCCESS; - LOG_DEBUG("receive drop restore point arg", K(arg)); - if (!inited_) { - ret = OB_NOT_INIT; - LOG_WARN("not init", K(ret)); - } else if (!arg.is_valid()) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid arg", K(arg), K(ret)); - } else if (OB_FAIL(restore_point_service_.drop_restore_point(arg.tenant_id_, - arg.name_.ptr()))) { - LOG_WARN("failed to drop restore point", K(ret), K(arg)); - } + int ret = OB_NOT_SUPPORTED; + UNUSED(arg); + LOG_WARN("drop restpre point is not supported now", K(ret)); return ret; } diff --git a/src/rootserver/ob_root_service.h b/src/rootserver/ob_root_service.h index fa2ec4f953..900c4e46bd 100644 --- a/src/rootserver/ob_root_service.h +++ b/src/rootserver/ob_root_service.h @@ -52,7 +52,6 @@ #include "rootserver/ob_update_rs_list_task.h" #include "rootserver/ob_schema_history_recycler.h" #include "rootserver/backup/ob_backup_lease_service.h" -#include "rootserver/ob_restore_point_service.h" #include "rootserver/ddl_task/ob_ddl_scheduler.h" #include "share/ls/ob_ls_info.h" #include "share/ls/ob_ls_table_operator.h" @@ -966,7 +965,6 @@ private: int64_t fail_count_; ObSchemaHistoryRecycler schema_history_recycler_; - ObRestorePointService restore_point_service_; ObBackupLeaseService backup_lease_service_; // Disaster Recovery related ObDRTaskExecutor disaster_recovery_task_executor_; diff --git a/src/storage/backup/ob_backup_task.cpp b/src/storage/backup/ob_backup_task.cpp index fbdd76b466..02ad68ef18 100644 --- a/src/storage/backup/ob_backup_task.cpp +++ b/src/storage/backup/ob_backup_task.cpp @@ -68,13 +68,13 @@ static int get_ls_handle(const uint64_t tenant_id, const share::ObLSID &ls_id, s } static int advance_checkpoint_by_flush(const uint64_t tenant_id, const share::ObLSID &ls_id, - const int64_t start_scn, storage::ObLS *ls) + const palf::SCN &start_scn, storage::ObLS *ls) { int ret = OB_SUCCESS; const int64_t advance_checkpoint_timeout = GCONF._advance_checkpoint_timeout; LOG_INFO("backup advance checkpoint timeout", K(tenant_id), K(advance_checkpoint_timeout)); checkpoint::ObCheckpointExecutor *checkpoint_executor = NULL; - if (start_scn < 0) { + if (!start_scn.is_valid()) { ret = OB_INVALID_ARGUMENT; LOG_WARN("get invalid args", K(ret), K(start_scn)); } else if (OB_ISNULL(checkpoint_executor = ls->get_checkpoint_executor())) { @@ -84,14 +84,12 @@ static int advance_checkpoint_by_flush(const uint64_t tenant_id, const share::Ob ObLSMetaPackage ls_meta_package; int64_t i = 0; const int64_t start_ts = ObTimeUtility::current_time(); - palf::SCN tmp; - tmp.convert_for_lsn_allocator(start_scn); do { const int64_t cur_ts = ObTimeUtility::current_time(); if (cur_ts - start_ts > advance_checkpoint_timeout) { ret = OB_BACKUP_ADVANCE_CHECKPOINT_TIMEOUT; LOG_WARN("backup advance checkpoint by flush timeout", K(ret), K(tenant_id), K(ls_id), K(start_scn)); - } else if (OB_FAIL(checkpoint_executor->advance_checkpoint_by_flush(tmp))) { + } else if (OB_FAIL(checkpoint_executor->advance_checkpoint_by_flush(start_scn))) { if (OB_NO_NEED_UPDATE == ret) { // clog checkpoint ts has passed start log ts ret = OB_SUCCESS; @@ -102,21 +100,21 @@ static int advance_checkpoint_by_flush(const uint64_t tenant_id, const share::Ob } else if (OB_FAIL(ls->get_ls_meta_package(ls_meta_package))) { LOG_WARN("failed to get ls meta package", K(ret), K(tenant_id), K(ls_id)); } else { - const int64_t clog_checkpoint_ts = ls_meta_package.ls_meta_.get_clog_checkpoint_ts(); - if (clog_checkpoint_ts >= start_scn) { - LOG_INFO("clog checkpoint ts has passed start log ts", + const palf::SCN clog_checkpoint_scn = ls_meta_package.ls_meta_.get_clog_checkpoint_scn(); + if (clog_checkpoint_scn >= start_scn) { + LOG_INFO("clog checkpoint scn has passed start scn", K(i), K(tenant_id), K(ls_id), - K(clog_checkpoint_ts), + K(clog_checkpoint_scn), K(start_scn)); break; } else { - LOG_WARN("clog checkpoint ts has not passed start log ts, retry again", + LOG_WARN("clog checkpoint scn has not passed start scn, retry again", K(i), K(tenant_id), K(ls_id), - K(clog_checkpoint_ts), + K(clog_checkpoint_scn), K(start_scn)); sleep(1); } @@ -3473,14 +3471,13 @@ int ObLSBackupMetaTask::advance_checkpoint_by_flush_( checkpoint::ObCheckpointExecutor *checkpoint_executor = NULL; storage::ObLSHandle ls_handle; storage::ObLS *ls = NULL; - const int64_t checkpoint_ts = static_cast(start_scn.get_val_for_lsn_allocator()); if (OB_FAIL(get_ls_handle(tenant_id, ls_id, ls_handle))) { LOG_WARN("failed to get ls", K(ret), K(tenant_id), K(ls_id)); } else if (OB_ISNULL(ls = ls_handle.get_ls())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("log stream not exist", K(ret), K(ls_id)); - } else if (OB_FAIL(advance_checkpoint_by_flush(tenant_id, ls_id, checkpoint_ts, ls))) { - LOG_WARN("failed to advance checkpoint by flush", K(ret), K(tenant_id), K(ls_id), K(checkpoint_ts)); + } else if (OB_FAIL(advance_checkpoint_by_flush(tenant_id, ls_id, start_scn, ls))) { + LOG_WARN("failed to advance checkpoint by flush", K(ret), K(tenant_id), K(ls_id), K(start_scn)); } return ret; } @@ -3778,11 +3775,11 @@ int ObLSBackupPrepareTask::may_need_advance_checkpoint_() { int ret = OB_SUCCESS; int64_t rebuild_seq = 0; - int64_t backup_clog_checkpoint_ts = 0; + palf::SCN backup_clog_checkpoint_scn; if (OB_ISNULL(ls_backup_ctx_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("ls backup ctx should not be null", K(ret)); - } else if (OB_FAIL(fetch_backup_ls_meta_(rebuild_seq, backup_clog_checkpoint_ts))) { + } else if (OB_FAIL(fetch_backup_ls_meta_(rebuild_seq, backup_clog_checkpoint_scn))) { LOG_WARN("failed to fetch backup ls meta checkpoint ts", K(ret), K_(param)); } else if (FALSE_IT(ls_backup_ctx_->rebuild_seq_ = rebuild_seq)) { // assign rebuild seq @@ -3802,10 +3799,10 @@ int ObLSBackupPrepareTask::may_need_advance_checkpoint_() LOG_WARN("log stream not exist", K(ret), K(ls_id)); } else if (OB_FAIL(ls->get_ls_meta_package(cur_ls_meta))) { LOG_WARN("failed to get ls meta package", K(ret), K(tenant_id), K(ls_id)); - } else if (backup_clog_checkpoint_ts <= cur_ls_meta.ls_meta_.get_clog_checkpoint_ts()) { + } else if (backup_clog_checkpoint_scn <= cur_ls_meta.ls_meta_.get_clog_checkpoint_scn()) { LOG_INFO("no need advance checkpoint", K_(param)); - } else if (OB_FAIL(advance_checkpoint_by_flush(tenant_id, ls_id, backup_clog_checkpoint_ts, ls))) { - LOG_WARN("failed to advance checkpoint by flush", K(ret), K(ls_id), K(backup_clog_checkpoint_ts)); + } else if (OB_FAIL(advance_checkpoint_by_flush(tenant_id, ls_id, backup_clog_checkpoint_scn, ls))) { + LOG_WARN("failed to advance checkpoint by flush", K(ret), K(ls_id), K(backup_clog_checkpoint_scn)); } else { LOG_INFO("advance checkpint by flush", K_(param)); } @@ -3814,11 +3811,11 @@ int ObLSBackupPrepareTask::may_need_advance_checkpoint_() return ret; } -int ObLSBackupPrepareTask::fetch_backup_ls_meta_(int64_t &rebuild_seq, int64_t &clog_checkpoint_ts) +int ObLSBackupPrepareTask::fetch_backup_ls_meta_(int64_t &rebuild_seq, palf::SCN &clog_checkpoint_scn) { int ret = OB_SUCCESS; rebuild_seq = 0; - clog_checkpoint_ts = 0; + clog_checkpoint_scn.reset(); ObLSMetaPackage ls_meta_package; share::ObBackupDataStore store; if (OB_FAIL(store.init(param_.backup_dest_, param_.backup_set_desc_))) { @@ -3830,7 +3827,7 @@ int ObLSBackupPrepareTask::fetch_backup_ls_meta_(int64_t &rebuild_seq, int64_t & LOG_WARN("invalid ls meta package", K(ret), K(ls_meta_package)); } else { rebuild_seq = ls_meta_package.ls_meta_.get_rebuild_seq(); - clog_checkpoint_ts = ls_meta_package.ls_meta_.get_clog_checkpoint_ts(); + clog_checkpoint_scn = ls_meta_package.ls_meta_.get_clog_checkpoint_scn(); } return ret; } @@ -3838,29 +3835,29 @@ int ObLSBackupPrepareTask::fetch_backup_ls_meta_(int64_t &rebuild_seq, int64_t & int ObLSBackupPrepareTask::check_tx_data_can_explain_user_data_() { int ret = OB_SUCCESS; - int64_t backup_filled_tx_log_ts = INT64_MAX; - int64_t cur_min_filled_tx_log_ts = INT64_MAX; + palf::SCN backup_filled_tx_scn = palf::SCN::max_scn(); + palf::SCN cur_min_filled_tx_scn = palf::SCN::max_scn(); if (!backup_data_type_.is_minor_backup()) { // do nothing - } else if (OB_FAIL(get_backup_tx_data_table_filled_tx_log_ts_(backup_filled_tx_log_ts))) { + } else if (OB_FAIL(get_backup_tx_data_table_filled_tx_scn_(backup_filled_tx_scn))) { LOG_WARN("failed to get backup tx data table filled tx log ts", K(ret)); - } else if (OB_FAIL(get_cur_ls_min_filled_tx_log_ts_(cur_min_filled_tx_log_ts))) { + } else if (OB_FAIL(get_cur_ls_min_filled_tx_scn_(cur_min_filled_tx_scn))) { LOG_WARN("failed to get cur ls min end log ts in latest tablets", K(ret)); } else { - if (cur_min_filled_tx_log_ts >= backup_filled_tx_log_ts) { - LOG_INFO("can backup replica", K(ret), K(cur_min_filled_tx_log_ts), K(backup_filled_tx_log_ts)); + if (cur_min_filled_tx_scn >= backup_filled_tx_scn) { + LOG_INFO("can backup replica", K(ret), K(cur_min_filled_tx_scn), K(backup_filled_tx_scn)); } else { ret = OB_REPLICA_CANNOT_BACKUP; - LOG_WARN("can not backup replica", K(ret), K(cur_min_filled_tx_log_ts), K(backup_filled_tx_log_ts)); + LOG_WARN("can not backup replica", K(ret), K(cur_min_filled_tx_scn), K(backup_filled_tx_scn)); } } return ret; } -int ObLSBackupPrepareTask::get_backup_tx_data_table_filled_tx_log_ts_(int64_t &filled_tx_log_ts) +int ObLSBackupPrepareTask::get_backup_tx_data_table_filled_tx_scn_(palf::SCN &filled_tx_scn) { int ret = OB_SUCCESS; - filled_tx_log_ts = INT64_MAX; + filled_tx_scn = palf::SCN::max_scn(); const common::ObTabletID &tx_data_tablet_id = LS_TX_DATA_TABLET; const ObBackupMetaType meta_type = ObBackupMetaType::BACKUP_SSTABLE_META; ObBackupDataType sys_backup_data_type; @@ -3881,10 +3878,10 @@ int ObLSBackupPrepareTask::get_backup_tx_data_table_filled_tx_log_ts_(int64_t &f backup_path.get_obstr(), param_.backup_dest_.get_storage_info(), meta_index, meta_array))) { LOG_WARN("failed to read sstable metas", K(ret), K(backup_path), K(meta_index)); } else if (meta_array.empty()) { - filled_tx_log_ts = 0; + filled_tx_scn = palf::SCN::min_scn(); LOG_INFO("the log stream do not have tx data sstable", K(ret)); } else { - filled_tx_log_ts = meta_array.at(0).sstable_meta_.basic_meta_.filled_tx_scn_.get_val_for_lsn_allocator(); + filled_tx_scn = meta_array.at(0).sstable_meta_.basic_meta_.filled_tx_scn_; } return ret; } @@ -3944,10 +3941,10 @@ int ObLSBackupPrepareTask::prepare_meta_index_store_param_( return ret; } -int ObLSBackupPrepareTask::get_cur_ls_min_filled_tx_log_ts_(int64_t &min_filled_tx_log_ts) +int ObLSBackupPrepareTask::get_cur_ls_min_filled_tx_scn_(palf::SCN &min_filled_tx_scn) { int ret = OB_SUCCESS; - min_filled_tx_log_ts = INT64_MAX; + min_filled_tx_scn = palf::SCN::max_scn(); ObLSTabletIterator iterator(ObTabletCommon::NO_CHECK_GET_TABLET_TIMEOUT_US); storage::ObLSHandle ls_handle; storage::ObLS *ls = NULL; @@ -3965,14 +3962,14 @@ int ObLSBackupPrepareTask::get_cur_ls_min_filled_tx_log_ts_(int64_t &min_filled_ STORAGE_LOG(WARN, "build ls table iter failed.", KR(ret)); } else { while (OB_SUCC(iterator.get_next_tablet(tablet_handle))) { - int64_t tmp_filled_tx_log_ts = INT64_MAX; + palf::SCN tmp_filled_tx_scn = palf::SCN::max_scn(); bool has_minor_sstable = false; - if (OB_FAIL(get_tablet_min_filled_tx_log_ts_(tablet_handle, tmp_filled_tx_log_ts, has_minor_sstable))) { + if (OB_FAIL(get_tablet_min_filled_tx_scn_(tablet_handle, tmp_filled_tx_scn, has_minor_sstable))) { STORAGE_LOG(WARN, "get min end_log_ts from a single tablet failed.", KR(ret)); } else if (!has_minor_sstable) { continue; - } else if (tmp_filled_tx_log_ts < min_filled_tx_log_ts) { - min_filled_tx_log_ts = tmp_filled_tx_log_ts; + } else if (tmp_filled_tx_scn < min_filled_tx_scn) { + min_filled_tx_scn = tmp_filled_tx_scn; } } @@ -3983,12 +3980,12 @@ int ObLSBackupPrepareTask::get_cur_ls_min_filled_tx_log_ts_(int64_t &min_filled_ return ret; } -int ObLSBackupPrepareTask::get_tablet_min_filled_tx_log_ts_( - ObTabletHandle &tablet_handle, int64_t &min_filled_tx_log_ts, bool &has_minor_sstable) +int ObLSBackupPrepareTask::get_tablet_min_filled_tx_scn_( + ObTabletHandle &tablet_handle, palf::SCN &min_filled_tx_scn, bool &has_minor_sstable) { int ret = OB_SUCCESS; has_minor_sstable = false; - min_filled_tx_log_ts = INT64_MAX; + min_filled_tx_scn = palf::SCN::max_scn(); ObTablet *tablet = nullptr; if (OB_ISNULL(tablet = tablet_handle.get_obj())) { ret = OB_ERR_UNEXPECTED; @@ -3996,7 +3993,7 @@ int ObLSBackupPrepareTask::get_tablet_min_filled_tx_log_ts_( } else if (tablet->get_tablet_meta().tablet_id_.is_ls_inner_tablet()) { // skip inner tablet } else { - min_filled_tx_log_ts = tablet->get_tablet_meta().clog_checkpoint_scn_.get_val_for_lsn_allocator(); + min_filled_tx_scn = tablet->get_tablet_meta().clog_checkpoint_scn_; ObTabletTableStore &table_store = tablet->get_table_store(); const ObSSTableArray &sstable_array = table_store.get_minor_sstables(); has_minor_sstable = !sstable_array.empty(); @@ -4011,8 +4008,8 @@ int ObLSBackupPrepareTask::get_tablet_min_filled_tx_log_ts_( LOG_WARN("table ptr type not expectedd", K(ret)); } else if (FALSE_IT(sstable = static_cast(table_ptr))) { } else { - int64_t filled_tx_scn = sstable->get_meta().get_basic_meta().filled_tx_scn_.get_val_for_lsn_allocator(); - min_filled_tx_log_ts = std::min(filled_tx_scn, min_filled_tx_log_ts); + palf::SCN filled_tx_scn = sstable->get_meta().get_basic_meta().filled_tx_scn_; + min_filled_tx_scn = std::min(filled_tx_scn, min_filled_tx_scn); } } } diff --git a/src/storage/backup/ob_backup_task.h b/src/storage/backup/ob_backup_task.h index a78cf0432d..6bab983158 100644 --- a/src/storage/backup/ob_backup_task.h +++ b/src/storage/backup/ob_backup_task.h @@ -34,6 +34,10 @@ #include "storage/blocksstable/ob_logic_macro_id.h" namespace oceanbase { +namespace palf +{ +class SCN; +} namespace backup { class ObLSBackupDagInitParam; @@ -447,15 +451,15 @@ public: private: int may_need_advance_checkpoint_(); - int fetch_backup_ls_meta_(int64_t &rebuild_seq, int64_t &clog_checkpoint_ts); int check_tx_data_can_explain_user_data_(); - int get_backup_tx_data_table_filled_tx_log_ts_(int64_t &filled_tx_log_ts); + int get_backup_tx_data_table_filled_tx_scn_(palf::SCN &filled_tx_scn); int prepare_meta_index_store_(ObBackupMetaIndexStore &meta_index_store); int get_sys_ls_retry_id_(int64_t &retry_id); int prepare_meta_index_store_param_(const int64_t retry_id, ObBackupIndexStoreParam ¶m); - int get_cur_ls_min_filled_tx_log_ts_(int64_t &min_filled_tx_log_ts); - int get_tablet_min_filled_tx_log_ts_(ObTabletHandle &tablet_handle, - int64_t &min_filled_tx_log_ts, bool &has_minor_sstable); + int get_cur_ls_min_filled_tx_scn_(palf::SCN &min_filled_tx_scn); + int get_tablet_min_filled_tx_scn_(ObTabletHandle &tablet_handle, + palf::SCN &min_filled_tx_scn, bool &has_minor_sstable); + int fetch_backup_ls_meta_(int64_t &rebuild_seq, palf::SCN &clog_checkpoint_scn); private: bool is_inited_; diff --git a/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp b/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp index 41c81762cf..34bc0b8079 100644 --- a/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp +++ b/src/storage/high_availability/ob_storage_ha_tablet_builder.cpp @@ -16,6 +16,7 @@ #include "share/rc/ob_tenant_base.h" #include "storage/tablet/ob_tablet_common.h" #include "storage/tablet/ob_tablet_create_delete_helper.h" +#include "logservice/palf/scn.h" namespace oceanbase { @@ -693,11 +694,11 @@ int ObStorageHATabletsBuilder::get_need_copy_ddl_sstable_range_( bool ddl_checkpoint_pushed = !ddl_sstable_array.empty(); if (ddl_checkpoint_pushed) { need_copy_scn_range.start_scn_ = ddl_start_scn; - int64_t min_start_scn = 0; - if (OB_FAIL(get_ddl_sstable_min_start_log_ts_(ddl_sstable_array, min_start_scn))) { + palf::SCN max_start_scn = palf::SCN::max_scn(); + if (OB_FAIL(get_ddl_sstable_max_start_scn_(ddl_sstable_array, max_start_scn))) { LOG_WARN("failed to get ddl sstable min start log ts", K(ret)); } else { - need_copy_scn_range.end_scn_.convert_for_lsn_allocator(min_start_scn); + need_copy_scn_range.end_scn_ = max_start_scn; } } else { need_copy_scn_range.start_scn_ = ddl_start_scn; @@ -712,13 +713,13 @@ int ObStorageHATabletsBuilder::get_need_copy_ddl_sstable_range_( return ret; } -int ObStorageHATabletsBuilder::get_ddl_sstable_min_start_log_ts_( +int ObStorageHATabletsBuilder::get_ddl_sstable_max_start_scn_( const ObSSTableArray &ddl_sstable_array, - int64_t &min_start_log_ts) + palf::SCN &max_start_scn) { int ret = OB_SUCCESS; ObArray sstables; - min_start_log_ts = 0; + max_start_scn = palf::SCN::max_scn(); if (!is_inited_) { ret = OB_NOT_INIT; @@ -736,11 +737,17 @@ int ObStorageHATabletsBuilder::get_ddl_sstable_min_start_log_ts_( ret = OB_ERR_UNEXPECTED; LOG_WARN("sstable type is unexpected", K(ret), KP(table), K(param_)); } else { - //TODO(scn) - int64_t start_log_ts = table->get_key().scn_range_.start_scn_.is_valid() ? (int64_t)(table->get_key().scn_range_.start_scn_.get_val_for_inner_table_field()) : OB_INVALID_TIMESTAMP; - min_start_log_ts = std::min(min_start_log_ts, start_log_ts); + palf::SCN start_scn = table->get_key().scn_range_.start_scn_.is_valid() ? (table->get_key().scn_range_.start_scn_) : palf::SCN::max_scn(); + max_start_scn = std::min(max_start_scn, start_scn); } } + + if (OB_FAIL(ret)) { + } else if (palf::SCN::max_scn() == max_start_scn) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("max start scn must not be equal to palf::max_scn", K(ret), K(max_start_scn)); + } + } return ret; } diff --git a/src/storage/high_availability/ob_storage_ha_tablet_builder.h b/src/storage/high_availability/ob_storage_ha_tablet_builder.h index a81e651d57..2e056bccb3 100644 --- a/src/storage/high_availability/ob_storage_ha_tablet_builder.h +++ b/src/storage/high_availability/ob_storage_ha_tablet_builder.h @@ -21,6 +21,11 @@ namespace oceanbase { + +namespace palf +{ +class SCN; +} namespace storage { @@ -97,9 +102,9 @@ private: const ObTablet *tablet, const ObSSTableArray &ddl_sstable_array, share::ObScnRange &scn_range); - int get_ddl_sstable_min_start_log_ts_( + int get_ddl_sstable_max_start_scn_( const ObSSTableArray &ddl_sstable_array, - int64_t &min_start_log_ts); + palf::SCN &max_start_scn); int hold_local_reuse_sstable_( const common::ObTabletID &tablet_id, ObTablesHandleArray &tables_handle); diff --git a/src/storage/high_availability/ob_storage_ha_utils.cpp b/src/storage/high_availability/ob_storage_ha_utils.cpp index f5e6995015..754c69e344 100644 --- a/src/storage/high_availability/ob_storage_ha_utils.cpp +++ b/src/storage/high_availability/ob_storage_ha_utils.cpp @@ -28,7 +28,6 @@ int ObStorageHAUtils::check_tablet_replica_validity(const uint64_t tenant_id, co const common::ObAddr &src_addr, const common::ObTabletID &tablet_id, common::ObISQLClient &sql_client) { int ret = OB_SUCCESS; - int64_t compaction_scn_val = 0; palf::SCN compaction_scn; if (tablet_id.is_ls_inner_tablet()) { // do nothing @@ -37,15 +36,13 @@ int ObStorageHAUtils::check_tablet_replica_validity(const uint64_t tenant_id, co LOG_WARN("get invalid args", K(ret), K(tenant_id), K(ls_id), K(src_addr), K(tablet_id)); } else if (OB_FAIL(check_merge_error_(tenant_id, sql_client))) { LOG_WARN("failed to check merge error", K(ret), K(tenant_id)); - } else if (OB_FAIL(fetch_src_tablet_meta_info_(tenant_id, tablet_id, ls_id, src_addr, sql_client, compaction_scn_val))) { + } else if (OB_FAIL(fetch_src_tablet_meta_info_(tenant_id, tablet_id, ls_id, src_addr, sql_client, compaction_scn))) { if (OB_ENTRY_NOT_EXIST == ret) { ret = OB_SUCCESS; LOG_INFO("tablet may not has major sstable, no need check", K(tenant_id), K(tablet_id), K(ls_id), K(src_addr)); } else { LOG_WARN("failed to fetch src tablet meta info", K(ret), K(tenant_id), K(tablet_id), K(ls_id), K(src_addr)); } - } else if (OB_FAIL(compaction_scn.convert_for_lsn_allocator(compaction_scn_val))) { - LOG_WARN("failed to convert scn", K(ret), K(compaction_scn_val), K(tenant_id), K(ls_id)); } else if (OB_FAIL(check_tablet_replica_checksum_(tenant_id, tablet_id, ls_id, compaction_scn, sql_client))) { LOG_WARN("failed to check tablet replica checksum", K(ret), K(compaction_scn)); } @@ -66,7 +63,7 @@ int ObStorageHAUtils::check_merge_error_(const uint64_t tenant_id, common::ObISQ } int ObStorageHAUtils::fetch_src_tablet_meta_info_(const uint64_t tenant_id, const common::ObTabletID &tablet_id, - const share::ObLSID &ls_id, const common::ObAddr &src_addr, common::ObISQLClient &sql_client, int64_t &compaction_scn) + const share::ObLSID &ls_id, const common::ObAddr &src_addr, common::ObISQLClient &sql_client, palf::SCN &compaction_scn) { int ret = OB_SUCCESS; ObTabletTableOperator op; @@ -76,7 +73,7 @@ int ObStorageHAUtils::fetch_src_tablet_meta_info_(const uint64_t tenant_id, cons } else if (OB_FAIL(op.get(tenant_id, tablet_id, ls_id, src_addr, tablet_replica))) { LOG_WARN("failed to get tablet meta info", K(ret), K(tenant_id), K(tablet_id), K(ls_id), K(src_addr)); } else { - compaction_scn = tablet_replica.get_snapshot_version(); + compaction_scn.convert_for_tx(tablet_replica.get_snapshot_version()); } return ret; } diff --git a/src/storage/high_availability/ob_storage_ha_utils.h b/src/storage/high_availability/ob_storage_ha_utils.h index fbfebd2aed..bb64695afc 100644 --- a/src/storage/high_availability/ob_storage_ha_utils.h +++ b/src/storage/high_availability/ob_storage_ha_utils.h @@ -33,7 +33,7 @@ private: static int check_merge_error_(const uint64_t tenant_id, common::ObISQLClient &sql_client); static int fetch_src_tablet_meta_info_(const uint64_t tenant_id, const common::ObTabletID &tablet_id, const share::ObLSID &ls_id, const common::ObAddr &src_addr, common::ObISQLClient &sql_client, - int64_t &compaction_scn); + palf::SCN &compaction_scn); static int check_tablet_replica_checksum_(const uint64_t tenant_id, const common::ObTabletID &tablet_id, const share::ObLSID &ls_id, const palf::SCN &compaction_scn, common::ObISQLClient &sql_client); };