[Task] add obkv hidden feature switch

This commit is contained in:
WeiXinChan 2024-05-24 05:19:03 +00:00 committed by ob-robot
parent a50f6b5bdd
commit afe60e724b
10 changed files with 25 additions and 1 deletions

View File

@ -50,6 +50,7 @@ protected:
table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
virtual void audit_on_finish() override;
virtual uint64_t get_request_checksum() override;
virtual bool is_kv_processor() override { return true; }
private:
int check_arg2() const;

View File

@ -33,6 +33,7 @@ protected:
int try_process() override;
table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
uint64_t get_request_checksum() override;
virtual bool is_kv_processor() override { return false; }
private:
common::ObArenaAllocator allocator_;
ObTableDirectLoadExecContext exec_ctx_;

View File

@ -46,6 +46,7 @@ protected:
virtual void audit_on_finish() override;
virtual uint64_t get_request_checksum() override;
virtual int before_response(int error_code) override;
virtual bool is_kv_processor() override { return true; }
private:
int init_tb_ctx();

View File

@ -44,6 +44,7 @@ protected:
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
virtual void audit_on_finish() override;
virtual uint64_t get_request_checksum() override;
virtual bool is_kv_processor() override { return true; }
private:
typedef std::pair<common::ObString, int32_t> ColumnIdx;

View File

@ -221,7 +221,7 @@ protected:
virtual void audit_on_finish() override;
virtual uint64_t get_request_checksum() override;
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
virtual bool is_kv_processor() override { return true; }
private:
int process_query_start();

View File

@ -39,6 +39,7 @@ protected:
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) override;
virtual void audit_on_finish() override;
virtual uint64_t get_request_checksum() override;
virtual bool is_kv_processor() override { return true; }
private:
int init_tb_ctx(table::ObTableApiCacheGuard &cache_guard);

View File

@ -794,6 +794,10 @@ int ObTableApiProcessorBase::process_with_retry(const ObString &credential, cons
LOG_ERROR("invalid argument", K(gctx_.ob_service_), K(ret));
} else if (OB_FAIL(check_arg())) {
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))) {
LOG_WARN("check user access failed", K(ret));
} else {

View File

@ -111,6 +111,14 @@ public:
virtual ~ObTableApiProcessorBase() = default;
public:
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);
// transaction control
int start_trans(bool is_readonly, const sql::stmt::StmtType stmt_type,
@ -146,6 +154,7 @@ protected:
virtual int try_process() = 0;
virtual table::ObTableAPITransCb *new_callback(rpc::ObRequest *req) = 0;
virtual void set_req_has_wokenup() = 0;
virtual bool is_kv_processor() = 0;
virtual void reset_ctx();
int get_ls_id(const ObTabletID &tablet_id, share::ObLSID &ls_id);
int process_with_retry(const ObString &credential, const int64_t timeout_ts);

View File

@ -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",
"Control whether can use DBMS_JOB package.",
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));

View File

@ -300,6 +300,7 @@ _enable_hash_join_hasher
_enable_hash_join_processor
_enable_hgby_llc_ndv_adaptive
_enable_in_range_optimization
_enable_kv_feature
_enable_log_cache
_enable_memleak_light_backtrace
_enable_newsort