fix: gts_callback_interrupted change tenant failure
This commit is contained in:
@ -258,6 +258,11 @@ public:
|
|||||||
MonotonicTs unused;
|
MonotonicTs unused;
|
||||||
return source_.get_gts(stc, NULL, gts, unused);
|
return source_.get_gts(stc, NULL, gts, unused);
|
||||||
}
|
}
|
||||||
|
virtual int remove_dropped_tenant(const uint64_t tenant_id)
|
||||||
|
{
|
||||||
|
UNUSED(tenant_id);
|
||||||
|
return OB_SUCCESS;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
MockObGtsSource &source_;
|
MockObGtsSource &source_;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1196,12 +1196,15 @@ int ObPartTransCtx::gts_callback_interrupted(const int errcode)
|
|||||||
if (IS_NOT_INIT) {
|
if (IS_NOT_INIT) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
TRANS_LOG(ERROR, "ObPartTransCtx not inited", K(ret));
|
TRANS_LOG(ERROR, "ObPartTransCtx not inited", K(ret));
|
||||||
} else if (OB_UNLIKELY(is_exiting_)) {
|
} else if (OB_UNLIKELY(!is_exiting_)) {
|
||||||
|
// at this time, ObTxCtxMgr should already be stopped,
|
||||||
|
// so ObPartTransCtx should already be killed
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
TRANS_LOG(ERROR, "ObPartTransCtx is not exiting", K(ret));
|
||||||
|
} else {
|
||||||
need_revert_ctx = true;
|
need_revert_ctx = true;
|
||||||
sub_state_.clear_gts_waiting();
|
sub_state_.clear_gts_waiting();
|
||||||
TRANS_LOG(INFO, "transaction is interruputed gts callback", KR(ret), "context", *this);
|
TRANS_LOG(INFO, "transaction is interruputed gts callback", KR(ret), "context", *this);
|
||||||
} else {
|
|
||||||
ret = OB_EAGAIN;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (need_revert_ctx) {
|
if (need_revert_ctx) {
|
||||||
|
|||||||
@ -260,6 +260,8 @@ void ObTransService::stop()
|
|||||||
TRANS_LOG(WARN, "ObTransTimer stop error", K(ret));
|
TRANS_LOG(WARN, "ObTransTimer stop error", K(ret));
|
||||||
} else if (OB_FAIL(dup_table_scan_timer_.stop())) {
|
} else if (OB_FAIL(dup_table_scan_timer_.stop())) {
|
||||||
TRANS_LOG(WARN, "dup_table_scan_timer_ stop error", K(ret));
|
TRANS_LOG(WARN, "dup_table_scan_timer_ stop error", K(ret));
|
||||||
|
} else if (OB_FAIL(ts_mgr_->remove_dropped_tenant(tenant_id_))) {
|
||||||
|
TRANS_LOG(WARN, "gts_mgr stop error", K(ret));
|
||||||
} else {
|
} else {
|
||||||
rpc_->stop();
|
rpc_->stop();
|
||||||
dup_table_rpc_->stop();
|
dup_table_rpc_->stop();
|
||||||
|
|||||||
@ -509,7 +509,7 @@ void ObTsMgr::run1()
|
|||||||
ids.reset();
|
ids.reset();
|
||||||
for (int64_t i = 0; i < check_ids.count(); i++) {
|
for (int64_t i = 0; i < check_ids.count(); i++) {
|
||||||
const uint64_t tenant_id = check_ids.at(i);
|
const uint64_t tenant_id = check_ids.at(i);
|
||||||
if (OB_FAIL(remove_dropped_tenant_(tenant_id))) {
|
if (OB_FAIL(remove_dropped_tenant(tenant_id))) {
|
||||||
TRANS_LOG(WARN, "remove dropped tenant failed", K(ret), K(tenant_id));
|
TRANS_LOG(WARN, "remove dropped tenant failed", K(ret), K(tenant_id));
|
||||||
// ignore ret
|
// ignore ret
|
||||||
ret = OB_SUCCESS;
|
ret = OB_SUCCESS;
|
||||||
@ -743,7 +743,7 @@ int ObTsMgr::delete_tenant_(const uint64_t tenant_id)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTsMgr::remove_dropped_tenant_(const uint64_t tenant_id)
|
int ObTsMgr::remove_dropped_tenant(const uint64_t tenant_id)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObTsTenantInfo tenant_info(tenant_id);
|
ObTsTenantInfo tenant_info(tenant_id);
|
||||||
|
|||||||
@ -100,6 +100,7 @@ public:
|
|||||||
bool &need_wait) = 0;
|
bool &need_wait) = 0;
|
||||||
virtual int wait_gts_elapse(const uint64_t tenant_id, const share::SCN &scn) = 0;
|
virtual int wait_gts_elapse(const uint64_t tenant_id, const share::SCN &scn) = 0;
|
||||||
virtual bool is_external_consistent(const uint64_t tenant_id) = 0;
|
virtual bool is_external_consistent(const uint64_t tenant_id) = 0;
|
||||||
|
virtual int remove_dropped_tenant(const uint64_t tenant_id) = 0;
|
||||||
public:
|
public:
|
||||||
VIRTUAL_TO_STRING_KV("", "");
|
VIRTUAL_TO_STRING_KV("", "");
|
||||||
};
|
};
|
||||||
@ -405,6 +406,7 @@ public:
|
|||||||
int wait_gts_elapse(const uint64_t tenant_id, const share::SCN &scn);
|
int wait_gts_elapse(const uint64_t tenant_id, const share::SCN &scn);
|
||||||
bool is_external_consistent(const uint64_t tenant_id);
|
bool is_external_consistent(const uint64_t tenant_id);
|
||||||
int refresh_gts_location(const uint64_t tenant_id);
|
int refresh_gts_location(const uint64_t tenant_id);
|
||||||
|
int remove_dropped_tenant(const uint64_t tenant_id);
|
||||||
public:
|
public:
|
||||||
TO_STRING_KV("ts_source", "GTS");
|
TO_STRING_KV("ts_source", "GTS");
|
||||||
public:
|
public:
|
||||||
@ -420,7 +422,6 @@ private:
|
|||||||
void revert_ts_source_info_(ObTsSourceInfoGuard &guard);
|
void revert_ts_source_info_(ObTsSourceInfoGuard &guard);
|
||||||
int add_tenant_(const uint64_t tenant_id);
|
int add_tenant_(const uint64_t tenant_id);
|
||||||
int delete_tenant_(const uint64_t tenant_id);
|
int delete_tenant_(const uint64_t tenant_id);
|
||||||
int remove_dropped_tenant_(const uint64_t tenant_id);
|
|
||||||
static ObTsMgr* &get_instance_inner();
|
static ObTsMgr* &get_instance_inner();
|
||||||
private:
|
private:
|
||||||
bool is_inited_;
|
bool is_inited_;
|
||||||
|
|||||||
@ -326,6 +326,11 @@ public:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int remove_dropped_tenant(const uint64_t tenant_id) {
|
||||||
|
UNUSED(tenant_id);
|
||||||
|
return OB_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
int update_base_ts(const int64_t base_ts) { return OB_SUCCESS; }
|
int update_base_ts(const int64_t base_ts) { return OB_SUCCESS; }
|
||||||
int get_base_ts(int64_t &base_ts) { return OB_SUCCESS; }
|
int get_base_ts(int64_t &base_ts) { return OB_SUCCESS; }
|
||||||
bool is_external_consistent(const uint64_t tenant_id) { return true; }
|
bool is_external_consistent(const uint64_t tenant_id) { return true; }
|
||||||
|
|||||||
Reference in New Issue
Block a user