[BUG] add row latch when log sync failed
This commit is contained in:
17
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
17
deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp
vendored
@ -654,6 +654,20 @@ public:
|
||||
tcp_keepintvl_ = tcp_keepintvl;
|
||||
tcp_keepcnt_ = tcp_keepcnt;
|
||||
}
|
||||
void close_all_fd() {
|
||||
if (lfd_ > 0) {
|
||||
IGNORE_RETURN epoll_ctl(epfd_, EPOLL_CTL_DEL, lfd_, NULL);
|
||||
close(lfd_);
|
||||
lfd_ = -1;
|
||||
}
|
||||
ObDLink* head = all_list_.head();
|
||||
ObLink* cur = head->next_;
|
||||
while (cur != head) {
|
||||
ObSqlSock* s = CONTAINER_OF(cur, ObSqlSock, all_list_link_);
|
||||
cur = cur->next_;
|
||||
s->do_close();
|
||||
}
|
||||
}
|
||||
private:
|
||||
void handle_epoll_event() {
|
||||
const int maxevents = 512;
|
||||
@ -937,6 +951,9 @@ void ObSqlNio::run(int64_t idx)
|
||||
while(!has_set_stop()) {
|
||||
impl_[idx].do_work();
|
||||
}
|
||||
if (has_set_stop()) {
|
||||
impl_[idx].close_all_fd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -737,6 +737,7 @@ void MockTenantModuleEnv::destroy()
|
||||
ObTsMgr::get_instance().wait();
|
||||
ObTsMgr::get_instance().destroy();
|
||||
|
||||
net_frame_.sql_nio_stop();
|
||||
net_frame_.stop();
|
||||
net_frame_.wait();
|
||||
net_frame_.destroy();
|
||||
|
@ -898,6 +898,10 @@ int ObServer::stop()
|
||||
FLOG_INFO("mysql shutdown network stopped");
|
||||
}
|
||||
|
||||
FLOG_INFO("begin to sql nio stop");
|
||||
net_frame_.sql_nio_stop();
|
||||
FLOG_INFO("sql nio stopped");
|
||||
|
||||
FLOG_INFO("begin to stop active session history task");
|
||||
ObActiveSessHistTask::get_instance().stop();
|
||||
FLOG_INFO("active session history task stopped");
|
||||
|
@ -453,9 +453,6 @@ int ObSrvNetworkFrame::stop()
|
||||
if (OB_FAIL(net_.stop())) {
|
||||
LOG_WARN("stop easy net fail", K(ret));
|
||||
}
|
||||
if (NULL != obmysql::global_sql_nio_server) {
|
||||
obmysql::global_sql_nio_server->stop();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -489,3 +486,10 @@ void ObSrvNetworkFrame::set_ratelimit_enable(int ratelimit_enabled)
|
||||
rpc_transport_->set_ratelimit_enable(ratelimit_enabled);
|
||||
batch_rpc_transport_->set_ratelimit_enable(ratelimit_enabled);
|
||||
}
|
||||
|
||||
void ObSrvNetworkFrame::sql_nio_stop()
|
||||
{
|
||||
if (NULL != obmysql::global_sql_nio_server) {
|
||||
obmysql::global_sql_nio_server->stop();
|
||||
}
|
||||
}
|
@ -49,6 +49,7 @@ public:
|
||||
int high_prio_rpc_shutdown();
|
||||
int batch_rpc_shutdown();
|
||||
int unix_rpc_shutdown();
|
||||
void sql_nio_stop();
|
||||
void wait();
|
||||
int stop();
|
||||
|
||||
|
@ -1204,6 +1204,8 @@ int ObMvccRowCallback::log_sync_fail()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
ObRowLatchGuard guard(value_.latch_);
|
||||
|
||||
if (OB_FAIL(dec_unsynced_cnt_())) {
|
||||
TRANS_LOG(ERROR, "memtable dec unsynced cnt error", K(ret),
|
||||
K(memtable_->get_unsynced_cnt()));
|
||||
|
@ -334,6 +334,7 @@ int MockObServer::stop()
|
||||
if (!is_inited_) {
|
||||
STORAGE_LOG(WARN, "ob server not inited");
|
||||
ret = OB_NOT_INIT;
|
||||
} else if (FALSE_IT(net_frame_.sql_nio_stop())) {
|
||||
} else if (OB_SUCCESS != (ret = net_frame_.stop())) {
|
||||
STORAGE_LOG(WARN, "net frame stop error", K(ret));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user