Re: Bug report: unexpected behavior when executing Lua object class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Comments inline

> ---------- Forwarded message ----------
> From: Zheyuan Chen <zchen137@xxxxxxxx>
> Date: Sat, Jun 3, 2017 at 1:45 PM
> Subject:  Bug report: unexpected behavior when executing
> Lua object class
> To: ceph-users@xxxxxxxxxxxxxx
>
> Bug 1: I can not get returned output in the first script. "data" is
> always empty.
>
>> import rados, json
>> cluster = rados.Rados(conffile='')
>> cluster.connect()
>> ioctx = cluster.open_ioctx('data')
>> cmd = {
>>     "script": """
>>         function test(input, output)
>>             data = bufferlist.new()
>>             data:append("test")
>>             objclass.write_full(data, #data)
>>             output:append("Here is the return value")
>>         end
>>         objclass.register(test)
>>     """,
>>     "handler": "test",
>>     "input": "",
>> }
>> # I can not get returned data
>> ret, data = ioctx.execute('test', 'lua', 'eval_json', json.dumps(cmd))
>> print ret, data

Unfortunately, this isn't a bug. Rados clears any returned data from
an object class method if the operation also writes to the object.

> Bug 2:
> The returned mtime is always 0.

This might be a bug, but there are a few things to rule out. Did you
write to the object before running stat? There is also a test case
here: can you try to run them?

https://github.com/ceph/ceph/blob/master/src/test/cls_lua/test_cls_lua.cc#L679

- Noah
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux