Browse Source

Hide "Connected with..." client messages by default

Vitaliy Filippov 1 year ago
parent
commit
ece14a7d65
  1. 4
      cluster_client.cpp
  2. 2
      etcd_state_client.cpp
  3. 11
      messenger.cpp
  4. 2
      osd.cpp
  5. 2
      rm_inode.cpp

4
cluster_client.cpp

@ -9,9 +9,12 @@ cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd
this->ringloop = ringloop;
this->tfd = tfd;
log_level = config["log_level"].int64_value();
msgr.osd_num = 0;
msgr.tfd = tfd;
msgr.ringloop = ringloop;
msgr.log_level = log_level;
msgr.repeer_pgs = [this](osd_num_t peer_osd)
{
if (msgr.osd_peer_fds.find(peer_osd) != msgr.osd_peer_fds.end())
@ -73,7 +76,6 @@ cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd
st_cli.on_change_hook = [this](json11::Json::object & changes) { on_change_hook(changes); };
st_cli.on_load_pgs_hook = [this](bool success) { on_load_pgs_hook(success); };
log_level = config["log_level"].int64_value();
st_cli.parse_config(config);
st_cli.load_global_config();

2
etcd_state_client.cpp

@ -136,7 +136,7 @@ void etcd_state_client_t::start_etcd_watcher()
}
for (auto & kv: changes)
{
if (this->log_level > 0)
if (this->log_level > 1)
{
printf("Incoming event: %s -> %s\n", kv.first.c_str(), kv.second.dump().c_str());
}

11
messenger.cpp

@ -220,7 +220,10 @@ void osd_messenger_t::on_connect_peer(osd_num_t peer_osd, int peer_fd)
}
return;
}
printf("Connected with peer OSD %lu (fd %d)\n", peer_osd, peer_fd);
if (log_level > 0)
{
printf("Connected with peer OSD %lu (fd %d)\n", peer_osd, peer_fd);
}
wanted_peers.erase(peer_osd);
repeer_pgs(peer_osd);
}
@ -331,12 +334,14 @@ void osd_messenger_t::stop_client(int peer_fd)
if (cl.osd_num)
{
// Reload configuration from etcd when the connection is dropped
printf("[OSD %lu] Stopping client %d (OSD peer %lu)\n", osd_num, peer_fd, cl.osd_num);
if (log_level > 0)
printf("[OSD %lu] Stopping client %d (OSD peer %lu)\n", osd_num, peer_fd, cl.osd_num);
repeer_osd = cl.osd_num;
}
else
{
printf("[OSD %lu] Stopping client %d (regular client)\n", osd_num, peer_fd);
if (log_level > 0)
printf("[OSD %lu] Stopping client %d (regular client)\n", osd_num, peer_fd);
}
}
clients.erase(it);

2
osd.cpp

@ -98,6 +98,8 @@ void osd_t::parse_config(blockstore_config_t & config)
if (!c_cli.peer_connect_timeout)
c_cli.peer_connect_timeout = DEFAULT_PEER_CONNECT_TIMEOUT;
log_level = strtoull(config["log_level"].c_str(), NULL, 10);
if (config.find("log_level") == config.end())
log_level = 1;
c_cli.log_level = log_level;
}

2
rm_inode.cpp

@ -102,7 +102,7 @@ public:
parallel_osds = cfg["parallel_osds"].uint64_value();
if (!parallel_osds)
parallel_osds = 4;
log_level = cfg["log_level"].uint64_value();
log_level = cfg["log_level"].int64_value();
progress = cfg["progress"].uint64_value() ? true : false;
// Create client
ringloop = new ring_loop_t(512);

Loading…
Cancel
Save