dout(10) << new_osdmap->get_epoch()
<< " (was " << (old_osdmap ? old_osdmap->get_epoch() : 0) << ")"
<< dendl;
- bool queued = false;
+ int queued = 0;
// check slots
auto p = pg_slots.begin();
dout(20) << __func__ << " " << pgid
<< " pending_peering first epoch " << first
<< " <= " << new_osdmap->get_epoch() << ", requeueing" << dendl;
- _wake_pg_slot(pgid, slot);
- queued = true;
+ queued += _wake_pg_slot(pgid, slot);
}
++p;
continue;
}
if (queued) {
std::lock_guard l{sdata_wait_lock};
- sdata_cond.notify_one();
+ if (queued == 1)
+ sdata_cond.notify_one();
+ else
+ sdata_cond.notify_all();
}
}
-void OSDShard::_wake_pg_slot(
+int OSDShard::_wake_pg_slot(
spg_t pgid,
OSDShardPGSlot *slot)
{
+ int count = 0;
dout(20) << __func__ << " " << pgid
<< " to_process " << slot->to_process
<< " waiting " << slot->waiting
i != slot->to_process.rend();
++i) {
scheduler->enqueue_front(std::move(*i));
+ count++;
}
slot->to_process.clear();
for (auto i = slot->waiting.rbegin();
i != slot->waiting.rend();
++i) {
scheduler->enqueue_front(std::move(*i));
+ count++;
}
slot->waiting.clear();
for (auto i = slot->waiting_peering.rbegin();
// someday, if we decide this inefficiency matters
for (auto j = i->second.rbegin(); j != i->second.rend(); ++j) {
scheduler->enqueue_front(std::move(*j));
+ count++;
}
}
slot->waiting_peering.clear();
++slot->requeue_seq;
+ return count;
}
void OSDShard::identify_splits_and_merges(
const OSDMapRef& osdmap,
unsigned *pushes_to_free);
- void _wake_pg_slot(spg_t pgid, OSDShardPGSlot *slot);
+ int _wake_pg_slot(spg_t pgid, OSDShardPGSlot *slot);
void identify_splits_and_merges(
const OSDMapRef& as_of_osdmap,