[Gluster-devel] [Questions] why shard feature doesn't support quota

2017-06-28 Thread Xie Changlong

Hi all

I did a small test on gluster 3.8.4, and found shard feature does not 
support quota.  Here is the step:

$ gluster volume set s1 features.shard on
$ gluster volume quota s1 enable
$ gluster volume quota s1 limit-usage /ttt 1GB
$ gluster volume quota s1 list
$ cd /mnt/s1/ttt; fallocate -l 2GB testfile
Then, i found testfile created sucessully.

So, It seems shard doesn't support quota. It's a technical issue or 
there is a ongoing plan?


--
Thanks
-Xie
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] Announcing Gluster release 3.11.1 (Short Term Maintenance)

2017-06-28 Thread Shyam
The Gluster community is pleased to announce the release of Gluster 
3.11.1 (packages available at [1]).


Major changes and features (complete release notes can be found @ [2])

- Improved disperse (EC) volume performance
- Group settings for enabling negative lookup caching are provided
- Gluster fuse now implements "-oauto_unmount" feature

We still carry a major issue that is reported in the release-notes as 
follows,


- Expanding a gluster volume that is sharded may cause file corruption

Sharded volumes are typically used for VM images, if such volumes 
are expanded or possibly contracted (i.e add/remove bricks and 
rebalance) there are reports of VM images getting corrupted.


Status of this bug can be tracked here, #1465123

Thanks,
Gluster community

[1] Packages: 
https://download.gluster.org/pub/gluster/glusterfs/3.11/3.11.1/


[2] Complete release notes: 
https://github.com/gluster/glusterfs/blob/release-3.11/doc/release-notes/3.11.1.md

___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel


Re: [Gluster-devel] glusterfsd crash when using quota without io-threads

2017-06-28 Thread Kinglong Mee
Hi Sanoj,

Do you testing with changing the 16K to 2M (default stack size)?

If also overflowing, there must be an important issue exist;
not overflowing, only the issue of 16K is small for marker without io-threads?

thanks,
Kinglong Mee

On 6/28/2017 19:48, Sanoj Unnikrishnan wrote:
> Hi Kinglong,
> 
> I opened https://bugzilla.redhat.com/show_bug.cgi?id=1465861 to track this. 
> It seems to be an important issue that went undetected.
> Thanks for catching this!!
> 
> In my attempts to repro this , I found that on each run some random 
> structures where getting corrupted and running into segfault.
> In order to assert that the stack was indeed growing into all the allocated 
> space and beyond, I set a guard page in the end of the allocated stack space 
> (so that we hit a segfault before overusing the space).
> Below are the code changes.
> 
> @@ -443,6 +443,8 @@ synctask_create (struct syncenv *env, size_t stacksize, 
> synctask_fn_t fn,
>  struct synctask *newtask = NULL;
>  xlator_t*this= THIS;
>  int destroymode = 0;
> +int r=0;
> +char*v;
>  
>  VALIDATE_OR_GOTO (env, err);
>  VALIDATE_OR_GOTO (fn, err);
> @@ -498,9 +500,15 @@ synctask_create (struct syncenv *env, size_t stacksize, 
> synctask_fn_t fn,
>  gf_common_mt_syncstack);
>  newtask->ctx.uc_stack.ss_size = env->stacksize;
>  } else {
> -newtask->stack = GF_CALLOC (1, stacksize,
> +   newtask->stack = GF_CALLOC (1, stacksize,
>  gf_common_mt_syncstack);
>  newtask->ctx.uc_stack.ss_size = stacksize;
> +if (stacksize == 16*1024) {
> +v = (unsigned long)((char *)(newtask->stack) + 4095) 
> & (~4095);
> +r = mprotect(v, 4096, PROT_NONE);
> +   gf_msg ("syncop", GF_LOG_ERROR, errno,
> +LG_MSG_GETCONTEXT_FAILED, "SKU: using 16k 
> stack starting at %p, mprotect returned %d, guard page: %p", newtask->stack, 
> r, v);
> +   }
>  }
>  
> (gdb) where
> #0  0x7f8a92c51204 in _dl_lookup_symbol_x () from 
> /lib64/ld-linux-x86-64.so.2
> #1  0x7f8a92c561e3 in _dl_fixup () from /lib64/ld-linux-x86-64.so.2
> #2  0x7f8a92c5dd33 in _dl_runtime_resolve_avx () from 
> /lib64/ld-linux-x86-64.so.2
> #3  0x in ?? ()
> 
> 
> (gdb) info reg
> 
> rdi0x7f8a92946188140233141412232
> rbp0x7f8a800b40000x7f8a800b4000
> rsp0x7f8a800b40000x7f8a800b4000
> r8 0x7f8a92e4ba60140233146677856
> 
> (gdb) layout asm
> 
>   >│0x7f8a92c51204 <_dl_lookup_symbol_x+4>  push   %r15   
> <== push on stack at the guarded page caused segfault
> 
> From the brick log we have,
> 
> [syncop.c:515:synctask_create] 0-syncop: SKU: using 16k stack starting at 
> 0x7f8a800b28f0, mprotect returned 0, guard page: 0x7f8a800b3000 [No data 
> available]
> 
> Stack grows downward from 0x7f8a800b68f0 to 0x7f8a800b28f0  and the page 
> 0x7f8a800b3000 - 0x7f8a800b4000 is guarded , which is where the segfault hit 
> as seen in gdb.
> 
> This confirms that the stack space is not sufficient and overflowing,
> I am not sure why we don't hit this in the presence of IO threads though, It 
> may just be that with io threads in graph, we may have some allocated and 
> unused memory which our stack freely grows into. It may just be a silent 
> undetected reuse of some memory.
> 
> Regards,
> Sanoj
> 
> 
> 
> On Tue, Jun 13, 2017 at 10:49 AM, Sanoj Unnikrishnan  > wrote:
> 
> Hi Kinglong
> I was reading about makecontext/swapcontext as well,
> I did find an article that suggested to use mprotect and force a segfault 
> to check if we have a stack space issue here.
> here is the link. http://www.evanjones.ca/software/threading.html 
> .
> 
> I don't think i can try this until tomorrow.
> thanks and regards,
> Sanoj
> 
> On Tue, Jun 13, 2017 at 5:58 AM, Kinglong Mee  > wrote:
> 
> Hi Sanoj,
> 
> What's your opinion about this problem?
> 
> thanks,
> Kinglong Mee
> 
> On 6/9/2017 17:20, Kinglong Mee wrote:
> > Hi Sanoj,
> >
> > On 6/9/2017 15:48, Sanoj Unnikrishnan wrote:
> >> I have not used valgrind before, so I may be wrong here.
> >>
> >> I think the valgrind_stack_deregister should have been after 
> GF_FREE_STACK.
> >> That may explain the instance of invalid_write during 
> stack_destroy calls in after.log.
> >
> > No. I move it, but the instance of invalid_write also exist.
> >
> >>

Re: [Gluster-devel] Adding xxhash to gluster code base

2017-06-28 Thread Kotresh Hiremath Ravishankar
That sounds good to me. I will send it as a separate patch then. And I can
maintain it. No issues.

Thanks and Regards,
Kotresh H R


On Wed, Jun 28, 2017 at 1:02 PM, Niels de Vos  wrote:

> On Wed, Jun 28, 2017 at 12:51:07PM +0530, Amar Tumballi wrote:
> > On Tue, Jun 27, 2017 at 8:46 PM, Niels de Vos  wrote:
> >
> > > On Tue, Jun 27, 2017 at 08:09:25AM -0400, Kaleb S. KEITHLEY wrote:
> > > >
> > > > xxhash doesn't seem to change much. Last update to the non-test code
> was
> > > six
> > > > months ago.
> > > >
> > > > bundling giant (for some definition of giant) packages/projects
> would be
> > > > bad. bundling two (three if you count the test) C files doesn't seem
> too
> > > bad
> > > > when you consider that there are already three or four packages in
> fedora
> > > > (perl, python, R-digest, ghc (gnu haskell) that have implementations
> of
> > > > xxhash or murmur but didn't bother to package a C implementation and
> use
> > > it.
> > >
> > > I prefer to have as little maintenance components in the Gluster
> sources
> > > as we can. The maintenance burdon is already very high. The number of
> > > changes to xxhash seem limited, but we still need someone to track and
> > > pay attention to them.
> > >
> >
> > I agree that someone should maintain it, and we should add it to
> > MAINTAINERS file
> > (or some other place, where we are tracking the dependencies).
> >
> > For now, Kotresh will be looking into keeping these changes up-to-date
> with
> > upstream xxhash project, along with me.
>
> Kotresh as maintainer/owner, and Aravinda as peer?
>
> > > > I'd be for packaging it in Fedora rather than bundling it in
> gluster. But
> > > > then we get to "carry" it in rhgs as we do with userspace-rcu.
> > >
> > > We should descide what the most maintainable solution is. Having
> package
> > > maintainers with the explicit task to keep xxhash updated and current
> is
> > > apealing to me. Merging (even small) projects into the Gluster codebase
> > > will add more maintenance need to the project members. Therefor I have
> a
> > > strong preference to use xxhash (or an other library) that is provided
> > > by distributions. The more common the library is, the better it will be
> > > maintained without our (Gluster Community's) help.
> > >
> > >
> > While this is desirable, we didn't see any library available for xxhash (
> > http://cyan4973.github.io/xxHash/) in our distro.
> >
> > I would recommend taking these patches with TODO to use library in future
> > when its available, and continue to have xxhash in 'contrib/'. It is not
> > new for us to take code from different libraries and use it for our need
> > and maintain only that part (eg. libfuse). Lets treat this as similar
> setup.
>
> Yes, if there is no suitable alternative available in the majority of
> distributions, this is the only sensible approach. Much of the code in
> contrib/ is not maintained at all. We should prevent this from happening
> with new code and assigning an owner/maintainer and peer(s) just like
> for other components is a must.
>
> Thanks,
> Niels
>
>
> >
> > Regards,
> > Amar
> >
> >
> >
> >
> >
> > > Niels
> > >
> > >
> > > > On 06/27/2017 04:08 AM, Niels de Vos wrote:
> > > > > On Tue, Jun 27, 2017 at 12:25:11PM +0530, Kotresh Hiremath
> Ravishankar
> > > wrote:
> > > > > > Hi,
> > > > > >
> > > > > > We were looking for faster non-cryptographic hash to be used for
> the
> > > > > > gfid2path infra [1]
> > > > > > The initial testing was done with md5 128bit checksum which was a
> > > slow,
> > > > > > cryptographic hash
> > > > > > and using it makes software not complaint to FIPS [2]
> > > > > >
> > > > > > On searching online a bit we found out xxhash [3] seems to be
> faster
> > > from
> > > > > > the results of
> > > > > > benchmark tests shared and lot of projects use it. So we have
> > > decided to us
> > > > > > xxHash
> > > > > > and added following files to gluster code base with the patch [4]
> > > > > >
> > > > > >  BSD 2-Clause License:
> > > > > > contrib/xxhash/xxhash.c
> > > > > > contrib/xxhash/xxhash.h
> > > > > >
> > > > > >  GPL v2 License:
> > > > > > tests/utils/xxhsum.c
> > > > > >
> > > > > > NOTE: We have ignored the code guideline check for these files as
> > > > > > maintaining it
> > > > > > further becomes difficult.
> > > > > >
> > > > > > Please comment on the same if there are any issues around it.
> > > > >
> > > > > How performance critical is the hashing for gfid2path?
> > > > >
> > > > > What is the plan to keep these files maintained? At minimal we
> need to
> > > > > add these files to MAINTAINERS and the maintainers need to
> cherry-pick
> > > > > updates and bugfixes from the original project. The few patches a
> year
> > > > > makes this a recurring task that should not be forgoten. It would
> be
> > > > > much better to use this as an external library that is provided by
> the
> > > > > distributions. We already 

Re: [Gluster-devel] Adding xxhash to gluster code base

2017-06-28 Thread Niels de Vos
On Wed, Jun 28, 2017 at 12:51:07PM +0530, Amar Tumballi wrote:
> On Tue, Jun 27, 2017 at 8:46 PM, Niels de Vos  wrote:
> 
> > On Tue, Jun 27, 2017 at 08:09:25AM -0400, Kaleb S. KEITHLEY wrote:
> > >
> > > xxhash doesn't seem to change much. Last update to the non-test code was
> > six
> > > months ago.
> > >
> > > bundling giant (for some definition of giant) packages/projects would be
> > > bad. bundling two (three if you count the test) C files doesn't seem too
> > bad
> > > when you consider that there are already three or four packages in fedora
> > > (perl, python, R-digest, ghc (gnu haskell) that have implementations of
> > > xxhash or murmur but didn't bother to package a C implementation and use
> > it.
> >
> > I prefer to have as little maintenance components in the Gluster sources
> > as we can. The maintenance burdon is already very high. The number of
> > changes to xxhash seem limited, but we still need someone to track and
> > pay attention to them.
> >
> 
> I agree that someone should maintain it, and we should add it to
> MAINTAINERS file
> (or some other place, where we are tracking the dependencies).
> 
> For now, Kotresh will be looking into keeping these changes up-to-date with
> upstream xxhash project, along with me.

Kotresh as maintainer/owner, and Aravinda as peer?

> > > I'd be for packaging it in Fedora rather than bundling it in gluster. But
> > > then we get to "carry" it in rhgs as we do with userspace-rcu.
> >
> > We should descide what the most maintainable solution is. Having package
> > maintainers with the explicit task to keep xxhash updated and current is
> > apealing to me. Merging (even small) projects into the Gluster codebase
> > will add more maintenance need to the project members. Therefor I have a
> > strong preference to use xxhash (or an other library) that is provided
> > by distributions. The more common the library is, the better it will be
> > maintained without our (Gluster Community's) help.
> >
> >
> While this is desirable, we didn't see any library available for xxhash (
> http://cyan4973.github.io/xxHash/) in our distro.
> 
> I would recommend taking these patches with TODO to use library in future
> when its available, and continue to have xxhash in 'contrib/'. It is not
> new for us to take code from different libraries and use it for our need
> and maintain only that part (eg. libfuse). Lets treat this as similar setup.

Yes, if there is no suitable alternative available in the majority of
distributions, this is the only sensible approach. Much of the code in
contrib/ is not maintained at all. We should prevent this from happening
with new code and assigning an owner/maintainer and peer(s) just like
for other components is a must.

Thanks,
Niels


> 
> Regards,
> Amar
> 
> 
> 
> 
> 
> > Niels
> >
> >
> > > On 06/27/2017 04:08 AM, Niels de Vos wrote:
> > > > On Tue, Jun 27, 2017 at 12:25:11PM +0530, Kotresh Hiremath Ravishankar
> > wrote:
> > > > > Hi,
> > > > >
> > > > > We were looking for faster non-cryptographic hash to be used for the
> > > > > gfid2path infra [1]
> > > > > The initial testing was done with md5 128bit checksum which was a
> > slow,
> > > > > cryptographic hash
> > > > > and using it makes software not complaint to FIPS [2]
> > > > >
> > > > > On searching online a bit we found out xxhash [3] seems to be faster
> > from
> > > > > the results of
> > > > > benchmark tests shared and lot of projects use it. So we have
> > decided to us
> > > > > xxHash
> > > > > and added following files to gluster code base with the patch [4]
> > > > >
> > > > >  BSD 2-Clause License:
> > > > > contrib/xxhash/xxhash.c
> > > > > contrib/xxhash/xxhash.h
> > > > >
> > > > >  GPL v2 License:
> > > > > tests/utils/xxhsum.c
> > > > >
> > > > > NOTE: We have ignored the code guideline check for these files as
> > > > > maintaining it
> > > > > further becomes difficult.
> > > > >
> > > > > Please comment on the same if there are any issues around it.
> > > >
> > > > How performance critical is the hashing for gfid2path?
> > > >
> > > > What is the plan to keep these files maintained? At minimal we need to
> > > > add these files to MAINTAINERS and the maintainers need to cherry-pick
> > > > updates and bugfixes from the original project. The few patches a year
> > > > makes this a recurring task that should not be forgoten. It would be
> > > > much better to use this as an external library that is provided by the
> > > > distributions. We already rely on OpenSSL, does this library not
> > provide
> > > > an alternative 'FIPS approved' hashing that performs reasonably well?
> > > >
> > > > Some distributions are very strict on bundling external projects, and
> > we
> > > > need to inform the packagers about the additions so that they can
> > handle
> > > > it correctly. Adding an external project to contrib/ should be
> > mentioned
> > > > in the release notes at the very least.
> > > >
> > > > Note 

Re: [Gluster-devel] Scripts to help RCA quota accounting issues

2017-06-28 Thread Amar Tumballi
On Thu, Jun 22, 2017 at 4:56 PM, Sanoj Unnikrishnan 
wrote:

> I have written some scripts that may help RCA quota accounting related
> issue in future.
> Please use them when necessary.
>
> 1) Below script will compare accounting done by 'du' with that done by
> quota and compare them.
> Requires input : mountpoint and volname.
> ouput: /tmp/gluster_files.tar
>
> cd 
> du -h | head -n -1 | tr -d '.' |awk  '{ for (i = 2; i <= NF; i++) { 
> printf("%s ", $i);}  print "" }' > /tmp/gluster_1
> cat /tmp/gluster_1 | sed 's/ $//' | sed 's/ /\\ /g' | sed 's/(/\\(/g' | sed 
> 's/)/\\)/g' |xargs gluster v quota  list > /tmp/gluster_2
> du -h | head -n -1 |awk  '{ for (i = 2; i <= NF; i++) { printf("%s %s", $i, 
> $1);}  print "" }' | tr -d '.' >  /tmp/gluster_3
> cat /tmp/gluster_2 /tmp/gluster_3 | sort > /tmp/gluster_4
> find . -type d > /tmp/gluster_5
> tar -cvf /tmp/gluster_files.tar /tmp/gluster_*
>
>
> Can you send this as patch ? Keep the script in
'extras/quota/good-script-name.sh'


> 2)  To recusively get the quota xattr on a FS tree use:
> https://gist.github.com/sanoj-unnikrishnan/740b177cbe9c3277123cf08d875a6b
> f8
>
>
Cool, even this can get into project if you wish. A blog post on how using
this helped maintaining Quota feature would help other admins IMO.

Regards,
Amar


> Regards,
> Sanoj
>
>
>
> ___
> Gluster-devel mailing list
> Gluster-devel@gluster.org
> http://lists.gluster.org/mailman/listinfo/gluster-devel
>



-- 
Amar Tumballi (amarts)
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel

Re: [Gluster-devel] Adding xxhash to gluster code base

2017-06-28 Thread Amar Tumballi
On Tue, Jun 27, 2017 at 8:46 PM, Niels de Vos  wrote:

> On Tue, Jun 27, 2017 at 08:09:25AM -0400, Kaleb S. KEITHLEY wrote:
> >
> > xxhash doesn't seem to change much. Last update to the non-test code was
> six
> > months ago.
> >
> > bundling giant (for some definition of giant) packages/projects would be
> > bad. bundling two (three if you count the test) C files doesn't seem too
> bad
> > when you consider that there are already three or four packages in fedora
> > (perl, python, R-digest, ghc (gnu haskell) that have implementations of
> > xxhash or murmur but didn't bother to package a C implementation and use
> it.
>
> I prefer to have as little maintenance components in the Gluster sources
> as we can. The maintenance burdon is already very high. The number of
> changes to xxhash seem limited, but we still need someone to track and
> pay attention to them.
>

I agree that someone should maintain it, and we should add it to
MAINTAINERS file
(or some other place, where we are tracking the dependencies).

For now, Kotresh will be looking into keeping these changes up-to-date with
upstream xxhash project, along with me.


>
> > I'd be for packaging it in Fedora rather than bundling it in gluster. But
> > then we get to "carry" it in rhgs as we do with userspace-rcu.
>
> We should descide what the most maintainable solution is. Having package
> maintainers with the explicit task to keep xxhash updated and current is
> apealing to me. Merging (even small) projects into the Gluster codebase
> will add more maintenance need to the project members. Therefor I have a
> strong preference to use xxhash (or an other library) that is provided
> by distributions. The more common the library is, the better it will be
> maintained without our (Gluster Community's) help.
>
>
While this is desirable, we didn't see any library available for xxhash (
http://cyan4973.github.io/xxHash/) in our distro.

I would recommend taking these patches with TODO to use library in future
when its available, and continue to have xxhash in 'contrib/'. It is not
new for us to take code from different libraries and use it for our need
and maintain only that part (eg. libfuse). Lets treat this as similar setup.

Regards,
Amar





> Niels
>
>
> > On 06/27/2017 04:08 AM, Niels de Vos wrote:
> > > On Tue, Jun 27, 2017 at 12:25:11PM +0530, Kotresh Hiremath Ravishankar
> wrote:
> > > > Hi,
> > > >
> > > > We were looking for faster non-cryptographic hash to be used for the
> > > > gfid2path infra [1]
> > > > The initial testing was done with md5 128bit checksum which was a
> slow,
> > > > cryptographic hash
> > > > and using it makes software not complaint to FIPS [2]
> > > >
> > > > On searching online a bit we found out xxhash [3] seems to be faster
> from
> > > > the results of
> > > > benchmark tests shared and lot of projects use it. So we have
> decided to us
> > > > xxHash
> > > > and added following files to gluster code base with the patch [4]
> > > >
> > > >  BSD 2-Clause License:
> > > > contrib/xxhash/xxhash.c
> > > > contrib/xxhash/xxhash.h
> > > >
> > > >  GPL v2 License:
> > > > tests/utils/xxhsum.c
> > > >
> > > > NOTE: We have ignored the code guideline check for these files as
> > > > maintaining it
> > > > further becomes difficult.
> > > >
> > > > Please comment on the same if there are any issues around it.
> > >
> > > How performance critical is the hashing for gfid2path?
> > >
> > > What is the plan to keep these files maintained? At minimal we need to
> > > add these files to MAINTAINERS and the maintainers need to cherry-pick
> > > updates and bugfixes from the original project. The few patches a year
> > > makes this a recurring task that should not be forgoten. It would be
> > > much better to use this as an external library that is provided by the
> > > distributions. We already rely on OpenSSL, does this library not
> provide
> > > an alternative 'FIPS approved' hashing that performs reasonably well?
> > >
> > > Some distributions are very strict on bundling external projects, and
> we
> > > need to inform the packagers about the additions so that they can
> handle
> > > it correctly. Adding an external project to contrib/ should be
> mentioned
> > > in the release notes at the very least.
> > >
> > > Note that none of the symbols of any public functions in Gluster may
> > > collide with functions in standard distribution libraries. This causes
> > > for regular problems with gfapi applications. All exposed symbols that
> > > get imported in contrib/ should have a gf_ prefix.
> > >
> > > Thanks,
> > > Niels
> > >
> > >
> > > >
> > > > [1] Issue: https://github.com/gluster/glusterfs/issues/139
> > > > [2] https://en.wikipedia.org/wiki/Federal_Information_
> Processing_Standards
> > > > [3] http://cyan4973.github.io/xxHash/
> > > > [4] https://review.gluster.org/#/c/17488/10
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks and Regards,
> > > > Kotresh H R and