]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not create localized pgs
authorSage Weil <sage.weil@dreamhost.com>
Fri, 20 Apr 2012 04:29:43 +0000 (21:29 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 20 Apr 2012 04:29:43 +0000 (21:29 -0700)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/common/config_opts.h
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/osdmaptool.cc

index 23bdbc375bb5a54ea3b43237759832b99c932e23..5e0aedfd85f8b578d9f2e3572d94a841dfcd8790 100644 (file)
@@ -255,7 +255,6 @@ OPTION(osd_client_message_size_cap, OPT_U64, 500*1024L*1024L) // default to 200M
 OPTION(osd_stat_refresh_interval, OPT_DOUBLE, .5)
 OPTION(osd_pg_bits, OPT_INT, 6)  // bits per osd
 OPTION(osd_pgp_bits, OPT_INT, 6)  // bits per osd
-OPTION(osd_lpg_bits, OPT_INT, 0)  // bits per osd
 OPTION(osd_pg_layout, OPT_INT, CEPH_PG_LAYOUT_CRUSH)
 OPTION(osd_min_rep, OPT_INT, 1)
 OPTION(osd_max_rep, OPT_INT, 10)
index a8918a647778f9f6b23b26b0435c574191ade640..d5fc530169420db88d6964eb6c040356fe4cfc5f 100644 (file)
@@ -78,7 +78,7 @@ void OSDMonitor::create_initial()
     newmap.set_fsid(mon->monmap->fsid);
   } else {
     newmap.build_simple(g_ceph_context, 0, mon->monmap->fsid, 0,
-                       g_conf->osd_pg_bits, g_conf->osd_pgp_bits, g_conf->osd_lpg_bits);
+                       g_conf->osd_pg_bits, g_conf->osd_pgp_bits);
   }
   newmap.set_epoch(1);
   newmap.created = newmap.modified = ceph_clock_now(g_ceph_context);
@@ -1499,8 +1499,6 @@ int OSDMonitor::prepare_new_pool(string& name, uint64_t auid, int crush_rule,
                                         g_conf->osd_pool_default_pg_num);
   pending_inc.new_pools[pool].pgp_num = (pgp_num ? pgp_num :
                                          g_conf->osd_pool_default_pgp_num);
-  pending_inc.new_pools[pool].lpg_num = 0;
-  pending_inc.new_pools[pool].lpgp_num = 0;
   pending_inc.new_pools[pool].last_change = pending_inc.epoch;
   pending_inc.new_pools[pool].auid = auid;
   pending_inc.new_pool_names[pool] = name;
@@ -2016,26 +2014,6 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
          paxos->wait_for_commit(new Monitor::C_Command(mon, m, ret, rs, paxos->get_version()));
          return true;
        }
-      } else if (m->cmd.size() >= 5 &&
-                m->cmd[2] == "disable_lpgs" &&
-                m->cmd[4] == "--yes-i-really-mean-it") {
-       // semi-kludge to disable localized pgs for a pool
-       int64_t pool = osdmap.lookup_pg_pool_name(m->cmd[3].c_str());
-       if (pool < 0) {
-         ss << "unrecognized pool '" << m->cmd[3] << "'";
-         err = -ENOENT;
-       } else {
-         const pg_pool_t *p = osdmap.get_pg_pool(pool);
-         if (pending_inc.new_pools.count(pool) == 0)
-           pending_inc.new_pools[pool] = *p;
-         pending_inc.new_pools[pool].lpg_num = 0;
-         pending_inc.new_pools[pool].lpgp_num = 0;
-         pending_inc.new_pools[pool].last_change = pending_inc.epoch;
-         ss << "disabled localized pgs for pool " << pool;
-         getline(ss, rs);
-         paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
-         return true;
-       }
       } else if (m->cmd[2] == "set") {
        if (m->cmd.size() != 6) {
          err = -EINVAL;
@@ -2150,16 +2128,6 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
          err = 0;
          goto out;
        }
-       if (m->cmd[4] == "lpg_num") {
-         ss << "LPG_NUM: " << p->get_lpg_num();
-         err = 0;
-         goto out;
-       }
-       if (m->cmd[4] == "lpgp_num") {
-         ss << "LPPG_NUM: " << p->get_lpgp_num();
-         err = 0;
-         goto out;
-       }
        ss << "don't know how to get pool field " << m->cmd[4];
        goto out;
       }
index e65e6825c6d80a4e6c1e0718dd3b0d08c4e7c90a..c15eee1feaf2dc2881801bc760e15f9355ce4628 100644 (file)
@@ -698,18 +698,6 @@ bool PGMonitor::register_new_pgs()
       created++;
       register_pg(pool, pgid, pool.get_last_change(), new_pool);
     }
-
-    for (ps_t ps = 0; ps < pool.get_lpg_num(); ps++) {
-      for (int osd = 0; osd < osdmap->get_max_osd(); osd++) {
-       pg_t pgid(ps, poolid, osd);
-       if (pg_map.pg_stat.count(pgid)) {
-         dout(20) << "register_new_pgs  have " << pgid << dendl;
-         continue;
-       }
-       created++;
-       register_pg(pool, pgid, pool.get_last_change(), new_pool);
-      }
-    }
   }
 
   int max = MIN(osdmap->get_max_osd(), osdmap->crush.get_max_devices());
index 0189fca617c9ce820186eddf417e1bf5d48240bd..e523869e53e578d6aa29b1a5649df8ffc81f88de 100644 (file)
@@ -899,7 +899,7 @@ void OSDMap::generate_test_instances(list<OSDMap*>& o)
   CephContext *cct = new CephContext(CODE_ENVIRONMENT_UTILITY);
   o.push_back(new OSDMap);
   uuid_d fsid;
-  o.back()->build_simple(cct, 1, fsid, 16, 7, 8, 9);
+  o.back()->build_simple(cct, 1, fsid, 16, 7, 8);
   o.back()->created = o.back()->modified = utime_t(1, 2);  // fix timestamp
   delete cct;
 }
@@ -1070,11 +1070,11 @@ void OSDMap::print_summary(ostream& out) const
 }
 
 void OSDMap::build_simple(CephContext *cct, epoch_t e, uuid_d &fsid,
-                         int nosd, int pg_bits, int pgp_bits, int lpg_bits)
+                         int nosd, int pg_bits, int pgp_bits)
 {
   ldout(cct, 10) << "build_simple on " << num_osd
                 << " osds with " << pg_bits << " pg bits per osd, "
-                << lpg_bits << " lpg bits" << dendl;
+                << dendl;
   epoch = e;
   set_fsid(fsid);
   created = modified = ceph_clock_now(cct);
@@ -1101,8 +1101,8 @@ void OSDMap::build_simple(CephContext *cct, epoch_t e, uuid_d &fsid,
     pools[pool].object_hash = CEPH_STR_HASH_RJENKINS;
     pools[pool].pg_num = poolbase << pg_bits;
     pools[pool].pgp_num = poolbase << pgp_bits;
-    pools[pool].lpg_num = lpg_bits ? (1 << (lpg_bits-1)) : 0;
-    pools[pool].lpgp_num = lpg_bits ? (1 << (lpg_bits-1)) : 0;
+    pools[pool].lpg_num = 0;
+    pools[pool].lpgp_num = 0;
     pools[pool].last_change = epoch;
     if (p->first == CEPH_DATA_RULE)
       pools[pool].crash_replay_interval = cct->_conf->osd_default_data_pool_replay_window;
@@ -1167,11 +1167,11 @@ void OSDMap::build_simple_crush_map(CephContext *cct, CrushWrapper& crush,
 }
 
 void OSDMap::build_simple_from_conf(CephContext *cct, epoch_t e, uuid_d &fsid,
-                                   int pg_bits, int pgp_bits, int lpg_bits)
+                                   int pg_bits, int pgp_bits)
 {
   ldout(cct, 10) << "build_simple_from_conf with "
                 << pg_bits << " pg bits per osd, "
-                << lpg_bits << " lpg bits" << dendl;
+                << dendl;
   epoch = e;
   set_fsid(fsid);
   created = modified = ceph_clock_now(cct);
@@ -1217,8 +1217,8 @@ void OSDMap::build_simple_from_conf(CephContext *cct, epoch_t e, uuid_d &fsid,
     pools[pool].object_hash = CEPH_STR_HASH_RJENKINS;
     pools[pool].pg_num = (maxosd + 1) << pg_bits;
     pools[pool].pgp_num = (maxosd + 1) << pgp_bits;
-    pools[pool].lpg_num = lpg_bits ? (1 << (lpg_bits-1)) : 0;
-    pools[pool].lpgp_num = lpg_bits ? (1 << (lpg_bits-1)) : 0;
+    pools[pool].lpg_num = 0;
+    pools[pool].lpgp_num = 0;
     pools[pool].last_change = epoch;
     if (p->first == CEPH_DATA_RULE)
       pools[pool].crash_replay_interval = cct->_conf->osd_default_data_pool_replay_window;
index 196c52e9261b69508c66b055776c52abcb4f7216..11b7f259040ca0613d9880cf50acae492f9f65ae 100644 (file)
@@ -664,9 +664,9 @@ public:
    * handy helpers to build simple maps...
    */
   void build_simple(CephContext *cct, epoch_t e, uuid_d &fsid,
-                   int num_osd, int pg_bits, int pgp_bits, int lpg_bits);
+                   int num_osd, int pg_bits, int pgp_bits);
   void build_simple_from_conf(CephContext *cct, epoch_t e, uuid_d &fsid,
-                             int pg_bits, int pgp_bits, int lpg_bits);
+                             int pg_bits, int pgp_bits);
   static void build_simple_crush_map(CephContext *cct, CrushWrapper& crush,
                                     map<int, const char*>& poolsets, int num_osd);
   static void build_simple_crush_map_from_conf(CephContext *cct, CrushWrapper& crush,
index 6dc62b46e5415ade15c3d30c3a94a17e1b60ef7c..41889c14a08edaad86ef9aa001ac61c1bb7f7ea1 100644 (file)
@@ -60,7 +60,6 @@ int main(int argc, const char **argv)
   int num_osd = 0;
   int pg_bits = g_conf->osd_pg_bits;
   int pgp_bits = g_conf->osd_pgp_bits;
-  int lpg_bits = g_conf->osd_lpg_bits;
   bool clobber = false;
   bool modified = false;
   std::string export_crush, import_crush, test_map_pg, test_map_object;
@@ -100,11 +99,6 @@ int main(int argc, const char **argv)
        cerr << err.str() << std::endl;
        exit(EXIT_FAILURE);
       }
-    } else if (ceph_argparse_withint(args, i, &lpg_bits, &err, "--lpg_bits", (char*)NULL)) {
-      if (!err.str().empty()) {
-       cerr << err.str() << std::endl;
-       exit(EXIT_FAILURE);
-      }
     } else if (ceph_argparse_witharg(args, i, &val, "--export_crush", (char*)NULL)) {
       export_crush = val;
     } else if (ceph_argparse_witharg(args, i, &val, "--import_crush", (char*)NULL)) {
@@ -165,13 +159,13 @@ int main(int argc, const char **argv)
     }
     uuid_d fsid;
     memset(&fsid, 0, sizeof(uuid_d));
-    osdmap.build_simple(g_ceph_context, 0, fsid, num_osd, pg_bits, pgp_bits, lpg_bits);
+    osdmap.build_simple(g_ceph_context, 0, fsid, num_osd, pg_bits, pgp_bits);
     modified = true;
   }
   if (create_from_conf) {
     uuid_d fsid;
     memset(&fsid, 0, sizeof(uuid_d));
-    osdmap.build_simple_from_conf(g_ceph_context, 0, fsid, pg_bits, pgp_bits, lpg_bits);
+    osdmap.build_simple_from_conf(g_ceph_context, 0, fsid, pg_bits, pgp_bits);
     modified = true;
   }