summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* trash_unlink fop addedAmar Tumballi2009-12-012-1/+337
| | | | | | | | Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 142 (enhance features/trash translator so it can work on client side too..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=142
* features/trash initial cleanup commitAmar Tumballi2009-12-013-610/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * support O_TRUNC flag in open (call comes to FS as 'truncate' or 'ftruncate' fop) * option to provide 'eliminate-pattern' so those files matching won't be kept in trash. Eg: option eliminate-pattern *.out|*~ * option to give 'maximum' file size to keep in trash, ie, when a 20GB file is deleted, it won't be kept in trash if max file size given is 1GB. Eg: option max-trashable-file-size 1GB These particular features are developped as a part of college project by following team: Sunil bhagwath <sunilkbhagwat@gmail.com> Yashaswi Kumar <yashaswikumar@gmail.com> Rashmi B K <rashmibk17@gmail.com> Sandeep M <astrophyster@gmail.com> Submitting after minor coding standard edits and memoryleak fixes. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 142 (enhance features/trash translator so it can work on client side too..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=142
* Booster configuration fixed for per transport type and honours conf-dir option.Harshavardhana Ranganath2009-12-012-11/+57
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 421 (Make booster configuration honour conf-dir and transport type) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=421
* cluster/afr: Don't do memcpy of afr_local_t in afr_local_copy.Vikas Gorur2009-12-013-20/+7
| | | | | | | | | | | | For the background self-heal frame's local_t, copy only required members --- not a wholesale memcpy. The memcpy lead to pointers being copied and then double free'd. 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: Set file size properly before unwinding from self-heal.Vikas Gorur2009-12-011-2/+5
| | | | | | | | | | | Set the buf.st_size of the original frame's afr_local_t, and not the copy_frame'd one. 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: Set the self-heal "source" as read subvolume even when not ↵Vikas Gorur2009-12-015-29/+117
| | | | | | | | | | | | | | 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
* stat-prefetch: fix unsafe reference to @local in sp_lookup_cbkAnand Avati2009-12-011-1/+5
| | | | | | | | | | | | | stat-prefetch uses the main syscall frame for performing lookup on demand. this causes a potential reference to a freed local in sp_lookup_cbk after resuming the main syscall frame (which could have unwound and destroyed) Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 242 (If any of the writes fail, write-behind should not wait till the fd is closed for reporting errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=242
* performance/stat-prefetch: make lookup to wait for the completion of another ↵Raghavendra G2009-12-011-14/+106
| | | | | | | | | | | | | | | | lookup on same path if one is in progress. - If current lookup (2) does not wait for completion of the lookup (1) which is in progress, there can be a race condition where (2) completes ahead of (1) and resuming all the waiting operations in the queue. When (1) returns, the original operation (eg., stat, chmod etc) might've already unwound and hence the frame would've been destroyed. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
* performance/stat-prefetch: don't use same variable for getting inode context ↵Raghavendra G2009-12-011-5/+5
| | | | | | | | | | | | | of an inode and its parent. - this bug results in updation of flags in inode context of the parent instead of that of inode. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
* performance/stat-prefetch: fix errors in handling memory allocation failures ↵Raghavendra G2009-12-011-3/+3
| | | | | | | | | | | | | | in sp_inode_ctx_process. - the variables that are used for making decisions are assigned before memory allocations and these variables were not reset to correct values in case of memory allocation failures. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
* fix leaks pointed out by cppcheck static analyzerCsaba Henk2009-11-305-3/+10
| | | | | | | | | | | | | | | | | | | See http://cppcheck.sf.net [./build/libglusterfs/src/y.tab.c:2104]: (error) Memory leak: cmd [./libglusterfs/src/md5.c:306]: (error) Resource leak: f [./xlators/debug/io-stats/src/io-stats.c:1396]: (error) Possible null pointer dereference: this - otherwise it is redundant to check if this is null at line 1402 [./xlators/cluster/stripe/src/stripe.c:3597]: (error) Memory leak: dup_str [./xlators/debug/trace/src/trace.c:2426]: (error) Possible null pointer dereference: this - otherwise it is redundant to check if this is null at line 2429 These appear in rarely hit error cases or test/demo code so nothing serious, in fact. Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 420 (fix leaks pointed out by cppcheck static analyzer) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=420
* cluster/afr: Preserve generation number along with inode in lookup and ↵Vikas Gorur2009-11-303-3/+26
| | | | | | | | | | | | | 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-302-117/+303
| | | | | | | | | | | | | 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
* afr: fix crash in afr_sh_data_closeAnand Avati2009-11-291-0/+3
| | | | | | | | | | | | when active_sink count is 0, the code proceeded into a dangerous loop resulting in a crash while issuing the call or in the callback afr_sh_data_setattr_cbk or afr_sh_data_flush_cbk 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
* protocol/server: enhance trace loggingAnand Avati2009-11-293-85/+206
| | | | | | | | | | add logging of fop name, callid number and make logging more friendly Signed-off-by: Anand V. Avati <avati@blackhole.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
* afr: handle fdctx->pre_op_done handlingAnand Avati2009-11-291-0/+1
| | | | | | | | | | | | reset pre_op_done[i] to 0 after issuing a postop in flush. this was missed during the introduction of pre_op_done[] array and was resulting in a lot of spurious self heals when spurious flushes were received 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
* afr: fix logic to break out of diff/checksum loopAnand Avati2009-11-281-9/+5
| | | | | | | | | | | | When checksum fop returns error, mark for terminating the loop at the end of the iteration (when all checksum calls of that iteration return) and not immediately Signed-off-by: Anand V. Avati <avati@blackhole.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
* protocol/server: fix improper validation of fd in server_rchecksumAnand Avati2009-11-281-6/+0
| | | | | | | | | | state->fd validation should be done _after_ resolve_and_resume() Signed-off-by: Anand V. Avati <avati@blackhole.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
* performance/quick-read: add options to doc/translator-options.txt.Raghavendra G2009-11-281-0/+4
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 419 (Issues with writing files of size >= 1MB) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=419
* performance/quick-read: change the maximum value of max-file-size to 1000KB ↵Raghavendra G2009-11-281-4/+4
| | | | | | | | | | | | | | | from 1MB. - protocol restricts the maximum buffer size that can be received over network to 1MB. Since the buffer holding reply of lookup should also contain the lookup header and other key/value pairs of xattr_reply dict, the maximum file size that can be fetched through dictionary cannot be equal to 1MB. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 419 (Issues with writing files of size >= 1MB) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=419
* Excluding static libraries.Harshavardhana Ranganath2009-11-281-0/+1
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 413 (rpmbuild fails with unpackaged files) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=413
* Removed deprecated export_dir in print string.Harshavardhana Ranganath2009-11-281-1/+1
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 412 (Remove deprecated export_dir in print string) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=412
* moved unify from 'cluster/unify' to 'legacy/cluster/unify'Amar Tumballi2009-11-281-1/+1
| | | | | | | | | | | | maintaining unify is not feasible, and its design of namespace is not scalable too. hence moving it to 'legacy/' directory.. Thanks to unify, we learnt something about rename(). 'cluster/unify' has served GlusterFS well for more than 2years, and its the time to say goodbye :-( Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* performance/stat-prefetch: Changed rbthash to make use of 1 bucketVijay Bellur2009-11-262-16/+66
| | | | | | | | | | rbthash makes use of 1 bucket and a common mem-pool is being used for all rbt entries. Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
* Volgen rewritten using option parser and added proper support for booster.Harshavardhana Ranganath2009-11-263-211/+274
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 411 (Rewrite volgen using option parser and extend cifs/nfs support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=411
* THIS: transport to use xlator_notify() for proper setting of @THISAnand Avati2009-11-261-2/+2
| | | | | | | | Signed-off-by: Anand V. Avati <avati@blackhole.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
* protocol/server: Introduce option trace to log requests and replies in ↵Pavan Sondur2009-11-264-6/+176
| | | | | | | | | | normal log. Signed-off-by: Pavan Vilas Sondur <pavan@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
* protocol/server: Get all fops to use the new 'resolve_and_resume' path in ↵Pavan Sondur2009-11-262-277/+299
| | | | | | | | | | server/protocol. Signed-off-by: Pavan Vilas Sondur <pavan@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
* Changed rbthash_table_init() to take a mem-pool argument.Vijay Bellur2009-11-266-31/+115
| | | | | | | | | | | | | | | | | | | Changes in libglusterfs/rbthash: rbthash_table_init() now takes a mem-pool argument. The mem-pool argument would be mutually exclusive to expected_entries. If expected_entries is provided, mem-pool would be ignored and vice-versa. Changes in io-cache: 1) Moved rbthash creation to readv. 2) rbthash makes use of 1 rbt instead of 4096 3) A global mem-pool is being used in place of a mem-pool per rbt. Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 335 (Io-cache optimization) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=335
* fixes in nufaAmar Tumballi2009-11-263-96/+92
| | | | | | | | | | | | | | | Now nufa uses dht_conf->private variable to store its contents, and doesn't pollute distribute's structures. It used to hang earlier as layout_lock was not INIT()'d. whitespace-cleanup done on the code too. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 409 (implement a switch scheduler) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=409
* switch translator addedAmar Tumballi2009-11-263-1/+1059
| | | | | | | | | | | switch translator is a wrapper around distribute to work for a pattern based scheduling. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 409 (implement a switch scheduler) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=409
* Volgen supporting multidisks and booster configuration for nfs and cifsHarshavardhana Ranganath2009-11-268-440/+489
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 396 (Volgen multiple export directory support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=396
* add an extra check for loc->parent when loc->ino is not 1Amar Tumballi2009-11-261-1/+1
| | | | | | | | | | | | This extra check is needed only in case where setup is "server -> chain -> client", where for the root inode, inode->ino is not updated in the first lookup call, hence used to crash. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 377 (segfault in protocol/client with chaining) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=377
* Fixed typo in gf_proc_dump for attribute_timeout.Harshavardhana Ranganath2009-11-261-1/+1
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 410 (Typo in gf_proc_dump for attribute_timeout) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=410
* don't allow stripe with just one subvolumeAmar Tumballi2009-11-261-1/+7
| | | | | | | | | | | | stripe code assumes in many places that it will have more than one subvolume, but the strict check was not there in init, hence, if somebody configures stripe with just one subvolume, it will cause many fops with frame loss. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 340 (Kernel Compilation fail in stripe) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=340
* protocol/server: Changed logging level of message on deep resolutionVijay Bellur2009-11-261-1/+1
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@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
* changed the log level of failure case in client_setvolume_cbkAmar Tumballi2009-11-261-1/+1
| | | | | | | | | | | It *should* be an error when a handshake fails. Its hard to debug it otherwise Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 26 (Version mismatch not handled correctly) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=26
* Added boundaries for each fops, mops and cbks.Harshavardhana Ranganath2009-11-261-6/+7
| | | | | | | | Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 366 (Infinite loop with centralized logging.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=366
* cluster/afr: Include "common-utils.h" instead of alloca.hVikas Gorur2009-11-261-1/+1
| | | | | | | | | | | alloca.h should be included on a platform-specific basis. Lets common-utils.h handle that. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 349 (FreeBSD compilation error (alloca.h).) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=349
* protocol/client: Make log message print both generation number and inode number.Vikas Gorur2009-11-251-4/+6
| | | | | | | | 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: Do self-heal on unopened fds.Vikas Gorur2009-11-256-26/+232
| | | | | | | | | | | | | | 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
* performance/stat-prefetch: Add refcounting to cache objectsRaghavendra G2009-11-241-6/+88
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 405 (Segmentation fault in stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=405
* performance/stat-prefetch: remove lock member in sp_fd_ctx_t.Raghavendra G2009-11-242-36/+22
| | | | | | | | | | | - since the lifetime of fd context can be no longer than the fd, we can use lock in fd. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 405 (Segmentation fault in stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=405
* performance/stat-prefetch: don't free the cache in readdir if the offset is ↵Raghavendra G2009-11-241-5/+2
| | | | | | | | | | | | | | | | | | | | | | not the expected one. - cache creation is expensive operation. Also, cache will be freed in releasedir. Hence, just remove all entries from cache without freeing the cache. However this is not entirely true, since sp_cache_remove_entry frees the old table and reinitializes a new table if all entries are being removed. When rbtree based hash table provides an interface to remove all the entries, sp_cache_remove_entry should be modified not to destroy the table. - this patch also fixes a race condition wherein the cache being used in lookup getting freed in readdir if the offset is not equal to expected offset. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 405 (Segmentation fault in stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=405
* cluster/afr: Refactored the self-heal interface.Vikas Gorur2009-11-249-167/+141
| | | | | | | | | | 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-2410-229/+699
| | | | | | | | | | | | | | | | | | | | | | | 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: Provide a post-post_op hook in the transaction.Vikas Gorur2009-11-242-6/+23
| | | | | | | | 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 data self-heal algorithm.Vikas Gorur2009-11-242-143/+248
| | | | | | | | | | | | | | | | | | Refactored the operation of the data self-heal algorithm as: * open all fd's (if fd not supplied by caller) * lock 0-0 (if lock not supplied by caller) * fxattrop, fstat (instead of lookup) ... self heal ... * unlock (if lock not supplied by caller) * close (if fd not supplied by caller). 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: Hold blocking locks for data self-heal.Vikas Gorur2009-11-244-35/+62
| | | | | | | | | | | Data self-heal now holds blocking locks, and instead of locking on all subvolumes, it only locks on {data-lock-server-count} subvolumes. 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: Set read-child = source regardless of foreground/background ↵Vikas Gorur2009-11-241-1/+2
| | | | | | | | | | self-heal 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