Skip to content

Commit

Permalink
Merge pull request ceph#6967 from majianpeng/osd-full-skip-readop
Browse files Browse the repository at this point in the history
osd: bypass readonly ops when osd full.

Reviewed-by: Samuel Just <[email protected]>
  • Loading branch information
tchaikov authored Jun 13, 2016
2 parents 3ab1343 + 07b2a22 commit f9c48df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1656,20 +1656,27 @@ void ReplicatedPG::do_op(OpRequestRef& op)
return;
}

// order this op as a write?
bool write_ordered =
op->may_write() ||
op->may_cache() ||
m->has_flag(CEPH_OSD_FLAG_RWORDERED);

// discard due to cluster full transition? (we discard any op that
// originates before the cluster or pool is marked full; the client
// will resend after the full flag is removed or if they expect the
// op to succeed despite being full). The except is FULL_FORCE ops,
// which there is no reason to discard because they bypass all full
// checks anyway.
// If this op isn't write or read-ordered, we skip
// FIXME: we exclude mds writes for now.
if (!(m->get_source().is_mds() || m->has_flag(CEPH_OSD_FLAG_FULL_FORCE)) &&
if (write_ordered && !( m->get_source().is_mds() || m->has_flag(CEPH_OSD_FLAG_FULL_FORCE)) &&
info.history.last_epoch_marked_full > m->get_map_epoch()) {
dout(10) << __func__ << " discarding op sent before full " << m << " "
<< *m << dendl;
return;
}
if (!m->get_source().is_mds() && osd->check_failsafe_full()) {
if (!(m->get_source().is_mds()) && osd->check_failsafe_full() && write_ordered) {
dout(10) << __func__ << " fail-safe full check failed, dropping request"
<< dendl;
return;
Expand Down Expand Up @@ -1700,12 +1707,6 @@ void ReplicatedPG::do_op(OpRequestRef& op)
}
}

// order this op as a write?
bool write_ordered =
op->may_write() ||
op->may_cache() ||
m->has_flag(CEPH_OSD_FLAG_RWORDERED);

dout(10) << "do_op " << *m
<< (op->may_write() ? " may_write" : "")
<< (op->may_read() ? " may_read" : "")
Expand Down
2 changes: 1 addition & 1 deletion src/osdc/Objecter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@ void Objecter::_op_submit(Op *op, shunique_lock& sul, ceph_tid_t *ptid)
<< dendl;
op->target.paused = true;
_maybe_request_map();
} else if ((op->target.flags & CEPH_OSD_FLAG_WRITE) &&
} else if ((op->target.flags & (CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_RWORDERED)) &&
!(op->target.flags & (CEPH_OSD_FLAG_FULL_TRY |
CEPH_OSD_FLAG_FULL_FORCE)) &&
(_osdmap_full_flag() ||
Expand Down

0 comments on commit f9c48df

Please sign in to comment.