]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/../client_request: relax replicated reads on clones
authorMatan Breizman <mbreizma@redhat.com>
Thu, 27 Mar 2025 10:42:55 +0000 (10:42 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 2 Apr 2025 10:28:53 +0000 (10:28 +0000)
When handling a client request on a clone object, m->get_hobj() might
not actually represent the "actual" object from the OSD's prespective.
See: ObjectContext::resolve_oid for how this logic is handled.

If this replica has any missing clone objects that are either this object head
or any of this object's clones - drop this replicted read and bounce back to primary.

We could possibly check if the head is not missing and then wait for
resolve_oid to lookup for the actual clone object (Which might exist!).
However, this seems to not be worth the complexity as the niche scenario
of being able to serve reads while having (possibly) releated missing objects.

Fixes (2/2): https://tracker.ceph.com/issues/70639

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 925508cbd88af160d3b84bdaed55db9d73011780..c9bb5657b6b30deca00c10c4879489bb3847195d 100644 (file)
@@ -197,9 +197,10 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
     }
 
     pg.get_perf_logger().inc(l_osd_replica_read);
-    if (pg.is_unreadable_object(m->get_hobj())) {
-      DEBUGDPP("{}.{}: {} missing on replica, bouncing to primary",
-              pg, *this, this_instance_id, m->get_hobj());
+    if (pg.is_missing_head_and_clones(m->get_hobj())) {
+      DEBUGDPP("{}.{}: {} possibly missing head or clone object on replica,"
+               " bouncing to primary",
+               pg, *this, this_instance_id, m->get_hobj());
       pg.get_perf_logger().inc(l_osd_replica_read_redirect_missing);
       co_await reply_op_error(pgref, -EAGAIN);
       co_return;
index 92611f217f9ae24f554925606639c97456b4e37a..2b772e5f799e89f2457f3328f867599abfa58368 100644 (file)
@@ -1511,6 +1511,10 @@ void PG::context_registry_on_change() {
   }
 }
 
+bool PG::is_missing_head_and_clones(const hobject_t &hoid) {
+  return peering_state.is_missing_any_head_or_clone_of(hoid);
+}
+
 bool PG::can_discard_op(const MOSDOp& m) const {
   if (m.get_map_epoch() <
       peering_state.get_info().history.same_primary_since) {
index b6b7b67262980c91128221502f85b7ce7e227497..0a20f2c4d6241cd31d266d384749bfa1c0fbe863 100644 (file)
@@ -952,6 +952,10 @@ private:
       !peering_state.get_missing_loc().readable_with_acting(
        oid, get_actingset(), v);
   }
+
+  // check if any head or clone of this object is missing
+  bool is_missing_head_and_clones(const hobject_t &hoid);
+
   bool is_missing_on_peer(
     const pg_shard_t &peer,
     const hobject_t &soid) const {