From bf68d8e54e95cd9ef740f818ae2dae3c5756a2f4 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 (cherry picked from commit f2f6e170de100cb57d06e4b9a3dbba65530f745f) --- 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 abfdde2f30ba5..b30e84a8fb29e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6298,7 +6298,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