[CP] delete the unused log
This commit is contained in:
committed by
ob-robot
parent
485c25fe99
commit
5679f92715
@ -710,7 +710,7 @@ int ObMPStmtExecute::parse_request_param_value(ObIAllocator &alloc,
|
|||||||
idx))) {
|
idx))) {
|
||||||
LOG_WARN("get param value failed", K(param));
|
LOG_WARN("get param value failed", K(param));
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("resolve execute with param", K(param));
|
LOG_DEBUG("resolve execute with param", K(param));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -37,7 +37,7 @@ ObTenantConfig::ObTenantConfig(uint64_t tenant_id)
|
|||||||
: tenant_id_(tenant_id), current_version_(1),
|
: tenant_id_(tenant_id), current_version_(1),
|
||||||
mutex_(),
|
mutex_(),
|
||||||
update_task_(), system_config_(), config_mgr_(nullptr),
|
update_task_(), system_config_(), config_mgr_(nullptr),
|
||||||
lock_(), is_deleting_(false)
|
lock_(ObLatchIds::CONFIG_LOCK), is_deleting_(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ int ObTenantConfig::init(ObTenantConfigMgr *config_mgr)
|
|||||||
|
|
||||||
void ObTenantConfig::print() const
|
void ObTenantConfig::print() const
|
||||||
{
|
{
|
||||||
ObLatchRGuard rd_guard(const_cast<ObLatch&>(lock_), ObLatchIds::CONFIG_LOCK);
|
DRWLock::RDLockGuard guard(lock_);
|
||||||
OB_LOG(INFO, "===================== * begin tenant config report * =====================", K(tenant_id_));
|
OB_LOG(INFO, "===================== * begin tenant config report * =====================", K(tenant_id_));
|
||||||
ObConfigContainer::const_iterator it = container_.begin();
|
ObConfigContainer::const_iterator it = container_.begin();
|
||||||
for (; it != container_.end(); ++it) {
|
for (; it != container_.end(); ++it) {
|
||||||
@ -71,7 +71,7 @@ void ObTenantConfig::print() const
|
|||||||
int ObTenantConfig::check_all() const
|
int ObTenantConfig::check_all() const
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObLatchRGuard rd_guard(const_cast<ObLatch&>(lock_), ObLatchIds::CONFIG_LOCK);
|
DRWLock::RDLockGuard guard(lock_);
|
||||||
ObConfigContainer::const_iterator it = container_.begin();
|
ObConfigContainer::const_iterator it = container_.begin();
|
||||||
for (; OB_SUCC(ret) && it != container_.end(); ++it) {
|
for (; OB_SUCC(ret) && it != container_.end(); ++it) {
|
||||||
if (OB_ISNULL(it->second)) {
|
if (OB_ISNULL(it->second)) {
|
||||||
@ -90,31 +90,32 @@ int ObTenantConfig::check_all() const
|
|||||||
|
|
||||||
int ObTenantConfig::rdlock()
|
int ObTenantConfig::rdlock()
|
||||||
{
|
{
|
||||||
return lock_.rdlock(ObLatchIds::CONFIG_LOCK) == OB_SUCCESS
|
return lock_.rdlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
||||||
? OB_SUCCESS : OB_EAGAIN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTenantConfig::wrlock()
|
int ObTenantConfig::wrlock()
|
||||||
{
|
{
|
||||||
return lock_.wrlock(ObLatchIds::CONFIG_LOCK) == OB_SUCCESS
|
return lock_.wrlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
||||||
? OB_SUCCESS : OB_EAGAIN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTenantConfig::try_rdlock()
|
int ObTenantConfig::try_rdlock()
|
||||||
{
|
{
|
||||||
return lock_.try_rdlock(ObLatchIds::CONFIG_LOCK) == OB_SUCCESS
|
return lock_.try_rdlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
||||||
? OB_SUCCESS : OB_EAGAIN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTenantConfig::try_wrlock()
|
int ObTenantConfig::try_wrlock()
|
||||||
{
|
{
|
||||||
return lock_.try_wrlock(ObLatchIds::CONFIG_LOCK) == OB_SUCCESS
|
return lock_.try_wrlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
||||||
? OB_SUCCESS : OB_EAGAIN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTenantConfig::unlock()
|
int ObTenantConfig::unlock()
|
||||||
{
|
{
|
||||||
return lock_.unlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
return lock_.rdunlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObTenantConfig::wrunlock()
|
||||||
|
{
|
||||||
|
return lock_.wrunlock() == OB_SUCCESS ? OB_SUCCESS : OB_EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObTenantConfig::read_config()
|
int ObTenantConfig::read_config()
|
||||||
@ -124,7 +125,7 @@ int ObTenantConfig::read_config()
|
|||||||
ObAddr server;
|
ObAddr server;
|
||||||
char local_ip[OB_MAX_SERVER_ADDR_SIZE] = "";
|
char local_ip[OB_MAX_SERVER_ADDR_SIZE] = "";
|
||||||
DRWLock::RDLockGuard lguard(ObConfigManager::get_serialize_lock());
|
DRWLock::RDLockGuard lguard(ObConfigManager::get_serialize_lock());
|
||||||
ObLatchWGuard wr_guard(lock_, ObLatchIds::CONFIG_LOCK);
|
DRWLock::WRLockGuard guard(lock_);
|
||||||
server = GCTX.self_addr();
|
server = GCTX.self_addr();
|
||||||
if (OB_UNLIKELY(true != server.ip_to_string(local_ip, sizeof(local_ip)))) {
|
if (OB_UNLIKELY(true != server.ip_to_string(local_ip, sizeof(local_ip)))) {
|
||||||
ret = OB_CONVERT_ERROR;
|
ret = OB_CONVERT_ERROR;
|
||||||
@ -365,7 +366,7 @@ int ObTenantConfig::add_extra_config(char *config_str,
|
|||||||
char *saveptr = NULL;
|
char *saveptr = NULL;
|
||||||
char *token = NULL;
|
char *token = NULL;
|
||||||
DRWLock::RDLockGuard lguard(ObConfigManager::get_serialize_lock());
|
DRWLock::RDLockGuard lguard(ObConfigManager::get_serialize_lock());
|
||||||
ObLatchWGuard wr_guard(lock_, ObLatchIds::CONFIG_LOCK);
|
DRWLock::WRLockGuard guard(lock_);
|
||||||
token = STRTOK_R(config_str, ",\n", &saveptr);
|
token = STRTOK_R(config_str, ",\n", &saveptr);
|
||||||
while (OB_SUCC(ret) && OB_LIKELY(NULL != token)) {
|
while (OB_SUCC(ret) && OB_LIKELY(NULL != token)) {
|
||||||
char *saveptr_one = NULL;
|
char *saveptr_one = NULL;
|
||||||
@ -423,7 +424,7 @@ OB_DEF_SERIALIZE(ObTenantConfig)
|
|||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
int64_t expect_data_len = get_serialize_size_();
|
int64_t expect_data_len = get_serialize_size_();
|
||||||
int64_t saved_pos = pos;
|
int64_t saved_pos = pos;
|
||||||
ObLatchRGuard rd_guard(const_cast<ObLatch&>(lock_), ObLatchIds::CONFIG_LOCK);
|
DRWLock::RDLockGuard guard(lock_);
|
||||||
if (OB_FAIL(databuff_printf(buf, buf_len, pos, "[%lu]\n", tenant_id_))) {
|
if (OB_FAIL(databuff_printf(buf, buf_len, pos, "[%lu]\n", tenant_id_))) {
|
||||||
} else {
|
} else {
|
||||||
ret = ObCommonConfig::serialize(buf, buf_len, pos);
|
ret = ObCommonConfig::serialize(buf, buf_len, pos);
|
||||||
@ -441,7 +442,7 @@ OB_DEF_SERIALIZE(ObTenantConfig)
|
|||||||
OB_DEF_DESERIALIZE(ObTenantConfig)
|
OB_DEF_DESERIALIZE(ObTenantConfig)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObLatchWGuard wr_guard(lock_, ObLatchIds::CONFIG_LOCK);
|
DRWLock::WRLockGuard guard(lock_);
|
||||||
if ('[' != *(buf + pos)) {
|
if ('[' != *(buf + pos)) {
|
||||||
ret = OB_INVALID_DATA;
|
ret = OB_INVALID_DATA;
|
||||||
LOG_ERROR("invalid tenant config", K(ret));
|
LOG_ERROR("invalid tenant config", K(ret));
|
||||||
@ -484,7 +485,7 @@ OB_DEF_SERIALIZE_SIZE(ObTenantConfig)
|
|||||||
int64_t len = 0, tmp_pos = 0;
|
int64_t len = 0, tmp_pos = 0;
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
char tenant_str[100] = {'\0'};
|
char tenant_str[100] = {'\0'};
|
||||||
ObLatchRGuard rd_guard(const_cast<ObLatch&>(lock_), ObLatchIds::CONFIG_LOCK);
|
DRWLock::RDLockGuard guard(lock_);
|
||||||
if (OB_FAIL(databuff_printf(tenant_str, 100, tmp_pos, "[%lu]\n", tenant_id_))) {
|
if (OB_FAIL(databuff_printf(tenant_str, 100, tmp_pos, "[%lu]\n", tenant_id_))) {
|
||||||
LOG_WARN("write data buff failed", K(ret));
|
LOG_WARN("write data buff failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
#include "share/config/ob_system_config.h"
|
#include "share/config/ob_system_config.h"
|
||||||
#include "share/config/ob_common_config.h"
|
#include "share/config/ob_common_config.h"
|
||||||
#include "share/config/ob_config_helper.h"
|
#include "share/config/ob_config_helper.h"
|
||||||
|
#include "lib/lock/ob_drw_lock.h"
|
||||||
|
|
||||||
namespace oceanbase {
|
namespace oceanbase {
|
||||||
|
|
||||||
@ -79,6 +80,7 @@ public:
|
|||||||
int try_rdlock();
|
int try_rdlock();
|
||||||
int try_wrlock();
|
int try_wrlock();
|
||||||
int unlock();
|
int unlock();
|
||||||
|
int wrunlock();
|
||||||
|
|
||||||
int read_config();
|
int read_config();
|
||||||
uint64_t get_tenant_id() const { return tenant_id_; }
|
uint64_t get_tenant_id() const { return tenant_id_; }
|
||||||
@ -100,7 +102,7 @@ private:
|
|||||||
common::ObSystemConfig system_config_;
|
common::ObSystemConfig system_config_;
|
||||||
ObTenantConfigMgr *config_mgr_;
|
ObTenantConfigMgr *config_mgr_;
|
||||||
// protect this object from being deleted in OTC_MGR.del_tenant_config
|
// protect this object from being deleted in OTC_MGR.del_tenant_config
|
||||||
common::ObLatch lock_;
|
mutable common::DRWLock lock_;
|
||||||
bool is_deleting_;
|
bool is_deleting_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -314,7 +314,7 @@ int ObTenantConfigMgr::del_tenant_config(uint64_t tenant_id)
|
|||||||
LOG_INFO("tenant config deleted", K(tenant_id), K(ret));
|
LOG_INFO("tenant config deleted", K(tenant_id), K(ret));
|
||||||
}
|
}
|
||||||
if (OB_FAIL(ret)) {
|
if (OB_FAIL(ret)) {
|
||||||
config->unlock();
|
config->wrunlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user