@@ -197,13 +197,16 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
197197 }
198198
199199 pg.get_perf_logger ().inc (l_osd_replica_read);
200- if (pg.is_unreadable_object (m->get_hobj ())) {
201- DEBUGDPP (" {}.{}: {} missing on replica, bouncing to primary" ,
202- pg, *this , this_instance_id, m->get_hobj ());
200+ if (pg.is_missing_head_and_clones (m->get_hobj ())) {
201+ DEBUGDPP (" {}.{}: {} possibly missing head or clone object on replica,"
202+ " bouncing to primary" ,
203+ pg, *this , this_instance_id, m->get_hobj ());
203204 pg.get_perf_logger ().inc (l_osd_replica_read_redirect_missing);
204205 co_await reply_op_error (pgref, -EAGAIN);
205206 co_return ;
206207 } else if (!pg.get_peering_state ().can_serve_replica_read (m->get_hobj ())) {
208+ // Note: can_serve_replica_read checks for writes on the head object
209+ // as writes can only occur to head.
207210 DEBUGDPP (" {}.{}: unstable write on replica, bouncing to primary" ,
208211 pg, *this , this_instance_id);
209212 pg.get_perf_logger ().inc (l_osd_replica_read_redirect_conflict);
@@ -353,7 +356,8 @@ ClientRequest::process_op(
353356 }
354357
355358 std::set<snapid_t > snaps = snaps_need_to_recover ();
356- if (!snaps.empty ()) {
359+ if (!snaps.empty () &&
360+ pg->is_missing_head_and_clones (m->get_hobj ().get_head ())) {
357361 co_await recover_missing_snaps (pg, snaps);
358362 }
359363 }
0 commit comments