Browse Source

Improve PG-related log messages

tags/v0.5.1
Vitaliy Filippov 3 months ago
parent
commit
398c86f943
5 changed files with 16 additions and 15 deletions
  1. +1
    -1
      messenger.cpp
  2. +2
    -2
      osd.cpp
  3. +5
    -5
      osd_peering.cpp
  4. +1
    -1
      osd_peering_pg.cpp
  5. +7
    -6
      rm_inode.cpp

+ 1
- 1
messenger.cpp View File

@@ -222,7 +222,7 @@ void osd_messenger_t::on_connect_peer(osd_num_t peer_osd, int peer_fd)
}
if (log_level > 0)
{
printf("Connected with peer OSD %lu (fd %d)\n", peer_osd, peer_fd);
printf("[OSD %lu] Connected with peer OSD %lu (fd %d)\n", osd_num, peer_osd, peer_fd);
}
wanted_peers.erase(peer_osd);
repeer_pgs(peer_osd);


+ 2
- 2
osd.cpp View File

@@ -49,6 +49,8 @@ osd_t::~osd_t()

void osd_t::parse_config(blockstore_config_t & config)
{
if (config.find("log_level") == config.end())
config["log_level"] = "1";
// Initial startup configuration
json11::Json json_config = json11::Json(config);
st_cli.parse_config(json_config);
@@ -98,8 +100,6 @@ 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;
}



+ 5
- 5
osd_peering.cpp View File

@@ -91,7 +91,7 @@ void osd_t::repeer_pgs(osd_num_t peer_osd)
if (repeer)
{
// Repeer this pg
printf("[PG %u] Repeer because of OSD %lu\n", p.second.pg_num, peer_osd);
printf("[PG %u/%u] Repeer because of OSD %lu\n", p.second.pool_id, p.second.pg_num, peer_osd);
start_pg_peering(p.second);
}
}
@@ -360,8 +360,8 @@ void osd_t::submit_list_subop(osd_num_t role_osd, pg_peering_state_t *ps)
}
add_bs_subop_stats(op);
printf(
"[PG %u] Got object list from OSD %lu (local): %d object versions (%lu of them stable)\n",
ps->pg_num, role_osd, bs_op->retval, bs_op->version
"[PG %u/%u] Got object list from OSD %lu (local): %d object versions (%lu of them stable)\n",
ps->pool_id, ps->pg_num, role_osd, bs_op->retval, bs_op->version
);
ps->list_results[role_osd] = {
.buf = (obj_ver_id*)op->bs_op->buf,
@@ -407,8 +407,8 @@ void osd_t::submit_list_subop(osd_num_t role_osd, pg_peering_state_t *ps)
return;
}
printf(
"[PG %u] Got object list from OSD %lu: %ld object versions (%lu of them stable)\n",
ps->pg_num, role_osd, op->reply.hdr.retval, op->reply.sec_list.stable_count
"[PG %u/%u] Got object list from OSD %lu: %ld object versions (%lu of them stable)\n",
ps->pool_id, ps->pg_num, role_osd, op->reply.hdr.retval, op->reply.sec_list.stable_count
);
ps->list_results[role_osd] = {
.buf = (obj_ver_id*)op->buf,


+ 1
- 1
osd_peering_pg.cpp View File

@@ -440,7 +440,7 @@ void pg_t::calc_object_states(int log_level)
void pg_t::print_state()
{
printf(
"[PG %u] is %s%s%s%s%s%s%s%s%s%s%s%s%s (%lu objects)\n", pg_num,
"[PG %u/%u] is %s%s%s%s%s%s%s%s%s%s%s%s%s (%lu objects)\n", pool_id, pg_num,
(state & PG_STARTING) ? "starting" : "",
(state & PG_OFFLINE) ? "offline" : "",
(state & PG_PEERING) ? "peering" : "",


+ 7
- 6
rm_inode.cpp View File

@@ -32,7 +32,8 @@ struct rm_pg_osd_t
class rm_inode_t
{
protected:
uint64_t inode = 0, pool_id = 0;
uint64_t inode = 0;
pool_id_t pool_id = 0;
uint64_t iodepth = 0, parallel_osds = 0;

ring_loop_t *ringloop = NULL;
@@ -89,7 +90,7 @@ public:
inode = cfg["inode"].uint64_value();
pool_id = cfg["pool"].uint64_value();
if (pool_id)
inode = (inode & ((1l << (64-POOL_ID_BITS)) - 1)) | (pool_id << (64-POOL_ID_BITS));
inode = (inode & ((1l << (64-POOL_ID_BITS)) - 1)) | (((uint64_t)pool_id) << (64-POOL_ID_BITS));
pool_id = INODE_POOL(inode);
if (!pool_id)
{
@@ -129,7 +130,7 @@ public:
{
if (cli->st_cli.pool_config.find(pool_id) == cli->st_cli.pool_config.end())
{
fprintf(stderr, "Pool %lu does not exist\n", pool_id);
fprintf(stderr, "Pool %u does not exist\n", pool_id);
exit(1);
}
auto pool_cfg = cli->st_cli.pool_config[pool_id];
@@ -199,8 +200,8 @@ public:
if (log_level > 0)
{
printf(
"[PG %u] Got inode object list from OSD %lu: %ld object versions\n",
cur_list->pg_num, cur_list->osd_num, op->reply.hdr.retval
"[PG %u/%u] Got inode object list from OSD %lu: %ld object versions\n",
pool_id, cur_list->pg_num, cur_list->osd_num, op->reply.hdr.retval
);
}
cur_list->obj_list = (obj_ver_id*)op->buf;
@@ -308,7 +309,7 @@ public:
}
if (!lists.size())
{
printf("Done, inode %lu in pool %lu removed\n", (inode & ((1l << (64-POOL_ID_BITS)) - 1)), pool_id);
printf("Done, inode %lu in pool %u removed\n", (inode & ((1l << (64-POOL_ID_BITS)) - 1)), pool_id);
exit(0);
}
}


Loading…
Cancel
Save