Re: Lua scripting in radoswg

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

 



Hi Yuval!

Yo are correct, I looked at the “optional” fields and didn’t realize that the parent parameter was optional.

I see that there is a check for checking if CopyFrom is nil in the example, I’m going to try something like that.

I mentinoned the Request.User field because of this from the example:

User = {
      Tenant = Request.User.Tenant,
      Id = Request.User.Id
    }

But I can see that the Request.User field is not in pacific.

I going to do some more tests.

Thanks!

> On 20 Feb 2022, at 08:22, Yuval Lifshitz <ylifshit@xxxxxxxxxx> wrote:
> 
> Hi Koldo,
> Great to hear that you are using Lua scripting!
> Some of the fields that you use: Request.Object and Request.Bucket are
> marked as "optional" in the table. Meaning, that for some operations they
> may have nil value. Ideally, the script would check that, either by
> checking Request.RGWOp or by checking that the values are not nil.
> I've looked at the elasticsearch example script, and we don't have these
> checks there :-(
> So, I opened a tracker issue [1]. Feel free to ad more info there, or
> submit a patch :-)
> 
> Couple more points:
> * we don't have a Request.User field, so you probably
> need Request.Bucket.User (when the Request.Bucket field is there)
> * when the lua script fails, we do not reply with an op failure (we log a
> warning), so according to the log, there is probably another reason for the
> operation to fail
> * would be great if you can share the log for the postRequest script case -
> so I can try to see why it is not working
> * the elsaticsearch readme [2] should contain information on the luarocks
> packages that should be used, please send info on what didn't work there
> 
> Yuval
> 
> [1] https://tracker.ceph.com/issues/54325
> [2]
> https://github.com/ceph/ceph/blob/master/examples/lua/elasticsearch_adapter.md
> 
> On Thu, Feb 17, 2022 at 10:02 AM Koldo Aingeru <koldo.aingeru@xxxxxxxxxx>
> wrote:
> 
>> Hi,
>> 
>> I’m doing my first steps with CEPH. I’ve installed a cluster following
>> this guide (
>> https://ralph.blog.imixs.com/2021/10/03/ceph-pacific-running-on-debian-11-bullseye/)
>> and have a pacific release (16.2.7) running with docker containers on
>> debian hosts.
>> 
>> I’ve then deployed the rgw daemon and have that working as well with beast
>> as webserver, with an haproxy as load balancer (for the tests I’m using
>> only one of the daemons). This is also working great with a variety of S3
>> compatble clients :)
>> 
>> Now I’m trying the lua scripting part (
>> https://docs.ceph.com/en/pacific/radosgw/lua-scripting/) here I’ve meet
>> with many obstacles:
>> 
>> - The Docker containers are based on Centos 8 and their repos don’t work
>> anyomore, it’s already addressed and I’ve just change to vault repos.
>> - Some trouble with luarocks dependencies (specially with the luasocket
>> one)
>> 
>> After a lot of thinkering I've a working script sending data to an
>> elasticsearch, but for some reasons I cannot access a lot of fileds from
>> the Request variable, specially I cannot access fields like Request.Object,
>> Request.Bucket or Request.User. :
>> 
>> debug 2022-02-16T15:16:04.685+0000 7f66417d4700  1 ====== starting new
>> request req=0x7f6757529620 =====
>> debug 2022-02-16T15:16:04.689+0000 7f66417d4700  1 req 4355535815128688423
>> 0.004000185s Lua ERROR: [string "local elasticsearch = require
>> ("elasticsearch")..."]:46: attempt to index a nil value (field 'Bucket')
>> debug 2022-02-16T15:16:04.693+0000 7f664a7e6700  1 req 4355535815128688423
>> 0.008000370s op->ERRORHANDLER: err_no=-2002 new_err_no=-2002
>> 
>> 
>> Others like Request.RGWOp. or Request.RGWOp works well.
>> 
>> My script is mostly based on this one (
>> https://github.com/ceph/ceph/blob/master/examples/lua/elasticsearch_adapter.lua),
>> I know thats from the master branch, but the docs for pacific has the same
>> fields for that variable.
>> 
>> I’ve the script running in preRequest, as loading it in postRequest
>> doesn’t seem to work (I don’t get any errors but it doesn’t do anything).
>> 
>> I think I’m missing something but I cannot find what is it, any help would
>> be appreciated.
>> 
>> Thanks!!
>> ========================================
>> Koldo Aingeru Marcos Fdez.
>> Ingeniería de Sistemas
>> Sarenet S.A.U.
>> 944209470
>> Parque Tecnológico, Edificio 103
>> 48170 Zamudio, Bizkaia
>> www.sarenet.es
>> ========================================
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> ceph-users mailing list -- ceph-users@xxxxxxx
>> To unsubscribe send an email to ceph-users-leave@xxxxxxx
>> 
> _______________________________________________
> ceph-users mailing list -- ceph-users@xxxxxxx
> To unsubscribe send an email to ceph-users-leave@xxxxxxx

========================================
Koldo Aingeru Marcos Fdez.  
Ingeniería de Sistemas
Sarenet S.A.U.
944209470
Parque Tecnológico, Edificio 103
48170 Zamudio, Bizkaia
www.sarenet.es
========================================







_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx




[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