[Task] add obkv hidden feature switch
This commit is contained in:
@ -50,6 +50,7 @@ protected:
|
|||||||
table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
||||||
virtual void audit_on_finish() override;
|
virtual void audit_on_finish() override;
|
||||||
virtual uint64_t get_request_checksum() override;
|
virtual uint64_t get_request_checksum() override;
|
||||||
|
virtual bool is_kv_processor() override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int check_arg2() const;
|
int check_arg2() const;
|
||||||
|
@ -33,6 +33,7 @@ protected:
|
|||||||
int try_process() override;
|
int try_process() override;
|
||||||
table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
||||||
uint64_t get_request_checksum() override;
|
uint64_t get_request_checksum() override;
|
||||||
|
virtual bool is_kv_processor() override { return false; }
|
||||||
private:
|
private:
|
||||||
common::ObArenaAllocator allocator_;
|
common::ObArenaAllocator allocator_;
|
||||||
ObTableDirectLoadExecContext exec_ctx_;
|
ObTableDirectLoadExecContext exec_ctx_;
|
||||||
|
@ -46,6 +46,7 @@ protected:
|
|||||||
virtual void audit_on_finish() override;
|
virtual void audit_on_finish() override;
|
||||||
virtual uint64_t get_request_checksum() override;
|
virtual uint64_t get_request_checksum() override;
|
||||||
virtual int before_response(int error_code) override;
|
virtual int before_response(int error_code) override;
|
||||||
|
virtual bool is_kv_processor() override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int init_tb_ctx();
|
int init_tb_ctx();
|
||||||
|
@ -44,6 +44,7 @@ protected:
|
|||||||
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
||||||
virtual void audit_on_finish() override;
|
virtual void audit_on_finish() override;
|
||||||
virtual uint64_t get_request_checksum() override;
|
virtual uint64_t get_request_checksum() override;
|
||||||
|
virtual bool is_kv_processor() override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::pair<common::ObString, int32_t> ColumnIdx;
|
typedef std::pair<common::ObString, int32_t> ColumnIdx;
|
||||||
|
@ -221,7 +221,7 @@ protected:
|
|||||||
virtual void audit_on_finish() override;
|
virtual void audit_on_finish() override;
|
||||||
virtual uint64_t get_request_checksum() override;
|
virtual uint64_t get_request_checksum() override;
|
||||||
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
||||||
|
virtual bool is_kv_processor() override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int process_query_start();
|
int process_query_start();
|
||||||
|
@ -39,6 +39,7 @@ protected:
|
|||||||
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
|
||||||
virtual void audit_on_finish() override;
|
virtual void audit_on_finish() override;
|
||||||
virtual uint64_t get_request_checksum() override;
|
virtual uint64_t get_request_checksum() override;
|
||||||
|
virtual bool is_kv_processor() override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int init_tb_ctx(table::ObTableApiCacheGuard &cache_guard);
|
int init_tb_ctx(table::ObTableApiCacheGuard &cache_guard);
|
||||||
|
@ -794,6 +794,10 @@ int ObTableApiProcessorBase::process_with_retry(const ObString &credential, cons
|
|||||||
LOG_ERROR("invalid argument", K(gctx_.ob_service_), K(ret));
|
LOG_ERROR("invalid argument", K(gctx_.ob_service_), K(ret));
|
||||||
} else if (OB_FAIL(check_arg())) {
|
} else if (OB_FAIL(check_arg())) {
|
||||||
LOG_WARN("check arg failed", K(ret));
|
LOG_WARN("check arg failed", K(ret));
|
||||||
|
} else if (OB_UNLIKELY(!is_kv_feature_enable())) {
|
||||||
|
ret = OB_NOT_SUPPORTED;
|
||||||
|
LOG_WARN("obkv feature is not enable", K(ret));
|
||||||
|
LOG_USER_ERROR(OB_NOT_SUPPORTED, "OBKV feature");
|
||||||
} else if (OB_FAIL(check_user_access(credential))) {
|
} else if (OB_FAIL(check_user_access(credential))) {
|
||||||
LOG_WARN("check user access failed", K(ret));
|
LOG_WARN("check user access failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,6 +111,14 @@ public:
|
|||||||
virtual ~ObTableApiProcessorBase() = default;
|
virtual ~ObTableApiProcessorBase() = default;
|
||||||
public:
|
public:
|
||||||
static int init_session();
|
static int init_session();
|
||||||
|
OB_INLINE bool is_kv_feature_enable()
|
||||||
|
{
|
||||||
|
bool bret = true;
|
||||||
|
if (is_kv_processor()) { // only check kv processor, ignore direct load processor
|
||||||
|
bret = GCONF._enable_kv_feature;
|
||||||
|
}
|
||||||
|
return bret;
|
||||||
|
}
|
||||||
int check_user_access(const ObString &credential_str);
|
int check_user_access(const ObString &credential_str);
|
||||||
// transaction control
|
// transaction control
|
||||||
int start_trans(bool is_readonly, const sql::stmt::StmtType stmt_type,
|
int start_trans(bool is_readonly, const sql::stmt::StmtType stmt_type,
|
||||||
@ -146,6 +154,7 @@ protected:
|
|||||||
virtual int try_process() = 0;
|
virtual int try_process() = 0;
|
||||||
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) = 0;
|
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) = 0;
|
||||||
virtual void set_req_has_wokenup() = 0;
|
virtual void set_req_has_wokenup() = 0;
|
||||||
|
virtual bool is_kv_processor() = 0;
|
||||||
virtual void reset_ctx();
|
virtual void reset_ctx();
|
||||||
int get_ls_id(const ObTabletID &tablet_id, share::ObLSID &ls_id);
|
int get_ls_id(const ObTabletID &tablet_id, share::ObLSID &ls_id);
|
||||||
int process_with_retry(const ObString &credential, const int64_t timeout_ts);
|
int process_with_retry(const ObString &credential, const int64_t timeout_ts);
|
||||||
|
@ -1961,3 +1961,8 @@ DEF_BOOL(_enable_dbms_lob_partial_update, OB_TENANT_PARAMETER, "False",
|
|||||||
DEF_BOOL(_enable_dbms_job_package, OB_CLUSTER_PARAMETER, "True",
|
DEF_BOOL(_enable_dbms_job_package, OB_CLUSTER_PARAMETER, "True",
|
||||||
"Control whether can use DBMS_JOB package.",
|
"Control whether can use DBMS_JOB package.",
|
||||||
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
|
|
||||||
|
// obkv feature switch
|
||||||
|
DEF_BOOL(_enable_kv_feature, OB_CLUSTER_PARAMETER, "True",
|
||||||
|
"Enable or disable OBKV feature.",
|
||||||
|
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
@ -300,6 +300,7 @@ _enable_hash_join_hasher
|
|||||||
_enable_hash_join_processor
|
_enable_hash_join_processor
|
||||||
_enable_hgby_llc_ndv_adaptive
|
_enable_hgby_llc_ndv_adaptive
|
||||||
_enable_in_range_optimization
|
_enable_in_range_optimization
|
||||||
|
_enable_kv_feature
|
||||||
_enable_log_cache
|
_enable_log_cache
|
||||||
_enable_memleak_light_backtrace
|
_enable_memleak_light_backtrace
|
||||||
_enable_newsort
|
_enable_newsort
|
||||||
|
Reference in New Issue
Block a user