]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: calc_pg_upmaps() pick most overfull remap from try_pg_upmap()
authorDavid Zafman <dzafman@redhat.com>
Tue, 26 Nov 2019 05:38:16 +0000 (21:38 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Dec 2019 01:55:22 +0000 (17:55 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 3f132061fd33c82dc131e18ae80cbec067b53cae)

src/osd/OSDMap.cc

index 1eb43ef5e1a93d4074f4cb6d2f99e3d91d2775ba..41c18e2674bdf826bc0dbef041605d700c8a67e5 100644 (file)
@@ -4414,13 +4414,24 @@ int OSDMap::calc_pg_upmaps(
          continue;
        }
        ceph_assert(orig != out);
+       int pos = -1;
+       float max_dev = 0;
        for (unsigned i = 0; i < out.size(); ++i) {
           if (orig[i] == out[i])
             continue; // skip invalid remappings
           if (existing.count(orig[i]) || existing.count(out[i]))
             continue; // we want new remappings only!
+         if (osd_deviation[orig[i]] > max_dev) {
+           max_dev = osd_deviation[orig[i]];
+           pos = i;
+           ldout(cct, 30) << "Max osd." << orig[i] << " pos " << i << " dev " << osd_deviation[orig[i]] << dendl;
+         }
+       }
+       if (pos != -1) {
+         int i = pos;
           ldout(cct, 10) << " will try adding new remapping pair "
                          << orig[i] << " -> " << out[i] << " for " << pg
+                        << (orig[i] != osd ? " NOT selected osd" : "")
                          << dendl;
           existing.insert(orig[i]);
           existing.insert(out[i]);