[CP] [master] fix handle tenant drop

This commit is contained in:
chinaxing 2023-09-16 02:10:14 +00:00 committed by ob-robot
parent 34a92c54e0
commit b505b83062
2 changed files with 13 additions and 3 deletions

View File

@ -151,7 +151,12 @@ int ObLocationAdapter::get_leader_(const int64_t cluster_id,
if (OB_SUCCESS != (tmp_ret = ObLocationService::check_ls_exist(tenant_id, ls_id, state))) {
TRANS_LOG(WARN, "check if ls exist failed", K(tmp_ret), K(ls_id));
if (OB_TENANT_NOT_EXIST == tmp_ret) {
ret = tmp_ret;
bool has_dropped = false;
if (OB_TMP_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(tenant_id, has_dropped))) {
TRANS_LOG(WARN, "failed to check tenant has been dropped", K(tmp_ret), K(tenant_id));
} else if (has_dropped) {
ret = OB_TENANT_HAS_BEEN_DROPPED;
}
}
} else if (state.is_deleted()) {
// rewrite ret
@ -234,7 +239,12 @@ int ObLocationAdapter::nonblock_get(const int64_t cluster_id,
if (OB_SUCCESS != (tmp_ret = ObLocationService::check_ls_exist(tenant_id, ls_id, state))) {
TRANS_LOG(WARN, "check if ls exist failed", K(tmp_ret), K(ls_id));
if (OB_TENANT_NOT_EXIST == tmp_ret) {
ret = tmp_ret;
bool has_dropped = false;
if (OB_TMP_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(tenant_id, has_dropped))) {
TRANS_LOG(WARN, "failed to check tenant has been dropped", K(tmp_ret), K(tenant_id));
} else if (has_dropped) {
ret = OB_TENANT_HAS_BEEN_DROPPED;
}
}
} else if (state.is_deleted()) {
// rewrite ret

View File

@ -452,7 +452,7 @@ int ObTransRpc::post_msg(const ObLSID &ls_id, ObTxMsg &msg)
} else if (OB_FAIL(trans_service_->get_location_adapter()->nonblock_get_leader(cluster_id, tenant_id, ls_id, server))) {
TRANS_LOG(WARN, "get leader failed", KR(ret), K(msg), K(cluster_id), K(ls_id));
if (ObTxMsgTypeChecker::is_2pc_msg_type(msg.get_msg_type())) {
if (OB_LS_IS_DELETED == ret || OB_TENANT_NOT_EXIST == ret) {
if (OB_LS_IS_DELETED == ret) {
int tmp_ret = trans_service_->handle_ls_deleted(msg);
if (OB_SUCCESS == tmp_ret) {
ret = OB_SUCCESS;