]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg_backend: introduce INTERNAL_PG_LOCAL_NS, skip in PGBackend::list_objects
authorSamuel Just <sjust@redhat.com>
Tue, 26 Mar 2024 05:36:07 +0000 (22:36 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 27 Mar 2024 02:36:54 +0000 (02:36 +0000)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/hobject.h
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/pg_backend.cc

index 8e0af9da778e81a6bb21f3a518a07f4edf404c9f..cb11c0aa70f994d2ff196f80c5674f8d0b6852b2 100644 (file)
@@ -313,6 +313,26 @@ public:
     return nspace;
   }
 
+  /**
+   * PG_LOCAL_NS
+   *
+   * Used exclusively by crimson at this time.
+   *
+   * Namespace for objects maintained by the local pg instantiation updated
+   * independently of the pg log.  librados IO to this namespace should fail.
+   * Listing operations related to pg objects should exclude objects in this
+   * namespace along with temp objects, ec rollback objects, and the pg
+   * meta object. Such operations include:
+   * - scrub
+   * - backfill
+   * - pgls
+   * See crimson/osd/pg_backend PGBackend::list_objects
+   */
+  static constexpr std::string_view INTERNAL_PG_LOCAL_NS = ".internal_pg_local";
+  bool is_internal_pg_local() const {
+    return nspace == INTERNAL_PG_LOCAL_NS;
+  }
+
   bool parse(const std::string& s);
 
   void encode(ceph::buffer::list& bl) const;
@@ -482,6 +502,10 @@ struct ghobject_t {
     return hobj.pool >= 0 && hobj.oid.name.empty();
   }
 
+  bool is_internal_pg_local() const {
+    return hobj.is_internal_pg_local();
+  }
+
   bool match(uint32_t bits, uint32_t match) const {
     return hobj.match_hash(hobj.hash, bits, match);
   }
index 460f413efe381c57b0aca0e1545dd2ff883032f4..7c1e7d321cfd02e9fb84887bfa18b424e35cf263 100644 (file)
@@ -324,6 +324,9 @@ ClientRequest::do_process(
     return reply_op_error(pg, -ENAMETOOLONG);
   } else if (m->get_hobj().oid.name.empty()) {
     return reply_op_error(pg, -EINVAL);
+  } else if (m->get_hobj().is_internal_pg_local()) {
+    // clients are not allowed to write to hobject_t::INTERNAL_PG_LOCAL_NS
+    return reply_op_error(pg, -EINVAL);
   } else if (pg->get_osdmap()->is_blocklisted(
         get_foreign_connection().get_peer_addr())) {
     DEBUGDPP("{}.{}: {} is blocklisted",
index 0c9822365d141cf8345c6267c0621e9a30f8a01a..ab60cfd12730837037730c8ad34ff26bd1fb4ce3 100644 (file)
@@ -1097,6 +1097,8 @@ PGBackend::list_objects(
        return false;
       } else if (o.hobj.is_temp()) {
        return false;
+      } else if (o.is_internal_pg_local()) {
+       return false;
       } else {
        return o.is_no_gen();
       }