summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-diskusage.c
Commit message (Collapse)AuthorAgeFilesLines
* distribute rebalance: handle the open file migrationAmar Tumballi2011-09-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Complexity involved: To migrate a file with open fd, we have to notify the other client process which has the open fd, and make sure the write()s happening on that fd is properly synced to the migrated file. Once the migration is complete, the client process which has open-fd should get notified and it should start performing all the operations on the new subvolume, instead of earlier cached volume. How to solve the notification part: We can overload the 'postbuf' attribute in the _cbk() function to understand if a file is 'under-migration' or 'migration-complete' state. (This will be something similar to deciding whether a file is DHT-linkfile by its 'mode'). Overall change includes below mentioned major changes: 1. dht_linkfile is decided by only 2 factors (mode(01000), xattr(trusted.glusterfs.dht.linkto)), instead of earlier 3 factors (size==0) 2. in linkfile self-heal part (in 'dht_lookup_everywhere_cbk()'), don't delete a linkfile if there is a open-fd on it. It means, there may be a migration in progress. 3. if a file's revalidate fails with ENOENT, it may be due to file migration, and hence need a lookup_everywhere() 4. There will be 2 phases of file-migration. -> Phase 1: Migration in progress * The source data file will have SGID and STICKY bit set in its mode. * The source data file will have a 'linkto' xattr pointing the destination. * Destination file will have mode set to '01000', and 'linkto' xattr set to itself. -> Phase 2: File migration Complete * The source data file will have mode '01000', and will be 'truncated' to size 0. * The destination file will have inherited mode from the source. (without sgid and sticky bit) and its 'linkto' attribute will be removed. 4. Changes in distribute to work smoothly with a file which is in migration / got migrated. The 'fops' are divided into 3 categories, inode-read, inode-write and others. inode-read fops need to handle only 'phase 2' notification, where as, the inode-write fops need to handle both 'phase 1' and phase2. The inode-write operations will be done on source file, and if any of 'file-migration' procedures are detected in _cbk(), then the operations should be performed on the destination too. when a phase-2 is detected, then the inode-ctx itself should be changed to represent a new layout. With these changes, the open file migration will work smoothly with multiple clients. Change-Id: I512408463814e650f34c62ed009bf2101d016fd6 BUG: 3071 Reviewed-on: http://review.gluster.com/209 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Change Copyright current yearPranith Kumar K2011-08-101-1/+1
| | | | | | | | Change-Id: I2d10f2be44f518f496427f257988f1858e888084 BUG: 3348 Reviewed-on: http://review.gluster.com/200 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* LICENSE: s/GNU Affero General Public/GNU General Public/Pranith Kumar K2011-08-061-3/+3
| | | | | | | | Change-Id: I3914467611e573cccee0d22df93920cf1b2eb79f BUG: 3348 Reviewed-on: http://review.gluster.com/182 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* dht disk usage: Correct free blk calculationshishir gowda2011-07-071-2/+2
| | | | | | | | | | | | | | Use f_bavial instead of f_bfree for %free calculation This fixes mismatch of df output wrt backend and glusterfs where: f_bfree = /* # free blocks */ f_bavail; /* free blocks avail to non-superuser */ Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3084 (Correcting percent calculation of disk space) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3084
* cluster/dht: log enhancementsAmar Tumballi2011-03-171-9/+4
| | | | | | | | | Signed-off-by: Shishir Gowda <shishirng@gluster.com> Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
* cluster/dht: whitespace cleanupAmar Tumballi2011-03-171-54/+54
| | | | | | | | | | also fill tabs by spaces (untabify), and indent the code Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
* distribute: bring in statfs normalizationAmar Tumballi2010-10-271-1/+1
| | | | | | | | | | | | | | We had normalization of statvfs structure in 'cluster/unify' translator, with distribute, we had this section as 'TODO:'. Now, the same code is migrated to distribute. Thanks to <marty.rosenberg@gmail.com> for sending the patches Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1035 (The distribute translator does not handle differently sized block sizes and/or fragment sizes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1035
* Copyright changesVijay Bellur2010-10-111-1/+1
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
* Change GNU GPL to GNU AGPLPranith K2010-10-041-3/+3
| | | | | | | | Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1388 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1388
* Fix incorrect logmsg about disk space in dhtshishir gowda2010-09-091-6/+8
| | | | | | | | Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1573 (Incorrect information about disk space in dht) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1573
* Remove dead variables.Sachidananda2010-08-021-2/+0
| | | | | | | | Signed-off-by: Sachidananda Urs <sac@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1068 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1068
* Bug 799: dht prints 100% full when subvolume is not connected to remote hostLakshmipathi2010-05-211-1/+1
| | | | | | | | Signed-off-by: lakshmipathi <lakshmipathi@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 799 (dht prints 100% full when subvolume is not connected to remote host) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=799
* THIS: set THIS pointers before forget/release/releasedir callbacksAnand Avati2009-12-061-1/+1
| | | | | Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* Changed occurrences of Z Research to Gluster.Vijay Bellur2009-10-071-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* making dht and nufa's 'min-free-disk' option to take both percent and disk-sizeAmar Tumballi2009-06-181-13/+40
| | | | | | | | | | | Originally from Paul Rawson <plrca2@gmail.com> http://patches.gluster.com/patch/391/ : patch re-submitted with patching guidelines. cluster/distribute, and cluster/nufa uses new option PERCENT_OR_SIZET for its option 'min-free-disk'. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* change the log level of disk full message in dht-diskusageAmar Tumballi2009-06-181-3/+3
| | | | | | | | the current msg is getting printed in warning level. Instead changed it to debug, as the msg specific each node being full is already getting printed in higher priority, hence this msg looks excessive. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* bug fix in dht-diskusage when statvfs->f_blocks is 0Amar Tumballi2009-06-021-2/+3
| | | | | | | This can happen when 'option export-statfs-size off' is given in posix volume. Caused divide by 0 error. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* log message cleanup in distributeAnand V. Avati2009-04-241-7/+7
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* bug fixes in dht-disk-usage feature.Amar Tumballi2009-04-141-0/+3
| | | | | | fixes bugs seen with dht's disk usage. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* in dht, initialize the free available space properly, so the first few ↵Amar Tumballi2009-04-121-3/+48
| | | | | | creates are not confused. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* distribute to take care of available disk space while creating new dirs, and ↵Amar Tumballi2009-04-031-0/+187
files. distribute gets awareness about disk-space while creating the files Signed-off-by: Anand V. Avati <avati@amp.gluster.com>