This is simpler than checking actingbackfill
since it may not yet be filled in.
Fixes: #7470
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
reg_next_scrub();
// stray?
- if ((!is_active() && !is_acting(from)) ||
- (is_active() && !is_actingbackfill(from))) {
+ if (!is_up(from) && !is_acting(from)) {
dout(10) << " osd." << from << " has stray content: " << oinfo << dendl;
stray_set.insert(from);
if (is_clean()) {
for (set<pg_shard_t>::iterator i = backfill_targets.begin();
i != backfill_targets.end();
++i) {
- stray_set.erase(*i);
+ assert(!stray_set.count(*i));
}
} else {
// Will not change if already set because up would have had to change
return std::find(acting.begin(), acting.end(), osd.osd) != acting.end();
}
}
+ bool is_up(pg_shard_t osd) const {
+ if (pool.info.ec_pool()) {
+ return up.size() > osd.shard && up[osd.shard] == osd.osd;
+ } else {
+ return std::find(up.begin(), up.end(), osd.osd) != up.end();
+ }
+ }
bool needs_recovery() const;
bool needs_backfill() const;