[master] fix errcode scan issues - 2

This commit is contained in:
zhjc1124 2023-08-23 06:40:21 +00:00 committed by ob-robot
parent 96798f4f60
commit 15657b8dfa
15 changed files with 37 additions and 23 deletions

View File

@ -491,9 +491,9 @@ int ObLogTableMatcher::init(const char *tb_white_list,
if (OB_ISNULL(tb_white_list) || OB_ISNULL(tb_black_list)
|| OB_ISNULL(tg_white_list) || OB_ISNULL(tg_black_list)) {
OBLOG_LOG(ERROR, "invalid_argument", K(tb_white_list), K(tb_black_list),
K(tg_white_list), K(tg_black_list));
ret = OB_INVALID_ARGUMENT;
OBLOG_LOG(ERROR, "invalid_argument", KR(ret), K(tb_white_list), K(tb_black_list),
K(tg_white_list), K(tg_black_list));
} else if (OB_FAIL(set_pattern_(tb_white_list))) {
OBLOG_LOG(ERROR, "set table white list pattern fail", KR(ret), K(tb_white_list));
} else if (OB_FAIL(set_black_pattern_(tb_black_list))) {

View File

@ -325,8 +325,8 @@ int ObLogTimeZoneInfoGetter::fetch_tenant_timezone_info_(
SMART_VAR(ObMySQLProxy::MySQLResult, res) {
sqlclient::ObMySQLResult *result = nullptr;
if (OB_ISNULL(mysql_proxy_)) {
LOG_ERROR("mysql_proxy_ is null", K(mysql_proxy_));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("mysql_proxy_ is null", KR(ret), K(mysql_proxy_));
} else if (! need_fetch_timezone_info_by_tennat_()) {
if (OB_FAIL(mysql_proxy_->read(res, ObTimeZoneInfoManager::FETCH_TZ_INFO_SQL))) {
LOG_WARN("fail to execute sql", KR(ret));

View File

@ -541,9 +541,9 @@ int TransCtx::build_ready_participants_list_()
// Linked list of participants
for (int64_t index = 0; OB_SUCCESS == ret && index < participant_count_; index++) {
if (OB_ISNULL(participants_[index].obj_)) {
LOG_ERROR("participant object is NULL", K(participants_[index]), K(index),
K(participant_count_), K(state_), K(trans_id_));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("participant object is NULL", KR(ret), K(participants_[index]), K(index),
K(participant_count_), K(state_), K(trans_id_));
} else if (index < participant_count_ - 1) {
participants_[index].obj_->set_next_task(participants_[index + 1].obj_);
} else {
@ -663,9 +663,9 @@ int TransCtx::commit()
ObSpinLockGuard guard(lock_);
if (OB_ISNULL(ready_participant_objs_)) {
LOG_ERROR("ready participant objs is null",
KPC(ready_participant_objs_), KPC(this));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("ready participant objs is null", KR(ret),
KPC(ready_participant_objs_), KPC(this));
} else {
const bool is_ddl_trans = ready_participant_objs_->is_ddl_trans();
@ -754,9 +754,9 @@ int TransCtx::get_tenant_id(uint64_t &tenant_id) const
int ret = OB_SUCCESS;
ObSpinLockGuard guard(lock_);
if (OB_ISNULL(ready_participant_objs_)) {
LOG_ERROR("ready participant objs is null, can not decide tenant id",
KPC(ready_participant_objs_), KPC(this));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("ready participant objs is null, can not decide tenant id", KR(ret),
KPC(ready_participant_objs_), KPC(this));
} else {
// The tenant ID of the first participant is used as the tenant ID of the distributed transaction
// TODO: support for cross-tenant transactions

View File

@ -115,8 +115,7 @@ int ObMPUtils::add_changed_session_info(OMPKOK &ok_pkt, sql::ObSQLSessionInfo &s
if (name.empty()) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid variable name", K(name), K(ret));
}
if (OB_FAIL(user_map.get_refactored(name, sess_var))) {
} else if (OB_FAIL(user_map.get_refactored(name, sess_var))) {
LOG_WARN("unknown user variable", K(name), K(ret));
} else {
ObStringKV str_kv;

View File

@ -272,7 +272,8 @@ void ObInnerSQLConnection::unref()
ret = OB_NOT_INIT;
LOG_WARN("not init", K(ret), K(lbt()));
} else if (OB_ISNULL(pool_)) {
LOG_ERROR("not init conn pool");
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("not init conn pool", K(ret));
} else {
if (0 == --ref_cnt_) {
if (OB_FAIL(pool_->revert(this))) {

View File

@ -116,7 +116,8 @@ int ObRpcCheckBackupSchuedulerWorkingP::process()
{
int ret = OB_SUCCESS;
if (OB_ISNULL(gctx_.root_service_)) {
LOG_ERROR("invalid argument", K(gctx_.root_service_));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("invalid argument", K(ret), K(gctx_.root_service_));
} else {
ret = gctx_.root_service_->check_backup_scheduler_working(result_);
}
@ -764,7 +765,8 @@ int ObRpcGetRoleP::process()
{
int ret = OB_SUCCESS;
if (OB_ISNULL(gctx_.root_service_)) {
LOG_ERROR("invalid argument", K(gctx_.root_service_));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("invalid argument", K(ret), K(gctx_.root_service_));
} else {
ret = gctx_.ob_service_->get_root_server_status(result_);
}

View File

@ -2073,7 +2073,8 @@ void ObMultiTenant::get_tenant_ids(TenantIdList &id_list)
it != tenants_.end() && OB_SUCCESS == ret;
it++) {
if (OB_ISNULL(*it)) {
LOG_ERROR("unexpected condition", K(*it));
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("unexpected condition", K(ret), K(*it));
} else if (OB_FAIL(id_list.push_back((*it)->id()))) {
LOG_ERROR("push tenant id to id list fail", K(ret));
}

View File

@ -256,7 +256,8 @@ void ObTenantSrs::TenantSrsUpdateTask::runTimerTask()
{
int ret = OB_SUCCESS;
if (OB_ISNULL(tenant_srs_)) {
LOG_WARN("failed to do srs update task. tenant_srs is null");
ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to do srs update task. tenant_srs is null", K(ret));
} else if (OB_FAIL(tenant_srs_->refresh_sys_srs())) {
if (ret != OB_ERR_EMPTY_QUERY) {
LOG_WARN("failed to refresh sys srs", K(ret), K(tenant_srs_->remote_sys_srs_version_),

View File

@ -344,7 +344,7 @@ int ObTenantTimezoneMgr::update_timezone_map()
}
}
if (OB_FAIL(ret)) {
} else if (add_new_tenants(latest_tenant_ids)) {
} else if (OB_FAIL(add_new_tenants(latest_tenant_ids))) {
LOG_WARN("add new tenants failed", K(ret));
}
return ret;
@ -361,6 +361,7 @@ int ObTenantTimezoneMgr::get_tenant_tz(const uint64_t tenant_id,
{
int ret = OB_SUCCESS;
if (OB_ISNULL(tenant_tz_map_getter_)) {
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("tenant tz map getter is null", K(ret), K(tenant_id));
} else if (OB_FAIL(tenant_tz_map_getter_(tenant_id, timezone_wrap))) {
LOG_WARN("get tenant tz map failed", K(ret), K(tenant_id));

View File

@ -677,6 +677,7 @@ int ObAllVirtualProxySchema::get_view_decoded_schema_(
resolver_ctx.expr_factory_ = &expr_factory;
resolver_ctx.stmt_factory_ = &stmt_factory;
if (OB_ISNULL(resolver_ctx.query_ctx_ = stmt_factory.get_query_ctx())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("create query context failed", KR(ret));
} else {
// set # of question marks

View File

@ -262,7 +262,9 @@ int ObSqlWorkareaActive::inner_get_next_row(common::ObNewRow *&row)
}
ObSqlWorkareaProfileInfo *wa_active = nullptr;
uint64_t tenant_id = 0;
if (OB_FAIL(iter_.get_next_wa_active(wa_active, tenant_id))) {
if (OB_FAIL(ret)) {
// do nothing
} else if (OB_FAIL(iter_.get_next_wa_active(wa_active, tenant_id))) {
if (OB_ITER_END != ret) {
LOG_WARN("failed to get next channel", K(ret));
}

View File

@ -213,7 +213,9 @@ int ObSqlWorkareaHistogram::inner_get_next_row(common::ObNewRow *&row)
}
ObWorkareaHistogram *wa_histogram = nullptr;
uint64_t tenant_id = 0;
if (OB_FAIL(iter_.get_next_wa_histogram(wa_histogram, tenant_id))) {
if (OB_FAIL(ret)) {
// do nothing
} else if (OB_FAIL(iter_.get_next_wa_histogram(wa_histogram, tenant_id))) {
if (OB_ITER_END != ret) {
LOG_WARN("failed to get next channel", K(ret));
}

View File

@ -282,7 +282,9 @@ int ObSqlWorkareaHistoryStat::inner_get_next_row(common::ObNewRow *&row)
}
ObSqlWorkAreaStat *wa_stat = nullptr;
uint64_t tenant_id = 0;
if (OB_FAIL(iter_.get_next_wa_stat(wa_stat, tenant_id))) {
if (OB_FAIL(ret)) {
// do nothing
} else if (OB_FAIL(iter_.get_next_wa_stat(wa_stat, tenant_id))) {
if (OB_ITER_END != ret) {
LOG_WARN("failed to get next channel", K(ret));
}

View File

@ -218,7 +218,9 @@ int ObSqlWorkareaMemoryInfo::inner_get_next_row(common::ObNewRow *&row)
}
ObSqlWorkareaCurrentMemoryInfo *memory_info = nullptr;
uint64_t tenant_id = 0;
if (OB_FAIL(iter_.get_next_wa_memory_info(memory_info, tenant_id))) {
if (OB_FAIL(ret)) {
// do nothing
} else if (OB_FAIL(iter_.get_next_wa_memory_info(memory_info, tenant_id))) {
if (OB_ITER_END != ret) {
LOG_WARN("failed to get next channel", K(ret));
}

View File

@ -355,8 +355,8 @@ int ObAdminDumpsstExecutor::init_master_key_getter()
// if (OB_FAIL(common::hex_to_cstr(key_hex_str_, len,
// master_key, share::OB_MAX_MASTER_KEY_LENGTH + 1))) {
// STORAGE_LOG(WARN, "fail to hex to cstr", K(ret));
// } else if (share::ObMasterKeyGetter::instance().set_master_key(
// master_key_id_, master_key, STRLEN(master_key))) {
// } else if (OB_FAIL(share::ObMasterKeyGetter::instance().set_master_key(
// master_key_id_, master_key, STRLEN(master_key)))) {
// STORAGE_LOG(WARN, "fail to set master key", K(ret));
// }
// }