From f2f6e170de100cb57d06e4b9a3dbba65530f745f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 14 Jun 2019 16:23:21 -0500 Subject: [PATCH] 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 --- src/osd/OSD.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index ee32615c409..155ddd3b827 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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); -- 2.39.5