]> git.apps.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>
Fri, 12 Mar 2021 00:02:24 +0000 (00:02 +0000)
This makes it easy and cheap to call from non-stretch contexts.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
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 31195adae84e4742ebd9904f2e066c503d4c5724..c0fe8f781c21ea6da4c04107c4d44ef21dfbb830 100644 (file)
@@ -1521,6 +1521,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);