fix: add recycle config latency check
This commit is contained in:
@ -37,7 +37,7 @@ ObTenantConfig::ObTenantConfig(uint64_t tenant_id)
|
||||
: tenant_id_(tenant_id), current_version_(INITIAL_TENANT_CONF_VERSION),
|
||||
mutex_(),
|
||||
update_task_(), system_config_(), config_mgr_(nullptr),
|
||||
lock_(ObLatchIds::CONFIG_LOCK), is_deleting_(false)
|
||||
lock_(ObLatchIds::CONFIG_LOCK), is_deleting_(false), create_timestamp_(0L)
|
||||
{
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ int ObTenantConfig::init(ObTenantConfigMgr *config_mgr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
config_mgr_ = config_mgr;
|
||||
create_timestamp_ = ObTimeUtility::current_time();
|
||||
if (OB_FAIL(system_config_.init())) {
|
||||
LOG_ERROR("init system config failed", K(ret));
|
||||
} else if (OB_FAIL(update_task_.init(config_mgr, this))) {
|
||||
|
||||
@ -88,6 +88,7 @@ public:
|
||||
uint64_t get_tenant_id() const { return tenant_id_; }
|
||||
int64_t get_current_version() const { return current_version_; }
|
||||
const TenantConfigUpdateTask &get_update_task() const { return update_task_; }
|
||||
int64_t get_create_timestamp() const { return create_timestamp_; }
|
||||
int got_version(int64_t version, const bool remove_repeat);
|
||||
int update_local(int64_t expected_version, common::ObMySQLProxy::MySQLResult &result,
|
||||
bool save2file = true);
|
||||
@ -106,6 +107,7 @@ private:
|
||||
// protect this object from being deleted in OTC_MGR.del_tenant_config
|
||||
mutable common::DRWLock lock_;
|
||||
bool is_deleting_;
|
||||
int64_t create_timestamp_;
|
||||
|
||||
public:
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -307,7 +307,7 @@ int ObTenantConfigMgr::del_tenant_config(uint64_t tenant_id)
|
||||
LOG_WARN("get tenant config failed", K(tenant_id), K(ret));
|
||||
} else if (OB_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(tenant_id, has_dropped))) {
|
||||
LOG_WARN("failed to check tenant has been dropped", K(tenant_id));
|
||||
} else if (!has_dropped) {
|
||||
} else if (!has_dropped && ObTimeUtility::current_time() - config->get_create_timestamp() < RECYCLE_LATENCY) {
|
||||
LOG_WARN("tenant still exist, try to delete tenant config later...", K(tenant_id));
|
||||
} else {
|
||||
static const int DEL_TRY_TIMES = 30;
|
||||
|
||||
@ -166,6 +166,7 @@ public:
|
||||
OB_UNIS_VERSION(1);
|
||||
|
||||
private:
|
||||
static const int64_t RECYCLE_LATENCY = 30L * 60L * 1000L * 1000L;
|
||||
ObTenantConfigMgr();
|
||||
bool inited_;
|
||||
common::ObAddr self_;
|
||||
|
||||
Reference in New Issue
Block a user