]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
replace pool type REP with REPLICATED 981/head
authorLoic Dachary <loic@dachary.org>
Sun, 22 Dec 2013 06:04:36 +0000 (07:04 +0100)
committerLoic Dachary <loic@dachary.org>
Sun, 22 Dec 2013 07:15:24 +0000 (08:15 +0100)
Signed-off-by: Loic Dachary <loic@dachary.org>
12 files changed:
qa/workunits/cephtool/test.sh
src/crush/CrushCompiler.cc
src/crush/CrushWrapper.cc
src/include/rados.h
src/mon/OSDMonitor.cc
src/osd/OSD.cc
src/osd/OSDMap.cc
src/osd/osd_types.cc
src/osd/osd_types.h
src/test/cli/osdmaptool/clobber.t
src/test/cli/osdmaptool/create-print.t
src/tools/crushtool.cc

index cf04c56cb46dd686cbdde3a0c412796a0b050aca..ee525cb674941bcb1abc621fc668a4012e32d3a2 100755 (executable)
@@ -273,11 +273,11 @@ ceph osd pool delete data3 data3 --yes-i-really-really-mean-it
 
 ceph osd pool create erasurecodes 12 12 erasure
 ceph osd pool create erasurecodes 12 12 erasure
-# should fail because the default type is rep and 
+# should fail because the default type is replicated and 
 # the pool is of type erasure
 #expect_false ceph osd pool create erasurecodes 12 12
-ceph osd pool create replicated 12 12 rep
-ceph osd pool create replicated 12 12 rep
+ceph osd pool create replicated 12 12 replicated
+ceph osd pool create replicated 12 12 replicated
 ceph osd pool create replicated 12 12 # default is replicated
 ceph osd pool create replicated 12    # default is replicated, pgp_num = pg_num
 # should fail because the type is not the same
index 9a210d1ea040266353d78af5a88eae260272c45f..a954fecd0be46619742b027a6a6a9cc048132890 100644 (file)
@@ -227,7 +227,7 @@ int CrushCompiler::decompile(ostream &out)
     out << "\truleset " << crush.get_rule_mask_ruleset(i) << "\n";
 
     switch (crush.get_rule_mask_type(i)) {
-    case CEPH_PG_TYPE_REP:
+    case CEPH_PG_TYPE_REPLICATED:
       out << "\ttype replicated\n";
       break;
     case CEPH_PG_TYPE_ERASURE:
@@ -583,7 +583,7 @@ int CrushCompiler::parse_rule(iter_t const& i)
   string tname = string_node(i->children[start+2]);
   int type;
   if (tname == "replicated")
-    type = CEPH_PG_TYPE_REP;
+    type = CEPH_PG_TYPE_REPLICATED;
   else if (tname == "erasure")
     type = CEPH_PG_TYPE_ERASURE;
   else 
index 5318ddd8a79cd89322cb3afafc2011eb179ea3b9..ae1ece1a74a6fab9096e94574e85ac5f3353ac69 100644 (file)
@@ -698,7 +698,7 @@ int CrushWrapper::add_simple_rule(string name, string root_name,
   int steps = 3;
   if (mode == "indep")
     steps = 4;
-  crush_rule *rule = crush_make_rule(steps, ruleset, 1 /* pg_pool_t::TYPE_REP */, 1, 10);
+  crush_rule *rule = crush_make_rule(steps, ruleset, 1 /* pg_pool_t::TYPE_REPLICATED */, 1, 10);
   assert(rule);
   int step = 0;
   if (mode == "indep")
index e52d2087da713a12a1bccab029445e2471879f9a..a037df15c2935c406776a6ba323d89b1d4498afb 100644 (file)
@@ -68,7 +68,7 @@ struct ceph_pg {
  * NOTE: These map 1:1 on to the pg_pool_t::TYPE_* values.  They are
  * duplicated here only for CrushCompiler's benefit.
  */
-#define CEPH_PG_TYPE_REP     1
+#define CEPH_PG_TYPE_REPLICATED 1
 /* #define CEPH_PG_TYPE_RAID4   2   never implemented */
 #define CEPH_PG_TYPE_ERASURE 3
 
index 4fa796e4d63a9e684986096cae79973d60e1fc74..1bd7a5e78f1e11538b82745dc95f0cff717815a1 100644 (file)
@@ -1882,7 +1882,7 @@ void OSDMonitor::tick()
     ps_t numps = osdmap.get_pg_num();
     for (int64_t pool=0; pool<1; pool++)
       for (ps_t ps = 0; ps < numps; ++ps) {
-       pg_t pgid = pg_t(pg_t::TYPE_REP, ps, pool, -1);
+       pg_t pgid = pg_t(pg_t::TYPE_REPLICATED, ps, pool, -1);
        vector<int> osds;
        osdmap.pg_to_osds(pgid, osds); 
        if (osds[0] == 0) {
@@ -2726,10 +2726,10 @@ int OSDMonitor::prepare_new_pool(MPoolOp *m)
   vector<string> properties;
   if (m->auid)
     return prepare_new_pool(m->name, m->auid, m->crush_rule, 0, 0,
-                            properties, pg_pool_t::TYPE_REP);
+                            properties, pg_pool_t::TYPE_REPLICATED);
   else
     return prepare_new_pool(m->name, session->auid, m->crush_rule, 0, 0,
-                            properties, pg_pool_t::TYPE_REP);
+                            properties, pg_pool_t::TYPE_REPLICATED);
 }
 
 /**
@@ -3955,8 +3955,8 @@ done:
     string pool_type_str;
     cmd_getval(g_ceph_context, cmdmap, "pool_type", pool_type_str);
     int pool_type;
-    if (pool_type_str.empty() || pool_type_str == "rep") {
-      pool_type = pg_pool_t::TYPE_REP;
+    if (pool_type_str.empty() || pool_type_str == "replicated") {
+      pool_type = pg_pool_t::TYPE_REPLICATED;
     } else if (pool_type_str == "erasure") {
 
       // check if all up osds support erasure coding
index 327c0adddada05a8bc4c92a1e3e4e27750cce2ad..582b36aed30ccf10e4c9d04c618272e1d0979c39 100644 (file)
@@ -1694,7 +1694,7 @@ PG* OSD::_make_pg(
   PG *pg;
   hobject_t logoid = make_pg_log_oid(pgid);
   hobject_t infooid = make_pg_biginfo_oid(pgid);
-  if (createmap->get_pg_type(pgid) == pg_pool_t::TYPE_REP)
+  if (createmap->get_pg_type(pgid) == pg_pool_t::TYPE_REPLICATED)
     pg = new ReplicatedPG(&service, createmap, pool, pgid, logoid, infooid);
   else 
     assert(0);
index 758b15dfdfc7aaac06d3c6517ba94b51a6bd1b01..400a1a490f4843296c171f5a4425067bd5302a79 100644 (file)
@@ -1828,7 +1828,7 @@ void OSDMap::build_simple(CephContext *cct, epoch_t e, uuid_d &fsid,
 
   for (map<int,const char*>::iterator p = rulesets.begin(); p != rulesets.end(); ++p) {
     int64_t pool = ++pool_max;
-    pools[pool].type = pg_pool_t::TYPE_REP;
+    pools[pool].type = pg_pool_t::TYPE_REPLICATED;
     pools[pool].flags = cct->_conf->osd_pool_default_flags;
     if (cct->_conf->osd_pool_default_flag_hashpspool)
       pools[pool].flags |= pg_pool_t::FLAG_HASHPSPOOL;
@@ -1901,7 +1901,7 @@ void OSDMap::build_simple_crush_map(CephContext *cct, CrushWrapper& crush,
   assert(maxrep >= minrep);
   for (map<int,const char*>::iterator p = rulesets.begin(); p != rulesets.end(); ++p) {
     int ruleset = p->first;
-    crush_rule *rule = crush_make_rule(3, ruleset, pg_pool_t::TYPE_REP, minrep, maxrep);
+    crush_rule *rule = crush_make_rule(3, ruleset, pg_pool_t::TYPE_REPLICATED, minrep, maxrep);
     assert(rule);
     crush_rule_set_step(rule, 0, CRUSH_RULE_TAKE, rootid, 0);
     crush_rule_set_step(rule, 1,
@@ -1966,7 +1966,7 @@ int OSDMap::build_simple_from_conf(CephContext *cct, epoch_t e, uuid_d &fsid,
 
   for (map<int,const char*>::iterator p = rulesets.begin(); p != rulesets.end(); ++p) {
     int64_t pool = ++pool_max;
-    pools[pool].type = pg_pool_t::TYPE_REP;
+    pools[pool].type = pg_pool_t::TYPE_REPLICATED;
     pools[pool].flags = cct->_conf->osd_pool_default_flags;
     if (cct->_conf->osd_pool_default_flag_hashpspool)
       pools[pool].flags |= pg_pool_t::FLAG_HASHPSPOOL;
@@ -2062,7 +2062,7 @@ void OSDMap::build_simple_crush_map_from_conf(CephContext *cct, CrushWrapper& cr
   int maxrep = conf->osd_max_rep;
   for (map<int,const char*>::iterator p = rulesets.begin(); p != rulesets.end(); ++p) {
     int ruleset = p->first;
-    crush_rule *rule = crush_make_rule(3, ruleset, pg_pool_t::TYPE_REP, minrep, maxrep);
+    crush_rule *rule = crush_make_rule(3, ruleset, pg_pool_t::TYPE_REPLICATED, minrep, maxrep);
     assert(rule);
     crush_rule_set_step(rule, 0, CRUSH_RULE_TAKE, rootid, 0);
 
index cc0d389c80fa2c8e131ffc89b47741e04a2f28e6..2ca70d33bfa3c3d685f461dad63408857b0ec48a 100644 (file)
@@ -1058,7 +1058,7 @@ void pg_pool_t::generate_test_instances(list<pg_pool_t*>& o)
   pg_pool_t a;
   o.push_back(new pg_pool_t(a));
 
-  a.type = TYPE_REP;
+  a.type = TYPE_REPLICATED;
   a.size = 2;
   a.crush_ruleset = 3;
   a.object_hash = 4;
index 72aaad735d29eb61556acbfe0e4c2c080ac5a14f..f224e6d864fbfe557196ab3e25b45dbca3d82a96 100644 (file)
@@ -697,13 +697,13 @@ inline ostream& operator<<(ostream& out, const pool_snap_info_t& si) {
  */
 struct pg_pool_t {
   enum {
-    TYPE_REP = 1,     // replication
+    TYPE_REPLICATED = 1,     // replication
     //TYPE_RAID4 = 2,   // raid4 (never implemented)
     TYPE_ERASURE = 3,      // erasure-coded
   };
   static const char *get_type_name(int t) {
     switch (t) {
-    case TYPE_REP: return "rep";
+    case TYPE_REPLICATED: return "replicated";
       //case TYPE_RAID4: return "raid4";
     case TYPE_ERASURE: return "erasure";
     default: return "???";
@@ -861,12 +861,12 @@ public:
   void set_snap_seq(snapid_t s) { snap_seq = s; }
   void set_snap_epoch(epoch_t e) { snap_epoch = e; }
 
-  bool is_rep()   const { return get_type() == TYPE_REP; }
+  bool is_replicated()   const { return get_type() == TYPE_REPLICATED; }
   bool is_erasure() const { return get_type() == TYPE_ERASURE; }
 
   bool can_shift_osds() const {
     switch (get_type()) {
-    case TYPE_REP:
+    case TYPE_REPLICATED:
       return true;
     case TYPE_ERASURE:
       return false;
index 6d6cc7d45aa38e67cd3fcbbfae842d5892b12ce9..9d8cfef04c60b47f005202b9d6975c1cb5785f70 100644 (file)
@@ -20,9 +20,9 @@
   modified \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ (re)
   flags 
   
-  pool 0 'data' rep size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool crash_replay_interval 45
-  pool 1 'metadata' rep size 3 min_size 2 crush_ruleset 1 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
-  pool 2 'rbd' rep size 3 min_size 2 crush_ruleset 2 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
+  pool 0 'data' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool crash_replay_interval 45
+  pool 1 'metadata' replicated size 3 min_size 2 crush_ruleset 1 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
+  pool 2 'rbd' replicated size 3 min_size 2 crush_ruleset 2 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
   
   max_osd 3
   
@@ -43,9 +43,9 @@
   modified \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ (re)
   flags 
   
-  pool 0 'data' rep size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 0 owner 0 flags hashpspool crash_replay_interval 45
-  pool 1 'metadata' rep size 3 min_size 2 crush_ruleset 1 object_hash rjenkins pg_num 64 pgp_num 64 last_change 0 owner 0 flags hashpspool
-  pool 2 'rbd' rep size 3 min_size 2 crush_ruleset 2 object_hash rjenkins pg_num 64 pgp_num 64 last_change 0 owner 0 flags hashpspool
+  pool 0 'data' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 0 owner 0 flags hashpspool crash_replay_interval 45
+  pool 1 'metadata' replicated size 3 min_size 2 crush_ruleset 1 object_hash rjenkins pg_num 64 pgp_num 64 last_change 0 owner 0 flags hashpspool
+  pool 2 'rbd' replicated size 3 min_size 2 crush_ruleset 2 object_hash rjenkins pg_num 64 pgp_num 64 last_change 0 owner 0 flags hashpspool
   
   max_osd 1
   
index f54f4be939501eda6970c7055816f558703243bc..c10e3d182eff9fbf49ef7e0b024f8ba4a89cad09 100644 (file)
@@ -10,9 +10,9 @@
   modified \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ (re)
   flags 
   
-  pool 0 'data' rep size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool crash_replay_interval 45
-  pool 1 'metadata' rep size 3 min_size 2 crush_ruleset 1 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
-  pool 2 'rbd' rep size 3 min_size 2 crush_ruleset 2 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
+  pool 0 'data' replicated size 3 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool crash_replay_interval 45
+  pool 1 'metadata' replicated size 3 min_size 2 crush_ruleset 1 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
+  pool 2 'rbd' replicated size 3 min_size 2 crush_ruleset 2 object_hash rjenkins pg_num 192 pgp_num 192 last_change 0 owner 0 flags hashpspool
   
   max_osd 3
   
index 14ac9c89a7e619b589e67cb94b627ac33793e4d0..55813c3d14f82c4fbd9683effb7c6285a70a1c48 100644 (file)
@@ -599,7 +599,7 @@ int main(int argc, const char **argv)
     
     // make a generic rules
     int ruleset=1;
-    crush_rule *rule = crush_make_rule(3, ruleset, CEPH_PG_TYPE_REP, 2, 2);
+    crush_rule *rule = crush_make_rule(3, ruleset, CEPH_PG_TYPE_REPLICATED, 2, 2);
     assert(rule);
     crush_rule_set_step(rule, 0, CRUSH_RULE_TAKE, rootid, 0);
     crush_rule_set_step(rule, 1, CRUSH_RULE_CHOOSELEAF_FIRSTN, CRUSH_CHOOSE_N, 1);