summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
Commit message (Collapse)AuthorAgeFilesLines
* cli: defer create_frame() (and dict creation) to later stages.Yaniv Kaul2019-07-161-110/+144
| | | | | | | | | Where possible, defer create_frame() - whenever possible, after command line verification, for example. Change-Id: Id6606e90e7ea6190f30b225c4733b229c519bb2f updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* Removing one top command from gluster v helpkshithijiyer2019-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The current help show 2 different top commands intead of one single top command which can be easily observed when "# gluster v help" command is issued. Removing one "volume top <VOLNAME>" and clubbing into them into a single command. Current help: volume top <VOLNAME> {open|read|write|opendir|readdir|clear} [nfs|brick <brick>] [list-cnt <value>] | volume top <VOLNAME> {read-perf|write-perf} [bs <size> count <count>] [brick <brick>] [list-cnt <value>] - volume top operations Expected help: volume top <VOLNAME> {open|read|write|opendir|readdir|clear} [nfs|brick <brick>] [list-cnt <value>] | {read-perf|write-perf} [bs <size> count <count>] [brick <brick>] [list-cnt <value>] - volume top operations fixes: bz#1725034 Change-Id: Ifbc4c95f2558286e27dfc5e9667046b80eb1715d Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* glusterd/thin-arbiter: Thin-arbiter integration with GD1Vishal Pandey2019-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | gluster volume create <VOLNAME> replica 2 thin-arbiter 1 <host1>:<brick1> <host2>:<brick2> <thin-arbiter-host>:<path-to-store-replica-id-file> [force] The changes have been made in a way that the last brick in the bricks list will be treated as the thin-arbiter. GD1 will be manipulated to consider replica count to be as 2 and continue creating the volume like any other replica 2 volume but since thin-arbiter volumes need ta-brick client xlator entries for each subvolume in fuse volfile, volfile generation is modified in a way to inject these entries seperately in the volfile for every subvolume. Few more additions - 1- Save the volinfo with new fields ta_bricks list and thin_arbiter_count. 2- Introduce a new option client.ta-brick-port to add remote-port to ta-brick xlator entry in fuse volfiles. The option can be set using the following CLI syntax - gluster volume set <VOLNAME> client.ta-brick-port <PORTNO.> 3- Volume Info will contain a Thin-Arbiter-path entry to distinguish from other replicate volumes. Change-Id: Ib434e2313b29716f32476c6c211d282c4ef39406 Updates #687 Signed-off-by: Vishal Pandey <vpandey@redhat.com>
* Adding white spaces to description of set group.kshithijiyer2019-06-251-4/+4
| | | | | | | | | | | | | | | | | | | | The description of set group is missing spaces which leads to the description look like: volume set <VOLNAME> group <GROUP> - This option can be used for setting multiple pre-defined volume optionswhere group_name is a file under /var/lib/glusterd/groups containing onekey, value pair per line Instead of: volume set <VOLNAME> group <GROUP> - This option can be used for setting multiple pre-defined volume options where group_name is a file under /var/lib/glusterd/groups containing one key value pair per line Fixes: bz#1723455 Change-Id: I4957988c0c1f35f043db3f64089c049193e60e8f Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* cli: Remove-brick warning seems unnecessaryShwetha K Acharya2019-06-121-8/+9
| | | | | | | | | | | As force-migration option is disabled by default, the warning seems unnessary. Rephrased the warning to make best sense out of it. fixes: bz#1712668 Change-Id: Ia18c3c5e7b3fec808fce2194ca0504a837708822 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* geo-rep: Geo-rep help text issueShwetha K Acharya2019-05-231-2/+2
| | | | | | | | | Modified Geo-rep help text for better sanity. fixes: bz#1652887 Change-Id: I40ef7ef709eaecf0125ab4b4a7517e2c5d1ef4a0 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* cli: Validate invalid slave urlKotresh HR2019-05-111-2/+8
| | | | | | | | | This patch validates the invalid slave url in cli itself and throws appropriate error. fixes: bz#1098991 Change-Id: I278e2a04a4d619d2c2d1db0dd56ab5bdf7e7f469 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* tier/cli: remove tier code to increase code coverage in cliSanju Rakonde2019-04-251-413/+1
| | | | | | Change-Id: I56cc09243dab23b3be86a7faac45001dda77181f updates: bz#1693692 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Multiple files: remove HAVE_BD_XLATOR related code.Yaniv Kaul2019-03-251-3/+0
| | | | | | | | | | | | The BD translator was removed some time ago, (in commit a907e468e724c32b9833ce59806fc215c7122d63). This completes the work. Compile-tested only! updates: bz#1635688 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I999df52e479a72d3cc9523f22f9056de17eb559c
* cli : fix mem leak during cli_cmd_volume_gsync_set_cbkSunny Kumar2019-02-191-20/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes mem-leak due to excessive use of gf_asprintf to form dynamic growing string. Problem: each call to asprintf/vsprintf for extending existing string causes a memory leak, because the blob at the original address of existing string is not freed and a new location is generated by asprintf. Tracebacks: #2 0x7fdf191b8b3b in gf_vasprintf ../libglusterfs/src/mem-pool.c:236 #3 0x7fdf191b8d0a in gf_asprintf ../libglusterfs/src/mem-pool.c:256 #4 0x420cd3 in cli_cmd_volume_gsync_set_cbk ../cli/src/cli-cmd-volume.c:2576 SUMMARY: AddressSanitizer: 255 byte(s) leaked in 3 allocation(s). .... SUMMARY: AddressSanitizer: 431 byte(s) leaked in 4 allocation(s). .... SUMMARY: AddressSanitizer: 449 byte(s) leaked in 4 allocation(s). .... SUMMARY: AddressSanitizer: 397 byte(s) leaked in 4 allocation(s). .... SUMMARY: AddressSanitizer: 160 byte(s) leaked in 2 allocation(s). .... updates: bz#1633930 Change-Id: I7e8902f0ed23e640dc17e3dcbdab7ae0579d2dc6 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: Added the group option for volume setRinku Kothiya2019-02-041-0/+5
| | | | | | | | | | | gluster volume set <VOLUME> group <GROUP> is used for setting multiple pre-defined volume options, but this was undocumented. This patch doc- ments this feature. fixes: bz#1243991 Change-Id: Id346cf2537f85179caff32479f09555ce2e72e76 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* libglusterfs/src/mem-types.h: remove unused common enums from mem-types.hYaniv Kaul2018-12-301-8/+1
| | | | | | | | | | | | | | | | | They were not used at all, just taking space. I've also marked all those that are not common really, but used in just one place - they probably should move there (in follow-up patches) As a test, I've removed from the stripe xlator unused private enums and moved one that was in the common list, but only used in the stripe code, to be a private enum. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I1158dc1d259f1fd3f69904336c46c9d83cea799f
* cli: variable-length array declaration clang fixSheetal Pamecha2018-12-141-2/+5
| | | | | | | | | | | Problem: Declared variable-length array can have zero size Added a goto statement to address this issue. Updates: bz#1622665 Change-Id: Ibf80643490367a5f7e50f66f87e4296380be45de Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* cli : fix memory leak in cli-cmd-volume.cSunny Kumar2018-12-101-6/+6
| | | | | | | | | | | | | | | | | | | This patch fixes ememory leak reported by ASan. Tracebacks: Direct leak of 84 byte(s) in 1 object(s) allocated from: #0 0x7f71ea107848 in __interceptor_malloc (/lib64/libasan.so.5+0xef848) #1 0x7f71e9e2ac49 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 #2 0x7f71e9e2b4bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236 #3 0x7f71e9e2b68a in gf_asprintf ./libglusterfs/src/mem-pool.c:256 #4 0x41e8ec in cli_cmd_bitrot_cbk ./cli/src/cli-cmd-volume.c:1847 #5 0x410b39 in cli_cmd_process ./cli/src/cli-cmd.c:137 #6 0x40fe9d in cli_batch ./cli/src/input.c:29 #7 0x7f71e989558d in start_thread (/lib64/libpthread.so.0+0x858d) updates: bz#1633930 Change-Id: I8977e45add742e67047291f398f0ee79eb09afe4 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: fix a memory leak reported by ASan.Rinku Kothiya2018-12-061-0/+2
| | | | | | | | | | | Fixed a leak in cli_cmd_volume_remove_brick_cbk. SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 8 allocation(s) updates: bz#1633930 Credits: Mohit Agrawal Change-Id: Idb59c3880329fde59c415c84d7f0bb09ae879a1a Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* cli: Fix mem-leaks reported by ASANKotresh HR2018-12-061-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracebacks: Direct leak of 96 byte(s) in 1 object(s) allocated from: #0 0x7f3acf9eac48 in malloc (/lib64/libasan.so.5+0xeec48) #1 0x7f3acf510949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 #2 0x7f3acf5111bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236 #3 0x7f3acf51138a in gf_asprintf ./libglusterfs/src/mem-pool.c:256 #4 0x421611 in cli_cmd_volume_set_cbk ./cli/src/cli-cmd-volume.c:868 #5 0x410599 in cli_cmd_process ./cli/src/cli-cmd.c:135 #6 0x40f90d in cli_batch ./cli/src/input.c:29 #7 0x7f3acd78c593 in start_thread pthread_create.c:463 Direct leak of 73 byte(s) in 1 object(s) allocated from: #0 0x7f3acf9eac48 in malloc (/lib64/libasan.so.5+0xeec48) #1 0x7f3acf510949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 #2 0x421519 in gf_strndup ../../libglusterfs/src/mem-pool.h:167 #3 0x421519 in gf_strdup ../../libglusterfs/src/mem-pool.h:184 #4 0x421519 in cli_cmd_volume_set_cbk cli/src/cli-cmd-volume.c:859 #5 0x410599 in cli_cmd_process cli/src/cli-cmd.c:135 #6 0x40f90d in cli_batch cli/src/input.c:29 #7 0x7f3acd78c593 in start_thread pthread_create.c:463 Change-Id: I3312751c1e3178672360a678fe15b1f7f1054b22 updates: bz#1633930 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cli: memory leak issue reported by asanRinku Kothiya2018-12-051-0/+2
| | | | | | | | | | This patch fixes dict leak in cli_cmd_volume_stop_cbk. SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s) Credits: Mohit Agrawal Change-Id: If14983b8588e68d16d6bbb04b87e2f06fb97023d fixes: bz#1633930 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* libglusterfs: Move devel headers under glusterfs directoryShyamsundarR2018-12-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | libglusterfs devel package headers are referenced in code using include semantics for a program, this while it works can be better especially when dealing with out of tree xlator builds or in general out of tree devel package usage. Towards this, the following changes are done, - moved all devel headers under a glusterfs directory - Included these headers using system header notation <> in all code outside of libglusterfs - Included these headers using own program notation "" within libglusterfs This change although big, is just moving around the headers and making it correct when including these headers from other sources. This helps us correctly include libglusterfs includes without namespace conflicts. Change-Id: Id2a98854e671a7ee5d73be44da5ba1a74252423b Updates: bz#1193929 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* cli: memory leak issue reported by asanHarpreet kaur2018-12-051-0/+4
| | | | | | | | | | | | This patch fixes Indirect leaks in cli-cmd-volume.c Leaks are happening in cli_cmd_quota_cbk and cli_cmd_quota_handle_list_all. SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 8 allocation(s) Updates: bz#1633930 Change-Id: Ia6c0306e88bd81f74d1220303ead8095fbcf5623 Signed-off-by: Harpreet kaur <hlalwani@redhat.com>
* cli: memory leak issue reported by asanHarpreet Lalwani2018-12-031-0/+3
| | | | | | | | | | | This patch fixes Indirect leaks in tests/bugs/heal-symlinks.t. Leaks are happening in cli_cmd_volume_heal_cbk. SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s). Updates: bz#1633930 Change-Id: I970b4229630fdaf01aec66581c1287beef7560a3 Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* geo-rep: Geo-rep help text issueShwetha K Acharya2018-11-271-4/+6
| | | | | | | | Modified Geo-rep help text for better sanity. Change-Id: I48f4d0fd60c1ffcde753b37416e0c73afd0b5702 fixes: bz#1652887 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* glfsheal: add a '--nolog' flagRavishankar N2018-11-261-3/+5
| | | | | | | | | | | | | | | | | | | | | ....and if set, change the log level to GF_LOG_NONE. This is useful for monitoring applications which invoke the heal info set of commands once every minute, leading to un-necessary glfsheal* logs in /var/log/glusterfs/. For example, we can now run `gluster volume heal <VOLNAME> info --nolog` `gluster volume heal <VOLNAME> info split-brain --nolog` etc. The default log level is still retained at GF_LOG_INFO. The patch also changes glfsheal internally to accept '--xml' instead of 'xml'. Note: The --nolog flag is *not* displayed in the help anywhere, for the sake of consistency in how the other flags are not displayed anywhere in the help. fixes: bz#1643519 Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* all: fix the format string exceptionsAmar Tumballi2018-11-051-1/+1
| | | | | | | | | | | | | | | | Currently, there are possibilities in few places, where a user-controlled (like filename, program parameter etc) string can be passed as 'fmt' for printf(), which can lead to segfault, if the user's string contains '%s', '%d' in it. While fixing it, makes sense to make the explicit check for such issues across the codebase, by making the format call properly. Fixes: CVE-2018-14661 Fixes: bz#1644763 Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* cli: handle negative scenariosSanju Rakonde2018-10-011-8/+32
| | | | | | | | | | | When control flow reaches negative case code block, we added "goto out" statement without assigning ret to -1. This patch assigns return value to -1, before going to the lable "out". Change-Id: I6db651a3c9ca285ade9ee1ca23d0abe6b36fda3a updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Land part 2 of clang-format changesGluster Ant2018-09-121-2827/+2752
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* cli: Add warning message while converting to replica 2 configurationkarthik-us2018-09-111-5/+7
| | | | | | | | | | | | | | Currently while creating replica 2 volume we display a warning message of ending up in split-brain. But while converting an existing volume from other configuration to replica 2 by add-brick or remove-brick operations we do not show any such messages. With this fix in add-brick and remove-brick cases also we will display the same warning message and prompt for confirmation if the configuration changes to replica 2. Change-Id: Ifc4ed6994a087d2403894f4e743c4eb41633276b fixes: bz#1627044 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* multiple files: calloc -> mallocYaniv Kaul2018-09-041-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xlators/cluster/stripe/src/stripe-helpers.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/tier.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-layout.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-helper.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-common.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/afr/src/afr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/afr/src/afr-inode-read.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/bugs/replicate/bug-1250170-fsync.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/basic/gfapi/gfapi-async-calls-test.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/basic/ec/ec-fast-fgetxattr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/xdr/src/glusterfs3.h: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/rpc-transport/socket/src/socket.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/rpc-lib/src/rpc-clnt.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible extras/geo-rep/gsync-sync-gfid.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-xml-output.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-rpc-ops.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-volume.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-system.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-snapshot.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-peer.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-global.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible 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. In some cases, also changed allocation size to be sizeof some struct or type instead of a pointer - easier to read. In some cases, removed redundant strlen() calls by saving the result into a variable. 1. Only done for the straightforward cases. There's room for improvement. 2. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! updates: bz#1193929 Original-Author: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Amar Tumballi <amarts@redhat.com> Change-Id: I16274dca4078a1d06ae09a0daf027d734b631ac2
* 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>
* All: remove memset() before sprintf()Yaniv Kaul2018-08-141-9/+0
| | | | | | | | | | | | 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>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-221-1/+1
| | | | | | | | | | | | 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>
* cli/glusterd: Add warning message in cli for user to checkSusant Palai2018-05-031-4/+20
| | | | | | | | | | | | | | | | | | | | 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>
* 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: 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: gluster help changesN Balachandran2017-11-021-53/+294
| | | | | | | | | | 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>
* cli/afr: gluster volume heal info "healed" command output is not appropriateMohit Agrawal2017-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* events : Add brick list in EVENT_VOLUME_CREATEAtin Mukherjee2017-09-181-2/+5
| | | | | | | | | | | 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-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Command to identify client processhari gowtham2017-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tier: separation of attach-tier from add-brickhari gowtham2017-08-011-1/+1
| | | | | | | | | | | | | | | | | | 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-261-2/+9
| | | | | | | | | | | | | | | | 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>
* 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>
* glusterd: Make reset-brick work correctly if brick-mux is onSamikshan Bairagya2017-05-101-0/+10
| | | | | | | | | | | | | | | | | | | Reset brick currently kills of the corresponding brick process. However, with brick multiplexing enabled, stopping the brick process would render all bricks attached to it unavailable. To handle this correctly, we need to make sure that the brick process is terminated only if brick-multiplexing is disabled. Otherwise, we should send the GLUSTERD_BRICK_TERMINATE rpc to the respective brick process to detach the brick that is to be reset. Change-Id: I69002d66ffe6ec36ef48af09b66c522c6d35ac58 BUG: 1446172 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17128 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: Atin Mukherjee <amukherj@redhat.com>
* Fix 'flush' type, coverity warningMichael Scherer2017-05-101-1/+1
| | | | | | | | | | | | | | | | | | | As getchar returna a int, (which is 4 bytes on most common platforms, and at least 2 bytes), and char being often 1 byte, the conversion would lose information, hence the warning. Change-Id: I5b0b39c636ff49ef5c15d51a7f798e21635eca06 BUG: 789278 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/17193 Tested-by: Michael Scherer <misc@fedoraproject.org> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Zhou Zhengping <johnzzpcrystal@gmail.com> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
* glusterd: add a cli command to trigger a statedump on a clientPoornima G2017-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this, we will be able to trigger statedumps on remote Gluster clients, mainly targetted for applications using libgfapi. Design: SIGUSR signal is the most comman way of taking a statedump in Gluster. But it cannot be used for libgfapi based processes, as the process loading the library might have already consumed SIGUSR signal. Hence going by the command way. One has to issue a Gluster command to initiate a statedump on the libgfapi based client. The command takes hostname and PID as an argument. All the glusterds in the cluster, check if they are connected to the specified hostname, and send an RPC request to all the connected clients from that hostname (via the mgmt connection). URL: http://review.gluster.org/16357 Change-Id: Icbe4d2f026b32a2c7d5535e1bfb2cdaaff042e91 BUG: 1169302 Signed-off-by: Poornima G <pgurusid@redhat.com> [ndevos: minor fixes and split patch in smaller pieces] Reviewed-on: https://review.gluster.org/9228 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Samikshan Bairagya <samikshan@gmail.com>
* cli: keep 'gluster volume status detail' consistentXavier Hernandez2017-01-191-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The output of the command 'gluster volume status <volname> detail' is not consistent between operating systems. On linux hosts it shows the file system type, the device name, mount options and inode size of each brick. However the same command executed on a FreeBSD host doesn't show all this information, even for bricks stored on a linux. Additionally, for hosts other than linux, this information is shown as 'N/A' many times. This has been fixed to show as much information as it can be retrieved from the operating system. The file contrib/mount/mntent.c has been mostly rewriten because it contained many errors that caused mount information to not be retrieved on some operating systems. Change-Id: Icb6e19e8af6ec82255e7792ad71914ef679fc316 BUG: 1411334 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/16371 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: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* tier : Tier as a servicehari gowtham2017-01-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tierd is implemented by separating from rebalance process. The commands affected: 1) Attach tier will trigger this process instead of old one 2) tier start and tier start force will also trigger this process. 3) volume status [tier] will show tier daemon as a process instead of task and normal tier status and tier detach status works. 4) tier stop implemented. 5) detach tier implemented separately along with new detach tier status 6) volume tier volname status will work using the changes. 7) volume set works This patch has separated the tier translator from the legacy DHT rebalance code. It now sends the RPCs from the CLI to glusterd separate to the DHT rebalance code. The daemon is now a service, similar to the snapshot daemon, and can be viewed using the volume status command. The code for the validation and commit phase are the same as the earlier tier validation code in DHT rebalance. The “brickop” phase has been changed so that the status command can use this framework. The service management framework is now used. DHT rebalance does not use this framework. This service framework takes care of : *) spawning the daemon, killing it and other such processes. *) volume set options , which are written on the volfile. *) restart and reconfigure functions. Restart is to restart the daemon at two points 1)after gluster goes down and comes up. 2) to stop detach tier. *) reconfigure is used to make immediate volfile changes. By doing this, we don’t restart the daemon. it has the code to rewrite the volfile for topological changes too (which comes into place during add and remove brick). With this patch the log, pid, and volfile are separated and put into respective directories. Change-Id: I3681d0d66894714b55aa02ca2a30ac000362a399 BUG: 1313838 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/13365 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> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* cluster/afr: CLI for granular entry heal enablement/disablementKrutika Dhananjay2016-11-281-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are already existing non-granular indices created that are yet to be healed, if granular-entry-heal option is toggled from 'off' to 'on', AFR self-heal whenever it kicks in, will try to look for granular indices in 'entry-changes'. Because of the absence of name indices, granular entry healing logic will fail to heal these directories, and worse yet unset pending extended attributes with the assumption that are no entries that need heal. To get around this, a new CLI is introduced which will invoke glfsheal program to figure whether at the time an attempt is made to enable granular entry heal, there are pending heals on the volume OR there are one or more bricks that are down. If either of them is true, the command will be failed with the appropriate error. New CLI: gluster volume heal <VOL> granular-entry-heal {enable,disable} Change-Id: I1f4fe8162813b9068e198965d94169fee4adc099 BUG: 1370410 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/15747 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* events: Add FMT_WARN for gf_eventPranith Kumar K2016-11-181-2/+2
| | | | | | | | | | | | | | | | | Raghavendra G found that posix is trying to print %s but passing an int when HEALTH_CHECK fails in posix. These are the kind of bugs that should be caught at compilation itself. Also fixed the problematic gf_event() callers. BUG: 1386097 Change-Id: Id7bd6d9a9690237cec3ca1aefa2aac085e8a1270 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/15671 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* CLI/TIER: throw warning regarding the removal of the older commands.hari2016-10-251-0/+28
| | | | | | | | | | | | | | | | The older tier commands for attach tier and detach tier have to be removed from code. This patch sends a warning asking to use new command as older ones are depricated and will be removed. Change-Id: Ie1c62947bad6ff106f40331ff6134838a6c72a7a BUG: 1388062 Signed-off-by: hari <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/15713 Tested-by: hari gowtham <hari.gowtham005@gmail.com> 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: Dan Lambright <dlambrig@redhat.com>
* eventsapi: Fix sending event during volume set helpAravinda VK2016-10-241-1/+1
| | | | | | | | | | | | | | | | Event sent when `gluster volume set help` command is run with Volume name as "help" and empty options list With this patch, event sent only when volume set on a real volume BUG: 1387207 Change-Id: Ia8785d6108cb86f7d89ecf9ea552df0334b41398 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/15685 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: Atin Mukherjee <amukherj@redhat.com>