if (is_mon_create) {
pending_creates_from_mon++;
} else {
- bool is_primary = osdmap->get_pg_acting_rank(pgid.pgid, whoami) == 0;
+ bool is_primary = osdmap->get_pg_acting_role(pgid, whoami) == 0;
pending_creates_from_osd.emplace(pgid, is_primary);
}
dout(1) << __func__ << " withhold creation of pg " << pgid
std::lock_guard l(pending_creates_lock);
for (auto pg = pending_creates_from_osd.begin();
pg != pending_creates_from_osd.end();) {
- if (osdmap->get_pg_acting_rank(pg->first.pgid, whoami) < 0) {
+ if (osdmap->get_pg_acting_role(pg->first, whoami) < 0) {
dout(10) << __func__ << " pg " << pg->first << " doesn't map here, "
<< "discarding pending_create_from_osd" << dendl;
pg = pending_creates_from_osd.erase(pg);
const std::vector<int> &newacting);
/* rank is -1 (stray), 0 (primary), 1,2,3,... (replica) */
- int get_pg_acting_rank(pg_t pg, int osd) const {
+ int get_pg_acting_role(spg_t pg, int osd) const {
std::vector<int> group;
- pg_to_acting_osds(pg, group);
- return calc_pg_role(osd, group, group.size());
+ pg_to_acting_osds(pg.pgid, group);
+ return calc_pg_role(pg_shard_t(osd, pg.shard), group);
}
bool osd_is_valid_op_target(pg_t pg, int osd) const {