From: Sage Weil Date: Thu, 19 Mar 2020 21:52:01 +0000 (-0500) Subject: mgr/DaemonServer: add explicit check that acting matches for merge X-Git-Tag: v15.2.0~5^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1700d181580f9ffc9a808ee29daf661f3776a901;p=ceph.git mgr/DaemonServer: add explicit check that acting matches for merge Add an explicit check that the PG acting for the source and target match before merging. Fixes: https://tracker.ceph.com/issues/44684 Signed-off-by: Sage Weil --- diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 67b2393896887..becd428aca6da 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -2528,6 +2528,7 @@ void DaemonServer::adjust_pgs() << dendl; ok = false; } + vector source_acting; for (auto &merge_participant : {merge_source, merge_target}) { bool is_merge_source = merge_participant == merge_source; if (osdmap.have_pg_upmaps(merge_participant)) { @@ -2560,6 +2561,19 @@ void DaemonServer::adjust_pgs() << ")" << dendl; ok = false; } + if (is_merge_source) { + source_acting = q->second.acting; + } else if (ok && q->second.acting != source_acting) { + dout(10) << "pool " << i.first + << " pg_num_target " << p.get_pg_num_target() + << " pg_num " << p.get_pg_num() + << (is_merge_source ? " - merge source " : " - merge target ") + << merge_participant + << " acting does not match (source " << source_acting + << " != target " << q->second.acting + << ")" << dendl; + ok = false; + } } if (ok) {