hi John,
On Thu, Nov 19, 2020 at 10:46 PM John Mulligan
<phlogistonjohn(a)asynchrono.us> wrote:
I'm not sure about the behavior of the function call rados_read_op_operate.
I'm hoping someone on this list can clarify and confirm that what I'm seeing is
expected behavior.
When I was first looking at this call I assumed that if one created a
rados_read_op_t (shortened as "op" later) and populated it with
"steps" you'd
be able to call rados_read_op_operate with the op on more than one different
object. However, this does not seem to be the case. When I call
rados_read_op_operate a second time, the function returns but the items passed
in to the "step" calls do not change, unlike the first time the function is
called.
I have attached a C file that tries to demonstrate what I mean. The function
print_one_omap works as expected when called on two times on different objects.
The function print_two_omaps is passed two objects to read but only data for
the first is printed. (I also try to dump data but I was originally testing
with omaps only - thus the function names. Also please excuse and bad C code,
I don't usually write in C but wanted to confirm this behavior occurred when
using the C api.)
What I'd like to ask is if this is intended behavior. If not, I'll be happy to
file a bug, but from the code I skimmed and the function doc comments, its not
clear to me what is supposed to happen.
If anyone on this list can shed some light on this I'd greatly appreciate it.
in short, the question is, "can we feed the same "rados_read_op_t"
instance to "rados_read_op_operate()" multiple times with different
oid?"
i think the the answer is "no". the callee just consumes the "op"
passed to it by
1. taking all the ops enclosed in it
2. taking the output buffers enclosed in it
see also
https://github.com/ceph/ceph/blob/1bfdd2c1c2baa364d9b61b5f73775162da787172/…
so after the "ret = rados_read_op_operate(rd, ioctx, oid1,
LIBRADOS_OPERATION_IGNORE_CACHE);", the "rd" is like a squeezed lemon.
i created
https://github.com/ceph/ceph/pull/38330 to document this behavior.
HTH
--John M._______________________________________________
Dev mailing list -- dev(a)ceph.io
To unsubscribe send an email to dev-leave(a)ceph.io
--
Regards
Kefu Chai