Skip to content

Commit edf8b22

Browse files
Merge pull request ceph#62806 from NitzanMordhai/wip-nitzan-mixed-balance-read-and-rwordered-fix
mixed balance read and rwordered in read ops
2 parents ae55bea + f68b217 commit edf8b22

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/osd/PrimaryLogPG.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,15 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
20452045
}
20462046
}
20472047

2048+
// check for op with rwordered and rebalance or localize reads
2049+
if ((m->has_flag(CEPH_OSD_FLAG_BALANCE_READS) || m->has_flag(CEPH_OSD_FLAG_LOCALIZE_READS)) &&
2050+
op->rwordered()) {
2051+
dout(4) << __func__ << ": rebelance or localized reads with rwordered not allowed "
2052+
<< *m << dendl;
2053+
osd->reply_op_error(op, -EINVAL);
2054+
return;
2055+
}
2056+
20482057
if ((m->get_flags() & (CEPH_OSD_FLAG_BALANCE_READS |
20492058
CEPH_OSD_FLAG_LOCALIZE_READS)) &&
20502059
op->may_read() &&

src/osdc/Objecter.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,8 +2933,15 @@ class Objecter : public md_config_obs_t, public Dispatcher {
29332933
int _op_cancel(ceph_tid_t tid, int r);
29342934

29352935
int get_read_flags(int flags) {
2936-
return flags | global_op_flags | extra_read_flags.load(std::memory_order_relaxed) |
2937-
CEPH_OSD_FLAG_READ;
2936+
int ret = flags | global_op_flags |
2937+
extra_read_flags.load(std::memory_order_relaxed) |
2938+
CEPH_OSD_FLAG_READ;
2939+
2940+
// If the op is rwordered, strip out the balanced and localized flags.
2941+
if (flags & CEPH_OSD_FLAG_RWORDERED) {
2942+
ret &= ~(CEPH_OSD_FLAG_BALANCE_READS | CEPH_OSD_FLAG_LOCALIZE_READS);
2943+
}
2944+
return ret;
29382945
}
29392946

29402947
public:

0 commit comments

Comments
 (0)