osd: copy (don't move) pg list when sending beacon

If we move the list, then a second beacon sent before the pg list refreshes
will be empty.

Fixes: http://tracker.ceph.com/issues/40377
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-06-14 16:23:21 -05:00
parent 85470cd171
commit f2f6e170de

View File

@ -5825,7 +5825,7 @@ void OSD::send_beacon(const ceph::coarse_mono_clock::time_point& now)
{
std::lock_guard l{min_last_epoch_clean_lock};
beacon = new MOSDBeacon(osdmap->get_epoch(), min_last_epoch_clean);
std::swap(beacon->pgs, min_last_epoch_clean_pgs);
beacon->pgs = min_last_epoch_clean_pgs;
last_sent_beacon = now;
}
monc->send_mon_message(beacon);