Skip to content

Commit 095c1f1

Browse files
authored
Merge pull request ceph#64503 from Matan-B/wip-matanb-crimson-misdirected-fix
crimson/osd/../client_request: fix is_misdirected Reviewed-by: Samuel Just <[email protected]>
2 parents 866054f + 1503ee4 commit 095c1f1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/crimson/osd/osd_operations/client_request.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
195195

196196
if (!pg.is_primary()) {
197197
// primary can handle both normal ops and balanced reads
198-
if (is_misdirected(pg)) {
198+
if (is_misdirected_replica_read(pg)) {
199199
DEBUGDPP("{}.{}: dropping misdirected op",
200200
pg, *this, this_instance_id);
201201
co_return;
@@ -625,24 +625,28 @@ ClientRequest::do_process(
625625
}
626626
}
627627

628-
bool ClientRequest::is_misdirected(const PG& pg) const
628+
bool ClientRequest::is_misdirected_replica_read(const PG& pg) const
629629
{
630+
LOG_PREFIX(ClientRequest::is_misdirected_replica_read);
630631
// otherwise take a closer look
631632
if (const int flags = m->get_flags();
632633
flags & CEPH_OSD_FLAG_BALANCE_READS ||
633634
flags & CEPH_OSD_FLAG_LOCALIZE_READS) {
635+
if (op_info.rwordered()) {
636+
DEBUGDPP("{}: dropping - rwoedered with balanced/localize read {}", pg, *this);
637+
return true;
638+
}
634639
if (!op_info.may_read()) {
635-
// no read found, so it can't be balanced read
640+
DEBUGDPP("{}: dropping - no read found with balanced/localize read", pg, *this);
636641
return true;
637642
}
638643
if (op_info.may_write() || op_info.may_cache()) {
639-
// write op, but i am not primary
644+
DEBUGDPP("{}: dropping - can't write to replica", pg, *this);
640645
return true;
641646
}
642-
// balanced reads; any replica will do
643647
return false;
644648
}
645-
// neither balanced nor localize reads
649+
DEBUGDPP("{}: dropping - not a balanced/localize read ", pg, *this);
646650
return true;
647651
}
648652

src/crimson/osd/osd_operations/client_request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class ClientRequest final
269269
::crimson::osd::IOInterruptCondition,
270270
Errorator>;
271271

272-
bool is_misdirected(const PG& pg) const;
272+
bool is_misdirected_replica_read(const PG& pg) const;
273273

274274
const SnapContext get_snapc(
275275
PG &pg,

0 commit comments

Comments
 (0)