]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: PeeringState: fix selection order in calc_replicated_acting_stretch 44518/head
authorGreg Farnum <gfarnum@redhat.com>
Tue, 11 Jan 2022 00:10:36 +0000 (00:10 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Tue, 11 Jan 2022 13:54:41 +0000 (13:54 +0000)
We were previously mis-ordering these to *de*prioritize the existing acting set. That is bad!

We generate OSD candidates from the acting set and strays, and push
them into the candidates list as a tuple of <<!in_acting,pg_info.last_update>,osd_id>.

Then we sort the list. Then we go through the list from front to back and
push_back entries into the appropriate ancestor lists.

And then we pop_back() off the lists to select the acting set.
Which of course turns our nice careful order backwards! So don't do that.

Fixes: https://tracker.ceph.com/issues/53824
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/osd/PeeringState.cc

index 03688fd11aa2544c60f33e7e681e7740db95dfa1..dd73537799e823c75eede4da9e3bcff8713372eb 100644 (file)
@@ -1854,8 +1854,8 @@ public:
   }
   osd_id_t pop_osd() {
     ceph_assert(!is_empty());
-    auto ret = osds.back();
-    osds.pop_back();
+    auto ret = osds.front();
+    osds.pop_front();
     return ret.second;
   }
 
@@ -1864,7 +1864,7 @@ public:
 
   osd_ord_t get_ord() const {
     return osds.empty() ? std::make_tuple(false, eversion_t())
-      : osds.back().first;
+      : osds.front().first;
   }
 
   bool is_empty() const { return osds.empty(); }