err = -ENOENT;
goto reply;
}
+ auto it = std::find(new_pg_upmap.begin(), new_pg_upmap.end(), osd);
+ if (it != new_pg_upmap.end()) {
+ ss << "osd." << osd << " already exists, ";
+ continue;
+ }
new_pg_upmap.push_back(osd);
}
+ if (new_pg_upmap.empty()) {
+ ss << "no valid upmap items(pairs) is specified";
+ err = -EINVAL;
+ goto reply;
+ }
+
pending_inc.new_pg_upmap[pgid] = mempool::osdmap::vector<int32_t>(
new_pg_upmap.begin(), new_pg_upmap.end());
ss << "set " << pgid << " pg_upmap mapping to " << new_pg_upmap;
for (auto p = id_vec.begin(); p != id_vec.end(); ++p) {
int from = *p++;
int to = *p;
+ if (from == to) {
+ ss << "from osd." << from << " == to osd." << to << ", ";
+ continue;
+ }
if (!osdmap.exists(from)) {
ss << "osd." << from << " does not exist";
err = -ENOENT;
out.resize(out.size() - 1); // drop last ','
out += "]";
+ if (new_pg_upmap_items.empty()) {
+ ss << "no valid upmap items(pairs) is specified";
+ err = -EINVAL;
+ goto reply;
+ }
+
pending_inc.new_pg_upmap_items[pgid] =
mempool::osdmap::vector<pair<int32_t,int32_t>>(
new_pg_upmap_items.begin(), new_pg_upmap_items.end());