Skip to contentSkip to conversation

question about ReplicatedPG::do_op

DISCUSSION xxhdx1985126 2 participants 2 messages Dec 5, 2016

lore
Share & tools
lore
#0 lore raw

Hi, everyone.

I'm trying to read the source code of ceph's read/write operation processing. In ReplicatedPG::do_op, I found that when the call to "get_rw_locks(write_ordered, ctx)" fail, as showed in the following, the method ReplicatedPG::do_op will return. However, when ReplicatedPG::do_op is called, the op is dequeued from the osd_op_wq, wouldn't the op be lost if do_op return without requeueing the op? If it is lost, wouldn't this lead to an error? Thanks.

         else if (!get_rw_locks(write_ordered, ctx)) {
		dout(20)
					<< __func__ << " waiting for rw locks " << dendl;
		op->mark_delayed("waiting for rw locks");
		close_op_ctx(ctx, -EBUSY);
		return;
	}
#1 lore raw

the RWState structure was used to reserve the waited ops

2016-12-05 17:07 GMT+08:00 xxhdx1985126 <[email protected]>:

Quoted 11 lines

Hi, everyone.

I'm trying to read the source code of ceph's read/write operation processing. In ReplicatedPG::do_op, I found that when the call to "get_rw_locks(write_ordered, ctx)" fail, as showed in the following, the method ReplicatedPG::do_op will return. However, when ReplicatedPG::do_op is called, the op is dequeued from the osd_op_wq, wouldn't the op be lost if do_op return without requeueing the op? If it is lost, wouldn't this lead to an error? Thanks.

         else if (!get_rw_locks(write_ordered, ctx)) {
                dout(20)
                                        << __func__ << " waiting for rw locks " << dendl;
                op->mark_delayed("waiting for rw locks");
                close_op_ctx(ctx, -EBUSY);
                return;
        }
Signature · 2 lines
Thank you!
HuangJun