patch some bug fix:part 1
This commit is contained in:
		
							
								
								
									
										1
									
								
								deps/oblib/src/lib/oblog/ob_log.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								deps/oblib/src/lib/oblog/ob_log.cpp
									
									
									
									
										vendored
									
									
								
							@ -864,7 +864,6 @@ void ObLogger::log_data(const char* mod_name, int32_t level, LogLocation locatio
 | 
				
			|||||||
      last_msg_time = e_ts - b_ts;
 | 
					      last_msg_time = e_ts - b_ts;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  this_routine::check();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ObLogger::rotate_log(
 | 
					void ObLogger::rotate_log(
 | 
				
			||||||
 | 
				
			|||||||
@ -163,7 +163,7 @@ void ObReqQueue::loop()
 | 
				
			|||||||
               "wait finish, remain %ld task",
 | 
					               "wait finish, remain %ld task",
 | 
				
			||||||
          "qsize",
 | 
					          "qsize",
 | 
				
			||||||
          queue_.size());
 | 
					          queue_.size());
 | 
				
			||||||
    } else if (0 == queue_.size()) {
 | 
					    } else if (0 != queue_.size()) {
 | 
				
			||||||
      LOG_INFO("exiting queue thread and wait remain finish");
 | 
					      LOG_INFO("exiting queue thread and wait remain finish");
 | 
				
			||||||
      // Process remains if we should wait until all task has been
 | 
					      // Process remains if we should wait until all task has been
 | 
				
			||||||
      // processed before exiting this thread. Previous return code
 | 
					      // processed before exiting this thread. Previous return code
 | 
				
			||||||
 | 
				
			|||||||
@ -90,7 +90,7 @@ int ObRpcSessionHandler::prepare_for_next_request(int64_t sessid)
 | 
				
			|||||||
  wait_object.thid_ = get_itid();
 | 
					  wait_object.thid_ = get_itid();
 | 
				
			||||||
  wait_object.req_ = NULL;
 | 
					  wait_object.req_ = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (wait_object.thid_ < 0 || wait_object.thid_ >= MAX_COND_COUNT) {
 | 
					  if (wait_object.thid_ < 0) {
 | 
				
			||||||
    ret = OB_ERR_UNEXPECTED;
 | 
					    ret = OB_ERR_UNEXPECTED;
 | 
				
			||||||
    LOG_WARN("Thread id no valid", K(ret), "thread id", wait_object.thid_);
 | 
					    LOG_WARN("Thread id no valid", K(ret), "thread id", wait_object.thid_);
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
 | 
				
			|||||||
@ -155,10 +155,8 @@ int ObMultiTenant::init(ObAddr myaddr, double node_quota, int64_t times_of_worke
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  myaddr_ = myaddr;
 | 
					  myaddr_ = myaddr;
 | 
				
			||||||
  node_quota_ = node_quota;
 | 
					  node_quota_ = node_quota;
 | 
				
			||||||
  const int64_t total_reserved_quota = static_cast<int64_t>(
 | 
					  const int64_t total_reserved_quota
 | 
				
			||||||
      GCONF.system_cpu_quota + GCONF.election_cpu_quota + GCONF.user_location_cpu_quota() +
 | 
					      = static_cast<int64_t>(VIRTUAL_TENANTS_CPU_RESERVED_QUOTA);
 | 
				
			||||||
      GCONF.sys_location_cpu_quota() + GCONF.root_location_cpu_quota() + GCONF.core_location_cpu_quota() +
 | 
					 | 
				
			||||||
      EXT_LOG_TENANT_CPU + OB_MONITOR_CPU + OB_SVR_BLACKLIST_CPU);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int64_t init_workers_cnt =
 | 
					  int64_t init_workers_cnt =
 | 
				
			||||||
      (static_cast<int64_t>(node_quota) + static_cast<int64_t>(GCONF.server_cpu_quota_min)) * DEFAULT_TIMES_OF_WORKERS +
 | 
					      (static_cast<int64_t>(node_quota) + static_cast<int64_t>(GCONF.server_cpu_quota_min)) * DEFAULT_TIMES_OF_WORKERS +
 | 
				
			||||||
@ -732,10 +730,8 @@ int ObMultiTenant::get_tenant_cpu(const uint64_t tenant_id, double& min_cpu, dou
 | 
				
			|||||||
void ObMultiTenant::set_workers_per_cpu(int64_t v)
 | 
					void ObMultiTenant::set_workers_per_cpu(int64_t v)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  times_of_workers_ = v;
 | 
					  times_of_workers_ = v;
 | 
				
			||||||
  const int64_t total_reserved_quota = static_cast<int64_t>(
 | 
					  const int64_t total_reserved_quota
 | 
				
			||||||
      GCONF.system_cpu_quota + GCONF.election_cpu_quota + GCONF.user_location_cpu_quota() +
 | 
					      = static_cast<int64_t>(VIRTUAL_TENANTS_CPU_RESERVED_QUOTA);
 | 
				
			||||||
      GCONF.sys_location_cpu_quota() + GCONF.root_location_cpu_quota() + GCONF.core_location_cpu_quota() +
 | 
					 | 
				
			||||||
      EXT_LOG_TENANT_CPU + OB_MONITOR_CPU + OB_SVR_BLACKLIST_CPU);
 | 
					 | 
				
			||||||
  auto max_workers_cnt = static_cast<int64_t>(node_quota_) * times_of_workers_ +
 | 
					  auto max_workers_cnt = static_cast<int64_t>(node_quota_) * times_of_workers_ +
 | 
				
			||||||
                         total_reserved_quota * static_cast<int64_t>(quota2token_) +
 | 
					                         total_reserved_quota * static_cast<int64_t>(quota2token_) +
 | 
				
			||||||
                         static_cast<int64_t>(node_quota_) * 16;
 | 
					                         static_cast<int64_t>(node_quota_) * 16;
 | 
				
			||||||
 | 
				
			|||||||
@ -31,6 +31,13 @@ class ObRequest;
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace omt {
 | 
					namespace omt {
 | 
				
			||||||
 | 
					#define VIRTUAL_TENANTS_CPU_RESERVED_QUOTA \
 | 
				
			||||||
 | 
					  (GCONF.system_cpu_quota \
 | 
				
			||||||
 | 
					  + GCONF.election_cpu_quota \
 | 
				
			||||||
 | 
					  + GCONF.user_location_cpu_quota() + GCONF.sys_location_cpu_quota() \
 | 
				
			||||||
 | 
					  + GCONF.root_location_cpu_quota() + GCONF.core_location_cpu_quota() \
 | 
				
			||||||
 | 
					  + EXT_LOG_TENANT_CPU + OB_MONITOR_CPU \
 | 
				
			||||||
 | 
					  + OB_SVR_BLACKLIST_CPU + OB_DATA_CPU + OB_DTL_CPU + OB_RS_CPU + OB_DIAG_CPU)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ObCtxMemConfig {
 | 
					struct ObCtxMemConfig {
 | 
				
			||||||
  ObCtxMemConfig() : ctx_id_(0), idle_size_(0)
 | 
					  ObCtxMemConfig() : ctx_id_(0), idle_size_(0)
 | 
				
			||||||
 | 
				
			|||||||
@ -403,6 +403,9 @@ int ObTenant::init()
 | 
				
			|||||||
      LOG_ERROR("tenant base init failed", K_(id), K(ret));
 | 
					      LOG_ERROR("tenant base init failed", K_(id), K(ret));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  if (OB_SUCCESS != ret && nullptr != multi_level_queue_) {
 | 
				
			||||||
 | 
					    common::ob_delete(multi_level_queue_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  return ret;
 | 
					  return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -525,6 +528,9 @@ void ObTenant::destroy()
 | 
				
			|||||||
    LOG_WARN("remove tenant cgroup failed", K(tmp_ret), K_(id));
 | 
					    LOG_WARN("remove tenant cgroup failed", K(tmp_ret), K_(id));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  ObTenantBase::destory();
 | 
					  ObTenantBase::destory();
 | 
				
			||||||
 | 
					  if (nullptr != multi_level_queue_) {
 | 
				
			||||||
 | 
					    common::ob_delete(multi_level_queue_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ObTenant::set_unit_max_cpu(double cpu)
 | 
					void ObTenant::set_unit_max_cpu(double cpu)
 | 
				
			||||||
 | 
				
			|||||||
@ -89,6 +89,8 @@ ObThWorker* ObWorkerPool::alloc()
 | 
				
			|||||||
        worker = nullptr;
 | 
					        worker = nullptr;
 | 
				
			||||||
        LOG_ERROR("create worker fail", K(ret));
 | 
					        LOG_ERROR("create worker fail", K(ret));
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      LOG_ERROR("worker cnt larger than max cnt", K(worker_cnt_), K(max_cnt_));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return worker;
 | 
					  return worker;
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user