summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
Commit message (Collapse)AuthorAgeFilesLines
* DHT - Removing commit hash and 'magical' return value from rebalanceBarak Sason Rofman2020-10-071-26/+7
| | | | | | | | | | | | | | | | | | | The order of operation in rebalance is as follows: gf_defrag_fix_layout - > gf_defrag_process_dir - > gf_defrag_get_entry gf_defrag_process_dir is passing to gf_defrag_get_entry a pointer to a variable 'gf_defrag_get_entry', however this value is ignored (remains unchanged in the method). Based on the return value from gf_defrag_get_entry, gf_defrag_process_dir may change it's return value to the 'magical' number 2, however since the value of 'should_commit_hash' never changes, this never happnes. All of this is propagated back to gf_defrag_fix_layout and is now removed from there as well. Change-Id: Ibff297650cf84139bd26c830bfa44f81119b60d4 updates: #1002 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht - Remove "tier" code (part 2)Barak Sason Rofman2020-10-019-515/+81
| | | | | | | | | | | | | | Part 1 of this patch https://review.gluster.org/#/c/glusterfs/+/24328/ Following part 1, this patch complety removes all traces of "tier" feature in dht. This is based in the work done in https://review.gluster.org/#/c/glusterfs/+/23935/ Change-Id: I7fba1ab7249719301ca578b4a6f4acac748da145 updates: #1097 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* DHT - Fixing memory allocation crashBarak Sason Rofman2020-10-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The allocation dir_dfmeta = GF_CALLOC(1, sizeof(*dir_dfmeta), gf_common_mt_pointer); seems to cause a crash. From the logs: [2020-09-24 13:10:13.225935 +0000] I [dht-rebalance.c:3273:gf_defrag_process_dir] 0-dist-dht: migrate data called on /dir1 [2020-09-24 13:10:13.226587 +0000] E [mem-pool.c:61:gf_mem_set_acct_info] (-->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x18e60) [0x7f4b1f71ee60] -->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x173ab) [0x7f4b1f71d3ab] -->/usr/local/lib/libglusterfs.so.0(+0x4d8e5) [0x7f4b357668e5] ) 0-: Assertion failed: type <= mem_acct->num_types [2020-09-24 13:10:13.226623 +0000] E [mem-pool.c:61:gf_mem_set_acct_info] (-->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x18e60) [0x7f4b1f71ee60] -->/usr/local/lib/glusterfs/9dev/xlator/cluster/distribute.so(+0x173d3) [0x7f4b1f71d3d3] -->/usr/local/lib/libglusterfs.so.0(+0x4d8e5) [0x7f4b357668e5] ) 0-: Assertion failed: type <= mem_acct->num_types The following change fixes that crash. fixes: #1511 Change-Id: Ibf605648981f7108e863c91a80370cf077ad7c4a Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht: explicit null dereferencenik-redhat2020-09-292-0/+4
| | | | | | | | | | | | | | Added a null check for uuid_list_copy, to avoid null dereference in strtok_r() in case of strdup() failure. CID: 1325612 CID: 1274223 Updates: #1060 Change-Id: I641a5068cd76d7b2ed92eccf39e7f97d6f7b2480 Signed-off-by: nik-redhat <nladha@redhat.com>
* dht: Ongoing IO is failing on non-distribute volumes after just add-brickMohit Agrawal2020-09-283-8/+41
| | | | | | | | | | | | | Problem: On a non-distributed volumes linux kernel untar is failed after running add-brick operation Solution: 1) Save hashed subvol as a MDS in case while MDS has not been populated Fixes: #1328 Change-Id: I9967e136da008c6367973a7346637617dfa8f934 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* DHT - fixing a bug in thread creationBarak Sason Rofman2020-09-241-2/+2
| | | | | | | | | | The 3rd argument of gf_thread_create is a pointer to a method, however in this case, a pointer to a pointer to a method is passed (2 levels of indirection instead of 1). Change-Id: Ic2d4ea75aa54c6bc85a80bd0277a0efa5e5814ad updates: #1002 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* Revert "dht: optimize rebalance crawl path"Pranith Kumar K2020-09-034-524/+5
| | | | | | | | | | | Based on the discussion on the issue, it is decided that it is better to not have this implementation of the feature. This reverts commit 3af9443c770837abe4f54db399623380ab9767a7. Change-Id: I4e3bf18fc376cdb0cf29f1d98a915deca17c3496 Updates: #1422 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* cluster/dht: simplify and cleanup internal time managementDmitry Antipov2020-08-215-35/+15
| | | | | | | | | | Prefer time_t and gf_time() over 'struct timeval' and gettimeofday() where microseconds are not really used, drop unneeded 'struct timeval' to 'struct timespec' conversion in dht_file_counter_thread(). Change-Id: Ibd802f79b8848df3f6175ca1fd82e93532bba38d Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* libglusterfs: add functions to calculate time differenceDmitry Antipov2020-08-211-4/+2
| | | | | | | | | | Add gf_tvdiff() and gf_tsdiff() to calculate the difference between 'struct timeval' and 'struct timespec' values, use them where appropriate. Change-Id: I172be06ee84e99a1da76847c15e5ea3fbc059338 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
* dht: optimize rebalance crawl pathSusant Palai2020-07-314-5/+524
| | | | | | | | | | | | | | | | | | | | | | For distribute only volumes we can use the information for local subvolumes to avoid syncop calls which goes through the whole stack to fetch stat and entries. A separate function gf_defrag_fix_layout_puredist is introduced. TODO: A glusterd flag needs to be introduced in case we want to fall back to run the old way. Perf numbers: DirSize - 1Million Old New %diff Depth - 100 (Run 1) 353 74 +377% Depth - 100 (Run 2) 348 72 +377~% Depth - 50 246 122 +100% Depth - 3 174 114 +52% Change-Id: I67cc136cebd34092fd775e69f74c2d5b33d3156d Fixes: #1242 Signed-off-by: Susant Palai <spalai@redhat.com>
* dht - fixing xattr inconsistencyBarak Sason Rofman2020-07-224-13/+20
| | | | | | | | | | | | | | | | | The scenario of setting an xattr to a dir, killing one of the bricks, removing the xattr, bringing back the brick results in xattr inconsistency - The downed brick will still have the xattr, but the rest won't. This patch add a mechanism that will remove the extra xattrs during lookup. This patch is a modification to a previous patch based on comments that were made after merge: https://review.gluster.org/#/c/glusterfs/+/24613/ fixes: #1324 Change-Id: Ifec0b7aea6cd40daa8b0319b881191cf83e031d1 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* cluster/dht: suppress file migration error for node not supposed to migrate fileTamar Shacked2020-07-151-13/+25
| | | | | | | | | | | | | | | | | | | | | A rebalance process does a lookup for every file in the dir it is processing before checking if it supposed to migrate the file. In this issue there are two rebalance processses running on a replica subvol: R1 is migrating the FILE. R2 is not supposed to migrate the FILE, but it does a lookup and finds a stale linkfile which is mostly due to a stale layout. Then, it tries to unlink the stale linkfile and gets EBUSY as the linkfile fd is open due R1 migration. As a result a misleading error msg about FILE migration failure due EBUSY is logged in R2 logfile. Fix: suppress the error in case it occured in a node that is not supposed to migrate the file. fixes: #1371 Change-Id: I37832b404e2b0cc40ac5caf45f14c32c891e71f3 Signed-off-by: Tamar Shacked <tshacked@redhat.com>
* dht: Heal missing dir entry on brick in revalidate pathSusant Palai2020-07-091-1/+9
| | | | | | | | | Mark dir as missing in layout structure to be healed in dht_selfheal_directory. fixes: #1327 Change-Id: If2c69294bd8107c26624cfe220f008bc3b952a4e Signed-off-by: Susant Palai <spalai@redhat.com>
* Revert "dht - fixing xattr inconsistency"Barak Sason Rofman2020-06-251-63/+0
| | | | | | | | | | | | This reverts commit 620158475f462251c996901a8e24306ef6cb4c42. The patch to revert is https://review.gluster.org/#/c/glusterfs/+/24613/ Reverting is required as comments were posted regarding a more efficient implementation were made after the patch was merged. A new patch will be posted to adress the comments will be posted. updates: #1324 Change-Id: I59205baefe1cada033c736d41ce9c51b21727d3f Signed-off-by: Barak Sason Rofman <redhat@gmail.com>
* dht - fixing xattr inconsistencyBarak Sason Rofman2020-06-251-0/+63
| | | | | | | | | | | | | The scenario of setting an xattr to a dir, killing one of the bricks, removing the xattr, bringing back the brick results in xattr inconsistency - The downed brick will still have the xattr, but the rest won't. This patch add a mechanism that will remove the extra xattrs during lookup. fixes: #1324 Change-Id: Ibcc449bad6c7cb46bcae380e42e4496d733b453d Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* cluster/afr: Delay post-op for fsyncPranith Kumar K2020-06-081-1/+14
| | | | | | | | | | | | | | | | | | Problem: AFR doesn't delay post-op for fsync fop. For fsync heavy workloads this leads to un-necessary fxattrop/finodelk for every fsync leading to bad performance. Fix: Have delayed post-op for fsync. Add special flag in xdata to indicate that afr shouldn't delay post-op in cases where either the process will terminate or graph-switch would happen. Otherwise it leads to un-necessary heals when the graph-switch/process-termination happens before delayed-post-op completes. Fixes: #1253 Change-Id: I531940d13269a111c49e0510d49514dc169f4577 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* dht - sparse files rebalance enhancementsBarak Sason Rofman2020-06-011-111/+102
| | | | | | | | | | | | | | | Currently data migration in rebalance reads sparse file sequentially, disregarding which segments are holes and which are data. This can lead to extremely long migration time for large sparse file. Data migration mechanism needs to be enhanced so only data segments are read and migrated. This can be achieved using lseek to seek for holes and data in the file. This enhancement is a consequence of https://bugzilla.redhat.com/show_bug.cgi?id=1823703 fixes: #1222 Change-Id: If5f448a0c532926464e1f34f504c5c94749b08c3 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht: add null check in gf_defrag_free_dir_dfmetaSusant Palai2020-05-261-1/+2
| | | | | | fixes: #1258 Change-Id: I9d1fb512072bcc540d21d47da5b15ae1b79cf2b8 Signed-off-by: Susant Palai <spalai@redhat.com>
* dht: Do opendir selectively in gf_defrag_process_dirSusant Palai2020-05-122-22/+55
| | | | | | | | | | | | | | | | Currently opendir is done from the cluster view. Hence, even if one opendir is successful, the opendir operation as a whole is considered successful. But since in gf_defrag_get_entry we fetch entries selectively from local_subvols, we need to opendir individually on those local subvols and keep track of fds separately. Otherwise it is possible that opendir failed on one of the subvol and we wind readdirp call on the fd to the corresponding subvol, which will ultimately result in EINVAL error. fixes: #1218 Change-Id: I50dd88b9597852a15579f4ee325918979417f570 Signed-off-by: Susant Palai <spalai@redhat.com>
* cluster/dht: Don't access local after STACK_DESTROYPranith Kumar K2020-05-031-1/+3
| | | | | | | | | | | | | There is a possibility that 'frame' could have been destroyed in dht_selfheal_dir_setattr() which can lead to local->mds_heal_fresh_lookup showing junk non-zero number. That will lead to double STACK_DESTROY. Remembered the value of the variable before the call to fix the access. Fixes: #1214 Change-Id: I37d1657798bfb549bb3887e260484d58fff42c91 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* dht xlator: integer handling issuenik-redhat2020-04-294-11/+19
| | | | | | | | | | | | | | Issue: The ret value is passed to the function instead of the proper errno value Fix: Passing the errno generated to the log function CID: 1415824 : Improper use of negative value CID: 1420205 : Improper use of negative value Change-Id: Iaa7407ebd03eda46a2c027695e6bf0f598b371b2 Updates: #1060 Signed-off-by: nik-redhat <nladha@redhat.com>
* dht: Handle setxattr and rm race for directory in rebalanceSusant Palai2020-04-283-0/+33
| | | | | | | | | | | | | | Problem: Selfheal as part of directory does not return an error if the layout setxattr fails. This is because the actual lookup fop must have been successful to proceed for layout heal. Hence, we could not tell if fix-layout failed in rebalance. Solution: We can check this information in the layout structure that whether all the xlators have returned error. fixes: #1200 Change-Id: I3e5f2a36c0d934c21476a73a9a5473d8e490cde7 Signed-off-by: Susant Palai <spalai@redhat.com>
* dht - fixing rebalance failures for files with holesBarak Sason Rofman2020-04-241-11/+10
| | | | | | | | | | | Rebalance process handling of files which contains holes casued rebalance to fail with "No space left on device" errors. This patch modifies the code-flow in such a way that files with holes will be rebalanced correctly. fixes: #1187 Change-Id: I89bc3d4ea7f074db7213d759c49307f379543932 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht/rebalance - fixing recursive failure issueBarak Sason Rofman2020-04-211-1/+2
| | | | | | | | | | | If rebalance process is failing, recursive failures appear in the log file, which is distracting from the root cause. In order to avoid recursive failure, error handling mechanism has been modified. fixes: #1072 Change-Id: Iae19430323630acd97c2c8d35685626d8da747a7 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht - Remove "tier" code (part 1)v9devBarak Sason Rofman2020-04-173-476/+19
| | | | | | | | | | | | | This patch is removing some of the "tier" code in dht xlator, as it is no longer being used. Not all of the not-needed code is removed at once, so reviewing is easier. Follow up patches removing additional unused code will follow. This is based in the work done in https://review.gluster.org/#/c/glusterfs/+/23935/ Change-Id: I3cb6a0c5d8f14afcd87cf021ef8f74b91c0f908a updates: #1097 Signed-off-by: Barak Sason Rofman <bsaonro@redhat.com>
* dht - fixing a permission update issueBarak Sason Rofman2020-04-082-8/+33
| | | | | | | | | | | | | | | | | | When bringing back a downed brick and performing lookup from the client side, the permission on said brick aren't updated on the first lookup, but only on the second. This patch modifies permission update logic so the first lookup will trigger a permission update on the downed brick. LIMITATIONS OF THE PATCH: As the choice of source depends on whether the directory has layout or not. Even the directories on the newly added brick will have layout xattr[zeroed], but the same is not true for a root directory. Hence, in case in the entire cluster only the newly added bricks are up [and others are down], then any change in permission during this time will be overwritten by the older permissions when the cluster is restarted. fixes: #999 Change-Id: Ieb70246d41e59f9cae9f70bc203627a433dfbd33 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht: gf_defrag_process_dir is called even if gf_defrag_fix_layout has failedSusant Palai2020-03-241-0/+1
| | | | | | | | | Currently even though gf_defrag_fix_layout fails with ENOENT or ESTALE, a subsequent call is made to gf_defrag_process_dir leading to rebalance failure. fixes: #1102 Change-Id: Ib0c309fd78e89a000fed3feb4bbe2c5b48e61478 Signed-off-by: Susant Palai <spalai@redhat.com>
* dht - selfheal code cleaningBarak Sason Rofman2020-03-121-135/+20
| | | | | | | | | 1 - Converted methods to static 2 - Removed unused code Change-Id: I49db3e28116da1c3c9ff0a33dcce7281bc3856f7 updates: bz#1193929 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht/rebalance - fixing failure occurace due to rebalance stopBarak Sason Rofman2020-03-041-0/+8
| | | | | | | | | | | | | | | | | Probelm description: When topping rebalance, the following error messages appear in the rebalance log file: [2020-01-28 14:31:42.452070] W [dht-rebalance.c:3447:gf_defrag_process_dir] 0-distrep-dht: Found error from gf_defrag_get_entry [2020-01-28 14:31:42.452764] E [MSGID: 109111] [dht-rebalance.c:3971:gf_defrag_fix_layout] 0-distrep-dht: gf_defrag_process_dir failed for directory: /0/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31 [2020-01-28 14:31:42.453498] E [MSGID: 109016] [dht-rebalance.c:3906:gf_defrag_fix_layout] 0-distrep-dht: Fix layout failed for /0/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30 In order to avoid seing these error messages, a modification to the error handling mechanism has been made. In addition, several log messages had been added in order to improve debugging efficiency fixes: bz#1800956 Change-Id: Ifc82dae79ab3da9fe22ee25088a2a6b855afcfcf Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* xlator/dht-helper: structure loggingyatipadia2020-03-032-97/+75
| | | | | | | | | | convert gf_msg() to gf_smsg() Updates: #657 Change-Id: Iab35ac89b7d7fb6fb0074fc61b11bf679c517c9d Signed-off-by: yatipadia <ypadia@redhat.com> Signed-off-by: yatip <ypadia@redhat.com>
* xlator/dht-lock: structure loggingyatipadia2020-02-262-105/+113
| | | | | | | | convert gf_msg() to gf_smsg() Change-Id: If540ca921b1cd8ca75b92b3d72eb9eb61bdaaa10 Updates: #657 Signed-off-by: yatip <ypadia@redhat.com>
* dht - Reducing methods scopeBarak Sason Rofman2020-02-136-104/+60
| | | | | | | | | | 1. Reduced methods scope in the following: inode read&write, layout, linkfile, shard 2. Removed dead code @ dht-linkkile.c:174-228 & dht-shard.c:44 Change-Id: I2d08a10c7b074fccdb0c020845cad60c6ea32db5 updates: bz#1193929 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht: Fix stale-layout and create issueSusant Palai2020-02-092-15/+140
| | | | | | | | | | | | | | | | | Problem: With lookup-optimize set to on by default, a client with stale-layout can create a new file on a wrong subvol. This will lead to possible duplicate files if two different clients attempt to create the same file with two different layouts. Solution: Send in-memory layout to be cross checked at posix before commiting a "create". In case of a mismatch, sync the client layout with that of the server and attempt the create fop one more time. test: Manual, testcase(attached) fixes: bz#1786679 Change-Id: Ife0941f105113f1c572f4363cbcee65e0dd9bd6a Signed-off-by: Susant Palai <spalai@redhat.com>
* dht-hashfn.c: ensure we do not try to calculate hash on NULL pathYaniv Kaul2020-02-051-0/+3
| | | | | | | | | | | For some reason, dht_selfheal_layout_alloc_start() sends a NULL loc->path string to dht_hash_compute(). Until we understand why it happens, we should strive not to crash on a strlen of a NULL pointer. Change-Id: I8c2a22602cfccba9af85f432a1841556f6978450 updates: bz#1793378 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* xlator/dht-selfheal: structure loggingyatipadia2020-02-043-258/+222
| | | | | | | | Convert gf_msg() to gf_smsg() Change-Id: Ic72f2513e641cfcbe074933cb2697ee9fc05a766 Updates: #657 Signed-off-by: yatip <ypadia@redhat.com>
* xlator/dht-linkfile: structure loggingyatip2020-02-042-26/+269
| | | | | | | | | convert all gf_msg() to gf_smsg() Updates: #657 Change-Id: I9104ba8a8102f04d031a208abb06b6cf8ea8fd13 Signed-off-by: yatip <ypadia@redhat.com>
* geo-rep: Fix for "Transport End Point not connected" issueHarpreet Kaur2020-01-312-0/+63
| | | | | | | | | | | | | | | | | | | | | | problem: Geo-rep gsyncd process mounts the master and slave volume on master nodes and slave nodes respectively and starts the sync. But it doesn't wait for the mount to be in ready state to accept I/O. The gluster mount is considered to be ready when all the distribute sub-volumes is up. If the all the distribute subvolumes are not up, it can cause ENOTCONN error, when lookup on file comes and file is on the subvol that is down. solution: Added a Virtual Xattr "dht.subvol.status" which returns "1" if all subvols are up and "0" if all subvols are not up. Geo-rep then uses this virtual xattr after a fresh mount, to check whether all subvols are up or not and then starts the I/O. fixes: bz#1664335 Change-Id: If3ad01d728b1372da7c08ccbe75a45bdc1ab2a91 Signed-off-by: Harpreet Kaur <hlalwani@redhat.com> Signed-off-by: Kotresh HR <khiremat@redhat.com>
* dht-hashfn.c: remove a strlen()Yaniv Kaul2020-01-141-16/+19
| | | | | | | | | | | We already have the length of the name, or when we munge it, we can return the length of it instead of strlen() again. Also, reduce a bit the code under the lock. Change-Id: I0141b0725ed1a4134d8d9f81ed1187b551b038b5 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* dht-rename.c: fix Coverity issues 1397018/7 - strcat into uninitialized valueYaniv Kaul2020-01-101-0/+4
| | | | | | | | | initialize both src and dst if they were not initialized already. fixes: CID#1397018 Change-Id: Ic91954423953e8bf24eaa11fc2798c554f304d28 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* DHT - Reduce methods scope (dht-common.c)Barak Sason Rofman2019-12-173-804/+708
| | | | | | | | | | | Methods that should have been static were defined as global, and the other way around. This patch fixes the issue in order to enforce encapsulation. updates: bz#1776757 Change-Id: I3eb5781849c5e597c1dd347e03f356c00db62a39 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht-common.h/dht-helper.c: exctract the LOCK() from DHT_UPDATE_TIMEYaniv Kaul2019-12-172-20/+20
| | | | | | | | | | | | | Currently, the code (and only place) that is using this macro is in dht_inode_ctx_time_update() where it is called 3 times in a row, which is essentially 3 cycles of LOCK/UNLOCK on the same lock. Instead, extract the LOCK()/UNLOCK() part of the macro and wrap those calls with it. Change-Id: I6312b985e3d97517857b55f342440accc4063db6 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cluster/dht: Add comments to codeN Balachandran2019-12-102-2/+14
| | | | | | Change-Id: Ieb7531af19ae89fb8a8387e81663c7f157b10c02 Updates: bz#1765421 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cluster/dht: Add comments to the codeN Balachandran2019-11-161-12/+75
| | | | | | | | | Add comments to the code to explain what is being done and why. Change-Id: I50831d7bd4bb73e75f6cda05fafaeb5a8619baae Updates: bz#1765421 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cluster/dht: Don't skip entries with invalid statN Balachandran2019-11-131-5/+4
| | | | | | | | | Don't strip out entries with invalid stats in dht_readdirp_cbk. Change-Id: I136ab342762d020a3c0f43e51e0090aed2af4120 Fixes: bz#1769754 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* dht: Rebalance causing IO Error - File descriptor in bad stateMohit Agrawal2019-10-155-17/+116
| | | | | | | | | | | | | | | | Problem : When a file is migrated, dht attempts to re-open all open fds on the new cached subvol. Earlier, if dht had not opened the fd, the client xlator would be unable to find the remote fd and would fall back to using an anon fd for the fop. That behavior changed with https://review.gluster.org/#/c/glusterfs/+/15804, causing fops to fail with EBADFD if the fd was not available on the cached subvol. The client xlator returns EBADFD if the remote fd is not found but dht only checks for EBADF before re-opening fds on the new cached subvol. Solution: Handle EBADFD at dht code path to avoid the issue Change-Id: I43c51995cdd48d05b12e4b2889c8dbe2bb2a72d8 Fixes: bz#1758579
* Multiple files: make root gfid a static variableYaniv Kaul2019-10-143-14/+3
| | | | | | | | | | | | | In many places we use it, compare to it, etc. It could be a static variable, as it really doesn't change. I think it's better than initializing to 0 and then doing gfid[15] = 1 or other tricks. I think there are additional oppportunuties to make more variables static. This is an attempt at an easy one. Change-Id: I7f23a30a94056d8f043645371ab841cbd0f90d19 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cluster/dht: Correct fd processing loopN Balachandran2019-10-021-22/+62
| | | | | | | | | | | | The fd processing loops in the dht_migration_complete_check_task and the dht_rebalance_inprogress_task functions were unsafe and could cause an open to be sent on an already freed fd. This has been fixed. Change-Id: I0a3c7d2fba314089e03dfd704f9dceb134749540 Fixes: bz#1757399 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cluster/dht: Handle file truncates during migrationN Balachandran2019-09-171-26/+34
| | | | | | | | | File truncate operations during a migration were not handled properly. This has been fixed. Change-Id: Ic642d257e893641236a4a21ab69fcc7a569dd70a Fixes: bz#1745967 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* ctime/rebalance: Heal ctime xattr on directory during rebalanceKotresh HR2019-09-161-0/+1
| | | | | | | | | | | | | | | | After add-brick and rebalance, the ctime xattr is not present on rebalanced directories on new brick. This patch fixes the same. Note that ctime still doesn't support consistent time across distribute sub-volume. This patch also fixes the in-memory inconsistency of time attributes when metadata is self healed. Change-Id: Ia20506f1839021bf61d4753191e7dc34b31bb2df fixes: bz#1734026 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cluster/dht: Log hashes in hexN Balachandran2019-08-064-15/+13
| | | | | | | | | Log layout hash ranges in hex to make it easier to compare them to the on disk xattrs. Change-Id: Ib75c2508bf8e0ab7f5ae26d0443ef02b792b7307 Fixes: bz#1697293 Signed-off-by: N Balachandran <nbalacha@redhat.com>