]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: pg-remap -> pg-upmap 14556/head
authorSage Weil <sage@redhat.com>
Tue, 18 Apr 2017 16:59:40 +0000 (12:59 -0400)
committerSage Weil <sage@redhat.com>
Tue, 18 Apr 2017 16:59:40 +0000 (12:59 -0400)
'remap' is to non-specific a name.  In particular, it
sounds like it is related to the 'remapped' PG state
but in reality it is not related.

'upmap' or 'pg-upmap' is more specific: it maps a pgid
to the 'up' set value (or item)

Signed-off-by: Sage Weil <sage@redhat.com>
18 files changed:
qa/suites/rados/upgrade/jewel-x-singleton/3-thrash/default.yaml
qa/suites/upgrade/jewel-x/stress-split-erasure-code/3-thrash/default.yaml
qa/suites/upgrade/jewel-x/stress-split/3-thrash/default.yaml
qa/suites/upgrade/kraken-x/stress-split-erasure-code/3-thrash/default.yaml
qa/suites/upgrade/kraken-x/stress-split/3-thrash/default.yaml
qa/tasks/ceph_manager.py
qa/tasks/thrashosds.py
src/common/config_opts.h
src/mon/MonCommands.h
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/test/cli/osdmaptool/help.t
src/test/cli/osdmaptool/missing-argument.t
src/test/cli/osdmaptool/remap.t [deleted file]
src/test/cli/osdmaptool/upmap.t [new file with mode: 0644]
src/tools/osdmaptool.cc
src/vstart.sh

index 8785de6c3f24552c13ef719edad279e50500b5f9..a83c77dab191dbab9d73ef7e7756b710d860221d 100644 (file)
@@ -18,6 +18,6 @@ split_tasks:
         chance_pgnum_grow: 1
         chance_pgpnum_fix: 1
         chance_thrash_cluster_full: 0
-        chance_thrash_pg_remap: 0
-        chance_thrash_pg_remap_items: 0
+        chance_thrash_pg_upmap: 0
+        chance_thrash_pg_upmap_items: 0
     - print: "**** done thrashosds 3-thrash"
index 0272cb94c14498eff3c79d4c8332523592f10048..d3259109ffbee9c951662c6a8a205668cd2322d3 100644 (file)
@@ -18,6 +18,6 @@ stress-tasks:
     chance_pgpnum_fix: 1
     min_in: 4
     chance_thrash_cluster_full: 0
-    chance_thrash_pg_remap: 0
-    chance_thrash_pg_remap_items: 0
+    chance_thrash_pg_upmap: 0
+    chance_thrash_pg_upmap_items: 0
 - print: "**** done thrashosds 3-thrash"
index 185bdbceb7feac8e388edfe84e54881fc2a87c10..955a855b00c939e19914d7a0fb2b52c0e8ab2772 100644 (file)
@@ -17,6 +17,6 @@ stress-tasks:
     chance_pgnum_grow: 1
     chance_pgpnum_fix: 1
     chance_thrash_cluster_full: 0
-    chance_thrash_pg_remap: 0
-    chance_thrash_pg_remap_items: 0
+    chance_thrash_pg_upmap: 0
+    chance_thrash_pg_upmap_items: 0
 - print: "**** done thrashosds 3-thrash"
index 0272cb94c14498eff3c79d4c8332523592f10048..d3259109ffbee9c951662c6a8a205668cd2322d3 100644 (file)
@@ -18,6 +18,6 @@ stress-tasks:
     chance_pgpnum_fix: 1
     min_in: 4
     chance_thrash_cluster_full: 0
-    chance_thrash_pg_remap: 0
-    chance_thrash_pg_remap_items: 0
+    chance_thrash_pg_upmap: 0
+    chance_thrash_pg_upmap_items: 0
 - print: "**** done thrashosds 3-thrash"
index 185bdbceb7feac8e388edfe84e54881fc2a87c10..955a855b00c939e19914d7a0fb2b52c0e8ab2772 100644 (file)
@@ -17,6 +17,6 @@ stress-tasks:
     chance_pgnum_grow: 1
     chance_pgpnum_fix: 1
     chance_thrash_cluster_full: 0
-    chance_thrash_pg_remap: 0
-    chance_thrash_pg_remap_items: 0
+    chance_thrash_pg_upmap: 0
+    chance_thrash_pg_upmap_items: 0
 - print: "**** done thrashosds 3-thrash"
index 8ff2556a7a0e9334c296c44f25b75063690dd049..694da55825eb5131c964e6bbf0b960c7eece7361 100644 (file)
@@ -123,8 +123,8 @@ class Thrasher:
         self.dump_ops_enable = self.config.get('dump_ops_enable')
         self.noscrub_toggle_delay = self.config.get('noscrub_toggle_delay')
         self.chance_thrash_cluster_full = self.config.get('chance_thrash_cluster_full', .05)
-        self.chance_thrash_pg_remap = self.config.get('chance_thrash_pg_remap', 1.0)
-        self.chance_thrash_pg_remap_items = self.config.get('chance_thrash_pg_remap', 1.0)
+        self.chance_thrash_pg_upmap = self.config.get('chance_thrash_pg_upmap', 1.0)
+        self.chance_thrash_pg_upmap_items = self.config.get('chance_thrash_pg_upmap', 1.0)
 
         num_osds = self.in_osds + self.out_osds
         self.max_pgs = self.config.get("max_pgs_per_pool_osd", 1200) * num_osds
@@ -507,9 +507,9 @@ class Thrasher:
         self.log('Setting full ratio back to .95')
         self.ceph_manager.raw_cluster_cmd('osd', 'set-full-ratio', '.95')
 
-    def thrash_pg_remap(self):
+    def thrash_pg_upmap(self):
         """
-        Install or remove random pg_remap entries in OSDMap
+        Install or remove random pg_upmap entries in OSDMap
         """
         from random import shuffle
         out = self.ceph_manager.raw_cluster_cmd('osd', 'dump', '-f', 'json-pretty')
@@ -529,27 +529,27 @@ class Thrasher:
                 shuffle(osds)
                 osds = osds[0:n]
                 self.log('Setting %s to %s' % (pgid, osds))
-                cmd = ['osd', 'pg-remap', pgid] + [str(x) for x in osds]
+                cmd = ['osd', 'pg-upmap', pgid] + [str(x) for x in osds]
                 self.log('cmd %s' % cmd)
                 self.ceph_manager.raw_cluster_cmd(*cmd)
             else:
-                m = j['pg_remap']
+                m = j['pg_upmap']
                 if len(m) > 0:
                     shuffle(m)
                     pg = m[0]['pgid']
-                    self.log('Clearing pg_remap on %s' % pg)
+                    self.log('Clearing pg_upmap on %s' % pg)
                     self.ceph_manager.raw_cluster_cmd(
                         'osd',
-                        'rm-pg-remap',
+                        'rm-pg-upmap',
                         pg)
                 else:
-                    self.log('No pg_remap entries; doing nothing')
+                    self.log('No pg_upmap entries; doing nothing')
         except CommandFailedError:
-            self.log('Failed to rm-pg-remap, ignoring')
+            self.log('Failed to rm-pg-upmap, ignoring')
 
-    def thrash_pg_remap_items(self):
+    def thrash_pg_upmap_items(self):
         """
-        Install or remove random pg_remap_items entries in OSDMap
+        Install or remove random pg_upmap_items entries in OSDMap
         """
         from random import shuffle
         out = self.ceph_manager.raw_cluster_cmd('osd', 'dump', '-f', 'json-pretty')
@@ -569,23 +569,23 @@ class Thrasher:
                 shuffle(osds)
                 osds = osds[0:n*2]
                 self.log('Setting %s to %s' % (pgid, osds))
-                cmd = ['osd', 'pg-remap-items', pgid] + [str(x) for x in osds]
+                cmd = ['osd', 'pg-upmap-items', pgid] + [str(x) for x in osds]
                 self.log('cmd %s' % cmd)
                 self.ceph_manager.raw_cluster_cmd(*cmd)
             else:
-                m = j['pg_remap_items']
+                m = j['pg_upmap_items']
                 if len(m) > 0:
                     shuffle(m)
                     pg = m[0]['pgid']
-                    self.log('Clearing pg_remap on %s' % pg)
+                    self.log('Clearing pg_upmap on %s' % pg)
                     self.ceph_manager.raw_cluster_cmd(
                         'osd',
-                        'rm-pg-remap-items',
+                        'rm-pg-upmap-items',
                         pg)
                 else:
-                    self.log('No pg_remap entries; doing nothing')
+                    self.log('No pg_upmap entries; doing nothing')
         except CommandFailedError:
-            self.log('Failed to rm-pg-remap-items, ignoring')
+            self.log('Failed to rm-pg-upmap-items, ignoring')
 
     def all_up(self):
         """
@@ -805,10 +805,10 @@ class Thrasher:
                         chance_test_backfill_full,))
         if self.chance_thrash_cluster_full > 0:
             actions.append((self.thrash_cluster_full, self.chance_thrash_cluster_full,))
-        if self.chance_thrash_pg_remap > 0:
-            actions.append((self.thrash_pg_remap, self.chance_thrash_pg_remap,))
-        if self.chance_thrash_pg_remap_items > 0:
-            actions.append((self.thrash_pg_remap_items, self.chance_thrash_pg_remap_items,))
+        if self.chance_thrash_pg_upmap > 0:
+            actions.append((self.thrash_pg_upmap, self.chance_thrash_pg_upmap,))
+        if self.chance_thrash_pg_upmap_items > 0:
+            actions.append((self.thrash_pg_upmap_items, self.chance_thrash_pg_upmap_items,))
 
         for key in ['heartbeat_inject_failure', 'filestore_inject_stall']:
             for scenario in [
index 37c52062b5b2217b44fd60d28b28706d84951779..29fefbc067511ed5880cba8655b66ac6081d762f 100644 (file)
@@ -122,8 +122,8 @@ def task(ctx, config):
 
     chance_thrash_cluster_full: .05
 
-    chance_thrash_pg_remap: 1.0
-    chance_thrash_pg_remap_items: 1.0
+    chance_thrash_pg_upmap: 1.0
+    chance_thrash_pg_upmap_items: 1.0
 
     example:
 
index 4a74361547e38f141293c4c1bcee52a7793b2d20..a4714304eb29498941501cd949fb9d5a27567949 100644 (file)
@@ -282,7 +282,7 @@ OPTION(mon_osd_max_op_age, OPT_DOUBLE, 32)     // max op age before we get conce
 OPTION(mon_osd_max_split_count, OPT_INT, 32) // largest number of PGs per "involved" OSD to let split create
 OPTION(mon_osd_allow_primary_temp, OPT_BOOL, false)  // allow primary_temp to be set in the osdmap
 OPTION(mon_osd_allow_primary_affinity, OPT_BOOL, false)  // allow primary_affinity to be set in the osdmap
-OPTION(mon_osd_allow_pg_remap, OPT_BOOL, false) // allow pg remap to be set in the osdmap
+OPTION(mon_osd_allow_pg_upmap, OPT_BOOL, false) // allow pg upmap to be set in the osdmap
 OPTION(mon_osd_prime_pg_temp, OPT_BOOL, true)  // prime osdmap with pg mapping changes
 OPTION(mon_osd_prime_pg_temp_max_time, OPT_FLOAT, .5)  // max time to spend priming
 OPTION(mon_osd_prime_pg_temp_max_estimate, OPT_FLOAT, .25) // max estimate of pg total before we do all pgs in parallel
index 4e816890820bbd3dae643af971b84e214ff535a5..aa63b57b505dd7b78ae3344eee3ad1dcc9840545 100644 (file)
@@ -647,24 +647,24 @@ COMMAND("osd pg-temp " \
        "name=id,type=CephOsdName,n=N,req=false", \
        "set pg_temp mapping pgid:[<id> [<id>...]] (developers only)", \
         "osd", "rw", "cli,rest")
-COMMAND("osd pg-remap " \
+COMMAND("osd pg-upmap " \
        "name=pgid,type=CephPgid " \
        "name=id,type=CephOsdName,n=N", \
-       "set pg_remap mapping <pgid>:[<id> [<id>...]] primary <primary> (developers only)", \
+       "set pg_upmap mapping <pgid>:[<id> [<id>...]] primary <primary> (developers only)", \
         "osd", "rw", "cli,rest")
-COMMAND("osd rm-pg-remap " \
+COMMAND("osd rm-pg-upmap " \
        "name=pgid,type=CephPgid",                                      \
-       "clear pg_remap mapping for <pgid> (developers only)", \
+       "clear pg_upmap mapping for <pgid> (developers only)", \
         "osd", "rw", "cli,rest")
 
-COMMAND("osd pg-remap-items " \
+COMMAND("osd pg-upmap-items " \
        "name=pgid,type=CephPgid " \
        "name=id,type=CephOsdName,n=N", \
-       "set pg_remap_items mapping <pgid>:{<id> to <id>, [...]} (developers only)", \
+       "set pg_upmap_items mapping <pgid>:{<id> to <id>, [...]} (developers only)", \
         "osd", "rw", "cli,rest")
-COMMAND("osd rm-pg-remap-items " \
+COMMAND("osd rm-pg-upmap-items " \
        "name=pgid,type=CephPgid",                \
-       "clear pg_remap_items mapping for <pgid> (developers only)", \
+       "clear pg_upmap_items mapping for <pgid> (developers only)", \
         "osd", "rw", "cli,rest")
 COMMAND("osd primary-temp " \
        "name=pgid,type=CephPgid " \
index a1540cd48e4aeb585ba184cab355662917813035..3c303a88e477ced24bcbbfd7cb2535898aa156de 100644 (file)
@@ -7219,9 +7219,9 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     pending_inc.new_primary_temp[pgid] = osd;
     ss << "set " << pgid << " primary_temp mapping to " << osd;
     goto update;
-  } else if (prefix == "osd pg-remap") {
-    if (!g_conf->mon_osd_allow_pg_remap) {
-      ss << "you must enable 'mon osd allow pg remap = true' on the mons before you can adjust pg_remap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
+  } else if (prefix == "osd pg-upmap") {
+    if (!g_conf->mon_osd_allow_pg_upmap) {
+      ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
       err = -EPERM;
       goto reply;
     }
@@ -7248,8 +7248,8 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -ENOENT;
       goto reply;
     }
-    if (pending_inc.new_pg_remap.count(pgid) ||
-       pending_inc.old_pg_remap.count(pgid)) {
+    if (pending_inc.new_pg_upmap.count(pgid) ||
+       pending_inc.old_pg_upmap.count(pgid)) {
       dout(10) << __func__ << " waiting for pending update on " << pgid << dendl;
       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
@@ -7261,22 +7261,22 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -EINVAL;
       goto reply;
     }
-    vector<int32_t> new_pg_remap;
+    vector<int32_t> new_pg_upmap;
     for (auto osd : id_vec) {
       if (osd != CRUSH_ITEM_NONE && !osdmap.exists(osd)) {
         ss << "osd." << osd << " does not exist";
         err = -ENOENT;
         goto reply;
       }
-      new_pg_remap.push_back(osd);
+      new_pg_upmap.push_back(osd);
     }
 
-    pending_inc.new_pg_remap[pgid] = new_pg_remap;
-    ss << "set " << pgid << " pg_remap mapping to " << new_pg_remap;
+    pending_inc.new_pg_upmap[pgid] = new_pg_upmap;
+    ss << "set " << pgid << " pg_upmap mapping to " << new_pg_upmap;
     goto update;
-  } else if (prefix == "osd rm-pg-remap") {
-    if (!g_conf->mon_osd_allow_pg_remap) {
-      ss << "you must enable 'mon osd allow pg remap = true' on the mons before you can adjust pg_remap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
+  } else if (prefix == "osd rm-pg-upmap") {
+    if (!g_conf->mon_osd_allow_pg_upmap) {
+      ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
       err = -EPERM;
       goto reply;
     }
@@ -7303,19 +7303,19 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -ENOENT;
       goto reply;
     }
-    if (pending_inc.new_pg_remap.count(pgid) ||
-       pending_inc.old_pg_remap.count(pgid)) {
+    if (pending_inc.new_pg_upmap.count(pgid) ||
+       pending_inc.old_pg_upmap.count(pgid)) {
       dout(10) << __func__ << " waiting for pending update on " << pgid << dendl;
       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
     }
 
-    pending_inc.old_pg_remap.insert(pgid);
-    ss << "clear " << pgid << " pg_remap mapping";
+    pending_inc.old_pg_upmap.insert(pgid);
+    ss << "clear " << pgid << " pg_upmap mapping";
     goto update;
-  } else if (prefix == "osd pg-remap-items") {
-    if (!g_conf->mon_osd_allow_pg_remap) {
-      ss << "you must enable 'mon osd allow pg remap = true' on the mons before you can adjust pg_remap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
+  } else if (prefix == "osd pg-upmap-items") {
+    if (!g_conf->mon_osd_allow_pg_upmap) {
+      ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
       err = -EPERM;
       goto reply;
     }
@@ -7342,8 +7342,8 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -ENOENT;
       goto reply;
     }
-    if (pending_inc.new_pg_remap_items.count(pgid) ||
-       pending_inc.old_pg_remap_items.count(pgid)) {
+    if (pending_inc.new_pg_upmap_items.count(pgid) ||
+       pending_inc.old_pg_upmap_items.count(pgid)) {
       dout(10) << __func__ << " waiting for pending update on " << pgid << dendl;
       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
@@ -7360,7 +7360,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -EINVAL;
       goto reply;
     }
-    vector<pair<int32_t,int32_t>> new_pg_remap_items;
+    vector<pair<int32_t,int32_t>> new_pg_upmap_items;
     for (auto p = id_vec.begin(); p != id_vec.end(); ++p) {
       int from = *p++;
       int to = *p;
@@ -7374,15 +7374,15 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        err = -ENOENT;
        goto reply;
       }
-      new_pg_remap_items.push_back(make_pair(from, to));
+      new_pg_upmap_items.push_back(make_pair(from, to));
     }
 
-    pending_inc.new_pg_remap_items[pgid] = new_pg_remap_items;
-    ss << "set " << pgid << " pg_remap_items mapping to " << new_pg_remap_items;
+    pending_inc.new_pg_upmap_items[pgid] = new_pg_upmap_items;
+    ss << "set " << pgid << " pg_upmap_items mapping to " << new_pg_upmap_items;
     goto update;
-  } else if (prefix == "osd rm-pg-remap-items") {
-    if (!g_conf->mon_osd_allow_pg_remap) {
-      ss << "you must enable 'mon osd allow pg remap = true' on the mons before you can adjust pg_remap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
+  } else if (prefix == "osd rm-pg-upmap-items") {
+    if (!g_conf->mon_osd_allow_pg_upmap) {
+      ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap.  note that pre-luminous clients will no longer be able to communicate with the cluster.";
       err = -EPERM;
       goto reply;
     }
@@ -7409,15 +7409,15 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -ENOENT;
       goto reply;
     }
-    if (pending_inc.new_pg_remap_items.count(pgid) ||
-       pending_inc.old_pg_remap_items.count(pgid)) {
+    if (pending_inc.new_pg_upmap_items.count(pgid) ||
+       pending_inc.old_pg_upmap_items.count(pgid)) {
       dout(10) << __func__ << " waiting for pending update on " << pgid << dendl;
       wait_for_finished_proposal(op, new C_RetryMessage(this, op));
       return true;
     }
 
-    pending_inc.old_pg_remap_items.insert(pgid);
-    ss << "clear " << pgid << " pg_remap_items mapping";
+    pending_inc.old_pg_upmap_items.insert(pgid);
+    ss << "clear " << pgid << " pg_upmap_items mapping";
     goto update;
   } else if (prefix == "osd primary-affinity") {
     int64_t id;
index c4e388f86cfba277d1eabbb43202d804a218289c..f83d384792b6dfd60e14866d0365d81d4ab70269 100644 (file)
@@ -441,10 +441,10 @@ void OSDMap::Incremental::encode(bufferlist& bl, uint64_t features) const
     ::encode(new_erasure_code_profiles, bl);
     ::encode(old_erasure_code_profiles, bl);
     if (v >= 4) {
-      ::encode(new_pg_remap, bl);
-      ::encode(old_pg_remap, bl);
-      ::encode(new_pg_remap_items, bl);
-      ::encode(old_pg_remap_items, bl);
+      ::encode(new_pg_upmap, bl);
+      ::encode(old_pg_upmap, bl);
+      ::encode(new_pg_upmap_items, bl);
+      ::encode(old_pg_upmap_items, bl);
     }
     ENCODE_FINISH(bl); // client-usable data
   }
@@ -645,10 +645,10 @@ void OSDMap::Incremental::decode(bufferlist::iterator& bl)
       old_erasure_code_profiles.clear();
     }
     if (struct_v >= 4) {
-      ::decode(new_pg_remap, bl);
-      ::decode(old_pg_remap, bl);
-      ::decode(new_pg_remap_items, bl);
-      ::decode(old_pg_remap_items, bl);
+      ::decode(new_pg_upmap, bl);
+      ::decode(old_pg_upmap, bl);
+      ::decode(new_pg_upmap_items, bl);
+      ::decode(old_pg_upmap_items, bl);
     }
     DECODE_FINISH(bl); // client-usable data
   }
@@ -822,8 +822,8 @@ void OSDMap::Incremental::dump(Formatter *f) const
   }
   f->close_section(); // primary_temp
 
-  f->open_array_section("new_pg_remap");
-  for (auto& i : new_pg_remap) {
+  f->open_array_section("new_pg_upmap");
+  for (auto& i : new_pg_upmap) {
     f->open_object_section("mapping");
     f->dump_stream("pgid") << i.first;
     f->open_array_section("osds");
@@ -834,14 +834,14 @@ void OSDMap::Incremental::dump(Formatter *f) const
     f->close_section();
   }
   f->close_section();
-  f->open_array_section("old_pg_remap");
-  for (auto& i : old_pg_remap) {
+  f->open_array_section("old_pg_upmap");
+  for (auto& i : old_pg_upmap) {
     f->dump_stream("pgid") << i;
   }
   f->close_section();
 
-  f->open_array_section("new_pg_remap_items");
-  for (auto& i : new_pg_remap_items) {
+  f->open_array_section("new_pg_upmap_items");
+  for (auto& i : new_pg_upmap_items) {
     f->open_object_section("mapping");
     f->dump_stream("pgid") << i.first;
     f->open_array_section("mappings");
@@ -855,8 +855,8 @@ void OSDMap::Incremental::dump(Formatter *f) const
     f->close_section();
   }
   f->close_section();
-  f->open_array_section("old_pg_remap_items");
-  for (auto& i : old_pg_remap_items) {
+  f->open_array_section("old_pg_upmap_items");
+  for (auto& i : old_pg_upmap_items) {
     f->dump_stream("pgid") << i;
   }
   f->close_section();
@@ -1128,7 +1128,7 @@ uint64_t OSDMap::get_features(int entity_type, uint64_t *pmask) const
     features |= CEPH_FEATURE_CRUSH_TUNABLES5;
   mask |= CEPH_FEATURES_CRUSH;
 
-  if (!pg_remap.empty() || !pg_remap_items.empty())
+  if (!pg_upmap.empty() || !pg_upmap_items.empty())
     features |= CEPH_FEATUREMASK_OSDMAP_REMAP;
   mask |= CEPH_FEATUREMASK_OSDMAP_REMAP;
 
@@ -1540,17 +1540,17 @@ int OSDMap::apply_incremental(const Incremental &inc)
       (*primary_temp)[p->first] = p->second;
   }
 
-  for (auto& p : inc.new_pg_remap) {
-    pg_remap[p.first] = p.second;
+  for (auto& p : inc.new_pg_upmap) {
+    pg_upmap[p.first] = p.second;
   }
-  for (auto& pg : inc.old_pg_remap) {
-    pg_remap.erase(pg);
+  for (auto& pg : inc.old_pg_upmap) {
+    pg_upmap.erase(pg);
   }
-  for (auto& p : inc.new_pg_remap_items) {
-    pg_remap_items[p.first] = p.second;
+  for (auto& p : inc.new_pg_upmap_items) {
+    pg_upmap_items[p.first] = p.second;
   }
-  for (auto& pg : inc.old_pg_remap_items) {
-    pg_remap_items.erase(pg);
+  for (auto& pg : inc.old_pg_upmap_items) {
+    pg_upmap_items.erase(pg);
   }
 
   // blacklist
@@ -1697,8 +1697,8 @@ int OSDMap::_pick_primary(const vector<int>& osds) const
 void OSDMap::_apply_remap(const pg_pool_t& pi, pg_t raw_pg, vector<int> *raw) const
 {
   pg_t pg = pi.raw_pg_to_pg(raw_pg);
-  auto p = pg_remap.find(pg);
-  if (p != pg_remap.end()) {
+  auto p = pg_upmap.find(pg);
+  if (p != pg_upmap.end()) {
     // make sure targets aren't marked out
     for (auto osd : p->second) {
       if (osd != CRUSH_ITEM_NONE && osd < max_osd && osd_weight[osd] == 0) {
@@ -1710,8 +1710,8 @@ void OSDMap::_apply_remap(const pg_pool_t& pi, pg_t raw_pg, vector<int> *raw) co
     return;
   }
 
-  auto q = pg_remap_items.find(pg);
-  if (q != pg_remap_items.end()) {
+  auto q = pg_upmap_items.find(pg);
+  if (q != pg_upmap_items.end()) {
     // NOTE: this approach does not allow a bidirectional swap,
     // e.g., [[1,2],[2,1]] applied to [0,1,2] -> [0,2,1].
     for (auto& r : q->second) {
@@ -2138,11 +2138,11 @@ void OSDMap::encode(bufferlist& bl, uint64_t features) const
     ::encode(erasure_code_profiles, bl);
 
     if (v >= 4) {
-      ::encode(pg_remap, bl);
-      ::encode(pg_remap_items, bl);
+      ::encode(pg_upmap, bl);
+      ::encode(pg_upmap_items, bl);
     } else {
-      assert(pg_remap.empty());
-      assert(pg_remap_items.empty());
+      assert(pg_upmap.empty());
+      assert(pg_upmap_items.empty());
     }
     ENCODE_FINISH(bl); // client-usable data
   }
@@ -2380,11 +2380,11 @@ void OSDMap::decode(bufferlist::iterator& bl)
       erasure_code_profiles.clear();
     }
     if (struct_v >= 4) {
-      ::decode(pg_remap, bl);
-      ::decode(pg_remap_items, bl);
+      ::decode(pg_upmap, bl);
+      ::decode(pg_upmap_items, bl);
     } else {
-      pg_remap.clear();
-      pg_remap_items.clear();
+      pg_upmap.clear();
+      pg_upmap_items.clear();
     }
     DECODE_FINISH(bl); // client-usable data
   }
@@ -2537,8 +2537,8 @@ void OSDMap::dump(Formatter *f) const
   }
   f->close_section();
 
-  f->open_array_section("pg_remap");
-  for (auto& p : pg_remap) {
+  f->open_array_section("pg_upmap");
+  for (auto& p : pg_upmap) {
     f->open_object_section("mapping");
     f->dump_stream("pgid") << p.first;
     f->open_array_section("osds");
@@ -2549,8 +2549,8 @@ void OSDMap::dump(Formatter *f) const
     f->close_section();
   }
   f->close_section();
-  f->open_array_section("pg_remap_items");
-  for (auto& p : pg_remap_items) {
+  f->open_array_section("pg_upmap_items");
+  for (auto& p : pg_upmap_items) {
     f->open_object_section("mapping");
     f->dump_stream("pgid") << p.first;
     f->open_array_section("mappings");
@@ -2731,11 +2731,11 @@ void OSDMap::print(ostream& out) const
   }
   out << std::endl;
 
-  for (auto& p : pg_remap) {
-    out << "pg_remap " << p.first << " " << p.second << "\n";
+  for (auto& p : pg_upmap) {
+    out << "pg_upmap " << p.first << " " << p.second << "\n";
   }
-  for (auto& p : pg_remap_items) {
-    out << "pg_remap_items " << p.first << " " << p.second << "\n";
+  for (auto& p : pg_upmap_items) {
+    out << "pg_upmap_items " << p.first << " " << p.second << "\n";
   }
 
   for (map<pg_t,vector<int32_t> >::const_iterator p = pg_temp->begin();
@@ -3316,24 +3316,24 @@ int OSDMap::summarize_mapping_stats(
 }
 
 
-int OSDMap::clean_remaps(
+int OSDMap::clean_pg_upmaps(
   CephContext *cct,
   Incremental *pending_inc)
 {
   ldout(cct, 10) << __func__ << dendl;
   int changed = 0;
-  for (auto& p : pg_remap) {
+  for (auto& p : pg_upmap) {
     vector<int> raw;
     int primary;
     pg_to_raw_osds(p.first, &raw, &primary);
     if (raw == p.second) {
-      ldout(cct, 10) << " removing redundant pg_remap " << p.first << " "
+      ldout(cct, 10) << " removing redundant pg_upmap " << p.first << " "
                     << p.second << dendl;
-      pending_inc->old_pg_remap.insert(p.first);
+      pending_inc->old_pg_upmap.insert(p.first);
       ++changed;
     }
   }
-  for (auto& p : pg_remap_items) {
+  for (auto& p : pg_upmap_items) {
     vector<int> raw;
     int primary;
     pg_to_raw_osds(p.first, &raw, &primary);
@@ -3344,21 +3344,21 @@ int OSDMap::clean_remaps(
       }
     }
     if (newmap.empty()) {
-      ldout(cct, 10) << " removing no-op pg_remap_items " << p.first << " "
+      ldout(cct, 10) << " removing no-op pg_upmap_items " << p.first << " "
                     << p.second << dendl;
-      pending_inc->old_pg_remap_items.insert(p.first);
+      pending_inc->old_pg_upmap_items.insert(p.first);
       ++changed;
     } else if (newmap != p.second) {
-      ldout(cct, 10) << " simplifying partially no-op pg_remap_items "
+      ldout(cct, 10) << " simplifying partially no-op pg_upmap_items "
                     << p.first << " " << p.second << " -> " << newmap << dendl;
-      pending_inc->new_pg_remap_items[p.first] = newmap;
+      pending_inc->new_pg_upmap_items[p.first] = newmap;
       ++changed;
     }
   }
   return changed;
 }
 
-bool OSDMap::try_pg_remap(
+bool OSDMap::try_pg_upmap(
   CephContext *cct,
   pg_t pg,                       ///< pg to potentially remap
   const set<int>& overfull,      ///< osds we'd want to evacuate
@@ -3403,7 +3403,7 @@ bool OSDMap::try_pg_remap(
   return true;
 }
 
-int OSDMap::remap_pgs(
+int OSDMap::calc_pg_upmaps(
   CephContext *cct,
   float max_deviation,
   int max,
@@ -3500,14 +3500,14 @@ int OSDMap::remap_pgs(
 
       // look for remaps we can un-remap
       for (auto pg : pgs) {
-       auto p = tmp.pg_remap_items.find(pg);
-       if (p != tmp.pg_remap_items.end()) {
+       auto p = tmp.pg_upmap_items.find(pg);
+       if (p != tmp.pg_upmap_items.end()) {
          for (auto q : p->second) {
            if (q.second == osd) {
-             ldout(cct, 10) << "  dropping pg_remap_items " << pg
+             ldout(cct, 10) << "  dropping pg_upmap_items " << pg
                             << " " << p->second << dendl;
-             tmp.pg_remap_items.erase(p);
-             pending_inc->old_pg_remap_items.insert(pg);
+             tmp.pg_upmap_items.erase(p);
+             pending_inc->old_pg_upmap_items.insert(pg);
              ++num_changed;
              restart = true;
            }
@@ -3520,14 +3520,14 @@ int OSDMap::remap_pgs(
        break;
 
       for (auto pg : pgs) {
-       if (tmp.pg_remap.count(pg) ||
-           tmp.pg_remap_items.count(pg)) {
+       if (tmp.pg_upmap.count(pg) ||
+           tmp.pg_upmap_items.count(pg)) {
          ldout(cct, 20) << "  already remapped " << pg << dendl;
          continue;
        }
        ldout(cct, 10) << "  trying " << pg << dendl;
        vector<int> orig, out;
-       if (!try_pg_remap(cct, pg, overfull, underfull, &orig, &out)) {
+       if (!try_pg_upmap(cct, pg, overfull, underfull, &orig, &out)) {
          continue;
        }
        ldout(cct, 10) << "  " << pg << " " << orig << " -> " << out << dendl;
@@ -3535,14 +3535,14 @@ int OSDMap::remap_pgs(
          continue;
        }
        assert(orig != out);
-       vector<pair<int,int>>& rmi = tmp.pg_remap_items[pg];
+       vector<pair<int,int>>& rmi = tmp.pg_upmap_items[pg];
        for (unsigned i = 0; i < out.size(); ++i) {
          if (orig[i] != out[i]) {
            rmi.push_back(make_pair(orig[i], out[i]));
          }
        }
-       pending_inc->new_pg_remap_items[pg] = rmi;
-       ldout(cct, 10) << "  " << pg << " pg_remap_items " << rmi << dendl;
+       pending_inc->new_pg_upmap_items[pg] = rmi;
+       ldout(cct, 10) << "  " << pg << " pg_upmap_items " << rmi << dendl;
        restart = true;
        ++num_changed;
        break;
index eb0399edda6e949e0e12f40b1365dff8a446b267..0daf00554d071a456538f7548ac505d3adfaedec 100644 (file)
@@ -148,9 +148,9 @@ public:
     map<int32_t, entity_addr_t> new_hb_back_up;
     map<int32_t, entity_addr_t> new_hb_front_up;
 
-    map<pg_t,vector<int32_t>> new_pg_remap;
-    map<pg_t,vector<pair<int32_t,int32_t>>> new_pg_remap_items;
-    set<pg_t> old_pg_remap, old_pg_remap_items;
+    map<pg_t,vector<int32_t>> new_pg_upmap;
+    map<pg_t,vector<pair<int32_t,int32_t>>> new_pg_upmap_items;
+    set<pg_t> old_pg_upmap, old_pg_upmap_items;
 
     string cluster_snapshot;
 
@@ -237,8 +237,8 @@ private:
   ceph::shared_ptr< vector<__u32> > osd_primary_affinity; ///< 16.16 fixed point, 0x10000 = baseline
 
   // remap (post-CRUSH, pre-up)
-  map<pg_t,vector<int32_t>> pg_remap; ///< remap pg
-  map<pg_t,vector<pair<int32_t,int32_t>>> pg_remap_items; ///< remap osds in up set
+  map<pg_t,vector<int32_t>> pg_upmap; ///< remap pg
+  map<pg_t,vector<pair<int32_t,int32_t>>> pg_upmap_items; ///< remap osds in up set
 
   map<int64_t,pg_pool_t> pools;
   map<int64_t,string> pool_name;
@@ -663,7 +663,7 @@ private:
   void _apply_primary_affinity(ps_t seed, const pg_pool_t& pool,
                               vector<int> *osds, int *primary) const;
 
-  /// apply pg_remap[_items] mappings
+  /// apply pg_upmap[_items] mappings
   void _apply_remap(const pg_pool_t& pi, pg_t pg, vector<int> *raw) const;
 
   /// pg -> (up osd list)
@@ -859,11 +859,11 @@ public:
     return calc_pg_role(osd, group, nrep) >= 0;
   }
 
-  int clean_remaps(
+  int clean_pg_upmaps(
     CephContext *cct,
     Incremental *pending_inc);
 
-  bool try_pg_remap(
+  bool try_pg_upmap(
     CephContext *cct,
     pg_t pg,                       ///< pg to potentially remap
     const set<int>& overfull,      ///< osds we'd want to evacuate
@@ -871,12 +871,12 @@ public:
     vector<int> *orig,
     vector<int> *out);             ///< resulting alternative mapping
 
-  int remap_pgs(
+  int calc_pg_upmaps(
     CephContext *cct,
     float max_deviation, ///< max deviation from target (value < 1.0)
     int max_iterations,  ///< max iterations to run
     const set<int64_t>& pools,        ///< [optional] restrict to pool
-    OSDMap::Incremental *pending_inc
+    Incremental *pending_inc
     );
 
   /*
index 22945468df85688b4ac421cc243a39c974dca369..69374a82dfa0053674914765306a6450bc67b111 100644 (file)
      --test-random           do random placements
      --test-map-pg <pgid>    map a pgid to osds
      --test-map-object <objectname> [--pool <poolid>] map an object to osds
-     --remap-cleanup <file>  clean up pg_remap[_items] entries, writing
+     --upmap-cleanup <file>  clean up pg_upmap[_items] entries, writing
                              commands to <file> [default: - for stdout]
-     --remap <file>          calculate pg remap entries to balance pg layout
+     --upmap <file>          calculate pg upmap entries to balance pg layout
                              writing commands to <file> [default: - for stdout]
-     --remap-max <max-count> set max remap entries to calculate [default: 100]
-     --remap-deviation <max-deviation>
+     --upmap-max <max-count> set max upmap entries to calculate [default: 100]
+     --upmap-deviation <max-deviation>
                              max deviation from target [default: .01]
-     --remap-pool <poolname> restrict remap balancing to 1 or more pools
+     --upmap-pool <poolname> restrict upmap balancing to 1 or more pools
   [1]
index 5e59b67614f0f776c464368535d288632129213d..9c7c65631279a46b57fde4bc4a2d42f77d681dc5 100644 (file)
      --test-random           do random placements
      --test-map-pg <pgid>    map a pgid to osds
      --test-map-object <objectname> [--pool <poolid>] map an object to osds
-     --remap-cleanup <file>  clean up pg_remap[_items] entries, writing
+     --upmap-cleanup <file>  clean up pg_upmap[_items] entries, writing
                              commands to <file> [default: - for stdout]
-     --remap <file>          calculate pg remap entries to balance pg layout
+     --upmap <file>          calculate pg upmap entries to balance pg layout
                              writing commands to <file> [default: - for stdout]
-     --remap-max <max-count> set max remap entries to calculate [default: 100]
-     --remap-deviation <max-deviation>
+     --upmap-max <max-count> set max upmap entries to calculate [default: 100]
+     --upmap-deviation <max-deviation>
                              max deviation from target [default: .01]
-     --remap-pool <poolname> restrict remap balancing to 1 or more pools
+     --upmap-pool <poolname> restrict upmap balancing to 1 or more pools
   [1]
diff --git a/src/test/cli/osdmaptool/remap.t b/src/test/cli/osdmaptool/remap.t
deleted file mode 100644 (file)
index 32841bc..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-  $ osdmaptool --create-from-conf om -c $TESTDIR/ceph.conf.withracks
-  osdmaptool: osdmap file 'om'
-  osdmaptool: writing epoch 1 to om
-  $ osdmaptool om --mark-up-in --remap-max 11 --remap c
-  osdmaptool: osdmap file 'om'
-  marking all OSDs up and in
-  writing remap command output to: c
-  checking for remap cleanups
-  remap, max-count 11, max deviation 0.01
-  osdmaptool: writing epoch 3 to om
-  $ cat c
-  ceph osd pg-remap-items 0.3 54 52 156 155
-  ceph osd pg-remap-items 0.1b 158 155 231 227 143 142
-  ceph osd pg-remap-items 0.22 168 163 54 52 136 135
-  ceph osd pg-remap-items 0.2e 87 86 54 52
-  ceph osd pg-remap-items 0.6f 69 65 54 52 157 155
-  ceph osd pg-remap-items 0.12b 54 52 226 227
-  ceph osd pg-remap-items 0.13f 54 52 96 95 43 46
-  ceph osd pg-remap-items 0.151 36 42 54 52
-  ceph osd pg-remap-items 0.185 60 61 54 52
-  ceph osd pg-remap-items 0.1e3 54 52
-  ceph osd pg-remap-items 0.272 54 52
-  $ rm -f om c
diff --git a/src/test/cli/osdmaptool/upmap.t b/src/test/cli/osdmaptool/upmap.t
new file mode 100644 (file)
index 0000000..c833da3
--- /dev/null
@@ -0,0 +1,23 @@
+  $ osdmaptool --create-from-conf om -c $TESTDIR/ceph.conf.withracks
+  osdmaptool: osdmap file 'om'
+  osdmaptool: writing epoch 1 to om
+  $ osdmaptool om --mark-up-in --upmap-max 11 --upmap c
+  osdmaptool: osdmap file 'om'
+  marking all OSDs up and in
+  writing upmap command output to: c
+  checking for upmap cleanups
+  upmap, max-count 11, max deviation 0.01
+  osdmaptool: writing epoch 3 to om
+  $ cat c
+  ceph osd pg-upmap-items 0.3 54 52 156 155
+  ceph osd pg-upmap-items 0.1b 158 155 231 227 143 142
+  ceph osd pg-upmap-items 0.22 168 163 54 52 136 135
+  ceph osd pg-upmap-items 0.2e 87 86 54 52
+  ceph osd pg-upmap-items 0.6f 69 65 54 52 157 155
+  ceph osd pg-upmap-items 0.12b 54 52 226 227
+  ceph osd pg-upmap-items 0.13f 54 52 96 95 43 46
+  ceph osd pg-upmap-items 0.151 36 42 54 52
+  ceph osd pg-upmap-items 0.185 60 61 54 52
+  ceph osd pg-upmap-items 0.1e3 54 52
+  ceph osd pg-upmap-items 0.272 54 52
+  $ rm -f om c
index db1480189d750844527e540da331749faef75de8..1301f4f542b619a607c5663c32cfa06a102fd4a9 100644 (file)
@@ -38,35 +38,35 @@ void usage()
   cout << "   --test-map-pg <pgid>    map a pgid to osds" << std::endl;
   cout << "   --test-map-object <objectname> [--pool <poolid>] map an object to osds"
        << std::endl;
-  cout << "   --remap-cleanup <file>  clean up pg_remap[_items] entries, writing" << std::endl;
+  cout << "   --upmap-cleanup <file>  clean up pg_upmap[_items] entries, writing" << std::endl;
   cout << "                           commands to <file> [default: - for stdout]" << std::endl;
-  cout << "   --remap <file>          calculate pg remap entries to balance pg layout" << std::endl;
+  cout << "   --upmap <file>          calculate pg upmap entries to balance pg layout" << std::endl;
   cout << "                           writing commands to <file> [default: - for stdout]" << std::endl;
-  cout << "   --remap-max <max-count> set max remap entries to calculate [default: 100]" << std::endl;
-  cout << "   --remap-deviation <max-deviation>" << std::endl;
+  cout << "   --upmap-max <max-count> set max upmap entries to calculate [default: 100]" << std::endl;
+  cout << "   --upmap-deviation <max-deviation>" << std::endl;
   cout << "                           max deviation from target [default: .01]" << std::endl;
-  cout << "   --remap-pool <poolname> restrict remap balancing to 1 or more pools" << std::endl;
+  cout << "   --upmap-pool <poolname> restrict upmap balancing to 1 or more pools" << std::endl;
   exit(1);
 }
 
-void print_inc_remaps(const OSDMap::Incremental& pending_inc, int fd)
+void print_inc_upmaps(const OSDMap::Incremental& pending_inc, int fd)
 {
   ostringstream ss;
-  for (auto& i : pending_inc.old_pg_remap) {
-    ss << "ceph osd rm-pg-remap " << i << std::endl;
+  for (auto& i : pending_inc.old_pg_upmap) {
+    ss << "ceph osd rm-pg-upmap " << i << std::endl;
   }
-  for (auto& i : pending_inc.new_pg_remap) {
-    ss << "ceph osd pg-remap " << i.first;
+  for (auto& i : pending_inc.new_pg_upmap) {
+    ss << "ceph osd pg-upmap " << i.first;
     for (auto osd : i.second) {
       ss << " " << osd;
     }
     ss << std::endl;
   }
-  for (auto& i : pending_inc.old_pg_remap_items) {
-    ss << "ceph osd rm-pg-remap-items " << i << std::endl;
+  for (auto& i : pending_inc.old_pg_upmap_items) {
+    ss << "ceph osd rm-pg-upmap-items " << i << std::endl;
   }
-  for (auto& i : pending_inc.new_pg_remap_items) {
-    ss << "ceph osd pg-remap-items " << i.first;
+  for (auto& i : pending_inc.new_pg_upmap_items) {
+    ss << "ceph osd pg-upmap-items " << i.first;
     for (auto p : i.second) {
       ss << " " << p.first << " " << p.second;
     }
@@ -115,12 +115,12 @@ int main(int argc, const char **argv)
   bool test_map_pgs = false;
   bool test_map_pgs_dump = false;
   bool test_random = false;
-  bool remap_cleanup = false;
-  bool remap = false;
-  std::string remap_file = "-";
-  int remap_max = 100;
-  float remap_deviation = .01;
-  std::set<std::string> remap_pools;
+  bool upmap_cleanup = false;
+  bool upmap = false;
+  std::string upmap_file = "-";
+  int upmap_max = 100;
+  float upmap_deviation = .01;
+  std::set<std::string> upmap_pools;
   int64_t pg_num = -1;
   bool test_map_pgs_dump_all = false;
 
@@ -143,15 +143,15 @@ int main(int argc, const char **argv)
       if (!val.empty() && val != "plain") {
        tree_formatter.reset(Formatter::create(val, "", "json"));
       }
-    } else if (ceph_argparse_witharg(args, i, &remap_file, "--remap-cleanup", (char*)NULL)) {
-      remap_cleanup = true;
-    } else if (ceph_argparse_witharg(args, i, &remap_file, "--remap", (char*)NULL)) {
-      remap_cleanup = true;
-      remap = true;
-    } else if (ceph_argparse_witharg(args, i, &remap_max, err, "--remap-max", (char*)NULL)) {
-    } else if (ceph_argparse_witharg(args, i, &remap_deviation, err, "--remap-deviation", (char*)NULL)) {
-    } else if (ceph_argparse_witharg(args, i, &val, "--remap-pool", (char*)NULL)) {
-      remap_pools.insert(val);
+    } else if (ceph_argparse_witharg(args, i, &upmap_file, "--upmap-cleanup", (char*)NULL)) {
+      upmap_cleanup = true;
+    } else if (ceph_argparse_witharg(args, i, &upmap_file, "--upmap", (char*)NULL)) {
+      upmap_cleanup = true;
+      upmap = true;
+    } else if (ceph_argparse_witharg(args, i, &upmap_max, err, "--upmap-max", (char*)NULL)) {
+    } else if (ceph_argparse_witharg(args, i, &upmap_deviation, err, "--upmap-deviation", (char*)NULL)) {
+    } else if (ceph_argparse_witharg(args, i, &val, "--upmap-pool", (char*)NULL)) {
+      upmap_pools.insert(val);
     } else if (ceph_argparse_witharg(args, i, &num_osd, err, "--createsimple", (char*)NULL)) {
       if (!err.str().empty()) {
        cerr << err.str() << std::endl;
@@ -303,37 +303,37 @@ int main(int argc, const char **argv)
     cout << "clearing pg/primary temp" << std::endl;
     osdmap.clear_temp();
   }
-  int remap_fd = STDOUT_FILENO;
-  if (remap || remap_cleanup) {
-    if (remap_file != "-") {
-      remap_fd = ::open(remap_file.c_str(), O_CREAT|O_WRONLY, 0644);
-      if (remap_fd < 0) {
-       cerr << "error opening " << remap_file << ": " << cpp_strerror(errno)
+  int upmap_fd = STDOUT_FILENO;
+  if (upmap || upmap_cleanup) {
+    if (upmap_file != "-") {
+      upmap_fd = ::open(upmap_file.c_str(), O_CREAT|O_WRONLY, 0644);
+      if (upmap_fd < 0) {
+       cerr << "error opening " << upmap_file << ": " << cpp_strerror(errno)
             << std::endl;
        exit(1);
       }
-      cout << "writing remap command output to: " << remap_file << std::endl;
+      cout << "writing upmap command output to: " << upmap_file << std::endl;
     }
   }
-  if (remap_cleanup) {
-    cout << "checking for remap cleanups" << std::endl;
+  if (upmap_cleanup) {
+    cout << "checking for upmap cleanups" << std::endl;
     OSDMap::Incremental pending_inc(osdmap.get_epoch()+1);
     pending_inc.fsid = osdmap.get_fsid();
-    int r = osdmap.clean_remaps(g_ceph_context, &pending_inc);
+    int r = osdmap.clean_pg_upmaps(g_ceph_context, &pending_inc);
     if (r > 0) {
-      print_inc_remaps(pending_inc, remap_fd);
+      print_inc_upmaps(pending_inc, upmap_fd);
       r = osdmap.apply_incremental(pending_inc);
       assert(r == 0);
     }
   }
-  if (remap) {
-    cout << "remap, max-count " << remap_max
-        << ", max deviation " << remap_deviation
+  if (upmap) {
+    cout << "upmap, max-count " << upmap_max
+        << ", max deviation " << upmap_deviation
         << std::endl;
     OSDMap::Incremental pending_inc(osdmap.get_epoch()+1);
     pending_inc.fsid = osdmap.get_fsid();
     set<int64_t> pools;
-    for (auto& s : remap_pools) {
+    for (auto& s : upmap_pools) {
       int64_t p = osdmap.lookup_pg_pool_name(s);
       if (p < 0) {
        cerr << " pool '" << s << "' does not exist" << std::endl;
@@ -342,22 +342,23 @@ int main(int argc, const char **argv)
       pools.insert(p);
     }
     if (!pools.empty())
-      cout << " limiting to pools " << remap_pools << " (" << pools << ")"
+      cout << " limiting to pools " << upmap_pools << " (" << pools << ")"
           << std::endl;
-    int changed = osdmap.remap_pgs(g_ceph_context, remap_deviation,
-                                  remap_max, pools,
-                                  &pending_inc);
+    int changed = osdmap.calc_pg_upmaps(
+      g_ceph_context, upmap_deviation,
+      upmap_max, pools,
+      &pending_inc);
     if (changed) {
-      print_inc_remaps(pending_inc, remap_fd);
+      print_inc_upmaps(pending_inc, upmap_fd);
       int r = osdmap.apply_incremental(pending_inc);
       assert(r == 0);
       modified = true;
     } else {
-      cout << "no remaps proposed" << std::endl;
+      cout << "no upmaps proposed" << std::endl;
     }
   }
-  if (remap_file != "-") {
-    ::close(remap_fd);
+  if (upmap_file != "-") {
+    ::close(upmap_fd);
   }
 
   if (!import_crush.empty()) {
@@ -597,7 +598,7 @@ int main(int argc, const char **argv)
       export_crush.empty() && import_crush.empty() && 
       test_map_pg.empty() && test_map_object.empty() &&
       !test_map_pgs && !test_map_pgs_dump && !test_map_pgs_dump_all &&
-      !remap && !remap_cleanup) {
+      !upmap && !upmap_cleanup) {
     cerr << me << ": no action specified?" << std::endl;
     usage();
   }
index 1b4b0518f9aa7b5fdefefc7d83ac7083539bbba1..77ff9212661ca3b388c02fcbab670039e7bb46f7 100755 (executable)
@@ -473,7 +473,7 @@ $extra_conf
 [mon]
         mon pg warn min per osd = 3
         mon osd allow primary affinity = true
-        mon osd allow pg remap = true
+        mon osd allow pg upmap = true
         mon reweight min pgs per osd = 4
         mon osd prime pg temp = true
         crushtool = $CEPH_BIN/crushtool