From: Kefu Chai Date: Sun, 1 Nov 2020 03:23:13 +0000 (+0800) Subject: crimson/osd: merge pg_temp_wanted before sending them X-Git-Tag: v16.1.0~716^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37910%2Fhead;p=ceph.git crimson/osd: merge pg_temp_wanted before sending them there is chance that new pg_temp_wanted is added when we are sending them in ShardServices::send_pg_temp(), but the pg temp are already collected into the messages before seastar::parallel_for_each(). so, we cannot move all elements from pg_temp_wanted to pg_temp_pending after sending the messages, that'd also move the unsent pg temps to pg_temp_pending as well. so we have to do this before do the async call, this issue was root caused by Xuehan Xu . Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index 4e393df844618..8c2cfc41543e2 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -200,6 +200,8 @@ seastar::future<> ShardServices::send_pg_temp() } m->pg_temp.emplace(pgid, pg_temp.acting); } + pg_temp_pending.merge(pg_temp_wanted); + pg_temp_wanted.clear(); return seastar::parallel_for_each(std::begin(ms), std::end(ms), [this](auto m) { if (m) { @@ -207,9 +209,6 @@ seastar::future<> ShardServices::send_pg_temp() } else { return seastar::now(); } - }).then([this] { - pg_temp_pending.merge(pg_temp_wanted); - pg_temp_wanted.clear(); }); }