]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-monstore-tool: rebuild: remove obsolete pgmap_meta fields
authorSage Weil <sage@redhat.com>
Tue, 9 Oct 2018 23:01:06 +0000 (18:01 -0500)
committerSage Weil <sage@redhat.com>
Wed, 10 Oct 2018 13:47:22 +0000 (08:47 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/tools/ceph_monstore_tool.cc

index 05ac4b1e69ad690cc4a98ecadfcc0cfc4e065f38..20db4db2658766e31f136e306b80f88e6f5dddf8 100644 (file)
@@ -511,7 +511,6 @@ int inflate_pgmap(MonitorDBStore& st, unsigned n, bool can_be_trimmed) {
     }
   }
   txn->put("pgmap", "last_committed", ver);
-  txn->put("pgmap_meta", "version", ver);
   // this will also piggy back the leftover pgmap added in the loop above
   st.apply_transaction(txn);
   return 0;
@@ -635,7 +634,7 @@ static int update_paxos(MonitorDBStore& st)
     MonitorDBStore::Transaction t;
     vector<string> prefixes = {"auth", "osdmap",
                               "mgr", "mgr_command_desc",
-                              "pgmap", "pgmap_pg", "pgmap_meta"};
+                              "pgmap", "pgmap_pg"};
     for (const auto& prefix : prefixes) {
       for (auto i = st.get_iterator(prefix); i->valid(); i->next()) {
        auto key = i->raw_key();
@@ -657,60 +656,6 @@ static int update_paxos(MonitorDBStore& st)
   return 0;
 }
 
-// rebuild
-//  - pgmap_meta/version
-//  - pgmap_meta/last_osdmap_epoch
-//  - pgmap_meta/last_pg_scan
-//  - pgmap_meta/full_ratio
-//  - pgmap_meta/nearfull_ratio
-//  - pgmap_meta/stamp
-static int update_pgmap_meta(MonitorDBStore& st)
-{
-  const string prefix("pgmap_meta");
-  auto t = make_shared<MonitorDBStore::Transaction>();
-  // stolen from PGMonitor::create_pending()
-  // the first pgmap_meta
-  t->put(prefix, "version", 1);
-  {
-    auto stamp = ceph_clock_now();
-    bufferlist bl;
-    encode(stamp, bl);
-    t->put(prefix, "stamp", bl);
-  }
-  {
-    auto last_osdmap_epoch = st.get("osdmap", "last_committed");
-    t->put(prefix, "last_osdmap_epoch", last_osdmap_epoch);
-  }
-  // be conservative, so PGMonitor will scan the all pools for pg changes
-  t->put(prefix, "last_pg_scan", 1);
-  {
-    auto full_ratio = g_ceph_context->_conf->mon_osd_full_ratio;
-    if (full_ratio > 1.0)
-      full_ratio /= 100.0;
-    bufferlist bl;
-    encode(full_ratio, bl);
-    t->put(prefix, "full_ratio", bl);
-  }
-  {
-    auto backfillfull_ratio = g_ceph_context->_conf->mon_osd_backfillfull_ratio;
-    if (backfillfull_ratio > 1.0)
-      backfillfull_ratio /= 100.0;
-    bufferlist bl;
-    encode(backfillfull_ratio, bl);
-    t->put(prefix, "backfillfull_ratio", bl);
-  }
-  {
-    auto nearfull_ratio = g_ceph_context->_conf->mon_osd_nearfull_ratio;
-    if (nearfull_ratio > 1.0)
-      nearfull_ratio /= 100.0;
-    bufferlist bl;
-    encode(nearfull_ratio, bl);
-    t->put(prefix, "nearfull_ratio", bl);
-  }
-  st.apply_transaction(t);
-  return 0;
-}
-
 int rebuild_monstore(const char* progname,
                     vector<string>& subcmds,
                     MonitorDBStore& st)
@@ -731,9 +676,6 @@ int rebuild_monstore(const char* progname,
   }
   if (!keyring_path.empty())
     update_auth(st, keyring_path);
-  if ((r = update_pgmap_meta(st))) {
-    return r;
-  }
   if ((r = update_mgrmap(st))) {
     return r;
   }