not to create MysqlIO under the old easy framework when sql_nio enabled

This commit is contained in:
liucc1997 2024-11-27 18:16:13 +00:00 committed by ob-robot
parent 4d4991fea0
commit 1bf1415bb6
3 changed files with 8 additions and 3 deletions

View File

@ -154,7 +154,8 @@ ObNetEasy::ObNetEasy()
rpc_unix_eio_(NULL),
is_inited_(false),
started_(false),
rpc_port_(0)
rpc_port_(0),
sql_io_cnt_(0)
{
net_easy_update_s2r_map_cb_ = NULL;
net_easy_update_s2r_map_cb_args_ = NULL;
@ -790,7 +791,7 @@ int ObNetEasy::init(const ObNetOptions &opts, uint8_t negotiation_enable)
}
}
}
sql_io_cnt_ = opts.mysql_io_cnt_;
is_inited_ = true;
}
} else {
@ -859,7 +860,7 @@ int ObNetEasy::start()
}
}
if (OB_SUCC(ret)) {
if (OB_SUCC(ret) && sql_io_cnt_ > 0) {
int eret = easy_eio_start(mysql_eio_);
if (EASY_OK == eret) {
LOG_INFO("start mysql easy io");

View File

@ -155,6 +155,7 @@ protected:
private:
ObListener rpc_listener_;
uint32_t rpc_port_;
int sql_io_cnt_; // the count of MysqlIO thread under the old easy framework, default is 0
}; // end of class ObNetEasy
} // end of namespace frame

View File

@ -106,6 +106,9 @@ int ObSrvNetworkFrame::init()
opts.rpc_io_cnt_ = io_cnt;
opts.high_prio_rpc_io_cnt_ = hp_io_cnt;
opts.mysql_io_cnt_ = io_cnt;
if (enable_new_sql_nio()) {
opts.mysql_io_cnt_ = 0; // if sql_nio enabled, not to create MysqlIO under the old easy framework
}
opts.batch_rpc_io_cnt_ = io_cnt;
opts.use_ipv6_ = GCONF.use_ipv6;
//TODO(tony.wzh): fix opts.tcp_keepidle negative