summaryrefslogtreecommitdiffstats
path: root/cli/src
Commit message (Collapse)AuthorAgeFilesLines
* cli : fix coverity issue in cli-cmd-volume.cSunny Kumar2018-08-311-6/+6
| | | | | | | | This patch fixes 1389756. Change-Id: I72d4f618368545a5dcee0ca59fe87ba6137ab4a1 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: dereferencing null coverity fixSanju Rakonde2018-08-291-1/+1
| | | | | | | | | | CID: 1124489 https://scan6.coverity.com/reports.htm#v42375/p10714/fileInstanceId=85018660&defectInstanceId=25877775&mergedDefectId=577602 updates: bz#789278 Change-Id: I0ebfbc52ecd5e3b70574df5f286116f872514cc6 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli : fix coverity cli-rl.cSunny Kumar2018-08-271-1/+1
| | | | | | | | | | This fixes new coverity issue introduced by commit 5acb74d7da. Fixes 1395188. Change-Id: I629e5f214150672e309abb2fc58f55f1f58d8fb7 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* {cli-cmd-parser|cli-rpc-ops||cli-xml-output}.c: strncpy()->sprintf(), reduce ↵Yaniv Kaul2018-08-243-24/+31
| | | | | | | | | | | | | | | | | | | | | | strlen()'s strncpy may not be very efficient for short strings copied into a large buffer: If the length of src is less than n, strncpy() writes additional null bytes to dest to ensure that a total of n bytes are written. Instead, use snprintf(). Also: - save the result of strlen() and re-use it when possible. - move from GF_CALLOC() to GF_MALLOC() for the strings. - move from strlen to sizeof() for const strings. Compile-tested only! Change-Id: I3cf49c5401ee100a5db6a4954c3d699ec1814c17 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cli : fix few coverity in cliSunny Kumar2018-08-242-4/+6
| | | | | | | | | | This patch fixes DEADCODE and FORWARD_NULL. CID : 1124495, 1124380, 1124381 Change-Id: I79992e396dbcb1bfe6cd0614d49a8da3f67d648d updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli/src/cli-cmd-parser.c:move to GF_MALLOC() instead of GF_CALLOC() whenYaniv Kaul2018-08-231-1/+1
| | | | | | | | | | | | | | | | It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! Change-Id: I01c67fd535ea4a2b8fa7cb4d89bff52642dc009a updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cli: Fix invalid access of option_str variableShyamsundarR2018-08-201-2/+7
| | | | | | | | | | | | | | | | | | In function cli_cmd_volume_statedump_options_parse if the wordcount of arguments is exactly 3, then option_str would remain NULL, and hence the function will generate a segmentation fault on the strstr check in its body. This can be triggered when we run the command, `gluster volume statedump <volname>` The fix is to check if option_str is non-NULL before use and also to pass in a duplicated empty string to the dict key "options" when this is NULL. Fixes: bz#1619423 Change-Id: Ic029ab60b64890d92c7a0876a638929495d3aa59 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* build: use standard PKG_CHECK_MODULES for libxml2 availabilityNiels de Vos2018-08-161-3/+2
| | | | | | | | | | | | | In case the development parts of libxml2 are not installed, it was required to re-run ./autogen.sh to cleanup the cached values for the check. This is not nice towards users. By using the standard PKG_CHECK_MODULES for libxml-2.0 the results of the check are not cached and will be probed again when running ./configure. Change-Id: I3c4586e5555a521be5d4fb61bdb873ae0317311a Fixes: bz#1599219 Reported-by: Sachidananda Urs <surs@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com>
* All: remove memset() before sprintf()Yaniv Kaul2018-08-144-327/+26
| | | | | | | | | | | | It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* build: rename event.h to gf-event.hNiels de Vos2018-07-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Newer FreeBSD versions (noticed with 10.3-RELEASE) provide a event.h file that on occasion gets included instead of the libglusterfs file. When this happens, 'struct event_pool' will not be defined and building will fail with errors like: autoscale-threads.c:18:55: error: incomplete definition of type 'struct event_pool' int thread_count = pool->eventthreadcount; ~~~~^ autoscale-threads.c:17:16: note: forward declaration of 'struct event_pool' struct event_pool *pool = ctx->event_pool; ^ This problem is caused by 'pkg-config --cflags uuid' that adds /usr/local/include to the GF_CPPFLAGS. The use of libuuid is preferred so that the contrib/uuid/ directory can be removed. By renaming event.h to gf-event.h there is no conflict between the different event.h files anymore and compiling on FreeBSD works without issues. Change-Id: Ie69f6b8a4f8f8e9630d39a86693eb74674f0f763 Updates: bz#1607319 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-224-6/+6
| | | | | | | | | | | | 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>
* Fix compile warningsXavi Hernandez2018-07-101-5/+5
| | | | | | | | | | | This patch fixes compile warnings that appear with newer compilers. The solution applied is only to remove the warnings, but it doesn't always solve the problem in the best way. It assumes that the problem will never happen, as the previous code assumed. Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* cli: change volume create syntax of arbiter volumeAmar Tumballi2018-07-031-25/+31
| | | | | | | fixes: bz#1596524 updates: gluster/glusterd2#515 Change-Id: I8a46fa2fd1fd2b0e9fbcecd3bb18d348aed9c6a9 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd: glusterd is releasing the locks before timeoutSanju Rakonde2018-05-281-0/+22
| | | | | | | | | | | | | | | | | | | Problem: We introduced lock timer in mgmt v3, which will realease the lock after 3 minutes from command execution. Some commands related to heal/profile will take more time to execute. For these comands timeout is set to 10 minutes. As the lock timer is set to 3 minutes glusterd is releasing the lock after 3 minutes. That means locks are released before the command is completed its execution. Solution: Pass a timeout parameter from cli to glusterd, when there is a change in default timeout value(i.e, default timeout value can be changed through command line or for the commands related to profile/heal we will change the default timeout value to 10 minutes.) glusterd will set the lock timer timeout according to the timeout value passed. Change-Id: I7b7a9a4f95ed44aca39ef9d9907f546bca99c69d fixes: bz#1577731 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli: Fix for gluster volume info --xmlSanju Rakonde2018-05-151-2/+2
| | | | | | | | | | | | Problem: gluster volume info --xml is showing same uuid to all the bricks of a tier volume. Solution: While iterating over hot/cold bricks of a tier volume, use correct iterator. Fixes: bz#1577627 Change-Id: Icf6a9c2a10b9da453abc262a57b7884d6638e3ed Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli/snapshot: ignore errors for snapshot status for ALL/VOLThomas Hindoe Paaboel Andersen2018-05-041-1/+1
| | | | | | | | | | | | | | | | | Currently errors are reported for snapshot status of type ALL and VOL. The intention was to ignore those, but the code gets it wrong. The original condition for ignoring ALL/VOL was removed in Bug 1096610 Change-Id Ifc0ac31d2a9f91e136e87f3b51a629df7dba94e8 And the current logic introduced in Bug 789278 Change-Id I985cea1ef787d239b2632d5a7f467070846f92e4 Change-Id: Ic02ea98fb23b1149264e91b41f2fc2ca916d405f Fixes: bz#1574259 Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
* cli/glusterd: Add warning message in cli for user to checkSusant Palai2018-05-033-8/+26
| | | | | | | | | | | | | | | | | | | | force-migration config for remove-brick operation. The cli will take input from the user before starting "remove-brick" start operation. The message/confirmation looks like the following: <Running remove-brick with cluster.force-migration enabled can result in data corruption. It is safer to disable this option so that files that receive writes during migration are not migrated. Files that are not migrated can then be manually copied after the remove-brick commit operation. Do you want to continue with your current cluster.force-migration settings? (y/n)> And also question for COMMIT_FORCE is changed. Fixes: bz#1572586 Change-Id: Ifdb6b108a646f50339dd196d6e65962864635139 Signed-off-by: Susant Palai <spalai@redhat.com>
* Make glusterfsd binary print statedump & xlator dirPrashanth Pai2018-04-192-7/+0
| | | | | | | | | | | | | | | | | | | | | | | The glusterd2 needs following options, some of which are provided by gluster CLI today: --print-xlatordir --print-statedumpdir --print-logdir However, the CLI package need not be present on the machine running glusterd2. This change adds the above CLI options to glusterfsd binary which glusterd2 depends on. Reverts 9a1ae47c8d60836ae0628a04a153f28c1085c0e8 Related changes: https://review.gluster.org/#/c/19882/ https://github.com/gluster/glusterd2/pull/663 Updates: bz#1193929 Change-Id: I18c123b0d3350d2bd4f2400783e3b94e402a4e29 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* Add CLI option to print XLATORDIRPrashanth Pai2018-04-182-0/+7
| | | | | | | | | | | | | | | | | | glusterfs gets the path to xlator dir from a compile time flag named XLATORDIR which gets passed through a -D flag to GCC. This path is used to find and load xlator shared objects. The XLATORDIR path isn't easily accessible to glusterd2. Glusterd2 currently uses the following command (hack) to get value of XLATORDIR: $ strings -d `which glusterfsd` | awk '/glusterfs/*/xlator$/' This change introduces "print-xlatordir" CLI option to expose XLATORDIR. The option is intentionally not documented. Updates: bz#1193929 Change-Id: Ic7247457600f11cd8d68eb3d0ad2526fdfda0b02 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* glusterd: TLS verification fails while using intermediate CAMohit Agrawal2018-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | Problem: TLS verification fails while using intermediate CA if mgmt SSL is enabled. Solution: There are two main issue of TLS verification failing 1) not calling ssl_api to set cert_depth 2) The current code does not allow to set certificate depth while MGMT SSL is enabled. After apply this patch to set certificate depth user need to set parameter option transport.socket.ssl-cert-depth <depth> in /var/lib/glusterd/secure_acccess instead to set in /etc/glusterfs/glusterd.vol. At the time of set secure_mgmt in ctx we will check the value of cert-depth and save the value of cert-depth in ctx.If user does not provide any value in cert-depth in that case it will consider default value is 1 BUG: 1555154 Change-Id: I89e9a9e1026e37efb5c20f9ec62b1989ef644f35 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* build: add --without-server optionNiels de Vos2018-02-191-0/+2
| | | | | | | | | | | | | | | | 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>
* bitrot : improved cli report after bitrot operatoinSunny Kumar2018-02-011-0/+57
| | | | | | | | | | Improved cli report post bitrot opertaion as previously it was showing output "volume bitrot: success" for all the sucessfull bitrot operations (enable, disable or scrub options). Change-Id: I0857e99f3956221a51cfd1b29a90e1038b90570f BUG: 1539166 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: Fixed a use_after_freeN Balachandran2018-01-041-1/+2
| | | | | | | | | gf_event in cli_cmd_volume_create_cbk was accessing memory that had already been freed. Change-Id: I447c939fa9b31e18819a62c3b356c14cca390787 BUG: 1530910 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cli: Fixed coverity issue in cli-cmd-system.cXavier Hernandez2017-12-201-1/+22
| | | | | | | | | | | This patch adds a missing check of the return value of strtok_r() and returns an error if it's NULL. It also fixes a couple of leaks. Change-Id: Ib15d6f843516e44c3bd8790a2e3ad936e357f6d4 BUG: 789278 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* libglusterfs: specify ctx in gf_log_set_loglevelZhang Huan2017-12-061-2/+2
| | | | | | | | | specify ctx in gf_log_set_loglevel, instead of getting it from a thread specific variable. Change-Id: I498f826e8e32231235a6b0005026a27c327727fd BUG: 1521213 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* cli: Fix coverity errors for cli-rpc-ops.cKaushal M2017-11-211-34/+106
| | | | | | | | | | | | | Fixes issues 147, 168, 169, 219, 715, 718, 766, 768, 772, 774, 776, 782, 790 from the report at [1]. Also, fixed some other possible static checker errors as well. [1]: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ BUG: 789278 Change-Id: I985cea1ef787d239b2632d5a7f467070846f92e4 Signed-off-by: Kaushal M <kaushal@redhat.com>
* cli: Fix coverity issues in cli.cMohammed Rafi KC2017-11-081-1/+0
| | | | | | | | This patch fixes coverity issue 536 BUG: 789278 Change-Id: I9fe7b324a3ab1f16b4ee4e63818f93ef71d3405a Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* cli: Fix several coverity issues in cli-cmd-parser.cXavier Hernandez2017-11-071-99/+173
| | | | | | | | | | | | | | This patch fixes coverity issues 115, 191, 274, 462, 463, 508, 588, 612, 614, 618 and 698 from [1]. Also removed the need for some relatively big arrays as local variables of some functions. [1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I4f435dbdbedc1b6de067084cce3050b620b28391 BUG: 789278 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* cli: correct rebalance status elapsed checkN Balachandran2017-11-071-1/+5
| | | | | | | | | Check that elapsed time has crossed 10 mins for at least one rebalance process before displaying the estimates. Change-Id: Ib357a6f0d0125a178e94ede1e31514fdc6ce3593 BUG: 1479528 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cli: Fix several coverity issues in cli-cmd-volume.cXavier Hernandez2017-11-031-5/+4
| | | | | | | | | | This patch fixes issues 133, 486, 487 and 691 from [1] [1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I1a6ca4870ac105ea4c634fc18293229a56ab8596 BUG: 789278 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* cli: Fixed coverity issue in cli-cmd-snapshot.cXavier Hernandez2017-11-021-4/+0
| | | | | | | | | | This patch fixes issue 132 from [1]. [1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I50952614e7edb6dbb1ec70383f1dc58ce1738c2f BUG: 789278 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* cli: gluster help changesN Balachandran2017-11-027-76/+387
| | | | | | | | | | gluster cli help now shows only the top level help commands. gluster <component> help will now show help commands for <component>. Change-Id: I263f53a0870d80ef4cfaad455fdaa47e2ac4423b BUG: 1474768 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* gluster: IPv6 single stack supportKevin Vigor2017-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: - This diff changes all locations in the code to prefer inet6 family instead of inet. This will allow change GlusterFS to operate via IPv6 instead of IPv4 for all internal operations while still being able to serve (FUSE or NFS) clients via IPv4. - The changes apply to NFS as well. - This diff ports D1892990, D1897341 & D1896522 to the 3.8 branch. Test Plan: Prove tests! Reviewers: dph, rwareing Signed-off-by: Shreyas Siravara <sshreyas@fb.com> Change-Id: I34fdaaeb33c194782255625e00616faf75d60c33 BUG: 1406898 Reviewed-on-3.8-fb: http://review.gluster.org/16059 Reviewed-by: Shreyas Siravara <sshreyas@fb.com> Tested-by: Shreyas Siravara <sshreyas@fb.com>
* geo-rep/scheduler: Add validation for session existenceKotresh HR2017-10-061-1/+1
| | | | | | | | | Added validation to check for session existence to give out proper error message out. Change-Id: I13c5f6ef29c1395cff092a14e1bd2c197a39f058 BUG: 1499159 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cli/afr: gluster volume heal info "healed" command output is not appropriateMohit Agrawal2017-10-043-17/+8
| | | | | | | | | | | | | | | | | | | | | | | | Problem: "gluster volume heal info [healed] [heal-failed]" command output on terminal is not appropriate in case of down any volume. Solution: To make message more appropriate change the condition in function "gd_syncop_mgmt_brick_op". Test : To verify the fix followed below procedure 1) Create 2*3 distribute replicate volume 2) set self-heal daemon off 3) kill two bricks (3, 6) 4) create some file on mount point 5) bring brick 3,6 up 6) kill other two brick (2 and 4) 7) make self heal daemon on 8) run "gluster v heal <vol-name>" Note: After apply the patch options (healed | heal-failed) will deprecate from command line. BUG: 1388509 Change-Id: I229c320c9caeb2525c76b78b44a53a64b088545a Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* cli: fix Coverity warning DEADCODE in gf_cli_attach_tier()Mohammed Azhar Padariyakam2017-09-291-3/+0
| | | | | | | | | | | | | | | Issue : At condition "ret", the value of "ret" must be equal to 0. The condition "ret" cannot be true since the value is always 0. Hence, the execution cannot reach the statement "goto out" Solution : The never-true if-condition and its body has to be removed Fix : The always false if-condition and the dead code under this if-condition was removed. Change-Id: I5c038b8ec9abf9b2f06dcfd981904b9dca1a0094 BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam <mpadariy@redhat.com>
* stack.h:PW.INCLUDE_RECURSIONSanju Rakonde2017-09-291-1/+0
| | | | | | | | | | | | | | | | | | | The headerfile globals.h is recursively adding itself. ( globals.h -> xlator.h -> stack.h -> globals.h). We are finding the source files which are including the header file globals.h and removing the inclusion line. I used git grep -l stack.h | xargs git grep globals.h -- to find out the files and removed the header file from all files except libglusterfs/src/xlator.h and libglusterfs/src/Makefile.am When I try to remove header file from libglusterfs/src/xlator.h I'm getting some errors. In libglusterfs/src/Makefile.am it is required for building RPMs. Change-Id: I537218c09ade6d7ea51717768b26563a247daf60 BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli: Bypass the confirmation question creating replica 2 volume with forcekarthik-us2017-09-211-13/+17
| | | | | | | | | | | When a replica 2 volume is created with the force option, remove the warning message with the confirmation question, whether they want to continue or not and Succeed the volume creation. Change-Id: I4f3306659fa4cbf53dd8d45269a32d19ce86ac88 BUG: 1493893 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* events : Add brick list in EVENT_VOLUME_CREATEAtin Mukherjee2017-09-183-5/+8
| | | | | | | | | | | Change-Id: Ibf87ae5ca57f9d27c036f329a30c8f81b51c52bf BUG: 1492109 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/18306 Reviewed-by: Prashanth Pai <ppai@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* heal: New feature heal info summary to list the status of brick and count of ↵Mohamed Ashiq Liyazudeen2017-09-153-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entries to be healed Command output: Brick 192.168.2.8:/brick/1 Status: Connected Total Number of entries: 363 Number of entries in heal pending: 362 Number of entries in split-brain: 0 Number of entries possibly healing: 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <healInfo> <bricks> <brick hostUuid="9105dd4b-eca8-4fdb-85b2-b81cdf77eda3"> <name>192.168.2.8:/brick/1</name> <status>Connected</status> <totalNumberOfEntries>363</numberOfEntries> <numberOfEntriesInHealPending>362</numberOfEntriesInHealPending> <numberOfEntriesInSplitBrain>0</numberOfEntriesInSplitBrain> <numberOfEntriesPossiblyHealing>1</numberOfEntriesPossiblyHealing> </brick> </bricks> </healInfo> <opRet>0</opRet> <opErrno>0</opErrno> <opErrstr/> </cliOutput> Change-Id: I40cb6f77a14131c9e41b292f4901b41a228863d7 BUG: 1261463 Signed-off-by: Mohamed Ashiq Liyazudeen <mliyazud@redhat.com> Reviewed-on: https://review.gluster.org/12154 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Karthik U S <ksubrahm@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* Use the new URL for the docsMichael Scherer2017-09-071-1/+1
| | | | | | | | | | | | | Change-Id: I0ef5c3980aed24a9fa2dda673f8293771ce81808 BUG: 1487644 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/18182 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Nigel Babu <nigelb@redhat.com> Tested-by: Nigel Babu <nigelb@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Tested-by: Michael Scherer <misc@fedoraproject.org> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* Command to identify client processhari gowtham2017-09-063-2/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command: gluster volume status <volname/all> client-list output: Client connections for volume v1 Name count ----- ------ fuse 2 tierd 1 total clients for volume v1 : 3 ----------------------------------------------------------------- Client connections for volume v2 Name count ----- ------ tierd 1 fuse.gsync 1 total clients for volume v2 : 2 ----------------------------------------------------------------- Updates: #178 Change-Id: I0ff2579d6adf57cc0d3bd0161a2ec6ac6c4747c0 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: https://review.gluster.org/18095 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: hari gowtham <hari.gowtham005@gmail.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: Add geo-replication session details to get-state outputSamikshan Bairagya2017-08-041-33/+0
| | | | | | | | | | | | | | | This commit adds support to the get-state CLI to capture details on geo-replication session as obtained in `gluster volume geo-replication status detail` in its output. Fixes: #291 Change-Id: I2fbcba70bfdaf439522637234805545194777ed4 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17941 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* tier: separation of attach-tier from add-brickhari gowtham2017-08-012-3/+89
| | | | | | | | | | | | | | | | | | PROBLEM: Both attach tier and add brick have the same RPC and set of code. This becomes a hurdle while tring to implement add brick on a tiered volume. FIX: This patch separates the add brick and attach tier giving them separate RPCs. Change-Id: Iec57e972be968a9ff00b15b507e56a4f6dc398a2 BUG: 1376326 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: https://review.gluster.org/15503 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: hari gowtham <hari.gowtham005@gmail.com> Reviewed-by: Samikshan Bairagya <samikshan@gmail.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* cli: error out incomplete CLI commandsAtin Mukherjee2017-07-263-8/+21
| | | | | | | | | | | | | | | | cli_cmd_bricks_parse () & cli_cmd_volume_remove_brick_parse () were not handling the the error cases where the command is incomplete with missing brick details which could lead to glusterd crashes. Credit : george.lian@nokia.com Change-Id: Ia6303457a2aa279465aa75d4e1cfcc948893d5de BUG: 1396327 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17870 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
* cluster/dht: Fix negative rebalance estimatesN Balachandran2017-07-261-27/+59
| | | | | | | | | | | | | | | | The calculation of the rebalance estimates will start after the rebalance operation has been running for 10 minutes. This patch also changes the cli rebalance status code to use unsigned variables for the time calculations. Change-Id: Ic76f517c59ad938a407f1cf5e3b9add571690a6c BUG: 1457985 Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: https://review.gluster.org/17863 Reviewed-by: Amar Tumballi <amarts@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* glusterd: Add option to get all volume options through get-state CLISamikshan Bairagya2017-07-252-9/+21
| | | | | | | | | | | | | | | | | | | | This commit makes the get-state CLI capable to returning the values for all volume options for all volumes. This is similar to what you get when you issue a `gluster volume get <volname> all` command. This is the new usage for the get-state CLI: # gluster get-state [<daemon>] [[odir </path/to/output/dir/>] \ [file <filename>]] [detail|volumeoptions] Fixes: #277 Change-Id: Ice52d936a5a389c6fa0ba5ab32416a65cdfde46d Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17858 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Gaurav Yadav <gyadav@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org>
* mem-pool: initialize pthread_key_t pool_key in mem_pool_init_early()Niels de Vos2017-07-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not possible to call pthread_key_delete for the pool_key that is intialized in the constructor for the memory pools. This makes it difficult to do a full cleanup of all the resources in mem_pools_fini(). For this, the initialization of pool_key should be moved to mem_pool_init(). However, the glusterfsd binary has a rather complex initialization procedure. The memory pools need to get initialized partially to get mem_get() functionality working. But, the pool_sweeper thread can get killed in case it is started before glusterfsd deamonizes. In order to solve this, mem_pools_init() is split into two pieces: 1. mem_pools_init_early() for initializing the basic structures 2. mem_pools_init_late() to start the pool_sweeper thread With the split of mem_pools_init(), and placing the pthread_key_create() in mem_pools_init_early(), it is now possible to correctly cleanup the pool_key with pthread_key_delete() in mem_pools_fini(). It seems that there was no memory pool initialization in the CLI. This has been added as well now. Without it, the CLI will not be able to call mem_get() successfully which results in a hang of the process. Change-Id: I1de0153dfe600fd79eac7468cc070e4bd35e71dd BUG: 1470170 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: https://review.gluster.org/17779 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
* cli/xml: fix return handlingAtin Mukherjee2017-07-061-40/+52
| | | | | | | | | | | | | | | | | | | | The return code of xmlTextWriter* APIs says it returns either the bytes written (may be 0 because of buffering) or -1 in case of error. Now if the volume of the xml data payload is not huge then most of the time the data to be written gets buffered, however when this grows sometimes this APIs will return the total number of bytes written and then it becomes absolutely mandatory that every such call is followed by XML_RET_CHECK_AND_GOTO otherwise we may end up returning a non zero ret code which would result into the overall xml generation to fail. Change-Id: I02ee7076e1d8c26cf654d3dc3e77b1eb17cbdab0 BUG: 1467841 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17702 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Gaurav Yadav <gyadav@redhat.com>
* cli: add 'all' option in gluster v get cli usageAtin Mukherjee2017-06-061-1/+3
| | | | | | | | | | | Change-Id: If216b13b7f9072f875eb2c5019d3b50b8bf3313e BUG: 1458582 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17460 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Samikshan Bairagya <samikshan@gmail.com>