refresh location cache when get leader failed in post_msg
This commit is contained in:
@ -396,7 +396,7 @@ int ObTransRpc::post_msg(const ObAddr &server, ObTxMsg &msg)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTransRpc::post_msg(const ObLSID &p, ObTxMsg &msg)
|
int ObTransRpc::post_msg(const ObLSID &ls_id, ObTxMsg &msg)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
#ifdef TRANS_ERROR
|
#ifdef TRANS_ERROR
|
||||||
@ -425,8 +425,9 @@ int ObTransRpc::post_msg(const ObLSID &p, ObTxMsg &msg)
|
|||||||
} else if (OB_UNLIKELY(!is_valid_tenant_id(tenant_id)) || OB_UNLIKELY(!msg.is_valid())) {
|
} else if (OB_UNLIKELY(!is_valid_tenant_id(tenant_id)) || OB_UNLIKELY(!msg.is_valid())) {
|
||||||
TRANS_LOG(WARN, "invalid argument", K(tenant_id), K(msg));
|
TRANS_LOG(WARN, "invalid argument", K(tenant_id), K(msg));
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
} else if (OB_FAIL(trans_service_->get_location_adapter()->nonblock_get_leader(cluster_id, tenant_id, p, server))) {
|
} 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(p));
|
TRANS_LOG(WARN, "get leader failed", KR(ret), K(msg), K(cluster_id), K(ls_id));
|
||||||
|
(void)refresh_location_cache(ls_id);
|
||||||
} else if (ObTxMsgTypeChecker::is_2pc_msg_type(msg.get_msg_type())) {
|
} else if (ObTxMsgTypeChecker::is_2pc_msg_type(msg.get_msg_type())) {
|
||||||
// 2pc msg optimization
|
// 2pc msg optimization
|
||||||
const int64_t dst_cluster_id = obrpc::ObRpcNetHandler::CLUSTER_ID;
|
const int64_t dst_cluster_id = obrpc::ObRpcNetHandler::CLUSTER_ID;
|
||||||
|
Reference in New Issue
Block a user