return next;
ceph_assert(!creating_pgs_by_epoch->second.empty());
- MOSDPGCreate2 *m = nullptr;
+ auto m = make_message<MOSDPGCreate2>(creating_pgs_epoch);
epoch_t last = 0;
for (auto epoch_pgs = creating_pgs_by_epoch->second.lower_bound(next);
// last_scrub_stamp upon pg creation.
auto create = creating_pgs.pgs.find(pg.pgid);
ceph_assert(create != creating_pgs.pgs.end());
- if (!m) {
- m = new MOSDPGCreate2(creating_pgs_epoch);
- }
m->pgs.emplace(pg, make_pair(create->second.create_epoch,
create->second.create_stamp));
if (create->second.history.epoch_created) {
<< " at " << create->second.create_epoch << dendl;
}
}
- if (m) {
- con->send_message(m);
+ if (!m->pgs.empty()) {
+ con->send_message2(std::move(m));
} else {
dout(20) << __func__ << " osd." << osd << " from " << next
<< " has nothing to send" << dendl;