]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: add explicit check that acting matches for merge 34067/head
authorSage Weil <sage@redhat.com>
Thu, 19 Mar 2020 21:52:01 +0000 (16:52 -0500)
committerSage Weil <sage@redhat.com>
Sat, 21 Mar 2020 19:17:30 +0000 (14:17 -0500)
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 <sage@redhat.com>
src/mgr/DaemonServer.cc

index 67b23938968871563c14641966b12fbab48253cd..becd428aca6da24cdd0719e013abc35eb155fc94 100644 (file)
@@ -2528,6 +2528,7 @@ void DaemonServer::adjust_pgs()
                       << dendl;
              ok = false;
            }
+           vector<int32_t> 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) {