From: Samuel Just Date: Tue, 26 Mar 2024 05:36:07 +0000 (-0700) Subject: crimson/osd/pg_backend: introduce INTERNAL_PG_LOCAL_NS, skip in PGBackend::list_objects X-Git-Tag: v20.0.0~2273^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f32b37a599592d35ea948e66e7cfdfef7113b8ac;p=ceph.git crimson/osd/pg_backend: introduce INTERNAL_PG_LOCAL_NS, skip in PGBackend::list_objects Signed-off-by: Samuel Just --- diff --git a/src/common/hobject.h b/src/common/hobject.h index 8e0af9da778e8..cb11c0aa70f99 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -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); } diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index 460f413efe381..7c1e7d321cfd0 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -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", diff --git a/src/crimson/osd/pg_backend.cc b/src/crimson/osd/pg_backend.cc index 0c9822365d141..ab60cfd127308 100644 --- a/src/crimson/osd/pg_backend.cc +++ b/src/crimson/osd/pg_backend.cc @@ -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(); }