summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatan Breizman <mbreizma@redhat.com>2023-07-19 11:39:31 +0200
committerMatan Breizman <mbreizma@redhat.com>2023-07-25 09:20:11 +0200
commite48ef1f6c52cf769374f891a2d699f508aeabf5e (patch)
treed8237fa1e683916e25aaa196bb7bfc1e21924c3a
parentmon/MonitorDBStore: close() assert queue is empty (diff)
downloadceph-e48ef1f6c52cf769374f891a2d699f508aeabf5e.tar.xz
ceph-e48ef1f6c52cf769374f891a2d699f508aeabf5e.zip
ceph_mon: use the same `store` instace
Fixes: https://tracker.ceph.com/issues/61820 Signed-off-by: Matan Breizman <mbreizma@redhat.com>
-rw-r--r--src/ceph_mon.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc
index 3f269ed8c6a..d129ea4dd59 100644
--- a/src/ceph_mon.cc
+++ b/src/ceph_mon.cc
@@ -356,6 +356,8 @@ int main(int argc, const char **argv)
exit(1);
}
+ MonitorDBStore *store = new MonitorDBStore(g_conf()->mon_data);
+
// -- mkfs --
if (mkfs) {
@@ -511,9 +513,8 @@ int main(int argc, const char **argv)
}
// go
- MonitorDBStore store(g_conf()->mon_data);
ostringstream oss;
- int r = store.create_and_open(oss);
+ int r = store->create_and_open(oss);
if (oss.tellp())
derr << oss.str() << dendl;
if (r < 0) {
@@ -523,13 +524,13 @@ int main(int argc, const char **argv)
}
ceph_assert(r == 0);
- Monitor mon(g_ceph_context, g_conf()->name.get_id(), &store, 0, 0, &monmap);
+ Monitor mon(g_ceph_context, g_conf()->name.get_id(), store, 0, 0, &monmap);
r = mon.mkfs(osdmapbl);
if (r < 0) {
derr << argv[0] << ": error creating monfs: " << cpp_strerror(r) << dendl;
exit(1);
}
- store.close();
+ store->close();
dout(0) << argv[0] << ": created monfs at " << g_conf()->mon_data
<< " for " << g_conf()->name << dendl;
return 0;
@@ -605,8 +606,6 @@ int main(int argc, const char **argv)
// set up signal handlers, now that we've daemonized/forked.
init_async_signal_handler();
- MonitorDBStore *store = new MonitorDBStore(g_conf()->mon_data);
-
// make sure we aren't upgrading too fast
{
string val;