Jeevan Patnaik
2017-Nov-13 06:44 UTC
[Gluster-users] What is it with trusted.io-stats-dump?
Hi, I am trying to understand how the extended attribute trusted.io-stats-dump works. setfattr -n trusted.io-stats-dump -v /tmp/gluster_perf_stats/io-stats-pre.txt /mnt/gluster/gv0_glusterfs I can see that the io-stats-pre.txt is created. But how and what happened in the background? And why I can't I see the attribute with getfattr again? getfattr -dm- /mnt/gluster/gv0_glusterfs # file: mnt/gluster/gv0_glusterfs trusted.glusterfs.dht.commithash="3480667945" Regards, Jeevan. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20171113/3fe88ca7/attachment.html>
Amar Tumballi
2017-Nov-13 07:10 UTC
[Gluster-users] What is it with trusted.io-stats-dump?
On Mon, Nov 13, 2017 at 12:14 PM, Jeevan Patnaik <g1patnaik at gmail.com> wrote:> Hi, > > I am trying to understand how the extended attribute trusted.io-stats-dump > works. > > setfattr -n trusted.io-stats-dump -v /tmp/gluster_perf_stats/io-stats-pre.txt > /mnt/gluster/gv0_glusterfs > > I can see that the io-stats-pre.txt is created. But how and what happened > in the background? > > And why I can't I see the attribute with getfattr again? > >That is because 'trusted.io-stats-dump' is one of the many Virtual key GlusterFS handles. As GlusterFS is a filesystem, the way to interact with it is through system calls. GlusterFS has some options for debugging in-built using 'setxattr()' and 'getxattr()' syscall interface, and they are called 'virtual keys'. Regards, Amar> getfattr -dm- /mnt/gluster/gv0_glusterfs > # file: mnt/gluster/gv0_glusterfs > trusted.glusterfs.dht.commithash="3480667945" > > Regards, > Jeevan. > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://lists.gluster.org/mailman/listinfo/gluster-users >-- Amar Tumballi (amarts) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20171113/91adccb7/attachment.html>
Jeevan Patnaik
2017-Nov-13 07:14 UTC
[Gluster-users] What is it with trusted.io-stats-dump?
Hi,>From strace, I can see the system calls setxattr and getxattr.Two things I don't understand is: 1. how does the file got created so quickly, from where it read the stats. 2.why is the added attribute missing if I check with getfattr? Regards, Jeevan. On Nov 13, 2017 12:40 PM, "Amar Tumballi" <atumball at redhat.com> wrote: On Mon, Nov 13, 2017 at 12:14 PM, Jeevan Patnaik <g1patnaik at gmail.com> wrote:> Hi, > > I am trying to understand how the extended attribute trusted.io-stats-dump > works. > > setfattr -n trusted.io-stats-dump -v /tmp/gluster_perf_stats/io-stats-pre.txt > /mnt/gluster/gv0_glusterfs > > I can see that the io-stats-pre.txt is created. But how and what happened > in the background? > > And why I can't I see the attribute with getfattr again? > >That is because 'trusted.io-stats-dump' is one of the many Virtual key GlusterFS handles. As GlusterFS is a filesystem, the way to interact with it is through system calls. GlusterFS has some options for debugging in-built using 'setxattr()' and 'getxattr()' syscall interface, and they are called 'virtual keys'. Regards, Amar> getfattr -dm- /mnt/gluster/gv0_glusterfs > # file: mnt/gluster/gv0_glusterfs > trusted.glusterfs.dht.commithash="3480667945 <03480%20667%20945>" > > Regards, > Jeevan. > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://lists.gluster.org/mailman/listinfo/gluster-users >-- Amar Tumballi (amarts) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20171113/e5f98615/attachment.html>
Krutika Dhananjay
2017-Nov-13 07:36 UTC
[Gluster-users] What is it with trusted.io-stats-dump?
trusted.io-stats-dump is a virtual (not physical) extended attribute. The code is written in a way that a request to set trusted.io-stats-dump gets bypassed at the io-stats translator layer on the stack and there it gets converted into the action of dumping the statistics into the provided output file path. See io_stats_setxattr() implementation in io-stats.c for more details. HTH, Krutika On Mon, Nov 13, 2017 at 12:14 PM, Jeevan Patnaik <g1patnaik at gmail.com> wrote:> Hi, > > I am trying to understand how the extended attribute trusted.io-stats-dump > works. > > setfattr -n trusted.io-stats-dump -v /tmp/gluster_perf_stats/io-stats-pre.txt > /mnt/gluster/gv0_glusterfs > > I can see that the io-stats-pre.txt is created. But how and what happened > in the background? > > And why I can't I see the attribute with getfattr again? > > getfattr -dm- /mnt/gluster/gv0_glusterfs > # file: mnt/gluster/gv0_glusterfs > trusted.glusterfs.dht.commithash="3480667945" > > Regards, > Jeevan. > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://lists.gluster.org/mailman/listinfo/gluster-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20171113/5ef31f37/attachment.html>
Jeevan Patnaik
2017-Nov-13 07:55 UTC
[Gluster-users] What is it with trusted.io-stats-dump?
Hi, Thanks. Now I understand :) On Nov 13, 2017 1:06 PM, "Krutika Dhananjay" <kdhananj at redhat.com> wrote:> trusted.io-stats-dump is a virtual (not physical) extended attribute. > The code is written in a way that a request to set trusted.io-stats-dump > gets bypassed at the io-stats translator layer on the stack and > there it gets converted into the action of dumping the statistics into the > provided output file path. > See io_stats_setxattr() implementation in io-stats.c for more details. > > HTH, > Krutika > > On Mon, Nov 13, 2017 at 12:14 PM, Jeevan Patnaik <g1patnaik at gmail.com> > wrote: > >> Hi, >> >> I am trying to understand how the extended attribute >> trusted.io-stats-dump works. >> >> setfattr -n trusted.io-stats-dump -v /tmp/gluster_perf_stats/io-stats-pre.txt >> /mnt/gluster/gv0_glusterfs >> >> I can see that the io-stats-pre.txt is created. But how and what happened >> in the background? >> >> And why I can't I see the attribute with getfattr again? >> >> getfattr -dm- /mnt/gluster/gv0_glusterfs >> # file: mnt/gluster/gv0_glusterfs >> trusted.glusterfs.dht.commithash="3480667945 <03480%20667%20945>" >> >> Regards, >> Jeevan. >> >> _______________________________________________ >> Gluster-users mailing list >> Gluster-users at gluster.org >> http://lists.gluster.org/mailman/listinfo/gluster-users >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20171113/60f9b950/attachment.html>