return true;
}
- if ((m->get_flags() & (CEPH_OSD_FLAG_BALANCE_READS |
- CEPH_OSD_FLAG_LOCALIZE_READS)) &&
- op->may_read() &&
- !(op->may_write() || op->may_cache())) {
- // balanced reads; any replica will do
- if (!(is_primary() || is_replica())) {
- osd->handle_misdirected_op(this, op);
- return true;
- }
- } else {
- // normal case; must be primary
- if (!is_primary()) {
- osd->handle_misdirected_op(this, op);
- return true;
- }
- }
if (is_replay()) {
if (m->get_version().version > 0) {
dout(7) << " queueing replay at " << m->get_version()
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
assert(m->get_type() == CEPH_MSG_OSD_OP);
+
+ if ((m->get_flags() & (CEPH_OSD_FLAG_BALANCE_READS |
+ CEPH_OSD_FLAG_LOCALIZE_READS)) &&
+ op->may_read() &&
+ !(op->may_write() || op->may_cache())) {
+ // balanced reads; any replica will do
+ if (!(is_primary() || is_replica())) {
+ osd->handle_misdirected_op(this, op);
+ return;
+ }
+ } else {
+ // normal case; must be primary
+ if (!is_primary()) {
+ osd->handle_misdirected_op(this, op);
+ return;
+ }
+ }
+
if (op->includes_pg_op()) {
if (pg_op_must_wait(m)) {
wait_for_all_missing(op);