fixed invalid PalfEnvKey when handle message on arbserver
This commit is contained in:
10
deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp
vendored
10
deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp
vendored
@ -47,6 +47,13 @@ Handle::Handle()
|
||||
|
||||
int ObRpcProxy::init(const ObReqTransport *transport,
|
||||
const oceanbase::common::ObAddr &dst)
|
||||
{
|
||||
return init(transport, ObRpcNetHandler::CLUSTER_ID, dst);
|
||||
}
|
||||
|
||||
int ObRpcProxy::init(const ObReqTransport *transport,
|
||||
const int64_t src_cluster_id,
|
||||
const oceanbase::common::ObAddr &dst)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -58,6 +65,7 @@ int ObRpcProxy::init(const ObReqTransport *transport,
|
||||
LOG_WARN("invalid argument", K(ret), KP(transport));
|
||||
} else {
|
||||
transport_ = transport;
|
||||
src_cluster_id_ = src_cluster_id;
|
||||
dst_ = dst;
|
||||
init_ = true;
|
||||
}
|
||||
@ -250,7 +258,7 @@ int ObRpcProxy::init_pkt(
|
||||
pkt->set_timestamp(ObTimeUtility::current_time());
|
||||
pkt->set_dst_cluster_id(dst_cluster_id_);
|
||||
// For request, src_cluster_id must be the cluster_id of this cluster, directly hard-coded
|
||||
pkt->set_src_cluster_id(ObRpcNetHandler::CLUSTER_ID);
|
||||
pkt->set_src_cluster_id(src_cluster_id_);
|
||||
pkt->set_unis_version(opts.unis_version_);
|
||||
pkt->set_group_id((0 != get_group_id()) ? get_group_id() : this_worker().get_group_id());
|
||||
if (need_increment_request_level(pcode)) {
|
||||
|
||||
5
deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h
vendored
5
deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h
vendored
@ -117,12 +117,16 @@ public:
|
||||
tenant_id_(common::OB_SYS_TENANT_ID), group_id_(0),
|
||||
priv_tenant_id_(common::OB_INVALID_TENANT_ID),
|
||||
max_process_handler_time_(0), compressor_type_(common::INVALID_COMPRESSOR),
|
||||
src_cluster_id_(common::OB_INVALID_CLUSTER_ID),
|
||||
dst_cluster_id_(common::OB_INVALID_CLUSTER_ID), init_(false),
|
||||
active_(true), is_trace_time_(false), do_ratelimit_(false), is_bg_flow_(0), rcode_() {}
|
||||
virtual ~ObRpcProxy() = default;
|
||||
|
||||
int init(const rpc::frame::ObReqTransport *transport,
|
||||
const common::ObAddr &dst = common::ObAddr());
|
||||
int init(const rpc::frame::ObReqTransport *transport,
|
||||
const int64_t src_cluster_id,
|
||||
const common::ObAddr &dst = common::ObAddr());
|
||||
void destroy() { init_ = false; }
|
||||
bool is_inited() const { return init_; }
|
||||
void set_timeout(int64_t timeout) { timeout_ = timeout; }
|
||||
@ -253,6 +257,7 @@ protected:
|
||||
uint64_t priv_tenant_id_;
|
||||
uint32_t max_process_handler_time_;
|
||||
common::ObCompressorType compressor_type_;
|
||||
int64_t src_cluster_id_;
|
||||
int64_t dst_cluster_id_;
|
||||
bool init_;
|
||||
bool active_;
|
||||
|
||||
Reference in New Issue
Block a user