summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
Commit message (Collapse)AuthorAgeFilesLines
* All: License message changeVarun Shastry2012-08-2831-435/+156
| | | | | | | | | | | | | | | | | | The license message is changed to Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com> This file is part of GlusterFS. This file is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. Change-Id: I07d2b63ed5fbbbd1884f1e74f2dd56013d15b0f4 BUG: 852318 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3858 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* rpcsvc: remove .vector_actor and related changesAnand Avati2012-08-203-47/+47
| | | | | | | | | | | | | The .vector_actor method of rpcsvc_actor_desc is defunct now after rpc unification. Remove the field and all related usage of it. Change-Id: I53048cebeae78f50259e8c4a7fec3497691fe388 BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3832 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* utils: don't leak after failed GF_REALLOCJim Meyering2012-08-191-5/+24
| | | | | | | | | | | | | This is primarily to avoid a leak upon failed GF_REALLOC when glusterd_readin_file reads a file that is too large. Also, remove unnecessary memset-0 of PATH_MAX+256-byte buffer. Change-Id: Id06bd5faef024e1d865f6f0f56bfbb837c9c6168 BUG: 846755 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3804 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* rpc: Reduce frame-timeout for glusterd connectionsKaushal M2012-08-173-8/+46
| | | | | | | | | | | | | | | | Reduce frame-timeout for glusterd connections from 30mins to 10 mins. 30mins is too long when compared to cli timeout of 2mins. Changing to 10mins reduces the disparity between cli and glusterd. Also, fix glusterfs_submit_reply() so that a reply is sent even if serialize failed. Change-Id: Id5f68f2ff28ea7453d9a62429fe12aa0c0a66952 BUG: 843003 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3803 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/dht: Optimize readdirp calls in DHTshishir gowda2012-08-131-0/+1
| | | | | | | | | | | | | | | | | Bring in option which is supported by posix xlator to filter out directory's entries from being returned. DHT would now request non-first subvols to filter out directory entries. dht xlator-option readdir-optimize will enable this optimization Change-Id: I35224bc81c9657f54f952efac02790276c35ded5 BUG: 838199 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.com/3772 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep: don't leak or segfault upon OOMJim Meyering2012-08-081-2/+4
| | | | | | | | | | | | | | | | In glusterd_urltransform, a failed GF_REALLOC would clobber the would-be-realloc'd buffer, linearr, with a NULL pointer, (thus leaking that memory) and then control would pass to the error-handling code that would attempt to free (via glusterd_urltransform_free) linearr[i], which is almost guaranteed to segfault when linearr is NULL. Change-Id: Ia75bf70fd8ff893a18804d49688048ef96db6037 BUG: 846755 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3791 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: while building graph, set xl->ctxAmar Tumballi2012-08-051-0/+2
| | | | | | | | | | | | | as glusterfs_'ctx'_t is used as reference in many places, it is important to set it right. In many places, xl->ctx is assumed to be present, hence it has to be set right. Change-Id: I37d767f384edb1819277c4ecee97dd94108aedff Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 845715 Reviewed-on: http://review.gluster.com/3779 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mgmt/glusterd: Fix a compilation failure when libxml2-dev is not presentVijay Bellur2012-08-031-0/+3
| | | | | | | | | | | Addresses problem introduced by 1e4a2354b57a1eb Change-Id: I7cea76410769c584af6960860260fbd061a6df8a BUG: 844696 Signed-off-by: Vijay Bellur <vijay@gluster.com> Reviewed-on: http://review.gluster.com/3778 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Made volume set help/help-xml a non-cluster operation.Krishnan Parthasarathi2012-08-027-54/+87
| | | | | | | | | | | | - Retained apparent redundant checks in stage, commit phase of set volume for the help options for backward compatibility Change-Id: Iaefe3805d6b5eeeced2e7e4870830edf3e61dc87 BUG: 844696 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.com/3761 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* glusterd: Fix glusterd crash resulting from uninitialised pointerKrutika Dhananjay2012-08-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | PROBLEM: glusterd crashes during replace-brick operation as the pointer old_brickinfo is dereferenced without being initialised. FIX: Have old_brickinfo initialised to point to the brick info of the brick being replaced before dereferencing it. TEST: Ran glusterd in debug mode before and after the fix; process crash ceased in the latter case. Change-Id: I53f21b5424f534bbdba3b3fc407d4501a2c0052f BUG: 844332 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.com/3777 Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Modifed replace-brick mount cleanup to use lazy umountKrishnan Parthasarathi2012-07-301-94/+135
| | | | | | | | | Change-Id: I83a985967cbaee4927f1b8ca4bc01c9fb0171522 BUG: 806890 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.com/3143 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* performance/io-threads: Provide option to turn off least-priorityPranith Kumar K2012-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | RCA: In cases when self-heal is in progress, self-heal fops are starved because of least-priority. This affects other fops with conflicting inode, entry locks with self-heal. Fix: This patch provides configuring enable/disable of least-priority. Additional changes: Moved RCHECKSUM fop to low instead of least because it will still affect the performance of other fops if RCHECKSUM is in LEAST priority. Tests: Tested that the enabling/disabling of fops is working fine. Tested that RCHECKSUM fop priority is assigned LOW when least-priority is disabled. Change-Id: I8d72872b33e2ac7e1ad3afb27582682b0eb98a80 BUG: 843704 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3743 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* volgen: add option to add trace/error-gen in client volume fileAmar Tumballi2012-07-291-0/+6
| | | | | | | | | | | | | | | | bash# gluster volume set <VOLNAME> debug.trace client bash# gluster volume set <VOLNAME> debug.error-gen client would add the corresponding translator in client volume file just below io-stats translator. (gets added even in nfs volfile) Change-Id: I698eb9b348c59aaff9967a4e238fabfc40e69a11 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 782262 Reviewed-on: http://review.gluster.com/3699 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Persisted hooks friendly user.* keysKrishnan Parthasarathi2012-07-294-48/+51
| | | | | | | | | | | | - Fixed validation of user.* keys in presence of multiple key, value pairs in a single volume set command Change-Id: I5b96de2d009fbc79772121308d9b4c0a552bac52 BUG: 825902 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.com/3715 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Ensured 'store' data reaches disk.Krishnan Parthasarathi2012-07-291-15/+55
| | | | | | | | | | | | | - Opened temporary file(s) with O_SYNC flag to avoid explicit fsync'ing. - Sync'd directory entry after creation and rename of 'store' files. - Thanks to Jeff Moyer's article on http://lwn.net/Articles/457667/ Change-Id: I68a8672dc6a0b24d128de53f3b60c74dd08d8ab8 BUG: 765434 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.com/3726 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Refactored brickinfo APIsKrishnan Parthasarathi2012-07-199-199/+145
| | | | | | | | | | | | | | | | | This patch modifies the existing brickinfo function signatures and/or names to do one thing right and call them by 'appropriate' names. - Decoupled brickinfo_get and is_brickpath_available - Removed dead comment about realpath(3) in canonicalize_path - Renamed glusterd_brickinfo_from_brick to glusterd_brickinfo_new_from_brick to make the name of the function reflect that an allocation is happening Change-Id: I29daba6d431ca799d43c927b9dfbaeda327e83e8 BUG: 764890 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.com/3668 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* glusterd: atomic store update.Krishnan Parthasarathi2012-07-192-2/+118
| | | | | | | | | | | | | | | | All 'updates' to store are done in their respective tmp files and a rename to their original copies is done in one pass. Failure to write or rename successfully, promptly reduces the store's revision no., giving us an opportunity to 'correct' it via peer 'detach-attach' operations, if need be. Change-Id: I44a33c41cb4d3d1cfbb455bc1f2f074d4f17dade BUG: 765434 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/654 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cluster/distribute: cli support for setting directory-layout-spreadshishir gowda2012-07-181-0/+1
| | | | | | | | | | | | | gluster volume set <volname> subvols-per-directory Change-Id: I5f1420eeb2268897d9b4c70edb933ed1f07649d1 BUG: 838006 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.com/3634 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterfs_ctx_t: un-globalize the filesystem contextAnand Avati2012-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | So far there has been a global glusterfs_ctx_t object which represents the running instance of the filesystem (client or server). It contains the various graphs, connection to the management daemon over which new graphs are obtained, calls stacks issued on this filesystem, and a bunch of such things. With the introduction of libgfapi, it is no more true that there will be only one filesystem context in a process. Applications can be written to use libgfapi and obtain serveral instances of different filesystems/volumes in the same process. This involves messy untangling of assumptions inside libglusterfs that there would only be one global glusterfs_ctx_t and offload that assumption to glusterfsd/ and cli/ (where it is true). Change-Id: Ifd7d1259428c26076140a5764a2dc7361694139c BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3678 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* rpc-transport/socket: Add SSL support.Jeff Darcy2012-07-171-0/+17
| | | | | | | | | | | | | Based on OpenSSL. Key/certificate management is still manual. Enabling SSL also enables multi-threading, though multi-threading can be forced on or off using a separate option. Change-Id: Icd9f256bb2fd8c6266a7abefdff16936b4f8922d BUG: 764731 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/362 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* storage/posix: implement native linux AIO supportAnand Avati2012-07-141-0/+1
| | | | | | | | | | | Configurable via cli with "storage.linux-aio" settable option Change-Id: I9929e0d6fc1bbc2a0fe1fb67bfc8d15d8a483d3f BUG: 837495 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3627 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* remove useless if-before-free (and free-like) functionsJim Meyering2012-07-1319-231/+115
| | | | | | | | | | | | See comments in http://bugzilla.redhat.com/839925 for the code to perform this change. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* no semantic change: reverse condition and if/else clauses...Jim Meyering2012-07-131-3/+3
| | | | | | | | | | | | | Reverse an if-condition and the corresponding then/else code blocks to hide a false-positive if-before-GF_FREE from the useless-if-before-free script. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: Ia68558218d63ae77b6c1c85e15231b66cce5bd49 Reviewed-on: http://review.gluster.com/3651 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* rpc: variable name changesAmar Tumballi2012-07-122-41/+41
| | | | | | | | | | | | | 's/3_1/3_3/g' in case of glusterfs protocol 's/3_1_/_/g' in case of CLI and mgmt protocol Change-Id: I6e6510d02c05f68f290c52ed284c04576326e12c Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 764890 Reviewed-on: http://review.gluster.com/3632 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* calls to dict_allocate_and_serialize() are not 64-bit cleanKaleb S. KEITHLEY2012-07-124-26/+20
| | | | | | | | | | | | | | | | | | | | | | | All calls to dict_allocate_and_serialize() pass the address of a 32-bit type, but must cast it to the 64-bit pointer type (size_t *). This happens to work on LE machines, but even if it's apparently benign, it's still a bug. On BE machines it is not benign. GF_PROTOCOL_DICT_SERIALIZE() hacks around it by creating a size_t temp var, but that's, well, a hack, IMO when you consider that all the callers are actually passing &<u_int>; the param should just be a u_int * and eliminate the buggy casts and the temp var in the macro. Nobody apparently uses the Fedora/EPEL PPC RPMs, but they might. People are trying to build gluster.org bits on SPARC and tripping over this. Change-Id: I92ea139f9e3e91ddbbb32a51b96fa582a9515626 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> BUG: 838928 Reviewed-on: http://review.gluster.com/3642 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep: don't let unexpected status provoke undefined behaviorJim Meyering2012-07-121-5/+10
| | | | | | | | | | | | | | | | | | | | glusterd_gsync_read_frm_status reads what is expected to be a NUL- terminated status string from the specified file, but makes two mistakes when trying to do the favor of trimming trailing spaces. Do not let a leading NUL byte of status cause us to read buf[-1] and possibly to clear that and any preceding "trailing" spaces. Do not let a blen-byte input (with no NUL byte) cause our use of strlen to access beyond the end of non-NUL-terminated buffer. I looked at this code because coverity reported that it was assuming a read-provided buffer to be NUL-terminated. Change-Id: I140be0948e31196e5be08766d4e6400bf6f4dfa1 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3647 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: avoid buffer overrun for over-long volnameJim Meyering2012-07-111-1/+7
| | | | | | | | | | | | | | | | | [in glusterd_store_is_valid_brickpath] When strlen(volname) is no smaller than sizeof(volinfo->volname), volinfo->volname would end up not being NUL-terminated. Then, a use of that buffer that expects it to be NUL-terminated (i.e., glusterd_store_brickinfopath_set's GLUSTERD_GET_BRICK_DIR) will access beyond the end of the buffer. Instead, diagnose the too-long volume name and fail. Change-Id: I655d8638547bf342d33280c14ff1edacc3cdeb5a BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3591 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: copy /etc/glusterd to /var/lib and remove /etc/glusterd instead ofRaghavendra Bhat2012-07-041-1/+1
| | | | | | | | | | | | | | moving * Change default directory from /etc/glusterd to /var/lib/glusterd Change-Id: Iefa82e4fdb94ce5a84dfb40855c80e16e9ffcc40 BUG: 830218 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3548 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cluster/afr: add a new option to select read-subvol by indexJeff Darcy2012-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | read subvolume is a nice option to set prefred read child if you have a replication over 2 datacenter. if you have 2 datacenter and have a distributed replication where one set of servers are in datacenter one and the other (the replicated) are in the other datacenter read-subvolume it not very handy since it goes over name and the subvolume name is different for each replication pair. i added a new option called read-subvolume-index which take the number of the subvolume to choose. 0 fo first , 1 for second and so on subvolume in every replication. this option can now be used in the --xlator-option mount option to choose the prefered read child for all replication at once. For Example on all clients in datacenter one you can use --xlator-option=volumename-replication-*.read-subvolume-index=0 to prefer read from the servers in datacenter one. when you expand or shrink the volume no changes are needed to the client config since the wildcard will set this option automatic on reconfigure. Change-Id: I3b47432f77037c380ff4a6296636c6f8fc953db9 BUG: 837420 Original-author: domwo <glusterfs@wollina.de> Signed-off-by: domwo <glusterfs@wollina.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/3615 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mgmt/glusterd: Added spaces in the logsVenkatesh Somyajulu2012-07-021-5/+9
| | | | | | | | | | Change-Id: Ic44e339219a845946e18c8c926fe993e09f86624 BUG: 820555 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.com/3609 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep: handle input without trailing newline; don't reference buf[-1]Jim Meyering2012-07-021-4/+9
| | | | | | | | | | | | | Do not truncate final byte of a line that does not end in a newline. Do not clobber stack (resbuf[-1]) for input that starts with a NUL byte. Likewise in glusterd_urltransform. Change-Id: Ifdcad02d908c8dcbc1a0eee78d318dd4e7860322 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3595 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd-rpc-ops: avoid buffer overrun for over-long keyJim Meyering2012-07-021-1/+3
| | | | | | | | | | | | | | strncpy explicitly does not NUL-terminate when source string has length >= the length specified via strncpy's 3rd argument. Assuming strncpy is justified (i.e., that it may truncate), be sure to NUL-terminate its destination buffer. Change-Id: Ia67bf136cdfae6d9850f673923c01baa3cdef9d8 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3592 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* features/worm: Allow worm option to be set throught volume setshishir gowda2012-07-021-2/+20
| | | | | | | | | | | | | | | | | | | | | | 'volume set <volname> worm on' adds the worm xlator on the bricks. Read-only and worm cannot exist together, and a check is added. Regular volumes can still be mounted with worm mount option. If a volume is started before conversion to worm, the bricks need to be restarted for the option to take force. Updated feature.read-only option to features.read-only to keep it consistent with other features based options. Change-Id: I1a8fab363aaf66e6da615dcffa328332ae39fa04 BUG: 811612 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3545 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: avoid buffer overrun due to lack of NUL terminatorJim Meyering2012-07-021-0/+1
| | | | | | | | | | | | | | Assume that this use of strncpy is not spurious (i.e., that it does sometimes truncate), and ensure that the result is NUL-terminated. Otherwise, callers that treat ->filepath as a NUL-terminated string could operate on a bogus file name and/or segfault. Change-Id: I276bf8a4da330284cc0300e8da7113a48b9b9b37 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3590 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Fix peer probe when username/password is missingKaushal M2012-07-021-12/+8
| | | | | | | | | | | | | Prevent failure of building volumes dictionary during peer probe, when username/password for a volume is missing. This situation can be caused by migration of gluster from pre-3.3 to 3.3 and above. Change-Id: Ib924ecd3d941ddaa5c7773e4d45b076c488b6421 BUG: 834229 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3619 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd, cli: handle uuid conflicts in probe gracefullyRaghavendra Bhat2012-07-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | A commonly faced problem among glusterfs users is: after a fresh installation of glusterfs in a virtual machine, the VM image is cloned to make multiple instances of the server. This breaks glusterd because right after glusterfs installation on the first boot glusterd would have created the node UUID and this gets inherited into the clone. The result is wierd behavior at the time of peer probe where glusterd does not (yet) deal with UUID collisions in a user friendly way. With this patch the peer which got the probe request will compare the uuid of the machine which send the probe request with its own uuid and send the proper error to cli if the uuids are same. Change-Id: I091741ec863431fb6480a09a3f4c68a0906a3339 BUG: 811493 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3612 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* localtime and ctime are not MT-SAFEKaleb S. KEITHLEY2012-06-294-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of nit-level issues throughout the source with the use of localtime and ctime. While they apparently aren't causing too many problems, apart from the one in bz 828058, they ought to be fixed. Among the "real" problems that are fixed in this patch: 1) general localtime and ctime not MT-SAFE. There's a non-zero chance that another thread calling localtime (or ctime) will over-write the static data about to be used in another thread 2) localtime(& <64-bit-type>) or ctime(& <64-bit-type>) generally not a problem on 64-bit or little-endian 32-bit. But even though we probably have zero users on big-ending 32-bit platforms, it's still incorrect. 3) multiple nested calls passed as params. Last one wins, i.e. over- writes result of prior calls. 4) Inconsistent error handling. Most of these calls are for logging, tracing, or dumping. I submit that if an error somehow occurs in the call to localtime or ctime, the log/trace/dump still should still occur. 5) Appliances should all have their clocks set to UTC, and all log entries, traces, and dumps should use GMT. 6) fix strtok(), change to strtok_r() Other things this patch fixes/changes (that aren't bugs per se): 1) Change "%Y-%m-%d %H:%M:%S" and similar to their equivalent shorthand, e.g. "%F %T" 2) change sizeof(timestr) to sizeof timestr. sizeof is an operator, not a function. You don't use i +(32), why use sizeof(<var>). (And yes, you do use parens with sizeof(<type>).) 3) change 'char timestr[256]' to 'char timestr[32]' where appropriate. Per-thread stack is limited. Time strings are never longer than ~20 characters, so why waste 220+ bytes on the stack? Things this patch doesn't fix: 1) hodgepodge of %Y-%m-%d %H:%M:%S versus %Y/%m/%d-%H%M%S and other variations. It's not clear to me whether this ever matters, not to mention 3rd party log filtering tools may already rely on a particular format. Still it would be nice to have a single manifest constant and have every call to localtime/strftime consistently use the same format. Change-Id: I827cad7bf53e57b69c0173f67abe72884249c1a9 BUG: 832173 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.com/3568 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep: checkpointingCsaba Henk2012-06-132-11/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - gluster vol geo-rep M S conf checkpoint <LABEL|now> sets a checkpoint with LABEL (the keyword "now" is special, it's rendered to the label "as of <timestamp of current time>") that's used to refer to the checkpoint in the sequel. (Technically, gsyncd makes a note of the xtime of master's root as of setting the checkpoint, called the "checkpoint target".) - gluster vol geo-rep M S conf \!checkpoint deletes the checkpoint. - gluster vol geo-rep M S stat if status is OK, and there is a checkpoint configured, the checkpoint info is appended to status (either "not yet reached", or "completed at <timestamp of completion>"). (Technically, the worker runs a thread that monitors / serializes / verifies checkpoint status, and answers checkpoint status requests through a UNIX socket; monitoring boils down to querying the xtime of slave's root and comparing with the target.) - gluster vol geo-rep M S conf log-file | xargs grep checkpoint displays the checkpoint history. Set, delete and completion events are logged properly. Change-Id: I4398e0819f1504e6e496b4209e91a0e156e1a0f8 BUG: 826512 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3491 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* mgmt/glusterd: fix the infinite loop in lazy uuid generationRaghavendra Bhat2012-06-132-1/+3
| | | | | | | | | | | | | | | | | * This is how the lazy uuid generation leads to infinite loop of function calls. MY_UUID -> glusterd_uuid_init -> glusterd_retrieve_uuid -> MY_UUID * Also while starting glusterd if valgrind option is not given in the volfile, then reset the ret variable to 0. Change-Id: Ief719f436d8a264a591ee6aefc6da3c0f6c75e8f BUG: 811493 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3564 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* cluster/stripe: implement the coalesce stripe file formatBrian Foster2012-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The coalesce file format for cluster/stripe condenses the striped files to a contiguous layout. The elimination of holes in striped files eliminates space wasted via local filesystem preallocation heuristics and significantly improves read performance. Coalesce mode is implemented with a new 'coalesce' xlator option, which is user-configurable and disabled by default. The format of newly created files is marked with a new 'stripe-coalesce' xattr. Cluster/stripe handles/preserves the format of files regardless of the current mode of operation (i.e., a volume can simultaneously consist of coalesced and non-coalesced files). Files without the stripe-coalesce attribute are assumed to have the traditional format to provide backward compatibility. extras/stripe-merge: support traditional and coalesce stripe formats Update the stripe-merge recovery tool to handle the traditional and coalesced file formats. The format of the file is detected automatically (and verified) via the stripe-coalesce attributes. BUG: 801887 Change-Id: I682f0b4e819f496ddb68c9a01c4de4688280fdf8 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3282 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: generate node UUID lazilyAnand Avati2012-06-0713-62/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A commonly faced problem among glusterfs users is: after a fresh installation of glusterfs in a virtual machine, the VM image is cloned to make multiple instances of the server. This breaks glusterd because right after glusterfs installation on the first boot glusterd would have created the node UUID and this gets inherited into the clone. The result is wierd behavior at the time of peer probe where glusterd does not (yet) deal with UUID collisions in a user friendly way. This patch is for the 'prevention' of the issue. The approach here is to avoid generating a UUID on the first start of glusterd, but instead generate a node UUID only when a node UUID is found to be necessary. This naturally avoids the creation of node UUID on first boot and prevents the issue to a large extent. This issue also needs a 'cure' patch, which gives more meaningful error messages to the user and provides CLI to recover from the situations (gluster peer reset?) Change-Id: Ieaaeeaf76ed35385844e98a8e23fc3dd8df5a208 BUG: 811493 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3533 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* glusterd: nfs.disable fix for "volume set help"Kaushal M2012-06-061-7/+12
| | | | | | | | | | | | | Fixes volgen to include "nfs.disable" in output of "volume set help". Also fixes some incorrect entries in glusterd_volopt_map. Change-Id: Ica5edf1ece31f9daa040fcdf559c1643ecdfd568 BUG: 828027 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3509 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: Set errstr for duplicate add-brickKaushal M2012-06-051-0/+3
| | | | | | | | | | | | Sets op_errstr when add-brick is given a duplicate brick. Change-Id: I7b8f8139f9f09834a71a5abc725692b145896830 BUG: 803336 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3519 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* replicate: default read_child to a local brick if there is one.Jeff Darcy2012-06-051-0/+1
| | | | | | | | | | | Controlled by the "choose-local" option (on by default). Change-Id: I560f27c81703f2c9c62fdb51532c8eb763826df7 BUG: 806462 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/3005 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd-volgen: by default include 'cluster/distribute' in volfileAmar Tumballi2012-06-011-6/+9
| | | | | | | | | | | | | | | | | | | include 'cluster/distribute' even if there is just one brick in the volume, that way, the directories would have some of the required extended attributes on it before a 'add-brick'. this fixes the issues of applications getting errored out when a 'add-brick' is done when a volume had only one brick before. Change-Id: Ie9d559e6b26aafd3d67908ab20a006e4e5e70d73 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 815227 Reviewed-on: http://review.gluster.com/3213 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com> Reviewed-by: Raghavendra G <raghavendra@gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: fix issues with volume reset handlingCsaba Henk2012-06-012-22/+35
| | | | | | | | | | | | - properly resolve shortened key names - make sure user gets decent feedback Change-Id: I94b75f34b29cb71fb1a2edf17c3f1bf841bb552a Signed-off-by: Csaba Henk <csaba@redhat.com> BUG: 826958 Reviewed-on: http://review.gluster.com/3500 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: regenerate brick vol-files on upgradePranith Kumar K2012-06-011-0/+5
| | | | | | | | | | | | | If upgrade/downgrade option is set in glusterd it terminates after the volfiles are regenerated. No need for 'sleep 10' hack anymore. BUG: 825872 Change-Id: I12e666eb871aad7e7efa954b9307993952745d92 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3482 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: makefile typo fix.Amar Tumballi2012-06-011-1/+1
| | | | | | | | | | | | instead of /var/lib/glusterd, symlink was pointing to /var/log/glusterd Change-Id: I485ad8d6cc8535378179621dea7539328d22454c Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 824231 Reviewed-on: http://review.gluster.com/3503 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Add server-side aux-GID resolution.Jeff Darcy2012-06-011-0/+1
| | | | | | | | | Change-Id: I09bcbfa41c7c31894ae35f24086bef2d90035ccc BUG: 827457 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/3241 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mgmt/glusterd: self-heals should be on in glustershdPranith Kumar K2012-05-311-0/+8
| | | | | | | | | BUG: 825740 Change-Id: I44829fb985f9c394b1e240e8ee7f8d026593add9 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3481 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>