summaryrefslogtreecommitdiffstats
path: root/extras
Commit message (Collapse)AuthorAgeFilesLines
* Bash integration script should namespace variablesMark Mielke2018-08-151-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the original submitted script, it looks like there was effort put into namespacing all global variables. However a few mistakes remained. GLUSTER_TOP_SUBOPTIONSx were defined, but TOP_SUBOPTIONSx were referenced. This was likely an unrecognized defect in the original code submission? These are now corrected to refer to GLUSTER_TOP_SUBOPTIONSx. FINAL_LIST, LIST, and TOP were leaked into all Bash shells and used by the command completion functions. The most problematic of these was TOP, which was declared with "-i" making it an integer. This cause other code which used TOP to define a path to fail like this: $ bash $ TOP=/abc bash: /abc: syntax error: operand expected (error token is "/abc") These are now qualified as GLUSTER_FINAL_LIST, GLUSTER_LIST, and GLUSTER_TOP to reduce impact on scripts that might choose to use these extremely common variable names. Change-Id: Ic96eda8efd1f3238bbade6c6ddb69118e8d82158 Fixes: bz#1425325 Signed-off-by: Mark Mielke <mark.mielke@gmail.com>
* geo-rep/hook-script: Fix ssh/scp optionsKotresh HR2018-08-031-11/+12
| | | | | | | | | | | | | | Always use ssh and scp with "-oPasswordAuthentication=no" and "-oStrictHostKeyChecking=no" options. It might hang the post script otherwise leading geo-rep setup failure Also increased geo-rep timeout. Occasionally, it's taking more time to reach Active/Passive status. Especially, the first start after create. fixes: bz#1610405 Change-Id: I9560d64dbe0edf5db73446a9fc97dda19b88d233 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-224-11/+11
| | | | | | | | | | | | Please review, it's not always just the comments that were fixed. I've had to revert of course all calls to creat() that were changed to create() ... Only compile-tested! Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* extras: Remove the prot_filter.py codeNigel Babu2018-07-191-144/+0
| | | | | | | | | | This code was meant to work with the protection xlator which was removed in Nov 2016. Unfortunately, this file remained and should be removed as well. Change-Id: Ia6daa06542ebc8c6fb935c352cc19924f3bb3d8a Fixes: bz#1598390 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* build/core: location of xattr.hKaleb S. KEITHLEY2018-07-185-5/+5
| | | | | | | | | | | | | | | | | | | starting with libattr-devel-2.4.48-1 in Fedora 28 <attr/xattr.h> has been removed from the package. On Fedora, RHEL/CentOS, and SUSE, the glibc-headers package has provided a near identical file, <sys/xattr.h>, in all the releases that we care about. On Debian, libc6-dev provides <sys/xattr.h> all the way back to 8/Jessie and presumably all Ubuntu derivatives since then. Note that on Debian the sys headers are installed in /usr/include/$DEB_HOST_GNU_TYPE/sys/... Change-Id: Id07c4b225bdaa6556bd54772604e75b8f346fb60 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* Add the tab space in the list of BROKEN_TESTS environment variabledkhandel2018-07-181-30/+30
| | | | | | | Fixes: bz#1598325 Change-Id: I4c14514d33288fd33cca903853c6d5e4f70bd441 Signed-off-by: Deepshikha Khandelwal <dkhandel@redhat.com>
* testing: Fix the build environmentNigel Babu2018-07-171-2/+1
| | | | | | | | | The build environment for FB is vastly different from us. This change will match the config to what we use for our regression testing Change-Id: Ib3584a02dbffb75892f2cbeebcbf51cc3aff3eb6 Fixes: bz#1601390 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* geo-rep/scheduler: Fix EBUSY trace backKotresh HR2018-07-121-5/+20
| | | | | | | | | | Fix the trace back during temporary mount cleanup. Temporary mount is done to touch the root required for checkpoint to complete. fixes: bz#1598977 Change-Id: I97fea538e92c4ef0747747e981ef98499504e336 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-07-125-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, https://review.gluster.org/#/c/20104/, https://review.gluster.org/#/c/20162/, https://review.gluster.org/#/c/20185/, https://review.gluster.org/#/c/20207/, https://review.gluster.org/#/c/20227/, https://review.gluster.org/#/c/20307/, https://review.gluster.org/#/c/20320/, https://review.gluster.org/#/c/20332/, https://review.gluster.org/#/c/20364/, and https://review.gluster.org/#/c/20441/ Fixes some overlooked string.join()s: + AFAICT extras/profiler/glusterfs-profiler, extras/prot_filter.py, extras/rebalance.py, and extras/volfilter.py would only manifest at runtime. + xlators/experimental/fdl/src/gen_recon.py is a build-time error when using python3 during the build, thus was not noticed previously when building with python2. + extras/create_new_xlator/generate_xlator.py seems to be example code and does not affect the build or runtime AFAICT Note: Fedora packaging guidelines and SUSE rpmlint require explicit shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, has_key, idioms, map, numliterals, raise, set_literal, types, urllib, and zip have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: Ia1fe2958d136f4303e30f7e7e86b6fe7d7b52c81 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* Update mount-shared-storage.sh to automatically include all enabled ↵Josiah2018-07-101-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glusterfs mounts in fstab Currently the mount-shared-storage.sh script requires manual entry of each volume and mount point. There is a TODO item from Bug 1452527 to automatically pull the list of glusterfs mounts from the /etc/fstab file, validate that they are mounted, or attempt to mount them. This is to complete that TODO item. The extras/mount-shared-storage.sh file has been updated to read only active glusterfs mounts from the /etc/fstab file, verify if they are mounted, and attemt to mount them if they are not. It will exit with a status 0 if successfully mounted or status 1 if any of the mounts fail. This method will allow the standard method of mounts in /etc/fstab to be utilized and will ensure they are monted following system reboots. This can be tested by creating a volume, mounting it using the /etc/fstab method, and rebooting the server. Output will be similar to this: Jun 29 19:09:38 localhost systemd[1]: Starting Mount glusterfs sharedstorage... Jun 29 19:09:43 localhost mount-shared-storage.sh[4096]: /mnt/mount1 has been mounted Jun 29 19:09:48 localhost mount-shared-storage.sh[4096]: /mnt/mount2 has been mounted Jun 29 19:09:48 localhost systemd[1]: Started Mount glusterfs sharedstorage. Multiple fixes based on code review suggestions and spellcheck Removed spaces in grep for glusterfs as tabs are valid as well Added tab as an IFS field separator for the lines read from /etc/fstab Increased sleep time to 10 seconds before mount validation Changed mount check to use “mountpoint -q” Change-Id: Ib90c99ced8f7aefc8dbe87340afc73a28f6195e7 fixes: bz#1596789 Signed-off-by: Josiah <josiahp@gmail.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-07-096-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, https://review.gluster.org/#/c/20104/, https://review.gluster.org/#/c/20162/, https://review.gluster.org/#/c/20185/, https://review.gluster.org/#/c/20207/, https://review.gluster.org/#/c/20227/, https://review.gluster.org/#/c/20307/, https://review.gluster.org/#/c/20320/, https://review.gluster.org/#/c/20332/, and https://review.gluster.org/#/c/20364/ Fixes glupy.py python2isms, iteritems -> items, and some overlooked print() in georep/peer_mountbroker.in Note: Fedora packaging guidelines and SUSE rpmlint require explicit shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, has_key, idioms, map, numliterals, raise, set_literal, types, urllib, and zip have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: Idda031c1ec975417c79323aea33e7b694e752b2a updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* Replace the BROKEN_TESTS environment variable valuedkhandel2018-07-061-125/+30
| | | | | | | | | | | In distributed-testing framework for regression, the value of BROKEN_TESTS environment variable needs to be replaced. This list of broken tests is different from what we have marked as a bad test in our test suites. Fixes: bz#1598325 Change-Id: I6a3ca5d9500170201ecaafcd5a96d9df3e46a851 Signed-off-by: Deepshikha Khandelwal <dkhandel@redhat.com>
* extras/group : add database workload profileAtin Mukherjee2018-06-282-9/+22
| | | | | | | | | | | | | | | | | Running DB workload patterns with all perf xlators enabled as default has resulted into some inconsistency issues. Based on the internal testing done by Elko Kuric (ekuric@redhat.com) there're certain set of perf xlators which need to be turned off to get these types of workload supported by Gluster. The proposal is to leverage group profile infrastructure to group together all those tunables at one place so that users just need to apply the profile to the volume to use it for the data base workload. Credits : Elko Kuric (ekuric@redhat.com) Change-Id: I8a50e915278ad4085b9aaa3f160a33af7c0b0444 fixes: bz#1596020 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-06-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, https://review.gluster.org/#/c/20104/, https://review.gluster.org/#/c/20162/, https://review.gluster.org/#/c/20185/, https://review.gluster.org/#/c/20207/, https://review.gluster.org/#/c/20227/, https://review.gluster.org/#/c/20307/, https://review.gluster.org/#/c/20320/, and https://review.gluster.org/#/c/20332/ This patch fixes the remaining comma white space (ws_comma) as suggested by the 2to3 utility. (Earlier attempts to fix all ws_comma in one patch did not pass centos regression, hence multiple patches to identify the change that causes the failure.) Note: Fedora packaging guidelines and SUSE rpmlint require explicit shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, has_key, idioms, map, numliterals, raise, set_literal, types, urllib, and zip have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: If5aca67084a7b1c06966fed35fb35e8bb2f7d67c updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-06-212-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, https://review.gluster.org/#/c/20104/, https://review.gluster.org/#/c/20162/, https://review.gluster.org/#/c/20185/, https://review.gluster.org/#/c/20207/, https://review.gluster.org/#/c/20227/, https://review.gluster.org/#/c/20307/, and https://review.gluster.org/#/c/20320/ This patch fixes more selected comma white space (ws_comma) as suggested by the 2to3 utility. (Earlier attempts to fix all ws_comma in one patch did not pass centos regression, hence multiple patches to identify the change that causes the failure.) Note: Fedora packaging guidelines and SUSE rpmlint require explicit shebangs; popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, has_key, idioms, map, numliterals, raise, set_literal, types, urllib, and zip have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: I6e5a2408fa1fc81e00e66d6e4a7f9f6fa1d1ed15 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-06-213-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, https://review.gluster.org/#/c/20104/, https://review.gluster.org/#/c/20162/, https://review.gluster.org/#/c/20185/, https://review.gluster.org/#/c/20207/, https://review.gluster.org/#/c/20227/, and https://review.gluster.org/#/c/20307/ This patch fixes more selected comma white space (ws_comma) as suggested by the 2to3 utility. Note: Fedora packaging guidelines and SUSE rpmlint require explicit shebangs, so popular practices like #!/usr/bin/env python and or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, has_key, idioms, map, numliterals, raise, set_literal, types, urllib, and zip have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: I60932030813484803f73733a9b2b7b23c7a843fd updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* Distributed-testing: Call the correct class i.e. GeneralXMLRPCServerdkhandel2018-06-201-2/+2
| | | | | | fixes: bz#1586342 Change-Id: I7a062d49f2a49ca4848ffd0b8d1e39c8b6b99815 Signed-off-by: Deepshikha Khandelwal <dkhandel@redhat.com>
* gcron: create the lockfile if it is missingNiels de Vos2018-06-181-1/+1
| | | | | | | | | The lockfile for the job may not exist yet. If that is the case, it should be created upon the first time it is accessed. Change-Id: I4da2b3ecdb79cc63ed82cc7bfa026c8f08d4d043 Fixes: bz#1590193 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* gcron: catch OSError as well as IOErrorNiels de Vos2018-06-181-2/+2
| | | | | | | | | | In case os.open() fails because the file does not exist, an OSError is raised. To prevent the script to abort uncleanly, catch the OSError in addition to the IOError. Change-Id: I48e5b23e17d63639cc33db51b4229249a9887880 Fixes: bz#1590193 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* Add a command-line argument option to use specific address familydkhandel2018-06-182-11/+28
| | | | | | | | | This commit adds option to pass command-line argument to use any of IPv4 or IPv6 address family. Also it clean all the logs in the /tmp before running the distributed-test-runner.py fixes: bz#1586342 Change-Id: Ie55021389d454a7e3631359cbd6a1504b6661317 Signed-off-by: dkhandel <dkhandel@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, https://review.gluster.org/#/c/20104/, https://review.gluster.org/#/c/20162/, https://review.gluster.org/#/c/20185/, and https://review.gluster.org/#/c/20207/ This patch changes uses of has_key() as suggested by the 2to3 utility. Note: Fedora packaging guidelines require explicit shebangs, so popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, idioms, numliterals, set_literal, types, urllib, zip, map, and raise have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, imports2, input, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Updates: #411 Change-Id: I79bda20f1583a0a1bb0320667498f4c137de93b3 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-06-074-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, and https://review.gluster.org/#/c/20104/ https://review.gluster.org/#/c/20162/ This patch changes uses of map() and raise(), and a few cases of print() that were overlooked in the prior patch that fixed print. Note: Fedora packaging guidelines require explicit shebangs, so popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, idioms, numliterals, set_literal, types, urllib, zip, map, and raise have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: Id62ea491e4ab5dd390075c5c6d9d889cf6f9da27 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-06-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/, https://review.gluster.org/#/c/19871/, https://review.gluster.org/#/c/19952/, and https://review.gluster.org/#/c/20104/ This patch changes uses of xrange() to range(), as suggested by the python 2to3 utility. https://www.geeksforgeeks.org/range-vs-xrange-python/ In Python 3, there is no xrange , but the range function behaves like xrange in Python 2. (My concern is that range() in python2 may behave differently until we "throw the switch" to switch to python3.) Note: Fedora packaging guidelines require explicit shebangs, so popular practices like #!/usr/bin/env python and #!/usr/bin/python are not allowed; they must be #!/usr/bin/python2 or #!/usr/bin/python3 Note: Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, idioms, numliterals, set_literal, types, urllib, and zip have already been applied. Also version agnostic imports for urllib, cpickle, socketserver, _thread, queue, etc., suggested by Aravinda in https://review.gluster.org/#/c/19767/1 Note: these 2to3 fixes report no changes are necessary: asserts, buffer, exec, execfile, exitfunc, filter, getcwdu, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Change-Id: I16ae9f4e3a4fd02a0623fb6f9fdb7aaf65f2a8a9 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-05-305-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | see https://review.gluster.org/#/c/19788/ and https://review.gluster.org/#/c/19871/ Selected small fixes from 2to3 utility. Specifically apply, basestring, funcattrs, idioms, numliterals, set_literal, types, urllib, zip Note: these 2to3 fixes report no changes are necessary: exec, execfile, exitfunc, filter, getcwdu, intern, itertools, metaclass, methodattrs, ne, next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr, standarderror, sys_exc, throw, tuple_params, xreadlines. Any 2to3 fixes not in the above two lists have more extensive changes which will follow in separate patches. most unicode changes suggested by 2to3 will need to be applied at the same time as changing the shebangs from python2 to python3. Prashanth notes that unicode strings in py2 need 'u' prefix; unicode strings in py3 3.0, 3.1, and 3.2 a 'u' prefix will throw an error, but in py3 3.3+ it is legal (or just ignored). All Linux dists we care about have 3.3 or later so we can leave 'u' prefixes on unicode strings. Change-Id: I49bba2f328b0ee24b9a8115a7183be979981563e updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* thin-arbiter : Provide scripts and service file to start thin-arbiter processAshish Pandey2018-05-304-66/+138
| | | | | | | | | | | | | | | | | | | | | 1 - setup-thin-arbiter.sh To setup directory path for thin-arbiter. This is the path where replica id file will be placed and used by TA process. By default it will be /mnt/thin-arbiter. It is better to use default path and once set it should not be changed. 2 - gluster-ta-volume.service This is the Unit file used by systemd to start and keep the thin-arbiter process running. 3 - thin-arbiter.vol This is the default volume file for thin-arbiter. It will be used to start thin-arbiter process. This should not be modified by user except the directory path which can be modified using [1]. Change-Id: I68f2164f24adfa326c1d1a7a98c6ac4ff04ed553 fixes: bz#1579786 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* Quota fsck scriptSanoj Unnikrishnan2018-05-291-0/+378
| | | | | | | | | | | | | | script can be used to for 3 purposes 1) Extract marker xattr from the backend with a crawl (for analysis) 2) Report anomalies in accounting by comparing stat based accounting with marker translator's accounting 3) Fix anomalies in the FS by marking the anamolous directories dirty and having them heal in a bottom up fashion over the directory tree. Change-Id: Ib4d4a6d1886d7332c80d5a93f7afccaa0f52ab58 fixes: #390 Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com> Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
* extras/create_new_xl : Fix the tool to accomodate the xl structure changesPoornima G2018-05-172-24/+100
| | | | | | Change-Id: I3524e62b0ed873c0763ca38f80fcd53b22ee79d1 fixes: bz#1577744 Signed-off-by: Poornima G <pgurusid@redhat.com>
* geo-rep/scheduler: Fix crashKotresh HR2018-05-141-35/+35
| | | | | | | | | | | | | | Fix crash where session_name is referenced before assignment. Well, this is a corner case where the geo-rep session exists and the status output doesn't show any rows. This might happen when glusterd is down or when the system is in inconsistent state w.r.t glusterd. fixes: bz#1576179 Change-Id: Iec1557e01b35068041b4b3c1aacee2bfa0e05873 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* extras/hooks: Do not blindly remove volume share from smb.confAnoop C S2018-05-073-9/+12
| | | | | | | | | | | | | | | | | When Gluster volumes are shared via Samba, any extra smb.conf parameter setting done by administrator to those shares are lost during restart of the volume. Instead of removing the whole share completely from smb.conf(via hook scripts during volume stop) it is better to make it temporarily unavailable to end-users till the volume is started again. Therefore we make use of a smb.conf parameter named 'available'[1] to achieve the above intend. [1] https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html Change-Id: I68a9055b50791f6ffd3b95a3c13d858a75fa6530 fixes: bz#1558921 BUG: 1558921 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* core/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-05-028-104/+113
| | | | | | | | | | see https://review.gluster.org/#/c/19788/ use print fn from __future__ Change-Id: If5075d8d9ca9641058fbc71df8a52aa35804cda4 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* block-profile: enable cluster.eager-lock in block-profilePrasanna Kumar Kalever2018-05-011-1/+1
| | | | | | | | | | | | | Eager-lock gave 2.5X perf improvement. On top of that with batching fix in tcmu-runner and client-io-threads we are seeing close to 3X perf improvement. But we don't want to include that in the default profile option but enable it on a case by case basis. So not adding client-io-threads option. BUG: 1573119 Fixes: bz#1573119 Change-Id: Ida53c3ef9a041a73b65fdd06158ac082da437206 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* feature/thin-arbiter: Implement thin-arbiter translatorAshish Pandey2018-04-251-0/+66
| | | | | | | Updates #352 Change-Id: I3d8caa6479dc8e48bec62a09b056971bb061f0cf Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* extras: Disable choose-local in groups virt and gluster-blockKrutika Dhananjay2018-04-132-0/+2
| | | | | | Change-Id: Icba68406d86623195d59d6ee668e0850c037c63a fixes: bz#1566386 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* core/build/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-04-1214-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note 1) we're not supposed to be using #!/usr/bin/env python, see https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Shebang_lines Note 2) we're also not supposed to be using "!/usr/bin/python, see https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out The previous patch (https://review.gluster.org/19767) tried to do too much in one patch, so it was abandoned. This patch does two things: 1) minor cleanup of configure(.ac) to explicitly use python2 2) change all the shebang lines to #!/usr/bin/python2 and add them where they were missing based on warnings emitted during rpmbuild. In a follow-up patch python2 will eventually be changed to python3. Before that python2-isms (e.g. print, string.join(), etc.) need to be converted to python3. Some of those can be rewritten in version agnostic python. E.g. print statements become print() with "from __future_ import print_function". The python 2to3 utility will be used for some of those. Also Aravinda has given guidance in the comments to the first patch for changes. updates: #411 Change-Id: I471730962b2526022115a1fc33629fb078b74338 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* ocf: use glusterd-workdir for finding volume status filesNiels de Vos2018-04-021-1/+1
| | | | | | | | | The volume status files are located in the glusterd-workdir, not under /etc (sysconfdir). BUG: 1234873 Change-Id: Id7f7c83261bb4b5ac2fc104dcd6cb198d6a930aa Signed-off-by: Niels de Vos <ndevos@redhat.com>
* extras/group: Change the server inode table size when upcall is onPoornima G2018-03-242-2/+2
| | | | | | | | | | | | | | | By default server inode table size is 16K, when upcall is enabled, there is going to be too many forgets sent on inodes as the brick can hold only 16K inodes in memory, so we increased this to 50K. This is still less than the client inode table size. We have seen performance improvement when server inode table size is set to 200000(almost as client inode table size). Hence changing the value to 200000. Increasing this increases the memory consumption by <1MB. BUG: 1559235 Change-Id: I931db965cd34bf33094328541bd5a633b3357805 Signed-off-by: Poornima G <pgurusid@redhat.com>
* hooks: fix workdir in S13create-subdir-mounts.shAtin Mukherjee2018-03-071-1/+1
| | | | | | Change-Id: Id3eff498091ad9fa4651e93b66903426e76776d6 BUG: 1549915 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* hooks: add a script to stat the subdirs in add-brickAmar Tumballi2018-03-062-2/+88
| | | | | | | | | | | | | | | | | | | | | | The subdirectories are expected to be present for a subdir mount to be successful. If not, the client_handshake() itself fails to succeed. When a volume is about to get mounted first time, this is easier to handle, as if the directory is not present in one brick, then its mostly not present in any other brick. In case of add-brick, the directory is not present in new brick, and there is no chance of healing it from the subdirectory mount, as in those clients, the subdir itself will be 'root' ('/') of the filesystem. Hence we need a volume mount to heal the directory before connections can succeed. This patch does take care of that by healing the directories which are expected to be mounted as subdirectories from the volume level mount point. Change-Id: I2c2ac7b7567fe209aaa720006d09b68584d0dd14 BUG: 1549915 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* build: add --without-server optionNiels de Vos2018-02-1912-6/+43
| | | | | | | | | | | | | | | | With Gluster 4.0 we will not provide the server components for EL6 and older. At one point Gluster 4.x will get GlusterD2, which requires Golang tools in the distribution. EL6 does not contain these at the moment. With this change, it is possible to `./configure --without-server` which prevents building glusterd and the xlators for the bricks. Building RPMs can pass `--without server` and the glusterfs-server sub-package will not be created. Change-Id: I97f5ccf9f2c76e60d9af83915fc59fae57ad6d25 BUG: 1074947 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* extras/hooks: Fix S10selinux-label-brick.sh hook scriptMilan Zink2018-01-311-28/+29
| | | | | | | | | | * script was failng due to syntax error * shellcheck issues fixed * improved performance: semanage & restorecon is being run on unique path Change-Id: I58b357d9fd37586004a2a518f7a5d1c5c9ddd7e3 BUG: 1533342 Signed-off-by: Milan Zink <zeten30@gmail.com>
* Fix disabled-quota-root-xattr-heal.sh hook scriptMilan Zink2018-01-301-73/+76
| | | | | | | | Fixing all shellchek warnings and POSIX incomapatibilities Change-Id: I35772bfcf7344c6ed9bd2a7db300c8f58bd3b243 BUG: 1500649 Signed-off-by: Milan Zink <zeten30@gmail.com>
* distributed-tests: Framework for running tests on a worker clusterkrad2018-01-186-0/+1153
| | | | | | | | | | | | Summary: This framework helps distribute running of unit tests on a cluster of machines. Test Plan: Run tests on fb cluster Reviewers: sshreyas, jdarcy Change-Id: If309f504d9aa959cc8b01c85bff3b5503a890ff1 updates #374 Signed-off-by: krad <krad@fb.com>
* tests: Enable geo-rep test casesKotresh HR2018-01-051-4/+11
| | | | | | | | | | | | | | | | | This patch re-enables the geo-rep test cases. Along with it does following optimizations. 1. Use EXPECT_WITHIN instead of sleep 2. Clean up geo-rep ssh key after test 3. Changes to gverify.sh and S56glusterd-geo-rep-create-post.sh to use the given ssh identity file for geo-rep create 4. Make gluster-command-dir configurable and introduce slave-gluster-command-dir which points the parent directory of gluster binaries in master and slave respectively. Change-Id: Ia7696278d9dd3ba04224dcd7c3564088ca970b04 BUG: 1480491 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* extras/devel-tools: Fix print-backtrace scriptPrashant D2017-11-261-2/+18
| | | | | | | | | | | | | | | Problem: If cpio version is less 2.11 then cpio command failing with unrecognised option --directory. Solution: Check the cpio version and run rpm2cpio/cpio with or without -D or --directory option. Fixes : #359 Change-Id: Ibd440207231807dab1b58291ab661857094f1a4a BUG: 1510874 Signed-off-by: Prashant D <pdhange@redhat.com>
* who-wrote-glusterfs: add an alias for potatogim@potatogim.netJi-Hyeon Gim2017-11-161-0/+1
| | | | | Change-Id: Ieb3d1910f0284bd951089c197abc569ae95e5bcd Signed-off-by: Ji-Hyeon Gim <potatogim@gluesys.com>
* who-wrote-glusterfs: add gluesys.com to domain-mapJi-Hyeon Gim2017-11-151-0/+1
| | | | | Change-Id: Idfc62026ca50aaf8767f093b4daefd7119564a1f Signed-off-by: Ji-Hyeon Gim <potatogim@gluesys.com>
* extras: scripts to control CPU/MEMORY for any gluster daemon during runtimeMohit Agrawal2017-11-133-1/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Sometime gluster daemons like glustershd can consume a lot of cpu and/ or memory if there is a large amount of data/ entries to be healed. Solution: Until we have some form of throttling/ QoS mechanisms built into gluster, we can use control groups for regulating cpu and memory of any gluster daemon using control-cpu-load.sh and control-mem.sh scripts respectively. Test: To test the control-cpu-load.sh script follow below procedure: 1) Setup distribute replica environment 2) Selfheal daemon off 3) Down one node from replica nodes 4) Create millions of files from mount point 5) Start down node 6) Check cpu usage for shd process in top command 7) Run script after provide shd pid with CPU quota value 8) Check again cpu usage for shd process in top command Note: control-mem.sh script can cap the memory usage of the process to the set limit, beyond which the process gets blocked. It resumes either when the memory usage comes down or if the limit is increased. BUG: 1496335 Change-Id: Id73c36b73ca600fa9f7905d84053d1e8633c996f Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* extras/hooks: Honour all input arguments to scriptsAnoop C S2017-10-314-28/+70
| | | | | | | | | | | | | | | | | Some of the hook scripts were not honouring the arguments with which they are invoked during various volume operations. So make sure that we consider everything while parsing the command line arguments to avoid following warnings: . . . ame: unrecognized option '--first=no' ame: unrecognized option '--version=1' ame: unrecognized option '--volume-op=start' . . . Change-Id: I5b08e5e7f32908c8509e97098a042096b507783e BUG: 1503983 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* snapshot/scheduler: handle the exception when SELinux is absentRishabh Dave2017-10-311-2/+7
| | | | | | | | | When SELinux is absent on an given system, snapshot_scheduler.py raises an exception; handle it and report it in the log. Change-Id: I21bc179e090d34f8061063e6d662521ee5046cce BUG: 1502253 Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
* extras/hooks: Fix getopt usageAnoop C S2017-10-309-9/+9
| | | | | | | | | | | | | | | | | | | | | | | `getopt` does not have an optional argument as '-name'. It should be either '-n' or '--name'(see man getopt(1)). This wrong usage resulted in setting the script name as 'ame' instead of $PROGNAME in most of the hook-scripts. Additionally the following line from DESCRIPTION given for `getopt` shell command expects short options for almost every kind of usage mentioned in SYNOPSIS: . . . If no '-o' or '--options' option is found in the first part, the first parameter of the second part is used as the short options string. . . . Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more clarity on its usage. Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce BUG: 1503983 Signed-off-by: Anoop C S <anoopcs@redhat.com>