]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: check for is_stretch_pool() in stretch_set_can_peer()
authorGreg Farnum <gfarnum@redhat.com>
Thu, 11 Mar 2021 07:58:19 +0000 (07:58 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Mon, 15 Mar 2021 18:38:52 +0000 (18:38 +0000)
This makes it easy and cheap to call from non-stretch contexts.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit e9185b0c437987b3d8cf3467ccaff22c8e422fe1)

src/osd/osd_types.cc
src/osd/osd_types.h

index 82bc693dfe6c99817e0c6b2d1b24db041ac6a3ae..07bdf025a45fe91f7b693f66e3b3de43eab0ee59 100644 (file)
@@ -2239,6 +2239,7 @@ void pg_pool_t::decode(ceph::buffer::list::const_iterator& bl)
 bool pg_pool_t::stretch_set_can_peer(const set<int>& want, const OSDMap& osdmap,
                                     std::ostream * out) const
 {
+  if (!is_stretch_pool()) return true;
   const uint32_t barrier_id = peering_crush_bucket_barrier;
   const uint32_t barrier_count = peering_crush_bucket_count;
   set<int> ancestors;
index 2250f6f3b0ed764da8b1d81c702ea7288b6c8363..4a13ffd9719a0a07bf27cc67c47fc4fdfb2b6b5f 100644 (file)
@@ -1486,6 +1486,7 @@ public:
                            std::ostream *out) const;
   bool stretch_set_can_peer(const vector<int>& want, const OSDMap& osdmap,
                            std::ostream *out) const {
+    if (!is_stretch_pool()) return true;
     set<int> swant;
     for (auto i : want) swant.insert(i);
     return stretch_set_can_peer(swant, osdmap, out);