[CP] [to #46055572]retry clear stratus need set at the begin of retry
This commit is contained in:
parent
08432fd243
commit
e02f7d3b6c
@ -1427,6 +1427,7 @@ int ObMPStmtExecute::do_process_single(ObSQLSessionInfo &session,
|
||||
share::schema::ObSchemaGetterGuard schema_guard;
|
||||
int64_t tenant_version = 0;
|
||||
int64_t sys_version = 0;
|
||||
retry_ctrl_.clear_state_before_each_retry(session.get_retry_info_for_update());
|
||||
OZ (gctx_.schema_service_->get_tenant_schema_guard(session.get_effective_tenant_id(),
|
||||
schema_guard));
|
||||
OZ (schema_guard.get_schema_version(session.get_effective_tenant_id(), tenant_version));
|
||||
@ -1436,7 +1437,6 @@ int ObMPStmtExecute::do_process_single(ObSQLSessionInfo &session,
|
||||
OX (retry_ctrl_.set_sys_local_schema_version(sys_version));
|
||||
|
||||
if (OB_SUCC(ret) && !is_send_long_data()) {
|
||||
retry_ctrl_.clear_state_before_each_retry(session.get_retry_info_for_update());
|
||||
if (OB_LIKELY(session.get_is_in_retry())
|
||||
|| (is_arraybinding_ && (prepare_packet_sent_ || !is_prexecute()))) {
|
||||
ret = process_retry(session,
|
||||
|
@ -303,6 +303,7 @@ int ObMPStmtPrepare::process_prepare_stmt(const ObMultiStmtItem &multi_stmt_item
|
||||
need_response_error = false;
|
||||
do {
|
||||
share::schema::ObSchemaGetterGuard schema_guard;
|
||||
retry_ctrl_.clear_state_before_each_retry(session.get_retry_info_for_update());
|
||||
if (OB_FAIL(gctx_.schema_service_->get_tenant_schema_guard(
|
||||
session.get_effective_tenant_id(), schema_guard))) {
|
||||
LOG_WARN("get schema guard failed", K(ret));
|
||||
@ -318,7 +319,6 @@ int ObMPStmtPrepare::process_prepare_stmt(const ObMultiStmtItem &multi_stmt_item
|
||||
retry_ctrl_.set_sys_local_schema_version(sys_version);
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
retry_ctrl_.clear_state_before_each_retry(session.get_retry_info_for_update());
|
||||
ret = do_process(session,
|
||||
has_more_result,
|
||||
force_sync_resp,
|
||||
|
@ -191,6 +191,7 @@ int ObMPStmtPrexecute::before_process()
|
||||
share::schema::ObSchemaGetterGuard schema_guard;
|
||||
const uint64_t tenant_id = session->get_effective_tenant_id();
|
||||
ObVirtualTableIteratorFactory vt_iter_factory(*gctx_.vt_iter_creator_);
|
||||
retry_ctrl_.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (OB_FAIL(gctx_.schema_service_->get_tenant_schema_guard(tenant_id, schema_guard))) {
|
||||
LOG_WARN("get schema guard failed", K(ret));
|
||||
} else if (OB_FAIL(schema_guard.get_schema_version(
|
||||
@ -225,7 +226,6 @@ int ObMPStmtPrexecute::before_process()
|
||||
LOG_WARN("fail to set session active", K(ret));
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
retry_ctrl_.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (OB_FAIL(gctx_.sql_engine_->stmt_prepare(sql_,
|
||||
get_ctx(),
|
||||
result,
|
||||
|
@ -161,6 +161,7 @@ int ObExprOpSubQueryInPl::eval_subquery(const ObExpr &expr,
|
||||
session->set_query_start_time(ObTimeUtility::current_time());
|
||||
|
||||
do {
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(session->get_effective_tenant_id(),
|
||||
schema_guard))) {
|
||||
LOG_WARN("get schema guard failed", K(ret));
|
||||
@ -172,7 +173,6 @@ int ObExprOpSubQueryInPl::eval_subquery(const ObExpr &expr,
|
||||
} else {
|
||||
retry_ctrl.set_tenant_local_schema_version(tenant_version);
|
||||
retry_ctrl.set_sys_local_schema_version(sys_version);
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
|
||||
mysql_result.reset();
|
||||
|
||||
|
@ -1292,6 +1292,7 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx,
|
||||
row_count = 0;
|
||||
spi_result.get_mysql_result().reset();
|
||||
out_params.reset();
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(session->get_effective_tenant_id(), schema_guard))) {
|
||||
LOG_WARN("get schema guard failed", K(ret));
|
||||
} else if (OB_FAIL(schema_guard.get_schema_version(session->get_effective_tenant_id(), tenant_version))) {
|
||||
@ -1301,7 +1302,6 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx,
|
||||
} else {
|
||||
retry_ctrl.set_tenant_local_schema_version(tenant_version);
|
||||
retry_ctrl.set_sys_local_schema_version(sys_version);
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
ObArenaAllocator allocator;
|
||||
if (OB_FAIL(inner_open(ctx,
|
||||
allocator,
|
||||
@ -1500,6 +1500,7 @@ int ObSPIService::dbms_cursor_execute(ObPLExecCtx *ctx,
|
||||
row_count = 0;
|
||||
spi_result.get_mysql_result().reset();
|
||||
out_params.reset();
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(eff_tenant_id, schema_guard))) {
|
||||
LOG_WARN("get schema guard failed", K(ret));
|
||||
} else if (OB_FAIL(schema_guard.get_schema_version(eff_tenant_id, tenant_version))) {
|
||||
@ -1509,7 +1510,6 @@ int ObSPIService::dbms_cursor_execute(ObPLExecCtx *ctx,
|
||||
} else {
|
||||
retry_ctrl.set_tenant_local_schema_version(tenant_version);
|
||||
retry_ctrl.set_sys_local_schema_version(sys_version);
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (OB_FAIL(inner_open(ctx,
|
||||
exec_params.count() > 0 ? NULL : sql_stmt.ptr(),
|
||||
stmt_id,
|
||||
@ -2381,6 +2381,7 @@ int ObSPIService::spi_execute_immediate(ObPLExecCtx *ctx,
|
||||
}
|
||||
|
||||
ret = OB_SUCCESS;
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
OZ (GCTX.schema_service_->get_tenant_schema_guard(session->get_effective_tenant_id(),
|
||||
schema_guard));
|
||||
OZ (schema_guard.get_schema_version(session->get_effective_tenant_id(), tenant_version));
|
||||
@ -2388,7 +2389,6 @@ int ObSPIService::spi_execute_immediate(ObPLExecCtx *ctx,
|
||||
|
||||
OX (retry_ctrl.set_tenant_local_schema_version(tenant_version));
|
||||
OX (retry_ctrl.set_sys_local_schema_version(sys_version));
|
||||
OX (retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update()));
|
||||
|
||||
if (OB_NOT_NULL(spi_conn)) {
|
||||
sql_proxy->close(spi_conn, OB_SUCCESS == ret);
|
||||
@ -3354,6 +3354,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
||||
share::schema::ObSchemaGetterGuard schema_guard;
|
||||
do {
|
||||
ret = OB_SUCCESS;
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
OZ (cursor.prepare_spi_cursor(spi_cursor,
|
||||
session->get_effective_tenant_id(),
|
||||
size));
|
||||
@ -3362,7 +3363,6 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
||||
OZ (schema_guard.get_schema_version(OB_SYS_TENANT_ID, sys_version));
|
||||
OX (retry_ctrl.set_tenant_local_schema_version(tenant_version));
|
||||
OX (retry_ctrl.set_sys_local_schema_version(sys_version));
|
||||
OX (retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update()));
|
||||
if (OB_SUCC(ret)) {
|
||||
OZ (inner_open(ctx, sql_str, stmt_id, stmt_type, exec_params,
|
||||
spi_result.get_mysql_result(), spi_result.get_out_params()),
|
||||
@ -5032,6 +5032,7 @@ int ObSPIService::inner_fetch_with_retry(ObPLExecCtx *ctx,
|
||||
if (OB_SUCC(ret)) {
|
||||
do {
|
||||
ret = OB_SUCCESS;
|
||||
retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update());
|
||||
if (THIS_WORKER.is_timeout()) {
|
||||
ret = OB_TIMEOUT;
|
||||
LOG_WARN("inner fetch with retry already timeout!",
|
||||
@ -5047,7 +5048,6 @@ int ObSPIService::inner_fetch_with_retry(ObPLExecCtx *ctx,
|
||||
OZ (schema_guard.get_schema_version(OB_SYS_TENANT_ID, sys_version));
|
||||
OX (retry_ctrl.set_tenant_local_schema_version(tenant_version));
|
||||
OX (retry_ctrl.set_sys_local_schema_version(sys_version));
|
||||
OX (retry_ctrl.clear_state_before_each_retry(session->get_retry_info_for_update()));
|
||||
CK (OB_NOT_NULL(result_set));
|
||||
CK (OB_NOT_NULL(static_cast<observer::ObInnerSQLResult*>(result_set)->get_result_set()));
|
||||
if (OB_SUCC(ret)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user