fix ObTenantAdminMergeRpcProxy init twice

This commit is contained in:
obdev
2022-11-14 04:38:32 +00:00
committed by wangzelin.wzl
parent fc7357a445
commit a890291041
3 changed files with 18 additions and 19 deletions

View File

@ -51,7 +51,7 @@ int ObMajorFreezeHelper::major_freeze(
if (OB_UNLIKELY(!param.is_valid())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(param), KR(ret));
} else if (OB_FAIL(get_freeze_info(param, freeze_info_array))){
} else if (OB_FAIL(get_freeze_info(param, freeze_info_array))) {
LOG_WARN("fail to get tenant id", KR(ret), K(param));
} else {
if (OB_FAIL(do_major_freeze(*param.transport_, freeze_info_array, merge_results))) {
@ -311,7 +311,6 @@ int ObMajorFreezeHelper::do_one_tenant_admin_merge(
LOG_WARN("invalid argument", KR(ret), K(tenant_id), K(admin_type));
} else {
obrpc::ObTenantAdminMergeRpcProxy proxy;
bool force_renew = false;
ObAddr leader;
obrpc::ObTenantAdminMergeRequest req(tenant_id, admin_type);
obrpc::ObTenantAdminMergeResponse resp;
@ -319,16 +318,16 @@ int ObMajorFreezeHelper::do_one_tenant_admin_merge(
if (OB_ISNULL(GCTX.location_service_)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid GCTX", KR(ret));
} else if (OB_FAIL(proxy.init(&transport))) {
LOG_WARN("fail to init", KR(ret));
} else {
const int64_t MAX_RETRY_COUNT = 5;
bool admin_merge_done = false;
for (int64_t i = 0; OB_SUCC(ret) && (!admin_merge_done) && (i < MAX_RETRY_COUNT); ++i) {
if (OB_FAIL(GCTX.location_service_->get_leader(GCONF.cluster_id,
tenant_id, share::SYS_LS, force_renew, leader))) {
LOG_WARN("fail to get ls locaiton leader", KR(ret), K(tenant_id), K(force_renew));
} else if (OB_FAIL(proxy.init(&transport))) {
LOG_WARN("fail to init", KR(ret));
if (OB_FAIL(GCTX.location_service_->get_leader_with_retry_until_timeout(GCONF.cluster_id,
tenant_id, share::SYS_LS, leader))) {
LOG_WARN("fail to get ls locaiton leader", KR(ret), K(tenant_id));
} else if (OB_FAIL(proxy.to(leader)
.trace_time(true)
.max_process_handler_time(MAX_PROCESS_TIME_US)

View File

@ -660,12 +660,12 @@ int ObMajorMergeScheduler::update_merge_status(const int64_t expected_epoch)
return ret;
}
int ObMajorMergeScheduler::update_global_merge_info_after_merge(const int64_t expected_epaoch)
int ObMajorMergeScheduler::update_global_merge_info_after_merge(const int64_t expected_epoch)
{
int ret = OB_SUCCESS;
// need update global merge_status
if (OB_FAIL(zone_merge_mgr_->update_global_merge_info_after_merge(expected_epaoch))) {
LOG_WARN("fail to update global merge info after merge", KR(ret), K_(tenant_id), K(expected_epaoch));
if (OB_FAIL(zone_merge_mgr_->update_global_merge_info_after_merge(expected_epoch))) {
LOG_WARN("fail to update global merge info after merge", KR(ret), K_(tenant_id), K(expected_epoch));
}
return ret;
}

View File

@ -58,9 +58,9 @@ int ObExprToOutfileRow::calc_result_typeN(ObExprResType &type,
// the result is only used to select into outile, so we don't care the accurate length
type.set_length(OB_MAX_ROW_LENGTH);
// field_str
types[PARAM_FIELD].set_calc_type(ObVarcharType);
types[PARAM_FIELD].set_calc_collation_type(types[PARAM_FIELD].get_collation_type());
// line_str
types[PARAM_FIELD].set_calc_type(ObVarcharType);
types[PARAM_FIELD].set_calc_collation_type(types[PARAM_FIELD].get_collation_type());
// line_str
types[PARAM_LINE].set_calc_type(ObVarcharType);
types[PARAM_LINE].set_calc_collation_type(types[PARAM_LINE].get_collation_type());
// closed_cht
@ -75,9 +75,9 @@ int ObExprToOutfileRow::calc_result_typeN(ObExprResType &type,
return ret;
}
int ObExprToOutfileRow::cg_expr(ObExprCGCtx &, const ObRawExpr &, ObExpr &expr) const
{
int ret = OB_SUCCESS;
int ObExprToOutfileRow::cg_expr(ObExprCGCtx &, const ObRawExpr &, ObExpr &expr) const
{
int ret = OB_SUCCESS;
CK(expr.arg_cnt_ > PARAM_SELECT_ITEM);
if (OB_SUCC(ret)) {
for (int i = PARAM_FIELD; i < PARAM_SELECT_ITEM; i++) {
@ -175,9 +175,9 @@ int ObExprToOutfileRow::to_outfile_str(const ObExpr &expr, ObEvalCtx &ctx, ObDat
int64_t pos = 0;
char *buf = out_info->buf_;
int64_t buf_len = out_info->buf_len_;
for (int64_t i = PARAM_SELECT_ITEM; OB_SUCC(ret) && i < expr.arg_cnt_; i++) {
ObDatum &v = expr.locate_param_datum(ctx, i);
const ObObjMeta &obj_meta = expr.args_[i]->obj_meta_;
for (int64_t i = PARAM_SELECT_ITEM; OB_SUCC(ret) && i < expr.arg_cnt_; i++) {
ObDatum &v = expr.locate_param_datum(ctx, i);
const ObObjMeta &obj_meta = expr.args_[i]->obj_meta_;
ObObj obj;
OZ(v.to_obj(obj, obj_meta, expr.args_[i]->obj_datum_map_));
OZ(print_field(buf, buf_len, pos, obj, *out_info));