]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/../client_request: rename is_misdirected and add logs
authorMatan Breizman <mbreizma@redhat.com>
Tue, 15 Jul 2025 08:24:06 +0000 (08:24 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 27 Jul 2025 11:33:05 +0000 (11:33 +0000)
This function mainly verifies replicated read related info.

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

index d32402ab2238976b59f492683f38c18d47ac98ea..cfb85bc83b44e632194cc092fecb1cb1e0764b43 100644 (file)
@@ -195,7 +195,7 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
 
   if (!pg.is_primary()) {
     // primary can handle both normal ops and balanced reads
-    if (is_misdirected(pg)) {
+    if (is_misdirected_replica_read(pg)) {
       DEBUGDPP("{}.{}: dropping misdirected op",
               pg, *this, this_instance_id);
       co_return;
@@ -625,24 +625,24 @@ ClientRequest::do_process(
   }
 }
 
-bool ClientRequest::is_misdirected(const PG& pg) const
+bool ClientRequest::is_misdirected_replica_read(const PG& pg) const
 {
+  LOG_PREFIX(ClientRequest::is_misdirected_replica_read);
   // otherwise take a closer look
   if (const int flags = m->get_flags();
       flags & CEPH_OSD_FLAG_BALANCE_READS ||
       flags & CEPH_OSD_FLAG_LOCALIZE_READS) {
     if (!op_info.may_read()) {
-      // no read found, so it can't be balanced read
+      DEBUGDPP("{}: dropping - no read found with balanced/localize read", pg, *this);
       return true;
     }
     if (op_info.may_write() || op_info.may_cache()) {
-      // write op, but i am not primary
+      DEBUGDPP("{}: dropping - can't write to replica", pg, *this);
       return true;
     }
-    // balanced reads; any replica will do
     return false;
   }
-  // neither balanced nor localize reads
+  DEBUGDPP("{}: dropping - not a balanced/localize read ", pg, *this);
   return true;
 }
 
index 4dfb735041ba11068bb58bed842d332592fcb2c4..006400aa9c6a579bfe4c7d19b158e6a2de4b4865 100644 (file)
@@ -269,7 +269,7 @@ private:
       ::crimson::osd::IOInterruptCondition,
       Errorator>;
 
-  bool is_misdirected(const PG& pg) const;
+  bool is_misdirected_replica_read(const PG& pg) const;
 
   const SnapContext get_snapc(
     PG &pg,