mirror of
https://github.com/ceph/ceph
synced 2025-03-06 00:10:04 +00:00
Objecter: add option for testing osd dup handling
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
parent
fa8aff9a25
commit
6faa449fc6
@ -429,6 +429,7 @@ OPTION(objecter_inflight_op_bytes, OPT_U64, 1024*1024*100) // max in-flight data
|
||||
OPTION(objecter_inflight_ops, OPT_U64, 1024) // max in-flight ios
|
||||
OPTION(objecter_completion_locks_per_session, OPT_U64, 32) // num of completion locks per each session, for serializing same object responses
|
||||
OPTION(objecter_inject_no_watch_ping, OPT_BOOL, false) // suppress watch pings
|
||||
OPTION(objecter_retry_writes_after_first_reply, OPT_BOOL, false) // ignore the first reply for each write, and resend the osd op instead
|
||||
|
||||
// Max number of deletes at once in a single Filer::purge call
|
||||
OPTION(filer_max_purge_ops, OPT_U32, 10)
|
||||
|
@ -3215,6 +3215,24 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
|
||||
<< dendl;
|
||||
Op *op = iter->second;
|
||||
|
||||
if (retry_writes_after_first_reply && op->attempts == 1 &&
|
||||
(op->target.flags & CEPH_OSD_FLAG_WRITE)) {
|
||||
ldout(cct, 7) << "retrying write after first reply: " << tid << dendl;
|
||||
if (op->onack) {
|
||||
num_unacked.dec();
|
||||
}
|
||||
if (op->oncommit || op->oncommit_sync) {
|
||||
num_uncommitted.dec();
|
||||
}
|
||||
_session_op_remove(s, op);
|
||||
sl.unlock();
|
||||
put_session(s);
|
||||
|
||||
_op_submit(op, sul, NULL);
|
||||
m->put();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m->get_retry_attempt() >= 0) {
|
||||
if (m->get_retry_attempt() != (op->attempts - 1)) {
|
||||
ldout(cct, 7) << " ignoring reply from attempt "
|
||||
|
@ -1951,7 +1951,8 @@ private:
|
||||
op_throttle_bytes(cct, "objecter_bytes",
|
||||
cct->_conf->objecter_inflight_op_bytes),
|
||||
op_throttle_ops(cct, "objecter_ops", cct->_conf->objecter_inflight_ops),
|
||||
epoch_barrier(0)
|
||||
epoch_barrier(0),
|
||||
retry_writes_after_first_reply(cct->_conf->objecter_retry_writes_after_first_reply)
|
||||
{ }
|
||||
~Objecter();
|
||||
|
||||
@ -2936,6 +2937,7 @@ public:
|
||||
|
||||
private:
|
||||
epoch_t epoch_barrier;
|
||||
bool retry_writes_after_first_reply;
|
||||
public:
|
||||
void set_epoch_barrier(epoch_t epoch);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user