./bin/ceph osd pg-upmap-items 1.0 1 2 1 2
osd.1 -> osd.2 already exists, set 1.0 pg_upmap_items mapping to [1->2]
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
err = -ENOENT;
goto reply;
}
- new_pg_upmap_items.push_back(make_pair(from, to));
+ pair<int32_t,int32_t> entry = make_pair(from, to);
+ auto it = std::find(new_pg_upmap_items.begin(),
+ new_pg_upmap_items.end(), entry);
+ if (it != new_pg_upmap_items.end()) {
+ ss << "osd." << from << " -> osd." << to << " already exists, ";
+ continue;
+ }
+ new_pg_upmap_items.push_back(entry);
items << from << "->" << to << ",";
}
string out(items.str());