Fix: Rpc connect error
This commit is contained in:
2
deps/oblib/src/lib/ob_define.h
vendored
2
deps/oblib/src/lib/ob_define.h
vendored
@ -174,6 +174,8 @@ const int64_t USER_RESOURCE_GROUP_START_ID = 10000;
|
|||||||
const int64_t USER_RESOURCE_GROUP_END_ID = 19999;
|
const int64_t USER_RESOURCE_GROUP_END_ID = 19999;
|
||||||
const int64_t SYS_RESOURCE_GROUP_START_ID = 20000;
|
const int64_t SYS_RESOURCE_GROUP_START_ID = 20000;
|
||||||
const int64_t SYS_RESOURCE_GROUP_CNT = 21; //accord ObIOModule
|
const int64_t SYS_RESOURCE_GROUP_CNT = 21; //accord ObIOModule
|
||||||
|
// The timeout provided to the storage layer will be reduced by 100ms
|
||||||
|
const int64_t ESTIMATE_PS_RESERVE_TIME = 100 * 1000;
|
||||||
OB_INLINE bool is_user_group(const int64_t group_id)
|
OB_INLINE bool is_user_group(const int64_t group_id)
|
||||||
{
|
{
|
||||||
return group_id >= USER_RESOURCE_GROUP_START_ID && group_id <= USER_RESOURCE_GROUP_END_ID;
|
return group_id >= USER_RESOURCE_GROUP_START_ID && group_id <= USER_RESOURCE_GROUP_END_ID;
|
||||||
|
|||||||
@ -468,7 +468,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(ObPhysicalPlanCtx);
|
DISALLOW_COPY_AND_ASSIGN(ObPhysicalPlanCtx);
|
||||||
private:
|
private:
|
||||||
static const int64_t ESTIMATE_PS_RESERVE_TIME = 100 * 1000;
|
|
||||||
static const int64_t ESTIMATE_TRANS_RESERVE_TIME = 70 * 1000;
|
static const int64_t ESTIMATE_TRANS_RESERVE_TIME = 70 * 1000;
|
||||||
//oracle calc time during running, not before running.
|
//oracle calc time during running, not before running.
|
||||||
//oracle datetime func has two categories: sysdate/systimestamp, current_date/current_timestamp/localtimestamp
|
//oracle datetime func has two categories: sysdate/systimestamp, current_date/current_timestamp/localtimestamp
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
#include "sql/ob_sql_context.h"
|
#include "sql/ob_sql_context.h"
|
||||||
#include "sql/executor/ob_executor_rpc_processor.h"
|
#include "sql/executor/ob_executor_rpc_processor.h"
|
||||||
#include "sql/executor/ob_remote_executor_processor.h"
|
#include "sql/executor/ob_remote_executor_processor.h"
|
||||||
|
|
||||||
using namespace oceanbase::common;
|
using namespace oceanbase::common;
|
||||||
namespace oceanbase
|
namespace oceanbase
|
||||||
{
|
{
|
||||||
@ -207,7 +206,7 @@ void ObExecutorRpcImpl::deal_with_rpc_timeout_err(ObExecutorRpcCtx &rpc_ctx,
|
|||||||
const ObAddr &dist_server) const
|
const ObAddr &dist_server) const
|
||||||
{
|
{
|
||||||
if (OB_TIMEOUT == err) {
|
if (OB_TIMEOUT == err) {
|
||||||
int64_t timeout_timestamp = rpc_ctx.get_timeout_timestamp();
|
int64_t timeout_timestamp = rpc_ctx.get_ps_timeout_timestamp();
|
||||||
int64_t cur_timestamp = ::oceanbase::common::ObTimeUtility::current_time();
|
int64_t cur_timestamp = ::oceanbase::common::ObTimeUtility::current_time();
|
||||||
if (timeout_timestamp - cur_timestamp > 0) {
|
if (timeout_timestamp - cur_timestamp > 0) {
|
||||||
LOG_DEBUG("rpc return OB_TIMEOUT, but it is actually not timeout, "
|
LOG_DEBUG("rpc return OB_TIMEOUT, but it is actually not timeout, "
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "sql/executor/ob_task_info.h"
|
#include "sql/executor/ob_task_info.h"
|
||||||
#include "sql/executor/ob_slice_id.h"
|
#include "sql/executor/ob_slice_id.h"
|
||||||
#include "sql/executor/ob_executor_rpc_proxy.h"
|
#include "sql/executor/ob_executor_rpc_proxy.h"
|
||||||
|
#include "lib/ob_define.h"
|
||||||
|
|
||||||
namespace oceanbase
|
namespace oceanbase
|
||||||
{
|
{
|
||||||
@ -248,6 +248,9 @@ public:
|
|||||||
|
|
||||||
uint64_t get_rpc_tenant_id() const { return rpc_tenant_id_; }
|
uint64_t get_rpc_tenant_id() const { return rpc_tenant_id_; }
|
||||||
inline int64_t get_timeout_timestamp() const { return timeout_timestamp_; }
|
inline int64_t get_timeout_timestamp() const { return timeout_timestamp_; }
|
||||||
|
// The timeout provided to the storage layer will be reduced by 100ms
|
||||||
|
// The timeout here needs to be aligned.
|
||||||
|
inline int64_t get_ps_timeout_timestamp() const { return timeout_timestamp_ - ESTIMATE_PS_RESERVE_TIME; }
|
||||||
// 等于INVALID_CLUSTER_VERSION说明是从远端的旧observer上序列化过来的
|
// 等于INVALID_CLUSTER_VERSION说明是从远端的旧observer上序列化过来的
|
||||||
inline bool min_cluster_version_is_valid() const
|
inline bool min_cluster_version_is_valid() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user