summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
Commit message (Collapse)AuthorAgeFilesLines
* cluster/afr: Do a broadcast unlock in replicate to eliminate deadlock during ↵v3.0.6Pavan Sondur2010-10-211-1/+108
| | | | | | | | | | upgrade/downgrade. Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1017 (Locking deadlock when upgrading lock) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1017
* replicate: remove checks which prevented self-heal when open fds were presentAnand V. Avati2010-10-181-10/+1
| | | | | | | | | | | this check is not needed anymore since the introduction of changelog piggybacking as the optimization technique instead of first-write-to-flush technique Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1235 (Bug for all pump/migrate commits) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1235
* replicate: replace first-write-to-flush optimizationAnand V. Avati2010-10-181-106/+22
| | | | | | | | | | | use a changelog piggybacking optimization instead of first-write-to-flush optimization and do other cleanups (removal of post-post-op hook etc.) Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1235 (Bug for all pump/migrate commits) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1235
* cluster/afr: Return correct flock structures correctly in lk fops.Pavan Sondur2010-07-021-8/+9
| | | | | | | | Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1042 (Use correct flock structures in lk fops) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1042
* cluster/afr: Set lk-owner to pid when fuse does not supply it.Pavan Sondur2010-06-291-0/+11
| | | | | | | | | | | | | | | | Use the frame->root address as lk-owner when FUSE does not supply lk_owner. Raghu, I unit tested this patch with dbench and self heal tests. Did not observe lk-owner=0 in any server logs. Can you verify this patch with the other tests you had run today? Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1032 (Set lock-owner with pid when fuse does not supply value) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1032
* Unset split-brain flags in afr_self_heal_completion_cbk if self heal ↵Simone Gotti2010-06-011-5/+8
| | | | | | | | | | | | | | | completes successfully. Signed-off-by: Simone Gotti <simone.gotti@gmail.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 884 (I/O errors after fixed split brain and successfully completed self heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=884 Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 884 (I/O errors after fixed split brain and successfully completed self heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=884
* cluster/afr: Unwind lk using struct flock from a successful serverVikas Gorur2010-05-031-1/+2
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 882 (directory traversing problem (client crash)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=882
* afr: fix inode ref leak in lookupAnand Avati2010-04-081-3/+0
| | | | | | | | | | | first success lookup sets local->cont.lookup with inode_ref and second setting leaks Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 813 (inode ref leak) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=813
* cluster/afr: Cleanup fd ctx in releasedir cbkVijay Bellur2010-04-071-5/+13
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 805 (memory leak in afr) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=805
* cluster/afr: Failover readdir calls.Vikas Gorur2010-03-041-6/+27
| | | | | | | | | | | | | | | | This patch makes the replicate readdir call fail over to the next subvolume if the first call fails. It takes care to ensure that entries are not duplicated. The failover behavior of readdir only comes into effect if the option 'strict-readdir' is on. Signed-off-by: Vikas Gorur <vikas@dev.gluster.com> Signed-off-by: root <root@client02.(none)> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 453 (afr_readdir does not fail over) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=453
* cluster/afr: Send the struct flock returned by the server to the user.Vikas Gorur2010-01-211-1/+1
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 521 (SPECFS validation fails over distribute + replicate) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=521
* cluster/afr: Hold inode lock on 0-infinity for a flush transaction.Vikas Gorur2009-12-071-1/+1
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 326 ([2.0.8rc9] Spurious self-heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=326
* cluster/afr: Fix inode_ref's for local->cont.lookup.inodeVikas Gorur2009-12-051-4/+8
| | | | | | | | Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* afr: fix memory leaksAnand Avati2009-12-041-14/+31
| | | | | | | | Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170
* cluster/afr: Don't do transactional flush if pre-op has been nowhere done.Vikas Gorur2009-12-031-18/+106
| | | | | | | | | | | If a pre-op has not been done on any subvolume at all, there is no reason to make flush a transaction call. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 427 (flush on a file opened read-only should not hold locks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=427
* storage/posix: Added janitor thread.Vikas Gorur2009-12-021-1/+1
| | | | | | | | | | | | | | | | | | The janitor thread deletes all files and directories in the "/" GF_REPLICATE_TRASH_DIR directory. This directory is used by replicate self-heal to dump files and directories it deletes. This is needed because letting replicate walk the directory tree and delete a directory and all its children is too racy. Instead, replicate self-heal only does an atomic rename(), and the janitor thread takes care of actually deleting them. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 227 (replicate selfheal does not remove directory with contents in it) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=227
* cluster/afr: Set the self-heal "source" as read subvolume even when not ↵Vikas Gorur2009-12-011-26/+69
| | | | | | | | | | | | | | doing self-heal. This patch sets the read-subvolume equal to the self-heal "source" even if we're not doing self-heal (because some one else is already doing it). Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* cluster/afr: Preserve generation number along with inode in lookup and ↵Vikas Gorur2009-11-301-2/+7
| | | | | | | | | | | | | creation fops. This fixes fuse_create_cbk conflict warnings and random errors while running dbench (typically open handle failure with ENOENT). Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
* cluster/afr: Refactored lookup_cbk and introduce precedence of errors.Vikas Gorur2009-11-301-117/+299
| | | | | | | | | | | | | Error handling in afr_lookup_cbk was faulty because it did not give priority to errors such as ESTALE over ENOENT, and ENOENT over other errors. This patch fixes that, and also breaks up afr_lookup_cbk into multiple logical functions. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 205 ([ glusterfs 2.0.6rc4 ] - Hard disk failure not handled correctly) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=205
* cluster/afr: Do self-heal on unopened fds.Vikas Gorur2009-11-251-0/+9
| | | | | | | | | | | | | | This patch completes the previous patch for self-heal of open fds in replicate. If an fd was never opened on a subvolume, we remember that and do the open after we've done self-heal on that fd. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170
* cluster/afr: Refactored the self-heal interface.Vikas Gorur2009-11-241-19/+18
| | | | | | | | | | Cleaned up the self-heal interface to callers. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170
* cluster/afr: Do self-heal on reopened fds.Vikas Gorur2009-11-241-145/+29
| | | | | | | | | | | | | | | | | | | | | | | This patch brings in partial support for self-heal of open fds. The precondition is that the fd should have been opened successfully during the initial open() (or create()), and we assume that protocol/client has successfully reopened the fd when the subvolume comes back up. It works by doing an "up/down flush" (a dummy flush transaction to do post-op wherever necessary) and then triggering data self-heal on the file in the post-post-op hook of the dummy flush transaction. This ensures that any writes that come in during self-heal will wait until self-heal completes. The up/down flush is also done when a subvolume goes down, so that post-op is done on all subvolumes where pre-op was done. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170
* cluster/afr: Fix inode context bitmasks.Vikas Gorur2009-11-241-7/+5
| | | | | | | | | | | Set opendir_done and split_brain flags correctly in the inode context. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 249 (Self heal of a file that does not exist on the first subvolume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249
* cluster/afr: Fix handling of revalidate lookups.Vikas Gorur2009-11-241-24/+37
| | | | | | | | | | | | | | | | This patch does two things related to revalidate: 1) If a revalidate fails on any subvolume, the entire lookup call is failed. 2) Self-heal is not triggered on a revalidate if revalidate has failed on any subvolume. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 389 (auto-heal fails randomly and causes "Stale NFS file handle" errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=389
* cluster/afr: Ensure directory contents are in sync during opendir.Vikas Gorur2009-11-131-4/+63
| | | | | | | | | | | | | | | | | | | | | | The problem: If some files on the first subvolume disappeared without leaving a trace in the entry changelog (this can happen, for example, when an fsck has deleted files or when a hard drive is replaced), those files would never be self-healed even though they would be present on the second subvolume. This is because readdir is sent only to the first subvolume, and since the files don't appear in the directory listing, no lookup would ever be sent on them. This patch fixes this problem by doing a readdir on all the subvolumes during the first opendir on a directory inode. If a discrepancy in the contents is detected, entry self-heal in a special "force merge" mode is triggered on that directory. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 249 (Self heal of a file that does not exist on the first subvolume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249
* cluster/afr: Refactored inode context bitmasks.Vikas Gorur2009-11-131-6/+10
| | | | | | | | | | | Defined symbolic constants for the bit masks and made 'split-brain' a single bit field in the ctx. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 249 (Self heal of a file that does not exist on the first subvolume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249
* cluster/afr: In fop structure afr_readdirp is not correctly registered.vinayak hegde2009-11-051-1/+1
| | | | | | | | Signed-off-by: Vinayak Hegde <vinayak@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 360 (All fop fails when stat-prefetch is loaded on afr.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=360
* cluster/afr: Don't try to self-heal if there are locks heldVikas Gorur2009-10-301-1/+15
| | | | | | | | | | | If the inodelk_count or entrylk_count is positive on a file/directory, don't try to do self-heal on it. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 326 ([2.0.8rc9] Spurious self-heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=326
* cluster/afr: Move deleted files to /.trash in entry self-heal.Vikas Gorur2009-10-291-0/+5
| | | | | | | | | | | | | | | | | If entry self-heal determines that a file/directory should be deleted from a subvolume, move that entry to a directory called "/.trash" on that subvolume. This is for two reasons: 1) It limits the damage that can be done by a "wrong" entry self-heal. 2) It solves the problem of a to-be-deleted directory not being empty. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 227 (replicate selfheal does not remove directory with contents in it) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=227
* cluster/afr: Set local->fd in fsync.Vikas Gorur2009-10-281-0/+1
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
* cluster/afr: NFS-friendly logic changesVikas Gorur2009-10-271-9/+43
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
* cluster/afr: Pick the data self-heal algorithm dynamically.Vikas Gorur2009-10-261-1/+1
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* cluster/afr: Check the target of symlink's in entry self-heal.Vikas Gorur2009-10-261-0/+3
| | | | | | | | | | During entry self-heal, make sure not only that a symlink exists on all subvolumes, but also that their targets match. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 193 (symlink contents not self-healed by replicate) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=193
* cluster/afr: Do self-heal in the background.Vikas Gorur2009-10-261-0/+17
| | | | | | | | | | | | | | This patch introduces a new option "background-self-heal-count", with a default value of 16. This means that upto {background-self-heal-count} number of files/directories will be healed in the background at any given time. If such number of self-heals are already in progress, further self-heals take place in the foreground. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* cluster/afr: Pipeline the "full" data self-heal read-write loop.Vikas Gorur2009-10-231-0/+19
| | | | | | | | | | | | | Start upto "data-self-heal-window-size" instances of the read-write loop of the "full" data self-heal algorithm simultaneously. Add a new option "data-self-heal-window-size" with range [1-1024], and a default value of 16. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
* prevent spurious unlocks from afr selfhealAnand Avati2009-10-131-0/+3
| | | | | | | | | | afr selfheal now remembers all the nodes on which locks were successfully held and sends unlocks only to those nodes Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 112 (parallel deletion of files mounted by different clients on the same back-end hangs and/or does not completely delete) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=112
* Changed occurrences of Z Research to Gluster.Vijay Bellur2009-10-071-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* cluster/afr: Change STACK_UNWIND to STACK_UNWIND_STRICT.Vikas Gorur2009-10-071-35/+48
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 269 (Add a specialized STACK_UNWIND macro for each FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=269
* Removed remaining references to chmod, chown and utimens as part of setattr ↵Pavan Sondur2009-10-061-5/+0
| | | | | | | | | | | changes. Removed references to chmod, chown and utimes. Removed utimes references in AFR and writebehind. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
* afr: Support readdirp fopShehjar Tikoo2009-10-061-0/+1
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 292 (Separate readdirp functionality from readdir fop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=292
* cluster/afr: Initialize local->first_up_child in AFR_LOCAL_INIT.Vikas Gorur2009-10-051-26/+0
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 285 ("first up child" can change during a transaction) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=285
* Global: NFS-friendly prototype changesShehjar Tikoo2009-10-011-8/+11
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
* Global: Introduce setattr and fsetattr fopsShehjar Tikoo2009-10-011-0/+2
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
* cluster/afr: Add new option "data-self-heal-algorithm"Vikas Gorur2009-09-221-0/+12
| | | | | | | | | | option: data-self-heal-algorithm type: string default: "full" This option allows the user to specify the algorithm to be used for data self-heal. Currently supported values are "full" and "diff". Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* TAKE2[PATCH BUG:213 1/1] Support for Process State DumpVijay Bellur2009-08-191-0/+59
| | | | | | | | | Support for process state dump. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 213 (Support for process state dump) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
* cluster/afr: Use user-supplied struct flock to STACK_WINDVikas Gorur2009-07-271-1/+0
| | | | | | | | | | | | afr_lk_cbk: Use the original struct flock supplied by the user to do further STACK_WIND's, and not the flock returned by the previous STACK_WIND. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 159 (Client hangs when coherent byte range locks is attempted in replicate setup) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=159
* fix build warnings in 'afr'Amar Tumballi2009-07-201-4/+10
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 130 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130
* Added NULL checks in a few places.Vikas Gorur2009-07-151-7/+25
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 119 (filter + replicate crash..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=119
* Return inode number always from the first up subvolume in AFR.Vikas Gorur2009-07-151-10/+15
| | | | | | | | | | Also fixes a bug in the "KLUDGE" part. It was setting lookup_buf when it should have been setting local->cont.lookup.buf Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 116 (Replicate: Need inode number from first subvolume on fresh lookup) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=116
* cluster/afr - replace ZR_FILENAME_MAX by NAME_MAXBasavanagowda Kanur2009-07-061-4/+4
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>