[scn] fix failure of mittest after refresh feature scn
This commit is contained in:
@ -40,7 +40,7 @@ using namespace oceanbase::omt;
|
||||
|
||||
ObUniqueIndexChecker::ObUniqueIndexChecker()
|
||||
: is_inited_(false), tenant_id_(OB_INVALID_TENANT_ID), ls_id_(), tablet_id_(),
|
||||
index_schema_(NULL), data_table_schema_(NULL), execution_id_(0), snapshot_version_(0), task_id_(0),
|
||||
index_schema_(NULL), data_table_schema_(NULL), execution_id_(0), snapshot_version_(0),
|
||||
is_scan_index_(false)
|
||||
{
|
||||
}
|
||||
@ -52,7 +52,6 @@ int ObUniqueIndexChecker::init(
|
||||
const bool is_scan_index,
|
||||
const ObTableSchema *data_table_schema,
|
||||
const ObTableSchema *index_schema,
|
||||
const int64_t task_id,
|
||||
const uint64_t execution_id,
|
||||
const int64_t snapshot_version)
|
||||
{
|
||||
@ -62,10 +61,9 @@ int ObUniqueIndexChecker::init(
|
||||
LOG_WARN("ObUniqueIndexChecker has already been inited", K(ret));
|
||||
} else if (OB_UNLIKELY(!ls_id.is_valid() || !tablet_id.is_valid()
|
||||
|| NULL == data_table_schema
|
||||
|| NULL == index_schema
|
||||
|| task_id <= 0)) {
|
||||
|| NULL == index_schema)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid arguments", K(ret), K(ls_id), K(tablet_id), KPC(data_table_schema), KPC(index_schema), K(task_id));
|
||||
LOG_WARN("invalid arguments", K(ret), K(ls_id), K(tablet_id), KPC(data_table_schema), KPC(index_schema));
|
||||
} else {
|
||||
is_inited_ = true;
|
||||
tenant_id_ = tenant_id;
|
||||
@ -73,7 +71,6 @@ int ObUniqueIndexChecker::init(
|
||||
tablet_id_ = tablet_id;
|
||||
data_table_schema_ = data_table_schema;
|
||||
index_schema_ = index_schema;
|
||||
task_id_ = task_id;
|
||||
execution_id_ = execution_id;
|
||||
snapshot_version_ = snapshot_version;
|
||||
is_scan_index_ = is_scan_index;
|
||||
@ -480,9 +477,9 @@ int ObUniqueIndexChecker::report_column_checksum(
|
||||
item.execution_id_ = execution_id_;
|
||||
item.tenant_id_ = tenant_id_;
|
||||
item.table_id_ = report_table_id;
|
||||
item.ddl_task_id_ = task_id_;
|
||||
item.tablet_id_ = tablet_id_.id(); // TODO(cangdi): replace this with tablet_id
|
||||
item.column_id_ = column_ids.at(i).col_id_;
|
||||
item.task_id_ = -tablet_id_.id();
|
||||
item.task_id_ = -1;
|
||||
item.checksum_ = column_checksum.at(i);
|
||||
if (OB_FAIL(checksum_items.push_back(item))) {
|
||||
LOG_WARN("fail to push back item", K(ret));
|
||||
@ -513,7 +510,10 @@ int ObUniqueIndexChecker::check_unique_index(ObIDag *dag)
|
||||
ObLSHandle ls_handle;
|
||||
if (OB_FAIL(MTL(ObLSService *)->get_ls(ls_id_, ls_handle, ObLSGetMod::DDL_MOD))) {
|
||||
LOG_WARN("fail to get log stream", K(ret), K(ls_id_));
|
||||
} else if (OB_FAIL(ObDDLUtil::ddl_get_tablet(ls_handle, tablet_id_, tablet_handle_))) {
|
||||
} else if (OB_UNLIKELY(nullptr == ls_handle.get_ls())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("ls is null", K(ret), K(ls_handle));
|
||||
} else if (OB_FAIL(ls_handle.get_ls()->get_tablet_svr()->get_tablet(tablet_id_, tablet_handle_))) {
|
||||
LOG_WARN("fail to get tablet", K(ret), K(tablet_id_), K(tablet_handle_));
|
||||
} else if (index_schema_->is_domain_index()) {
|
||||
STORAGE_LOG(INFO, "do not need to check unique for domain index", "index_id", index_schema_->get_table_id());
|
||||
@ -609,7 +609,6 @@ int ObUniqueCheckingDag::init(
|
||||
const bool is_scan_index,
|
||||
const uint64_t index_table_id,
|
||||
const int64_t schema_version,
|
||||
const int64_t task_id,
|
||||
const uint64_t execution_id,
|
||||
const int64_t snapshot_version)
|
||||
{
|
||||
@ -619,11 +618,11 @@ int ObUniqueCheckingDag::init(
|
||||
ret = OB_INIT_TWICE;
|
||||
STORAGE_LOG(WARN, "ObUniqueCheckingDag has already been inited", K(ret));
|
||||
} else if (OB_UNLIKELY(OB_INVALID_TENANT_ID == tenant_id || !ls_id.is_valid() || !tablet_id.is_valid()
|
||||
|| OB_INVALID_ID == index_table_id || schema_version < 0 || task_id <= 0
|
||||
|| OB_INVALID_ID == index_table_id || schema_version < 0
|
||||
|| execution_id < 0 || snapshot_version < 0)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
STORAGE_LOG(WARN, "invalid arguments", K(ret), K(tenant_id), K(ls_id), K(tablet_id),
|
||||
K(index_table_id), K(schema_version), K(task_id), K(execution_id), K(snapshot_version));
|
||||
K(index_table_id), K(schema_version), K(execution_id), K(snapshot_version));
|
||||
} else {
|
||||
MTL_SWITCH(tenant_id) {
|
||||
if (OB_ISNULL(schema_service = MTL(ObTenantSchemaService *)->get_schema_service())) {
|
||||
@ -654,7 +653,6 @@ int ObUniqueCheckingDag::init(
|
||||
schema_service_ = schema_service;
|
||||
execution_id_ = execution_id;
|
||||
snapshot_version_ = snapshot_version;
|
||||
task_id_ = task_id;
|
||||
}
|
||||
} else {
|
||||
LOG_WARN("switch to tenant failed", K(ret), K(index_table_id), K(tenant_id));
|
||||
@ -896,15 +894,8 @@ int ObSimpleUniqueCheckingTask::init(
|
||||
if (OB_UNLIKELY(!tablet_id_.is_valid())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
STORAGE_LOG(WARN, "invalid arguments", K(ret), K(tablet_id_));
|
||||
} else if (OB_FAIL(unique_checker_.init(tenant_id_,
|
||||
dag->get_ls_id(),
|
||||
tablet_id_,
|
||||
dag->get_is_scan_index(),
|
||||
data_table_schema,
|
||||
index_schema,
|
||||
dag->get_task_id(),
|
||||
dag->get_execution_id(),
|
||||
dag->get_snapshot_version()))) {
|
||||
} else if (OB_FAIL(unique_checker_.init(tenant_id_, dag->get_ls_id(), tablet_id_, dag->get_is_scan_index(), data_table_schema, index_schema,
|
||||
dag->get_execution_id(), dag->get_snapshot_version()))) {
|
||||
STORAGE_LOG(WARN, "fail to init unique index checker", K(ret));
|
||||
} else {
|
||||
index_schema_ = index_schema;
|
||||
@ -960,14 +951,7 @@ int ObGlobalUniqueIndexCallback::operator()(const int ret_code)
|
||||
arg.source_table_id_ = data_table_id_;
|
||||
arg.schema_version_ = schema_version_;
|
||||
arg.task_id_ = task_id_;
|
||||
#ifdef ERRSIM
|
||||
if (OB_SUCC(ret)) {
|
||||
ret = E(EventTable::EN_DDL_REPORT_REPLICA_BUILD_STATUS_FAIL) OB_SUCCESS;
|
||||
LOG_INFO("report replica build status errsim", K(ret));
|
||||
}
|
||||
#endif
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_ISNULL(GCTX.rs_rpc_proxy_) || OB_ISNULL(GCTX.rs_mgr_)) {
|
||||
if (OB_ISNULL(GCTX.rs_rpc_proxy_) || OB_ISNULL(GCTX.rs_mgr_)) {
|
||||
ret = OB_ERR_SYS;
|
||||
STORAGE_LOG(WARN, "innner system error, rootserver rpc proxy or rs mgr must not be NULL", K(ret), K(GCTX));
|
||||
} else if (OB_FAIL(GCTX.rs_mgr_->get_master_root_server(rs_addr))) {
|
||||
|
||||
Reference in New Issue
Block a user