err = -ENOTEMPTY;
goto reply;
}
- if (tp->ec_pool()) {
+ if (tp->is_erasure()) {
ss << "tier pool '" << tierpoolstr
<< "' is an ec pool, which cannot be a tier";
err = -ENOTSUP;
bool pg_is_ec(pg_t pg) const {
auto i = pools.find(pg.pool());
assert(i != pools.end());
- return i->second.ec_pool();
+ return i->second.is_erasure();
}
bool get_primary_shard(const pg_t& pgid, spg_t *out) const {
auto i = get_pools().find(pgid.pool());
if (i == get_pools().end()) {
return false;
}
- if (!i->second.ec_pool()) {
+ if (!i->second.is_erasure()) {
*out = spg_t(pgid);
return true;
}
const OSDMap &osdmap = *get_osdmap();
PastIntervals::PriorSet prior = past_intervals.get_prior_set(
- pool.info.ec_pool(),
+ pool.info.is_erasure(),
info.history.last_epoch_started,
get_pgbackend()->get_is_recoverable_predicate(),
[&](epoch_t start, int osd, epoch_t *lost_at) {
vector<int> want;
pg_shard_t want_primary;
stringstream ss;
- if (!pool.info.ec_pool())
+ if (!pool.info.is_erasure())
calc_replicated_acting(
auth_log_shard,
get_osdmap()->get_pg_size(info.pgid.pgid),
have.insert(
pg_shard_t(
want[i],
- pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD));
+ pool.info.is_erasure() ? shard_id_t(i) : shard_id_t::NO_SHARD));
}
}
// does not currently maintain rollbackability
// Otherwise, we will go "peered", but not "active"
if (num_want_acting < pool.info.min_size &&
- (pool.info.ec_pool() ||
+ (pool.info.is_erasure() ||
!cct->_conf->osd_allow_recovery_below_min_size)) {
want_acting.clear();
dout(10) << "choose_acting failed, below min size" << dendl;
might_have_unfound = past_intervals.get_might_have_unfound(
pg_whoami,
- pool.info.ec_pool());
+ pool.info.is_erasure());
// include any (stray) peers
for (map<pg_shard_t, pg_info_t>::iterator p = peer_info.begin();
public:
bool is_ec_pg() const {
- return pool.info.ec_pool();
+ return pool.info.is_erasure();
}
// pg state
pg_info_t info; ///< current pg info
return actingbackfill.count(osd);
}
bool is_acting(pg_shard_t osd) const {
- return has_shard(pool.info.ec_pool(), acting, osd);
+ return has_shard(pool.info.is_erasure(), acting, osd);
}
bool is_up(pg_shard_t osd) const {
- return has_shard(pool.info.ec_pool(), up, osd);
+ return has_shard(pool.info.is_erasure(), up, osd);
}
static bool has_shard(bool ec, const vector<int>& v, pg_shard_t osd) {
if (ec) {
actingset.insert(
pg_shard_t(
acting[i],
- pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD));
+ pool.info.is_erasure() ? shard_id_t(i) : shard_id_t::NO_SHARD));
}
upset.clear();
up = newup;
upset.insert(
pg_shard_t(
up[i],
- pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD));
+ pool.info.is_erasure() ? shard_id_t(i) : shard_id_t::NO_SHARD));
}
- if (!pool.info.ec_pool()) {
+ if (!pool.info.is_erasure()) {
up_primary = pg_shard_t(new_up_primary, shard_id_t::NO_SHARD);
primary = pg_shard_t(new_acting_primary, shard_id_t::NO_SHARD);
return;
cmd_getval(cct, cmdmap, "mulcmd", mulcmd);
int mode = -1;
if (mulcmd == "revert") {
- if (pool.info.ec_pool()) {
+ if (pool.info.is_erasure()) {
ss << "mode must be 'delete' for ec pool";
return -EINVAL;
}
}
++ctx->num_read;
- if (pool.info.ec_pool()) {
+ if (pool.info.is_erasure()) {
// translate sparse read to a normal one if not supported
uint64_t offset = op.extent.offset;
uint64_t length = op.extent.length;
*
* This behavior is no longer necessary, but we preserve it so old
* primaries can keep their repops in order */
- if (pool.info.ec_pool()) {
+ if (pool.info.is_erasure()) {
t.register_on_complete(complete);
} else {
t.register_on_commit(complete);
to->insert(
pg_shard_t(
from[i],
- ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD));
+ is_erasure() ? shard_id_t(i) : shard_id_t::NO_SHARD));
}
}
}
if (out)
*out << __func__ << " " << i << " : acting set is too small" << std::endl;
}
- past_intervals->past_intervals->add_interval(old_pg_pool.ec_pool(), i);
+ past_intervals->past_intervals->add_interval(old_pg_pool.is_erasure(), i);
return true;
} else {
return false;
void set_flag(uint64_t f) { flags |= f; }
void unset_flag(uint64_t f) { flags &= ~f; }
- bool ec_pool() const {
- return type == TYPE_ERASURE;
- }
bool require_rollback() const {
- return ec_pool();
+ return is_erasure();
}
/// true if incomplete clones may be present