// do not include strays
if (stray_set.find(shard_i) != stray_set.end())
continue;
+ // Do not include an osd that is not up, since choosing it as
+ // an async_recovery_target will move it out of the acting set.
+ // This results in it being identified as a stray during peering,
+ // because it is no longer in the up or acting set.
+ if (!is_up(shard_i))
+ continue;
auto shard_info = all_info.find(shard_i)->second;
// for ec pools we rollback all entries past the authoritative
// last_update *before* activation. This is relatively inexpensive
// do not include strays
if (stray_set.find(shard_i) != stray_set.end())
continue;
+ // Do not include an osd that is not up, since choosing it as
+ // an async_recovery_target will move it out of the acting set.
+ // This results in it being identified as a stray during peering,
+ // because it is no longer in the up or acting set.
+ if (!is_up(shard_i))
+ continue;
auto shard_info = all_info.find(shard_i)->second;
// use the approximate magnitude of the difference in length of
// logs as the cost of recovery