From 915d04c446a35cb441d235d2273fa73a3ed8fa2e Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 31 Jan 2021 22:49:36 +0300 Subject: [PATCH] Allow empty global configuration, report OSD statistics faster --- mon/mon.js | 5 ++++- osd_cluster.cpp | 1 + osd_primary_subops.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mon/mon.js b/mon/mon.js index ba271fa3..a21877ad 100644 --- a/mon/mon.js +++ b/mon/mon.js @@ -253,7 +253,10 @@ class Mon const res = await this.etcd_call('/kv/txn', { success: [ { requestRange: { key: b64(this.etcd_prefix+'/config/global') } } ] }, this.etcd_start_timeout, -1); - this.parse_kv(res.responses[0].response_range.kvs[0]); + if (res.responses[0].response_range.kvs) + { + this.parse_kv(res.responses[0].response_range.kvs[0]); + } this.check_config(); } diff --git a/osd_cluster.cpp b/osd_cluster.cpp index 37574499..554c8631 100644 --- a/osd_cluster.cpp +++ b/osd_cluster.cpp @@ -384,6 +384,7 @@ void osd_t::create_osd_state() { st_cli.load_pgs(); } + report_statistics(); }); } diff --git a/osd_primary_subops.cpp b/osd_primary_subops.cpp index d3c4884f..919c1799 100644 --- a/osd_primary_subops.cpp +++ b/osd_primary_subops.cpp @@ -295,7 +295,7 @@ void osd_t::handle_primary_subop(osd_op_t *subop, osd_op_t *cur_op) uint64_t version = subop->reply.sec_rw.version; #ifdef OSD_DEBUG uint64_t peer_osd = c_cli.clients.find(subop->peer_fd) != c_cli.clients.end() - ? c_cli.clients[subop->peer_fd].osd_num : osd_num; + ? c_cli.clients[subop->peer_fd]->osd_num : osd_num; printf("subop %lu from osd %lu: version = %lu\n", opcode, peer_osd, version); #endif if (op_data->fact_ver != 0 && op_data->fact_ver != version)