[CP] [OBKV] Fix accord to some TTL left review comment
This commit is contained in:
committed by
ob-robot
parent
436c11c98d
commit
9716c6df9f
@ -21,7 +21,8 @@ namespace table
|
|||||||
|
|
||||||
const char *OB_HTABLE_LOCK_MANAGER = "hTableLockMgr";
|
const char *OB_HTABLE_LOCK_MANAGER = "hTableLockMgr";
|
||||||
|
|
||||||
int ObHTableLockMgr::mtl_init(ObHTableLockMgr *&htable_lock_mgr) {
|
int ObHTableLockMgr::mtl_init(ObHTableLockMgr *&htable_lock_mgr)
|
||||||
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
htable_lock_mgr = OB_NEW(ObHTableLockMgr, ObMemAttr(MTL_ID(), OB_HTABLE_LOCK_MANAGER));
|
htable_lock_mgr = OB_NEW(ObHTableLockMgr, ObMemAttr(MTL_ID(), OB_HTABLE_LOCK_MANAGER));
|
||||||
if (OB_ISNULL(htable_lock_mgr)) {
|
if (OB_ISNULL(htable_lock_mgr)) {
|
||||||
@ -126,7 +127,7 @@ int ObHTableLockMgr::lock_row(const uint64_t table_id, const common::ObString& k
|
|||||||
if (key.empty()) {
|
if (key.empty()) {
|
||||||
ret = OB_ERR_NULL_VALUE;
|
ret = OB_ERR_NULL_VALUE;
|
||||||
LOG_WARN("null lock row key", K(ret));
|
LOG_WARN("null lock row key", K(ret));
|
||||||
} else if (handle.find_lock_node(table_id, key, lock_node)) {
|
} else if (OB_FAIL(handle.find_lock_node(table_id, key, lock_node))) {
|
||||||
LOG_WARN("fail to find lock node", K(ret), K(table_id), K(key));
|
LOG_WARN("fail to find lock node", K(ret), K(table_id), K(key));
|
||||||
} else if (OB_ISNULL(lock_node)) {
|
} else if (OB_ISNULL(lock_node)) {
|
||||||
if (OB_FAIL(internal_lock_row(table_id, key, mode, handle))) {
|
if (OB_FAIL(internal_lock_row(table_id, key, mode, handle))) {
|
||||||
|
|||||||
@ -362,12 +362,7 @@ bool ObTableTTLDag::operator==(const ObIDag& other) const
|
|||||||
!dag.info_.is_valid() || !dag.info_.is_valid())) {
|
!dag.info_.is_valid() || !dag.info_.is_valid())) {
|
||||||
LOG_ERROR_RET(OB_ERR_SYS, "invalid argument", K_(param), K_(info), K(dag.param_), K(dag.info_));
|
LOG_ERROR_RET(OB_ERR_SYS, "invalid argument", K_(param), K_(info), K(dag.param_), K(dag.info_));
|
||||||
} else {
|
} else {
|
||||||
is_equal = (info_.tenant_id_ == dag.info_.tenant_id_) &&
|
is_equal = ((info_ == dag.info_) && (param_ == dag.param_));
|
||||||
(info_.task_id_ == dag.info_.task_id_) &&
|
|
||||||
(info_.table_id_ == dag.info_.table_id_) &&
|
|
||||||
(info_.tablet_id_ == dag.info_.tablet_id_) &&
|
|
||||||
(param_.ttl_ == dag.param_.ttl_) &&
|
|
||||||
(param_.max_version_ == dag.param_.max_version_);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return is_equal;
|
return is_equal;
|
||||||
|
|||||||
@ -55254,8 +55254,6 @@ def_sys_index_table(
|
|||||||
keywords = all_def_keywords['__all_dbms_lock_allocated'])
|
keywords = all_def_keywords['__all_dbms_lock_allocated'])
|
||||||
|
|
||||||
# 101092 : placeholder for index of __all_tablet_reorganize_history
|
# 101092 : placeholder for index of __all_tablet_reorganize_history
|
||||||
# 101093 : placeholder for index of __all_kv_ttl_task
|
|
||||||
# 101094 : placeholder for index of __all_kv_ttl_task_history
|
|
||||||
|
|
||||||
def_sys_index_table(
|
def_sys_index_table(
|
||||||
index_name = 'idx_kv_ttl_task_table_id',
|
index_name = 'idx_kv_ttl_task_table_id',
|
||||||
|
|||||||
@ -362,7 +362,7 @@ static const char* ref_info_type_strs[] = {
|
|||||||
"SCHEMA_RECORDER",
|
"SCHEMA_RECORDER",
|
||||||
"SPI_RESULT_SET",
|
"SPI_RESULT_SET",
|
||||||
"PL_PREPARE_RESULT",
|
"PL_PREPARE_RESULT",
|
||||||
"PARTITION_BALANCE",
|
"PARTITION_BALANCE"
|
||||||
};
|
};
|
||||||
|
|
||||||
int ObSchemaMgrCache::get_ref_info_type_str_(const int64_t &index, const char *&type_str) {
|
int ObSchemaMgrCache::get_ref_info_type_str_(const int64_t &index, const char *&type_str) {
|
||||||
|
|||||||
@ -91,6 +91,14 @@ public:
|
|||||||
}
|
}
|
||||||
const common::ObTabletID &get_tablet_id() const { return tablet_id_; }
|
const common::ObTabletID &get_tablet_id() const { return tablet_id_; }
|
||||||
|
|
||||||
|
bool operator==(const ObTTLTaskInfo& other) const
|
||||||
|
{
|
||||||
|
return ((tenant_id_ == other.tenant_id_) &&
|
||||||
|
(task_id_ == other.task_id_) &&
|
||||||
|
(table_id_ == other.table_id_) &&
|
||||||
|
(tablet_id_ == other.tablet_id_));
|
||||||
|
}
|
||||||
|
|
||||||
TO_STRING_KV(K_(task_id), K_(tablet_id), K_(table_id), K_(is_user_trigger),
|
TO_STRING_KV(K_(task_id), K_(tablet_id), K_(table_id), K_(is_user_trigger),
|
||||||
K_(is_user_trigger), K_(row_key), K_(ttl_del_cnt),
|
K_(is_user_trigger), K_(row_key), K_(ttl_del_cnt),
|
||||||
K_(max_version_del_cnt), K_(scan_cnt), K_(err_code),
|
K_(max_version_del_cnt), K_(scan_cnt), K_(err_code),
|
||||||
|
|||||||
@ -1098,17 +1098,12 @@ int ObTTLUtil::get_all_user_tenant_ttl(ObIArray<ObSimpleTTLInfo> &ttl_info_array
|
|||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObSEArray<uint64_t, 32> tenant_ids;
|
ObSEArray<uint64_t, 32> tenant_ids;
|
||||||
{
|
|
||||||
share::schema::ObSchemaGetterGuard schema_guard;
|
|
||||||
if (OB_ISNULL(GCTX.schema_service_)) {
|
if (OB_ISNULL(GCTX.schema_service_)) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("invalid GCTX", KR(ret));
|
LOG_WARN("invalid GCTX", KR(ret));
|
||||||
} else if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(OB_SYS_TENANT_ID, schema_guard))) {
|
} else if (OB_FAIL(GCTX.schema_service_->get_tenant_ids(tenant_ids))) {
|
||||||
LOG_WARN("fail to get schema guard", KR(ret));
|
|
||||||
} else if (OB_FAIL(schema_guard.get_tenant_ids(tenant_ids))) {
|
|
||||||
LOG_WARN("fail to get tenant ids", KR(ret));
|
LOG_WARN("fail to get tenant ids", KR(ret));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && i < tenant_ids.count(); ++i) {
|
for (int64_t i = 0; OB_SUCC(ret) && i < tenant_ids.count(); ++i) {
|
||||||
if (is_user_tenant(tenant_ids[i])) {
|
if (is_user_tenant(tenant_ids[i])) {
|
||||||
ObSimpleTTLInfo info(tenant_ids[i]);
|
ObSimpleTTLInfo info(tenant_ids[i]);
|
||||||
|
|||||||
@ -877,10 +877,22 @@ int ObAlterTableResolver::resolve_action_list(const ParseNode &node)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case T_REMOVE_TTL: {
|
case T_REMOVE_TTL: {
|
||||||
|
uint64_t tenant_data_version = 0;
|
||||||
|
if (OB_ISNULL(session_info_)) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
LOG_WARN("unexpected null", K(ret));
|
||||||
|
} else if (OB_FAIL(GET_MIN_DATA_VERSION(session_info_->get_effective_tenant_id(), tenant_data_version))) {
|
||||||
|
LOG_WARN("get tenant data version failed", K(ret), K(session_info_->get_effective_tenant_id()));
|
||||||
|
} else if (tenant_data_version < DATA_VERSION_4_2_1_0) {
|
||||||
|
ret = OB_NOT_SUPPORTED;
|
||||||
|
LOG_WARN("REMOVE TTL is not supported in data version less than 4.2.1", K(ret), K(tenant_data_version));
|
||||||
|
LOG_USER_ERROR(OB_NOT_SUPPORTED, "REMOVE TTL in data version less than 4.2.1");
|
||||||
|
} else {
|
||||||
ttl_definition_.reset();
|
ttl_definition_.reset();
|
||||||
if (OB_FAIL(alter_table_bitset_.add_member(ObAlterTableArg::TTL_DEFINITION))) {
|
if (OB_FAIL(alter_table_bitset_.add_member(ObAlterTableArg::TTL_DEFINITION))) {
|
||||||
SQL_RESV_LOG(WARN, "failed to add member to bitset!", K(ret));
|
SQL_RESV_LOG(WARN, "failed to add member to bitset!", K(ret));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
Reference in New Issue
Block a user