]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: add explicit check that acting matches for merge 34354/head
authorSage Weil <sage@redhat.com>
Thu, 19 Mar 2020 21:52:01 +0000 (16:52 -0500)
committerNathan Cutler <ncutler@suse.com>
Wed, 1 Apr 2020 20:13:06 +0000 (22:13 +0200)
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>
(cherry picked from commit 1700d181580f9ffc9a808ee29daf661f3776a901)

src/mgr/DaemonServer.cc

index ac6e00d512d0af7658d32220ad035b67c67588b3..e485e8216163b7ac113488f373ef4f12bd4c69b5 100644 (file)
@@ -2534,6 +2534,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)) {
@@ -2566,6 +2567,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) {