[Gluster-devel] DHT xlator, read and write a file during creating a new file
Tahereh Fattahi
t28.fattahi at gmail.com
Tue May 2 12:56:55 UTC 2017
Thank you very much
I had test this before. I want all the client can see this counter and can
update that, so I add an attribute for directory.
setxattr for directory was very in-efficient (I saw a lot of lookup request
to server because of setxattr) for every create file when our workload
generate a lot of file.
So which one is better in your opinion?
On Tue, May 2, 2017 at 5:06 PM, Amar Tumballi <atumball at redhat.com> wrote:
>
>
> On Tue, May 2, 2017 at 5:30 PM, Tahereh Fattahi <t28.fattahi at gmail.com>
> wrote:
>
>> Hi
>>
>> I want to use a file as a counter when I create a file in dht xlator.
>> I mean, after creating a new file, I want open a file in the same
>> directory with a special name, read that, update the counter and write
>> back.
>> I think for this purpose I should open in dht_create_cbk, read in
>> dht_open_cbk and write in dht_readv_cbk.
>> I think I should use dht_open , dht_readv and dht_writev. Maybe I could
>> create inputs for these function expect frame! is it correct to use the
>> frame fro dht_create function?
>>
>> Is this scenario correct or there is better way?
>>
>> This is correct. But very in-efficient (for so many different fops for
> one fop from user). See if you can keep another extended attribute itself
> which you can update. That way, you can just handle the counter management
> using 'xattrop' or `setxattr()' fops
>
> Regards,
> Amar
>
>> _______________________________________________
>> Gluster-devel mailing list
>> Gluster-devel at gluster.org
>> http://lists.gluster.org/mailman/listinfo/gluster-devel
>>
>
>
>
> --
> Amar Tumballi (amarts)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20170502/e2a55c13/attachment.html>
More information about the Gluster-devel
mailing list