revert code

This commit is contained in:
GongYusen
2024-04-01 13:07:02 +00:00
committed by ob-robot
parent a21418864c
commit 36d42c2008
3 changed files with 8 additions and 14 deletions

View File

@ -316,8 +316,7 @@ ObPsStmtInfo::ObPsStmtInfo(ObIAllocator *inner_allocator,
raw_sql_(), raw_sql_(),
raw_params_(inner_allocator), raw_params_(inner_allocator),
raw_params_idx_(inner_allocator), raw_params_idx_(inner_allocator),
literal_stmt_type_(stmt::T_NONE), literal_stmt_type_(stmt::T_NONE)
erased_(false)
{ {
} }
@ -463,7 +462,6 @@ int ObPsStmtInfo::deep_copy(const ObPsStmtInfo &other)
is_expired_ = other.is_expired_; is_expired_ = other.is_expired_;
is_expired_evicted_ = other.is_expired_evicted_; is_expired_evicted_ = other.is_expired_evicted_;
literal_stmt_type_ = other.literal_stmt_type_; literal_stmt_type_ = other.literal_stmt_type_;
erased_ = other.erased_;
if (other.get_dep_objs_cnt() > 0) { if (other.get_dep_objs_cnt() > 0) {
dep_objs_cnt_ = other.get_dep_objs_cnt(); dep_objs_cnt_ = other.get_dep_objs_cnt();
if (NULL == (dep_objs_ = reinterpret_cast<ObSchemaObjVersion *> if (NULL == (dep_objs_ = reinterpret_cast<ObSchemaObjVersion *>

View File

@ -251,7 +251,6 @@ public:
void set_is_expired() { ATOMIC_STORE(&is_expired_, true); } void set_is_expired() { ATOMIC_STORE(&is_expired_, true); }
bool is_expired() { return ATOMIC_LOAD(&is_expired_); } bool is_expired() { return ATOMIC_LOAD(&is_expired_); }
bool *get_is_expired_evicted_ptr() { return &is_expired_evicted_; } bool *get_is_expired_evicted_ptr() { return &is_expired_evicted_; }
bool try_set_erase_flag() { return ATOMIC_BCAS(&erased_, false, true); }
DECLARE_VIRTUAL_TO_STRING; DECLARE_VIRTUAL_TO_STRING;
@ -293,7 +292,6 @@ private:
ObFixedArray<ObPCParam *, common::ObIAllocator> raw_params_; ObFixedArray<ObPCParam *, common::ObIAllocator> raw_params_;
ObFixedArray<int64_t, common::ObIAllocator> raw_params_idx_; ObFixedArray<int64_t, common::ObIAllocator> raw_params_idx_;
stmt::StmtType literal_stmt_type_; stmt::StmtType literal_stmt_type_;
volatile bool erased_;
}; };
struct TypeInfo { struct TypeInfo {

View File

@ -152,9 +152,6 @@ int ObPsCache::deref_ps_stmt(const ObPsStmtId stmt_id, bool erase_item/*=false*/
if (erase_item) { // dec cached ref if (erase_item) { // dec cached ref
if (OB_FAIL(erase_stmt_item(stmt_id, ps_sql_key))) { if (OB_FAIL(erase_stmt_item(stmt_id, ps_sql_key))) {
LOG_WARN("fail to erase stmt", K(ret)); LOG_WARN("fail to erase stmt", K(ret));
} else if (ps_info->try_set_erase_flag() && OB_SUCCESS != (tmp_ret = deref_stmt_info(stmt_id))) {
ret = tmp_ret;
LOG_WARN("deref stmt info failed", K(ret), K(stmt_id), K(ps_sql_key));
} }
} else { // dec session ref } else { // dec session ref
if (OB_ISNULL(ps_info->get_ps_item())) { if (OB_ISNULL(ps_info->get_ps_item())) {
@ -163,6 +160,8 @@ int ObPsCache::deref_ps_stmt(const ObPsStmtId stmt_id, bool erase_item/*=false*/
} else { } else {
ps_info->get_ps_item()->dec_ref_count_check_erase(); ps_info->get_ps_item()->dec_ref_count_check_erase();
} }
}
if (OB_SUCCESS != (tmp_ret = deref_stmt_info(stmt_id))) { if (OB_SUCCESS != (tmp_ret = deref_stmt_info(stmt_id))) {
ret = tmp_ret; //previous ret ignore ret = tmp_ret; //previous ret ignore
LOG_WARN("deref stmt info failed", K(ret), K(stmt_id), K(ps_sql_key)); LOG_WARN("deref stmt info failed", K(ret), K(stmt_id), K(ps_sql_key));
@ -170,7 +169,6 @@ int ObPsCache::deref_ps_stmt(const ObPsStmtId stmt_id, bool erase_item/*=false*/
LOG_TRACE("deref stmt info success", K(stmt_id), K(ps_sql_key), K(ret)); LOG_TRACE("deref stmt info success", K(stmt_id), K(ps_sql_key), K(ret));
} }
} }
}
return ret; return ret;
} }