summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* posix: Do not update unmodified xattr in (f)xattropXavier Hernandez2015-05-271-1/+5
| | | | | | | | | | | | | | | If a (f)xattrop is issued with a value that only contains 0's, then we don't modify or create the extended attribute. This is useful to avoid ctime modifications when the only purpose of the xattrop was to get the current value. Change-Id: Ia62494e9009962e683c8276783f671da17a8b03a BUG: 1211123 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/10886 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: Fix entry-self-heal.tKrutika Dhananjay2015-05-262-3/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | Because both bricks in the replica pair of patchy are in the same node, both full healer threads within the same shd try and fail to acquire non-blocking locks when each one gets lock on one of the bricks, causing heal to fail occasionally. Now heals are triggered from the mount as part of inode refresh. And because the AFR on the mount graph a. does not treat presence of dirty xattrs as something that needs a heal (this is true for dirs fool_heal and fool_me) and b. does not recursively heal the entire hierarchy of subdirs and their entries in one shot (this is true with source_creations_heal/dir1), index heal is used to heal fool_heal, fool_me and source_creations_heal/dir1 wherein only one brick (which is the brick that contains the good copy of source_creations_heal/dir_1: brick-1) has all the gfids to be healed copied into its indices/xattrop directory. Change-Id: I46df4188f16d1623f20cc0d7266b3afaeca6c31f BUG: 1163543 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10916 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Quota: fix testcases not to send parallel writes for accuratevmallika2015-05-2512-63/+157
| | | | | | | | | | | | | | | | | | | | | | | quota enforcement Currently quota enforcer doesn't consider parallel writes and allows quota to exceed limit where there are high rate of parallel writes. Bug# 1223658 tracks the issue. This patch fixes the spurious failures by not sending parallel writes. Using O_SYNC and O_APPEND flags and block size not more that 256k (For higher block size NFS client splits the block into 256k chinks and does parallel writes) Change-Id: I297c164b030cecb87ce5b494c02b09e8b073b276 BUG: 1223798 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/10878 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* tests: arbiter.t fixRavishankar N2015-05-242-3/+9
| | | | | | | | | | | | | | | | | | | Wait for AFR's children to be up in glustershd process before attempting heal. Also, grep (version 2.21) is detecting statedump files as binary, causing tests to succeed incorrectly. Hence adding the -a switch to force it to treat it as a text file. Thanks to Vijay Bellur for identifying the issue (http://lists.gnu.org/archive/html/bug-grep/2015-05/msg00000.html) and the workaround. Change-Id: Ie3d9591ffaf44baa0cd8c2baa327aed24378e3df BUG: 1163543 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10833 Tested-by: NetBSD Build System Tested-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: data-self-heal.t fixRavishankar N2015-05-221-2/+26
| | | | | | | | | | | | | Use Index heal instead of full heal to heal files because if both bricks are on the same node, the 2 full heal threads might compete and fail to acquire the non blocking locks and the file might not get healed during the full heal crawl. Change-Id: I3b9e2de7b0366b4bc40b54314807ef165baad68f BUG: 1163543 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10875 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: Removing tests/bugs/snapshot/bug-1112559.t from test-suiteAvra Sengupta2015-05-201-61/+0
| | | | | | | | | | | | | The fix that introduced this test has been reverted as part of design change. Hence removing it from the test-suite Change-Id: I7acaf387ec3035f736498a437c736fe70970d421 BUG: 1219738 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10840 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/ec: Correctly cleanup delayed locksXavier Hernandez2015-05-201-0/+50
| | | | | | | | | | | | | | | | | When a delayed lock is pending, a graph switch doesn't correctly terminate it. This means that the update of version and size xattrs is lost, causing EIO errors. This patch handles GF_EVENT_PARENT_DOWN event to correctly finish pending udpdates before completing the graph switch. Change-Id: I394f3b8d41df8d83cdd36636aeb62330f30a66d5 BUG: 1188145 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/10787 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* test: Fix sparse file self heal testzhoushicheng2015-05-192-1/+10
| | | | | | | | | | | | | | | | | | | | | | | This patch solves problems caused by XFS with speculative preallocation feature on : Test EXPECT "1" has_holes $B0/${V0}0/big2bigger would fall when XFS has not freed the preallocated blocks. It is caused by XFS speculative preallocation feature. The test would pass if this feature is disabled. Speculative preallocation can speed up under linux 3.8(and later). Otherwise, the test would pass by dropping cache manually to speed up speculative preallocation. As in http://review.gluster.org/#/c/10411/, using "( cd $M0 ; umount $M0 )" to drop caches, which is better than "echo 3 > /proc/sys/vm/drop_caches". drop caches operation was added in test: tests/basic/afr/sparse-file-self-heal.t BUG: 1206461 Change-Id: Ie2c9d1b92fa8307c44498752fdd100eb86f9689c Signed-off-by: zhoushicheng <madaozhou@gmail.com> Reviewed-on: http://review.gluster.org/10253 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: data-self-heal.t-create files from the mount point.Ravishankar N2015-05-181-32/+14
| | | | | | | | | | | | | | | | | | Currently data-self-heal.t creates files directly on the brick and sets the trusted.gfid xattr. Later it depends on stat from mount to create the .glusterfs/<gfid hard link>. The link creation doesn't seem to be happening always. Hence changing the test to create files from the mount point before modifying afr xattrs in the backend and triggering heal. Also disabled all performance translators. With these changes, http://review.gluster.org/#/c/10667/ is not failing in data-self-heal.t Change-Id: I7d054e52b97aeb0bdc2fdf9d70a8cf33318d4310 BUG: 1218304 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10530 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Tests: avoid hang in br-stub.tEmmanuel Dreyfus2015-05-181-0/+2
| | | | | | | | | | | | | | | | | br-stub.t forgot to unmount the NFS mount, leading to the situation where cleanup code had to do it after glusterfs daemon were shut down. NetBSD has trouble dealing with this situation and may enter endless wait for the NFS server to come back. Fix is simply to unmount before the end og the script BUG: 1129939 Change-Id: I972d379172a75f29ad11abc66d700c2d31106194 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10748 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* tests: write log for glupy.t to the standard log directoryNiels de Vos2015-05-162-1/+3
| | | | | | | | | | | | | | | | | | There is (or was) a spurious test in glupy.t for which a separate log file was setup. The directory where the log is saved, is not available on NetBSD and this causes glupy.t to always fail, without a log. Instead of hard-coding the path to the log, use "gluster --print-logdir" to provide a LOGDIR environment variable. glupy.t now writes the log to an existing directory. BUG: 1163543 Change-Id: Ifa73198d06fa267856d0da9d25a4380329909124 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10801 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Wait for NFS exports to be ready before mountRaghavendra Talur2015-05-111-0/+1
| | | | | | | | | Change-Id: Ie71e8c80d6a43dd618c9decb946a459b211295ce BUG: 1219846 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/10724 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* dht: make lookup-unhashed=auto do something actually usefulJeff Darcy2015-05-104-12/+116
| | | | | | | | | | | | | | | | | | | | | | | | The key concept here is to determine whether a directory is "clean" by comparing its last-known-good topology to the current one for the volume. These are stored as "commit hashes" on the directory and the volume root respectively. The volume's commit hash changes whenever a brick is added or removed, and a fix-layout is done. A directory's commit hash changes only when a full rebalance (not just fix-layout) is done on it. If all bricks are present and have a directory commit hash that matches the volume commit hash, then we can assume that every file is in its "proper" place. Therefore, if we look for a file in that proper place and don't find it, we can assume it's not on any other subvolume and *safely* skip the global (broadcast to all) lookup. Change-Id: Id6ce4593ba1f7daffa74cfab591cb45960629ae3 BUG: 1219637 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/7702 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* bitrot: Volfile generation should not proceed if node doesn't have any brick.Gaurav Kumar Garg2015-05-091-2/+2
| | | | | | | | | | | | | | | | | | | glusterd crashes when bitrot is enabled on a distributed volume from a node which doesn't host a brick. While generating volfile glusterd should check number of brick on that node. If node doesn't have any brick then graph generation for bitrot and scrubber should not proceed further. Change-Id: I2158113e20e93738cde2a22fd73f0ae6b22aae9e BUG: 1219784 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10664 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* tests: fix bitrot spurious failuresGaurav Kumar Garg2015-05-093-3/+3
| | | | | | | | | | Change-Id: I342b7f8ec9c37cfd8d4cbd4090319330345bed4c BUG: 1220016 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10707 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: fix bitrot spurious failuresAtin Mukherjee2015-05-095-0/+18
| | | | | | | | | Change-Id: I55bd62480b7ee38cf7b29aeba67b19b0c5bbe2fb BUG: 1220016 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/10702 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* cli/tiering: Enhance cli output for tieringMohammed Rafi KC2015-05-081-1/+1
| | | | | | | | | | | | | | Fix for handling cli output for attach-tier and detach-tier Change-Id: I4d17f4b09612754fe1b8cec6c2e14927029b9678 BUG: 1211562 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10284 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests : workaround fix for volume-snapshot-clone spurious failureAtin Mukherjee2015-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Snippet of the existing test: TEST kill_glusterd 2; TEST $glusterd_2; sleep 5 EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field ${V0}_clone 'Status'; EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field ${V1}_clone 'Status'; stop_force_volumes 2 The above EXPECT_WITHINs will not wait as the volumes were never stopped which results into immediate trigger of volume stop where handshaking is not completed. A workaround would be to check whether handshaking is completed and then proceed. Change-Id: Id3468b56f801212fc8e19ff196bc99e5e2358471 BUG: 1163543 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/10619 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* features/bit-rot-stub: versioning of objects in write/truncate fop instead ↵Raghavendra Bhat2015-05-082-14/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of open * This patch brings in the changes where object versioning is done in write and truncate fops instead of tracking them in open and create fops. This model works for both regular and anonymous fds. It also removes the race associated with open calls, create and lookups. This patch follows the below method for object versioning and notifications: Before sending writev on the fd, increase the ongoing version first. This makes anonymous fd write similar to the regular fd write by having the ongoing version increased before doing the write. Do following steps to do versioning: 1) For anonymous fds set the fd context (so that release is invoked) and add the fd context to the list maintained in the inode context. For regular fds the above think would have been done in open itself. 2) Increase the on-disk ongoing version 3) Increase the in memory ongoing version and mark inode as non-dirty 3) Once versioning is successfully done send write operation. If versioning fails, then fail the write fop. 5) In writev_cbk mark inode as modified. Change-Id: I7104391bbe076d8fc49b68745d2ec29a6e92476c BUG: 1207979 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/10233 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Disable flush-behindPranith Kumar K2015-05-081-0/+1
| | | | | | | | | Change-Id: Ibbb6b03d2878ef4a049f737662c31e70a68e5755 BUG: 1219816 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10666 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* Tests: fix file count in ec-readdir.tEmmanuel Dreyfus2015-05-081-1/+1
| | | | | | | | | | | | | | | On BSD systems, ls(1) reports dot-files when it is run as root, while Linux ls(1) does not do that. In ec-readdir.t, this means the directory count is different because of .trashcan directory. Fix this by using ls $M0/* instead of ls $M0 BUG: 1129939 Change-Id: Ia337c8a8e68a163ed527c0e4cbe313072ab1672b Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10657 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Tests: use a portable way to flush kernel cacheEmmanuel Dreyfus2015-05-073-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux, kernel cache can be flushed using echo 3 > /proc/sys/vm/drop_caches This non-portable approach can be replaced by an on-purpose failed attempt to unmount: if the mount point is the current directory and umount is called, the kernel will flush inodes until it realize it cannot complete the operation because root of filesystem is busy: ( cd $M0 ; umount $M0 ) Unfortunately this does not flush everything. Entries may still be present in the kenrel FUSE cache. Using $GFS to mount the filesystem ensure --entry-timeout=0 and clears this problem. Some stall information may also remain in glusterfs caches, and that may have to be adressed by appropriate volume option. For instance tests/bugs/rpc/bug-954057.t needs to disable performance.stat-prefetch. Qtherwise, root's new credentials are not evaluated after root-quash is enabled. The test could also be done with performance.stat-prefetch enabled using various tricks: copying the file to read, creating a hard link on it, or just waiting long enough for metadata cache to expire. BUG: 1129939 Change-Id: I54929e899d55c04dcd9d947809133549f01fd0e1 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10411 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapshot: Handshake with glusterd is not properMohammed Rafi KC2015-05-072-0/+40
| | | | | | | | | | | | | | | | | | | | If a snap is activated or deactivated, when a node is down, it is not retrieving the data properly during the handshake of glusterd With this patch, a version check will made when a glusterd is started running. If there is a mismach in version, then peers will exchange the healed data. Change-Id: I8bd2a347723db2194d3fa73295878b4dd2e9be5d BUG: 1122377 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9664 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: NetBSD Build System Reviewed-by: Kaushal M <kaushal@redhat.com>
* tests: Spurious failure in fop-sanity.tNithya Balachandran2015-05-073-18/+21
| | | | | | | | | | | | | | | | | | Modified the calls to open in fops-sanity.c to pass in the mode as well if flags includes O_CREAT (as per man page). The missing mode randomly caused T files to be created causing DHT to treat them as linkto files and fail the fop. Modified 2 other files where the mode was not being provided. Change-Id: I047573d43655b4957d0703f7df36238f7e729c1f BUG: 1218951 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/10590 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* dht/rebalance: Throttle rebalanceSusant Palai2015-05-071-0/+42
| | | | | | | | | | | | Throttle value will be "normal" by default. For throttling down, a thread will be put in to sleep. And for throttling up, gf_defrag_process_dir will wake up the sleeping threads. Change-Id: I74d530e3effd6e60e6eec81ccc8ff65789fa9c13 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/10526 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* cluster/afr : Prevent inode-evict during split-brain resolutionAnuradha2015-05-071-0/+1
| | | | | | | | | | | | | | | | | | | | | 1) Provided setfattr command to set timeout for split-brain choice. 2) If split-brain inspection/resolution is being done from the mount for a file, ref the inode when split-brain-choice is set. This inode will be unconditionally unref-ed after timeout seconds set by the user/default otherwise. 3) Updated the doc and testcase to reflect the changes. Change-Id: I15c9037dee28855f21e680e7e3632e1f48dba4e1 BUG: 1209104 Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/10134 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* bitrot/glusterd: Bitrot scrub pause/resume should give proper errorGaurav Kumar Garg2015-05-071-0/+37
| | | | | | | | | | | | | | bitrot scrubber paused/resume command should give proper error messages if scrubber already pause/resume and user again try to perform same operation on a volume. Change-Id: I01ad69c80f03b177535a4e5f1c95ab7709a804b0 BUG: 1210684 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10209 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* glusterd: remove replace brick with data migration support form cli/glusterdGaurav Kumar Garg2015-05-075-42/+33
| | | | | | | | | | | | | | | | Replace-brick operation with data migration support have been deprecated from gluster. With this fix replace brick command will support only one commad gluster volume replace-brick <VOLNAME> <SOURCE-BRICK> <NEW-BRICK> {commit force} Change-Id: Ib81d49e5d8e7eaa4ccb5830cfec2bc081191b43b BUG: 1094119 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10101 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* ctr/xlator: Named lookup heal of pre-existing files, before ctr was ON.Joseph Fernandes2015-05-061-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The CTR xlator records file meta (heat/hardlinks) into the data. This works fine for files which are created after ctr xlator is switched ON. But for files which were created before CTR xlator is ON, CTR xlator is not able to record either of the meta i.e heat or hardlinks. Thus making those files immune to promotions/demotions. Solution: The solution that is implemented in this patch is do ctr-db heal of all those pre-existent files, using named lookup. For this purpose we use the inode-xlator context variable option in gluster. The inode-xlator context variable for ctr xlator will have the following, a. A Lock for the context variable b. A hardlink list: This list represents the successful looked up hardlinks. These are the scenarios when the hardlink list is updated: 1) Named-Lookup: Whenever a named lookup happens on a file, in the wind path we copy all required hardlink and inode information to ctr_db_record structure, which resides in the frame->local variable. We dont update the database in wind. During the unwind, we read the information from the ctr_db_record and , Check if the inode context variable is created, if not we create it. Check if the hard link is there in the hardlink list. If its not there we add it to the list and send a update to the database using libgfdb. Please note: The database transaction can fail(and we ignore) as there already might be a record in the db. This update to the db is to heal if its not there. If its there in the list we ignore it. 2) Inode Forget: Whenever an inode forget hits we clear the hardlink list in the inode context variable and delete the inode context variable. Please note: An inode forget may happen for two reason, a. when the inode is delete. b. the in-memory inode is evicted from the inode table due to cache limits. 3) create: whenever a create happens we create the inode context variable and add the hardlink. The database updation is done as usual by ctr. 4) link: whenever a hardlink is created for the inode, we create the inode context variable, if not present, and add the hardlink to the list. 5) unlink: whenever a unlink happens we delete the hardlink from the list. 6) mknod: same as create. 7) rename: whenever a rename happens we update the hardlink in list. if the hardlink was not present for updation, we add the hardlink to the list. What is pending: 1) This solution will only work for named lookups. 2) We dont track afr-self-heal/dht-rebalancer traffic for healing. Change-Id: Ia4bbaf84128ad6ce8c3ddd70bcfa82894c79585f BUG: 1212037 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/10370 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/bitrot: Follow xattr naming conventionsVenky Shankar2015-05-061-1/+1
| | | | | | | | | | | | | | | | | Instead of "trusted.glusterfs.bit-rot.*" use "trusted.bit-rot.*" NOTE: With this patch, data on existing volumes would be resigned (which should be OK as of now since we do not expect many users as of now :-)) Change-Id: I926c7bca266a9c8f2cb35d57c4d0359aa5cecfa0 BUG: 1170075 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/10181 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libgfapi : anonymous fd supportJiffin Tony Thottan2015-05-053-1/+128
| | | | | | | | | | | | | | | | Anonymous fd's are floating fd assigned to a glusterfs client without a explicit file open. Here either it will create a new anonymous fd or existing anonymous fd in the client stack for requested file.The anonymous fd's are mainly used for IO's. This patch introduces two api's glfs_h_anonymous_read and glfs_h_anonymous_write which performs read and write respectively Change-Id: Id646f2220e8387b2f8bb244c848dc1db6761444f BUG: 1204651 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9971 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* cleanup: Unmount all fuse mountsPranith Kumar K2015-05-051-0/+3
| | | | | | | | | Change-Id: I851b4bd74b595d739f7bf9eea920d07e31fa5fbc BUG: 1202244 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10540 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tiering: Send both attach-tier and tier-start togetherMohammed Rafi KC2015-05-053-9/+78
| | | | | | | | | | | | After attaching tier, we have to start tier rebalance process. This patch is to trigger tier start along with attch-tier. Change-Id: I39380f95123f0087a82213ef263f9f33adcc5adc BUG: 1214222 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10363 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* Tests: wworkaround NetBSD failures in cdc.tEmmanuel Dreyfus2015-05-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The volume reset network.compression operation cause brick processes to be restarted. If the volume is already started, a brick process is already there and the restart will fail, as the brick TCP port is already in use. Because the new brick process is not started, the volume is left with no brick online, and the volume stop operation will timeout waiting for bricks to stop. Obviosuly we have two bugs here - If volume reset network.compression needs to restart the bricks, it should first make sure the previous brick process is terminated - volume stop should not wait forever for bricks to come back online This change does not fix the bugs but just makes sure the volume is stoped before volume reset network.compression, so that the failure oes not happen. BUG: 1129939 Change-Id: I9cd5cdc767ef6ee9dd31f2121d672dc3bfdce45f Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10553 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Upcall: Send stat as part of cache_invalidation notificationsSoumya Koduri2015-05-051-4/+13
| | | | | | | | | | | | | | | | Have added support to send attributes of both entries and its parent (include oldparent in case of RENAME fop) in the same notification request to avoid multiple rpc requests. Also, made changes in gfapi to send parent object and its attributes changed in a single upcall event. Change-Id: I92833da3bcec38d65216921c2ce4d10367c32ef1 BUG: 1200262 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/10460 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* tests: Unmount aux quota mountPranith Kumar K2015-05-051-0/+2
| | | | | | | | | | Change-Id: Ie4ec40230e6b92d2e694b804a991246050b5fa51 BUG: 1202244 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10539 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Sachin Pandit <spandit@redhat.com>
* afr: add arbitration supportRavishankar N2015-05-051-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | Add logic in afr to work in conjunction with the arbiter xlator when a replica 3 arbiter volume is created. More specifically, this patch: * Enables full locks for afr data transaction for such volumes. * Removes the upfront marking of pending xattrs at the time of pre-op and defer it to post-op. (This is an arbiter independent change and is made for all afr transactions.) * After pre-op stage, check if we can proceed with the fop stage without ending up in split-brain by examining the changelog xattrs. * Unwinds the fop with failure if only one source was available at the time of pre-op and the fop happened to fail on particular source brick. * Skips data self-heal if arbiter brick is the only source available. * Adds the arbiter-count option to the shd graph. This patch is a part of the arbiter logic implementation for 3 way AFR details of which can be found at http://review.gluster.org/#/c/9656/ Change-Id: I9603db9d04de5626eb2f4d8d959ef5b46113561d BUG: 1199985 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10258 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* libglusterfs: Fix cluster_entrylk retryPranith Kumar K2015-05-041-2/+4
| | | | | | | | | Change-Id: I92ff46bae36d39a449d4bbaedc88a322992f65eb BUG: 1215265 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10391 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
* cluster/ec: Fix dictionary compare functionPranith Kumar K2015-05-041-0/+4
| | | | | | | | | | | | | | | | | | | | If both dicts are NULL then equal. If one of the dicts is NULL but the other has only ignorable keys then also they are equal. If both dicts are non-null then check if for each non-ignorable key, values are same or not. value_ignore function is used to skip comparing values for the keys which must be present in both the dictionaries but the value could be different. geo-rep's stime xattr doesn't need to be present in list xattr but when getxattr comes on stime xattr even if there aren't enough responses with the xattr we should still give out an answer which is maximum of the stimes available. Change-Id: I8de2ceaa2db785b797f302f585d88e73b154167d BUG: 1207712 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10078 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
* snapshot/uss: fix regression failure in bug-1162498.tAvra Sengupta2015-05-043-7/+6
| | | | | | | | | | | | | | | .snaps seems to take some time, before it is available based on the state of the system. Using EXPECT_WITHIN instead of TEST to check the contents of .snaps, hence giving it some time to come up. Change-Id: Iac166500d5a09ba8bab00d994c27a9ad0a01b9c3 BUG: 1218120 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10518 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: fix failures due to not unmounting $M2 (/mnt/glusterfs/2)Jeff Darcy2015-05-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Our failure to unmount meant that both mkdir and rmdir would fail in cleanup(). Because one of those mkdirs was the last thing cleanup() executed, it would fail, so the test would fail, so the entire regression run would fail. The fix has two parts. (1) Unmount the offending directory. (2) Make sure cleanup() returns success even if that last mkdir failed. That might keep us from consistently blowing up regression runs on the very first tests (basic/afr/data-self-heal.t) that we execute. Change-Id: I7a9761bd28761a5ee2face3db8112e9c3f6c5dc8 BUG: 1163543 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/10536 Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd: Enable readdir-ahead by default on new volumesanand2015-05-041-3/+0
| | | | | | | | | | | | | | With gluster-3.7, 'performance.readdir-ahead' will be enabled by default on new volumes when the cluster op-version supports it. Change-Id: I44e76a69e7d1c11e6dfad72c941caf887bb810ee BUG: 1216187 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/10433 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* tiering/cli: Check replica count and bricks are proper or notMohammed Rafi KC2015-05-041-1/+2
| | | | | | | | | | | | | | Right now, attach-tier calls parsing function for add-brick. Add-brick does not have any check for brick count and replca count compatibility. Change-Id: I44ec13eadffc003a9ebf8c4eb0193df559933a68 BUG: 1215122 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10428 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* quota: support for inode quota in quota.confvmallika2015-05-041-0/+41
| | | | | | | | | | | | | | | | | Currently when quota limit is set, corresponding gfid is set in quota.conf. This patch supports storing inode-quota limits in quota.conf and also stores additional byte for each gfid to differentiate between usage quota limit and inode quota limit. Change-Id: I444d7399407594edd280e640681679a784d4c46a BUG: 1202244 Signed-off-by: vmallika <vmallika@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/10069 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: gluster volume status should show status of bitrot and scrubber daemonGaurav Kumar Garg2015-05-041-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | Command gluster volume status <VOLNAME> should show the status of bitrot and scrubber daemon and its pid information. Along with displaying bitrot and scrubber daemon information in gluster volume status command there should be command to show its individual status separately. Command to show individual status of bitrot and scrubber daemon will following. command to show only bitd daemon information will be gluster volume status <VOLNAME> bitd command to show only scrubber daemon information gluster volume status <VOLNAME> scrub Change-Id: Id86aae1156c8c599347c98e2a538f294d37376e4 BUG: 1209752 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10175 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* tests: Check aux umount is unmounted for quota testsPranith Kumar K2015-05-0424-24/+57
| | | | | | | | | | Change-Id: If57d08f3446755ea41f66ca258efcc8ea5a89063 BUG: 1217701 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10480 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Fix spurious failuresPranith Kumar K2015-05-033-3/+3
| | | | | | | | | | | | | - Use REBALANCE_TIMEOUT in EXPECT_WITHIN - Use fdatasync to prevent write-behind from giving success - Add logfile to glupy Change-Id: I51ab51644aaa4aa9d49f185e7b8959bb58be966b BUG: 1217766 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10487 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* tests: Disable flush behind so that file will be closedPranith Kumar K2015-05-031-0/+1
| | | | | | | | | | | Change-Id: I97eb8d236448e8783f09b4922aa465a2b1b3979b BUG: 1217788 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10488 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
* features/changelog: Consider only changelog on/off as changelog breakageKotresh HR2015-05-023-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier, both chagelog on/off and brick restart were considered to be changelog breakage and treated as changelog not being continuous. As a result, new HTIME.TSTAMP file was created on both the above cases. Now the change is made such that only on changelog enable/disable, the changelog is considered to be discontinuous. New HTIME.TSTAMP file is not created on brick restart, the changelogs files are appended to last HTIME.TSTAMP file. Treating changelog as continuous in above scenario is important as changelog history API will fail otherwise. It can successfully get changes between start and end timestamps only when changelog is continuous (Changelogs in single HTIME.TSTAMP file are treated as continuous). Without this change, changelog history API would fail, and it would become necessary to fallback to other mechanisms like xsync FSCrawl in case geo-rep to detect changes in this time window. But Xsync FSCrawl would not be applicable to other consumers like glusterfind. Rationale: 1. In plain distributed volume, if brick goes down, no I/O can happen onto the brick. Hence changelog is intact with data on disk. 2. In distributed replicate volume, if brick goes down, since self-heal traffic is captured in changelog. Eventually, I/O happened whend brick down is captured in changelog. Change-Id: I2eb66efe6ee9a9228fb1fcb38d6e7696b9559d5b BUG: 1211327 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10222 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System
* nfs: fix spurious failure in bug-1166862.tNiels de Vos2015-04-301-11/+11
| | | | | | | | | | | | | | | In some environments, "showmount" could return an NFS-client that does not start with "1". This would cause the test-case to fail. The check is incorrect, the number of lines should get counted instead. Also moving the test-case to the .../nfs/... subdirectory. BUG: 1166862 Change-Id: Ic03aa8145ca57d78aea01564466e924b03bb302a Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10419 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>