fix: there is a gap tenant config maybe dropped when create tenant
This commit is contained in:
@ -20,6 +20,7 @@
|
|||||||
#include "ob_tenant.h"
|
#include "ob_tenant.h"
|
||||||
#include "share/ob_rpc_struct.h"
|
#include "share/ob_rpc_struct.h"
|
||||||
#include "share/inner_table/ob_inner_table_schema_constants.h"
|
#include "share/inner_table/ob_inner_table_schema_constants.h"
|
||||||
|
#include "share/schema/ob_multi_version_schema_service.h"
|
||||||
|
|
||||||
using namespace oceanbase::common;
|
using namespace oceanbase::common;
|
||||||
using namespace oceanbase::share;
|
using namespace oceanbase::share;
|
||||||
@ -302,12 +303,13 @@ int ObTenantConfigMgr::del_tenant_config(uint64_t tenant_id)
|
|||||||
DRWLock::RDLockGuard lguard(ObConfigManager::get_serialize_lock());
|
DRWLock::RDLockGuard lguard(ObConfigManager::get_serialize_lock());
|
||||||
DRWLock::WRLockGuard guard(rwlock_);
|
DRWLock::WRLockGuard guard(rwlock_);
|
||||||
ObTenant *tenant = NULL;
|
ObTenant *tenant = NULL;
|
||||||
|
bool has_dropped = false;
|
||||||
if (is_virtual_tenant_id(tenant_id)) {
|
if (is_virtual_tenant_id(tenant_id)) {
|
||||||
} else if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config))) {
|
} else if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config))) {
|
||||||
LOG_WARN("get tenant config failed", K(tenant_id), K(ret));
|
LOG_WARN("get tenant config failed", K(tenant_id), K(ret));
|
||||||
} else if (OB_SUCC(GCTX.omt_->get_tenant(tenant_id, tenant))) {
|
} else if (OB_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(tenant_id, has_dropped))) {
|
||||||
// https://work.aone.alibaba-inc.com/issue/31717023
|
LOG_WARN("failed to check tenant has been dropped", K(tenant_id));
|
||||||
// 判断租户是否在这台机器上,避免启动时没有刷到租户时删掉了租户配置项
|
} else if (!has_dropped) {
|
||||||
LOG_WARN("tenant still exist, try to delete tenant config later...", K(tenant_id));
|
LOG_WARN("tenant still exist, try to delete tenant config later...", K(tenant_id));
|
||||||
} else {
|
} else {
|
||||||
static const int DEL_TRY_TIMES = 30;
|
static const int DEL_TRY_TIMES = 30;
|
||||||
|
|||||||
@ -27,9 +27,9 @@ class ObObj;
|
|||||||
|
|
||||||
namespace observer
|
namespace observer
|
||||||
{
|
{
|
||||||
|
|
||||||
class ObInfoSchemaKvCacheTable : public common::ObVirtualTableScannerIterator
|
class ObInfoSchemaKvCacheTable : public common::ObVirtualTableScannerIterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObInfoSchemaKvCacheTable();
|
ObInfoSchemaKvCacheTable();
|
||||||
virtual ~ObInfoSchemaKvCacheTable();
|
virtual ~ObInfoSchemaKvCacheTable();
|
||||||
@ -50,9 +50,9 @@ private:
|
|||||||
{
|
{
|
||||||
TENANT_ID = common::OB_APP_MIN_COLUMN_ID,
|
TENANT_ID = common::OB_APP_MIN_COLUMN_ID,
|
||||||
SVR_IP,
|
SVR_IP,
|
||||||
SVR_PORT,
|
SVR_PORT,
|
||||||
CACHE_NAME,
|
CACHE_NAME,
|
||||||
CACHE_ID,
|
CACHE_ID,
|
||||||
PRIORITY,
|
PRIORITY,
|
||||||
CACHE_SIZE,
|
CACHE_SIZE,
|
||||||
CACHE_STORE_SIZE,
|
CACHE_STORE_SIZE,
|
||||||
@ -63,9 +63,9 @@ private:
|
|||||||
TOTAL_HIT_CNT,
|
TOTAL_HIT_CNT,
|
||||||
TOTAL_MISS_CNT,
|
TOTAL_MISS_CNT,
|
||||||
HOLD_SIZE
|
HOLD_SIZE
|
||||||
};
|
};
|
||||||
common::ObAddr *addr_;
|
common::ObAddr *addr_;
|
||||||
common::ObString ipstr_;
|
common::ObString ipstr_;
|
||||||
int32_t port_;
|
int32_t port_;
|
||||||
common::ObSEArray<common::ObKVCacheInstHandle, 100 > inst_handles_;
|
common::ObSEArray<common::ObKVCacheInstHandle, 100 > inst_handles_;
|
||||||
int16_t cache_iter_;
|
int16_t cache_iter_;
|
||||||
@ -79,5 +79,5 @@ private:
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE */
|
#endif /* OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user