summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
...
* dht: don't ignore xdata in fgetxattr (#2020)Xavi Hernandez2021-01-191-2/+2
| | | | | | | | | | | DHT was passing NULL for xdata in fgetxattr() request, ignoring any data sent by upper xlators. This patch fixes the issue by sending the received xdata to lower xlators, as it's currently done for getxattr(). Fixes: #1991 Change-Id: If3d3f1f2ce6215f3b1acc46480e133cb4294eaec Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* shard: Fixed redundant checks done (#1769)Rinku Kothiya2021-01-181-19/+20
| | | | | | | | | This patch fixes redundant checks done while calling shard_modify_size_and_block_count. Fixes: #1703 Change-Id: I735e532c78cbb181afa4b51480ad742ef4a75f77 Signed-off-by: Rinku Kothiya rkothiya@redhat.com
* Removing unused memory allocationRinku Kothiya2021-01-1851-60/+58
| | | | | | | | | | Removing extra unused type. Removing leftovers from the RDMA Fixes: #904 Change-Id: Id5d28622120578b7076d112e355ad8df116021dd Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* glusterd: Removing redundant NULL checks for this and other cleanups. (#1735)schaffung2021-01-1844-2971/+1009
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glusterd: Removing redundant NULL checks for this Issue: It has been noticed that the NULL checks performed on `this` are actually being done on `THIS` as `this` is derived from `THIS`. If the `THIS` had been NULL, the crash would have happened before itself. Fix: Basically removing the validations and assertion functions which check if `this` is NULL. Fixes: #1596 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com> * Made changes wrt review comments received. Fixes: #1596 Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> * glusterd: The efficient usage of `THIS` and `this`. This commit addresses the review comments and tries to change code in more places wherein the `THIS` and `this` can be handled efficiently. Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> * Updated commit to address review comments. Updates: #1596 Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> * Addressing Review comments. Updates: #1596 Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> * Made changes after regression failure. Updates: #1596 Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> * One has to be careful while working with c Instead of a `||` operation, the cleanup left out with `|`. Does the compiler ceck for these things? Updates: #1596 Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> * Fixing clang-format issues. Change-Id: I68c52249af66080f59f57e558901f2654bd43cd8 Updates: #1596 Signed-off-by: srijan-sivakumar <ssivakumar@redhat.com> Co-authored-by: srijan-sivakumar <ssivakumar@redhat.com>
* afr: remove memcpy() + ntoh32() pattern (#1998)Ravishankar N2021-01-154-34/+7
| | | | | | | | | Remove memcpy and/or byte order conversions when fetching values from the dictionary. Fixes: #504 Change-Id: Idf2367bac8cc592c419a11ea751495e1c664ec4d Reported-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* posix: Reduce posix_fdstat() calls in IO paths (#1994)mohit842021-01-151-5/+9
| | | | | | | | | The fops(posix_seek, posix_open, posix_readv) are calling posix_fdstat even cloud sync is not enabled, for these specific fops prestat is use by only cloud specific function(posix_cs_maintenance) Fixes: #1981 Change-Id: I4d3b6c41e88925456d2f957aba6b1d2441904f73 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* posix: use malloc in page_aligned_alloc() when possible (#2009)Ravishankar N2021-01-151-8/+11
| | | | | | | | | | | | - Some callers of this function do not require that the allocated buffer be zeroed out. Use GF_MALLOC instead of GF_CALLOC for such cases. - posix_rchecksum seems to be using the incorrect bufer size for computing the checksum. Fixed it. Updates: #1885 Reported-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com> Change-Id: I44413b1efd7b69d3a4d318639d5ebdb38a99af7f
* features/shard: avoid repeatative calls to gf_uuid_unparse() (#1689)Vinayak hariharmath2021-01-111-60/+59
| | | | | | | | | | | The issue is shard_make_block_abspath() calls gf_uuid_unparse() every time while constructing shard path. The gfid can be parsed and saved once and passed while constructing the path. Thus we can avoid calling gf_uuid_unparse(). Fixes: #1423 Change-Id: Ia26fbd5f09e812bbad9e5715242f14143c013c9c Signed-off-by: Vinayakswami Hariharmath vharihar@redhat.com
* glusterd: fix resource leak (#1970)Sheetal Pamecha2021-01-082-0/+6
| | | | | | | | | | | | | * glusterd: fix resource leak Change-Id: I03b4ad477b70eeeda387ff0d161d08a7353f147e CID: 1438341, 1438342 Updates: #1060 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * Add check for resource leak Change-Id: If34c8074fa4b70184d8103fd4d09695c84b907f5 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
* ./tests/bugs/core/bug-1432542-mpx-restart-crash.t is getting crashedMohit Agrawal2021-01-081-4/+13
| | | | | | | | | | | | | | The test case ./tests/bugs/core/bug-1432542-mpx-restart-crash.t is getting crashed at the time of detaching a brick.The brick process is getting crashed because there is a race condition to send a disconnect on rpc associated with victim brick and handling GF_EVENT_CLEANUP for the victim brick. Solution: Save victim_name on local variable to avoid crash. Fixes: #1978 Change-Id: I76877f20b6ac0eecc39f1fa7d82afc9744dc5e04 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* stripe cleanup: Remove the option from create and add-brick cmds (#1812)Sheetal Pamecha2021-01-0510-103/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stripe cleanup: Remove the option from create and add-brick cmds This patch aims to remove the code for stripe option instead of keeping a default values of stripe/stripe-count variables and setting and getting dict options and similar redundant operations. Also removing tests for stripe volumes that have been already marked bad. Updates: #1000 Change-Id: Ic2b3cabd671f0c8dc0521384b164c3078f7ca7c6 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * Fix regression error tests/000-flaky/basic_changelog_changelog-snapshot.t was failing due to 0 return value Change-Id: I8ea0443669c63768760526db5aa1f205978e1dbb Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * add constant stripe_count value for upgrade scenerios Change-Id: I49f3da4f106c55f9da20d0b0a299275a19daf4ba * Fix clang-format warning Change-Id: I83bae85d10c8c5b3c66f56c9f8de1ec81d0bbc95
* posix: avoiding redundant access of dictionary (#1786)Rinku Kothiya2021-01-052-56/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * posix: avoiding redundant access of dictionary This patch fixes the redundant access of dictionary for the same information by the macro PL_LOCAL_GET_REQUESTS fixes: #1707 Change-Id: I48047537436ce920e74bc11cecd9773d7fe4457c Signed-off-by: Rinku Kothiya <rkothiya@redhat.com> * posix: avoiding redundant access of dictionary - Converted the macro SET_BIT to function set_bit - Removed the code to delete the key GLUSTERFS_INODELK_DOM_COUNT - Assigned the value to local->bitfield Change-Id: I101f3fda65e9e75e05907d671203c5d7f072fa8f Fixes: #1707 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com> * posix: avoiding redundant access of dictionary deleted GLUSTERFS_INODELK_DOM_COUNT key Change-Id: I638269e6a9f6fc11351eaede4c103e032881fe12 Fixes: #1707 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com> * posix: avoiding redundant access of dictionary Smoke test warnings fixed. Fixes: #1707 Change-Id: I8682bd0e49f44cbc1442324e1756b56481f18ccd Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
* cli/glusterd: conscious language changes for geo-repRavishankar N2020-12-3013-1069/+1165
| | | | | | | | | | | | | | Replace master and slave terminology in geo-replication with primary and secondary respectively. All instances are replaced in cli and glusterd. Changes to other parts of the code to follow in separate patches. tests/00-geo-rep/* are passing thus far. Updates: #1415 Change-Id: Ifb12b7f5ce927a4a61bda1e953c1eb0fdfc8a7c5 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* DHT/Rebalance - removing an unneeded subvol calculation and comparison (#1803)Barak Sason Rofman2020-12-232-106/+113
| | | | | | | | | | | | * DHT/Rebalance - removing an unneeded subvol calculation and comparison During the data migration phase of rebalance, an unneeded calculation and comparison is made. These operations are not required, as the information is already cached. Removing the unneeded operations. fixes: ##1801 Change-Id: I9bce8152c7936a73edc4704b2f9d4f0f241ce13e Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* DHT: fix coverity issue - argument cannot be negative (#1942)Tamar Shacked2020-12-221-1/+1
| | | | | | | | | CID 1438086: Initialize op_errno to a positive error, because it might be passed to a parameter that cannot be negative. updates: #1060 Change-Id: I1b5fda4dbbd5b1a50ea1c293af3b265d385d891c Signed-off-by: Tamar Shacked <tshacked@redhat.com>
* NFS - Fixing a clang issue (#1938)Barak Sason Rofman2020-12-211-3/+3
| | | | | | | | | | Smoke tests verified PR https://github.com/gluster/glusterfs/pull/1894 even though there was a clang issue present and the PR was merged. Smoke tests have been fixed so sending this PR to rectify the clang issue. Change-Id: I3df5d2c77d9f3dd1872f2f28824565d5f24d82ec updates: #1060 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* glusterd: start brick process with proper logger option (#1936)Amar Tumballi2020-12-201-0/+4
| | | | | | | | Check if 'glusterd' is started with `--logger` option as syslog, and use the same option to brick processes. Updates: #1935 Change-Id: Ib0ea76322d48cccf6db30097bffe01903125650e Signed-off-by: Amar Tumballi <amar@kadalu.io>
* DHT - Remove redundant lookup operation in Rebalance (#1696)Barak Sason Rofman2020-12-201-45/+16
| | | | | | | | | | | | | | | | | | | | * DHT - Remove redundant lookup operation in Rebalance Remove a redundant lookup (and correlated operations) and slightly changed error handling. - The lookup which is removed is redundant as a lookup on the dir specified by "loc" is done at the entry to the method. - Error handling was changed a bit to remove special handling for "root" dir (as it is not necessary). In addition, error handling was changed so increments of defrag->total_failures in case of a failure will done inside the error-checking blocks of the operations inside gf_defrag_fix_layout instead of in the calling methods. fixes: #1695 Change-Id: I85c8791988bd314ce706d3627e01e15e4f983329 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* dht: handle DHT_SUBVOL_STATUS_KEY in dht_pt_getxattr (#1934)Ravishankar N2020-12-181-0/+24
| | | | | | | | | | | In non distribute volumes (plain replicate, ec), DHT uses pass-through FOPs (dht_pt_getxattr) instead of the usual FOPS (dht_getxattr). The pass through FOP was not handling the DHT_SUBVOL_STATUS_KEY virtual xattr because of which geo-rep session was going into a faulty state. Fixing it now. updates: #1925 Change-Id: I766b5b5c047c954a9957ab78aca680eedef1ff1f Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* AFR - Fixing Coverity issue (Illegal memory access) (#1893)Barak Sason Rofman2020-12-181-1/+3
| | | | | | | | CID 1437682 Fixing use-after-free bug by setting the released pointer to NULL Change-Id: Id08f415577df86245e3926f59ac0ba2c23a663dc updates: #1060 Signed-off-by: Barak Sason Rofman bsasonro@redhat.com
* NFS - Fixing Coverity issue (Dereference null return value) (#1894)Barak Sason Rofman2020-12-171-2/+4
| | | | | | | | | CID 1430123 Fixing dereference null return value by checking the value returned by an allocating method Change-Id: I3fc18208fd4cec2db4b2b5d1f47ef7d7f1c9a4b3 updates: #1060 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* io-stats: Change latency to nanoseconds from microseconds (#1833)Shree Vatsa N2020-12-172-22/+21
| | | | | | | | | | | | | | | | | | | | - In 'BUMP_THROUGHPUT' macro changed 'elapsed' from microseconds to nanoseconds. - In 'update_ios_latency' function 'elapsed' is now in nanoseconds. - In 'collect_ios_latency_sample' function removed conversion from nano to micro, instead directly assigned as 'nano' to 'tv_nsec' of 'timespec' macro - in 'ios_sample_t' macro changed 'timeval' to 'timespec' to support above change. - In '_io_stats_write_latency_sample' function changed formula to from 1e+6 to 1e+9 since 'ios_sample_t' macro now has 'timespec' - In 'BUMP_THROUGHPUT','_ios_sample_t','collect_ios_latency_sample' & update_ios_latency' changed 'elapsed' datatype from 'double' to 'int64_t' - In glusterfs/libglusterfs/src/glusterfs/common-utils.h changed return type of 'gf_tsdiff' function from 'double' to 'int64_t' since it can return negative values. - In glusterfs/libglusterfs/src/latency.c, libglusterfs/src/glusterfs/common-utils.h, xlators/debug/io-stats/src/io-stats.c & xlators/storage/posix/src/posix-helpers.c 'elapsed' is now of type 'int64_t' Fixes: #1825 Signed-off-by: Shree Vatsa N <vatsa@kadalu.io>
* core: Implement gracefull shutdown for a brick process (#1751)mohit842020-12-1611-27/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * core: Implement gracefull shutdown for a brick process glusterd sends a SIGTERM to brick process at the time of stopping a volume if brick_mux is not enabled.In case of brick_mux at the time of getting a terminate signal for last brick a brick process sends a SIGTERM to own process for stop a brick process.The current approach does not cleanup resources in case of either last brick is detached or brick_mux is not enabled. Solution: glusterd sends a terminate notification to a brick process at the time of stopping a volume for gracefull shutdown Change-Id: I49b729e1205e75760f6eff9bf6803ed0dbf876ae Fixes: #1749 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> * core: Implement gracefull shutdown for a brick process Resolve some reviwere comment Fixes: #1749 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Change-Id: I50e6a9e2ec86256b349aef5b127cc5bbf32d2561 * core: Implement graceful shutdown for a brick process Implement a key cluster.brick-graceful-cleanup to enable graceful shutdown for a brick process.If key value is on glusterd sends a detach request to stop the brick. Fixes: #1749 Change-Id: Iba8fb27ba15cc37ecd3eb48f0ea8f981633465c3 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> * core: Implement graceful shutdown for a brick process Resolve reviewer comments Fixes: #1749 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Change-Id: I2a8eb4cf25cd8fca98d099889e4cae3954c8579e * core: Implement gracefull shutdown for a brick process Resolve reviewer comment specific to avoid memory leak Fixes: #1749 Change-Id: Ic2f09efe6190fd3776f712afc2d49b4e63de7d1f Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> * core: Implement gracefull shutdown for a brick process Resolve reviewer comment specific to avoid memory leak Fixes: #1749 Change-Id: I68fbbb39160a4595fb8b1b19836f44b356e89716 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* fuse: render gfid only once in fuse_invalidate_entry()Csaba Henk2020-12-151-3/+5
| | | | | | Change-Id: I6073489a8308c6f518438d2ad2348a0c4cd5f805 Fixes: #1545 Signed-off-by: Csaba Henk <csaba@redhat.com>
* fuse: fix dispatch of requests when dumpingCsaba Henk2020-12-151-1/+1
| | | | | | | | | | | | | | | | | | fuse_dumper() is a wrapper for fuse request handlers that performs its specific task (dumping the request), then delegates to the standard handler for the given FUSE opcode. This should be a faithful delegation, the standard handlers should be invoked the same way as without passing through fuse_dumper(). However, the call to the handler has nulled out the last argument, iobuf. This gets fixed here. Change-Id: I7bd9a20dfdc46f162076f350826cadf69f9c78a7 Updates: #1000 Signed-off-by: Csaba Henk <csaba@redhat.com>
* fuse: sanitize FUSE_OP_HIGHCsaba Henk2020-12-152-95/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea behind FUSE_OP_HIGH was that it should be the upper limit for the opcodes we can ever get from kernel (maximum opcode that can occur plus one). The problem with this idea is that this depends on the FUSE protocol version; and since the fuse proto header does not export this value, it has to be retroactively defined considering the particular opcode values in the protocol header. That is, not just the value, but the definition itself depends on the FUSE protocol version. So we ended up maintaining -- or indeed, not even maintaining, just living with -- a mess of conditional defines for FUSE_OP_HIGH. Now we change the meaning of it: FUSE_OP_HIGH will simply be upper limit of the opcodes for which we define a handler (the highest such opcode plus one, which is the same as the size of the fuse optable). The practical implication of this change is as follows. Potentially there is a gap between the new and the old value of FUSE_OP_HIGH: those opcodes which might occur in requests but are higher than any opcode we handle. With the old definition of FUSE_OP_HIGH we could statically dispatch these opcodes to fuse_enosys() (a function that sends a FUSE response with error ENOSYS). With the new definition we don't know the upper limit of this gap, so we need to dispatch the opcodes of the gap to fuse_enosys() dynamically (perform a runtime check if the opcode is greater-or-equal than the new FUSE_OP_HIGH, and if yes, then call fuse_enosys()). Change-Id: I8cd26ead538de8ce36c91feaf938e4c5dc59c88c Updates: #1000 Signed-off-by: Csaba Henk <csaba@redhat.com>
* core: Avoid several dict OR key is NULL message in brick logs (#1910)mohit842020-12-113-16/+21
| | | | | | | | | | Problem: dict_get_with_ref throw a message "dict or key is NULL" if dict or key is NULL. Solution: Before access a key check if dictionary is valid. Fixes: #1909 Change-Id: I50911679142b52f854baf20c187962a2a3698f2d Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* glusterd/cli: enhance rebalance-status after replace/reset-brick (#1869)Tamar Shacked2020-12-082-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glusterd/cli: enhance rebalance-status after replace/reset-brick Rebalance status is being reset during replace/reset-brick operations. This cause 'volume status' to shows rebalance as "not started". Fix: change rebalance-status to "reset due to (replace|reset)-brick" Change-Id: I6e3372d67355eb76c5965984a23f073289d4ff23 Signed-off-by: Tamar Shacked <tshacked@redhat.com> * glusterd/cli: enhance rebalance-status after replace/reset-brick Rebalance status is being reset during replace/reset-brick operations. This cause 'volume status' to shows rebalance as "not started". Fix: change rebalance-status to "reset due to (replace|reset)-brick" Fixes: #1717 Signed-off-by: Tamar Shacked <tshacked@redhat.com> Change-Id: I1e3e373ca3b2007b5b7005b6c757fb43801fde33 * cli: changing rebal task ID to "None" in case status is being reset Rebalance status is being reset during replace/reset-brick operations. This cause 'volume status' to shows rebalance as "not started". Fix: change rebalance-status to "reset due to (replace|reset)-brick" Fixes: #1717 Change-Id: Ia73a8bea3dcd8e51acf4faa6434c3cb0d09856d0 Signed-off-by: Tamar Shacked <tshacked@redhat.com>
* glusterd: modify logic for checking hostname in add-brick (#1781)Sheetal Pamecha2020-12-074-11/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glusterd: modify logic for checking hostname in add-brick Problem: add-brick command parses only the bricks provided in cli for a subvolume. If in same subvolume bricks are increased, these are not checked with present volume bricks. Fixes: #1779 Change-Id: I768bcf7359a008f2d6baccef50e582536473a9dc Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * removed assignment of unused variable Fixes: #1779 Change-Id: Id5ed776b28343e1225b9898e81502ce29fb480fa Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * few more changes Change-Id: I7bacedb984f968939b214f9d13546f4bf92e9df7 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * few more changes Change-Id: I7bacedb984f968939b214f9d13546f4bf92e9df7 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> * correction in last commit Signed-off-by: Sheetal Pamecha <spamecha@redhat.com> Change-Id: I1fd0d941cf3f32aa6e8c7850def78e5af0d88782
* cluster/afr: Remove redundant afr_fd_ctx_get calls (#1718)Ashish Pandey2020-12-042-50/+33
| | | | | | | | | | | | | | Description: __afr_fd_ctx_get() is calling __fd_ctx_get(). If that fails, it goes to __afr_fd_ctx_set(). __afr_fd_ctx_set() is now calling __fd_ctx_get() again. When we get back from __afr_fd_ctx_set(), we are calling __fd_ctx_get() again. we could just change __afr_fd_ctx_set() to return ctx as the return value and NULL in case of failure. Change-Id: Ifdb9b86984a3438abac52b2b74a8f0e0a4966093 updates: #1251 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* DHT/Rebalance -removing unused variable (#1795)Barak Sason Rofman2020-12-041-14/+13
| | | | | | | Removing an unused variable from rebalance data migration path fixes: #1773 Change-Id: I5f9f8d2a25e888cfc79978170809c7ae66ad839a Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* all: change 'primary' to 'root' where it makes senseRavishankar N2020-12-024-7/+6
| | | | | | | | | | | | | | | | | | As a part of offensive language removal, we changed 'master' to 'primary' in some parts of the code that are *not* related to geo-replication via commits e4c9a14429c51d8d059287c2a2c7a76a5116a362 and 0fd92465333be674485b984e54b08df3e431bb0d. But it is better to use 'root' in some places to distinguish it from the geo-rep changes which use 'primary/secondary' instead of 'master/slave'. This patch mainly changes glusterfs_ctx_t->primary to glusterfs_ctx_t->root. Other places like meta xlator is also changed. gf-changelog.c is not changed since it is related to geo-rep. Updates: #1000 Change-Id: I3cd610f7bea06c7a28ae2c0104f34291023d1daf Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* glusterd[brick_mux]: Optimize friend handshake code to avoid call_bail (#1614)mohit842020-11-306-78/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During glusterd handshake glusterd received a volume dictionary from peer end to compare the own volume dictionary data.If the options are differ it sets the key to recognize volume options are changed and call import syntask to delete/start the volume.In brick_mux environment while number of volumes are high(5k) the dict api in function glusterd_compare_friend_volume takes time because the function glusterd_handle_friend_req saves all peer volume data in a single dictionary. Due to time taken by the function glusterd_handle_friend RPC requests receives a call_bail from a peer end gluster(CLI) won't be able to show volume status. Solution: To optimize the code done below changes 1) Populate a new specific dictionary to save the peer end version specific data so that function won't take much time to take the decision about the peer end has some volume updates. 2) In case of volume has differ version set the key in status_arr instead of saving in a dictionary to make the operation is faster. Note: To validate the changes followed below procedure 1) Setup 5100 distributed volumes 3x1 2) Enable brick_mux 3) Start all the volumes 4) Kill all gluster processes on 3rd node 5) Run a loop to update volume option on a 1st node for i in {1..5100}; do gluster v set vol$i performance.open-behind off; done 6) Start the glusterd process on the 3rd node 7) Wait to finish handshake and check there should not be any call_bail message in the logs Change-Id: Ibad7c23988539cc369ecc39dea2ea6985470bee1 Fixes: #1613 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* afr: return -EIO for gfid split-brains. (#1819)Ravishankar N2020-11-266-35/+42
| | | | | | | | | | | | | | | | | | | | | | Problem: entry-self-heal-anon-dir-off.t was failing occasionally because afr_gfid_split_brain_source() returned -1 instead of -EIO for split-brains, causing the code to proceed to afr_lookup_done(), which in turn succeeded the lookup if there was a parallel client side heal going on. Fix: Return -EIO instead of -1 so that lookp fails. Also, afr_selfheal_name() was using the same dict to get and set values. This could be problematic if the caller passed local->xdata_req, since setting a response in a request dict can lead to bugs.So changed it to use separate request and response dicts. Fixes: #1739 Credits Pranith Karampuri <pranith.karampuri@phonepe.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com> Change-Id: I5cb4c547fb25e6bfc8bec1740f7eb64e1a5ad443
* DHT/Rebalance - Ensure Rebalance reports status only once upon stopping (#1783)Barak Sason Rofman2020-11-243-37/+35
| | | | | | | | | | | | | | | DHT/Rebalance - Ensure Rebalance reports status only once upon stopping Upon issuing rebalance stop command, the status of rebalance is being logged twice to the log file, which can sometime result in an inconsistent reports (one report states status stopped, while the other may report something else). This fix ensures rebalance reports it's status only once and that the correct status is being reported. fixes: #1782 Change-Id: Id3206edfad33b3db60e9df8e95a519928dc7cb37 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* posix: In the commit 2f044c4587c6db3cb82b6128f056ec2ea2bc1b98 the ret (#1837)mohit842020-11-241-0/+1
| | | | | | | | | | update was missed in the function posix_get_gfid2path if GF_MALLOC is failed. Solution: Update the ret value to -1 if GF_MALLOC is failed Fixes: #1836 Change-Id: I510ebf0605ee49b84ff3570948771319f283b10e Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* glusterd: fix a bug in enabling nfs ganesha (#1813)Ravishankar N2020-11-191-1/+1
| | | | | | | | | | | As detailed in the github issue,`gluster volume set Svolname ganesha.enable on` is currently broken due to a minor typo in the commit e081ac683b6a5bda548913, Fixing it now. Updates: #1778 Change-Id: I99276fedc43f40e8a439e545bd2b8d1698aa03ee Signed-off-by: Ravishankar N <ravishankar@redhat.com> Tested-by: Strahil Nikolov <hunter86_bg@yahoo.com>
* posix: fix io_uring crash in reconfigure (#1804)Ravishankar N2020-11-171-1/+4
| | | | | | | | | Call posix_io_uring_fini only if it was inited to begin with. Fixes: #1794 Reported-by: Mohit Agrawal <moagrawa@redhat.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com> Change-Id: I0e840b6b1d1f26b104b30c8c4b88c14ce4aaac0d
* afr: call afr_is_lock_mode_mandatory only while xdata is valid (#1797)mohit842020-11-171-9/+9
| | | | | | | | | afr_is_lock_mode_mandatory throws a warning message while xdata is not valid, to avoid a message call a function only while xdata is valid. Fixes: #1796 Change-Id: I32d37960ea4e936ba87e65811c1792a2f1158c0d Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* glusterd: resource leaks (#1748)Nikhil Ladha2020-11-121-34/+18
| | | | | | | | | | | | | | | Issue: iobref was not freed before exiting the function if all the checks were OK, which caused the resource leak. Fix: Modified the code a bit to avoid use of an extra reference to the label, and to free the iobref and iobuf if not NULL, and then exit the function. CID: 1430118 Updates: #1060
* posix: Attach a posix_spawn_disk_thread with glusterfs_ctx (#1595)mohit842020-11-096-67/+148
| | | | | | | | | | | | | Currently posix xlator spawns posix_disk_space_threads per brick and in case of brick_mux environment while glusterd attached bricks at maximum level(250) with a single brick process in that case 250 threads are spawned for all bricks and brick process memory size also increased. Solution: Attach a posix_disk_space thread with glusterfs_ctx to spawn a thread per process basis instead of spawning a per brick Fixes: #1482 Change-Id: I8dd88f252a950495b71742e2a7588bd5bb019ec7 Signed-off-by: Mohit Agrawal moagrawa@redhat.com
* glusterd: fix bug in enabling granular-entry-heal (#1752)Ravishankar N2020-11-052-2/+3
| | | | | | | | | | | | | | commit f5e1eb87d4af44be3b317b7f99ab88f89c2f0b1a meant to enable the volume option only for replica volumes but inadvertently enabled it for all volume types. Fixing it now. Also found a bug in glusterd where disabling the option on plain distribute was succeeding even though setting it in the fist place fails. Fixed that too. Fixes: #1483 Change-Id: Icb6c169a8eec44cc4fb4dd636405d3b3485e91b4 Reported-by: Sheetal Pamecha <spamecha@redhat.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* posix: Use CALLOC instead of alloca to allocate memory for xattrs list (#1730)mohit842020-11-043-5/+15
| | | | | | | | | | | In case of file is having huge xattrs on backend a brick process is crashed while alloca(size) limit has been crossed 256k because iot_worker stack size is 256k. Use MALLOC to allocate memory instead of using alloca Fixes: #1699 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Change-Id: I100468234f83329a7d65b43cbe4e10450c1ccecd
* write-behind: Implement 'pass-through' optionXavi Hernandez2020-11-033-1/+27
| | | | | | | | | | | | | | | The pass-through option was implemented for all performance xlators in commit 549b547, but write-behind was missed. This patch implements the functionality for write-behind. Given that it's not safe to enable or disable this option while the volume is mounted, it cannot be reconfigured online. A change will only take effect after a remount. Fixes: #1565 Change-Id: I189a48e0044b292e1d6c3b77751ff25045531883 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* xlators: misc conscious language changes (#1715)Ravishankar N2020-11-029-34/+34
| | | | | | | | | | | | core:change xlator_t->ctx->master to xlator_t->ctx->primary afr: just changed comments. meta: change .meta/master to .meta/primary. Might break scripts. changelog: variable/function name changes only. These are unrelated to geo-rep. Fixes: #1713 Change-Id: I58eb5fcd75d65fc8269633acc41313503dccf5ff Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* DHT - Fixing rebalance failure on issuing stop command (#1628)Barak Sason Rofman2020-10-301-11/+12
| | | | | | | | | | | | | | | | | | Issuing a stop command for an ongoing rebalance process results in an error. This issue was brought up in https://bugzilla.redhat.com/1286171 and a patch (https://review.gluster.org/24103/) was submitted to resolve the issue. However the submitted patch resolved only part of the problem by reducing the number of log messages that were printed (since rebalnace is currently a recursive process, an error message was printed for every directory) but didn't fully resolve the root cause for the failure. This patch fixes the issue by modifying the code-path which handles the termination of the rebalance process by issuing a stop command. fixes: #1627 Change-Id: I604f2b0f8b1ccb1026b8425a14200bbd1dc5bd03 Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
* glusterd: Resolve coverity bug CID1435891 (#1716)mohit842020-10-301-2/+3
| | | | | | | The PR #1672 has introduced a coverity bug, this fixes it. Change-Id: I1140bf7527b6466f4210809a74dc3e59ecf02b6e Fixes: #1663 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* cluster/dht: Perform migrate-file with lk-owner (#1581)Pranith Kumar Karampuri2020-10-296-9/+41
| | | | | | | | | | | | | | | | | | | | | | * cluster/dht: Perform migrate-file with lk-owner 1) Added GF_ASSERT() calls in client-xlator to find these issues sooner. 2) Fuse is setting zero-lkowner with len as 8 when the fop doesn't have any lk-owner. Changed this to have len as 0 just as we have in fops triggered from xlators lower to fuse. * syncop: Avoid frame allocation if we can * cluster/dht: Set lkowner in daemon rebalance code path * cluster/afr: Set lkowner for ta-selfheal * cluster/ec: Destroy frame after heal is done * Don't assert for lk-owner in lk call * set lkowner for mandatory lock heal tests fixes: #1529 Change-Id: Ia803db6b00869316893abb1cf435b898eec31228 Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
* io-cache: Minor Performance Optimization (#1656)Shree Vatsa N2020-10-281-17/+3
| | | | | | | | move trace logs after mutex unlock in some macros * Also removed unused macros - ioc_page_lock and ioc_page_unlock Fixes: #1653 Signed-off-by: Shreevatsa N <i.mnshreevatsa@gmail.com>
* rpcsvc/transport: gracefully disconnect when graph is not ready (#1671)Rafi KC2020-10-271-2/+3
| | | | | | | | | | | | | | | | | * rpcsvc/transport: gracefully disconnect when graph is not ready. There was a crash reported when the brick rpc get's an accept request from a client before the server xlator is fully inited. The fix https://review.gluster.org/22339/ solves the crash, but it leaves the connection alive with out adding the rpc to xprts list of server conf. This will leads to problems with upcall, dump, and other cleanup codes. So this patch will make the rpc to fail and disconnect if a connection attempted before the server is fully inited. Change-Id: I3bf1113c0da4c2614afaa2c0f4eb6abfb0d26ed0 Signed-off-by: Mohammed Rafi KC <rafi.kavungal@iternity.com>