summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/heal_libs.py
Commit message (Collapse)AuthorAgeFilesLines
* [Test+Lib] Add tests to check self healkshithijiyer2021-01-201-1/+39
| | | | | | | | | | | | | | | | Test scenarios added: 1. Test to check entry self heal. 2. Test to check meta data self heal. 3. Test self heal when files are removed and dirs created with the same name. Additional libraries added: 1. group_del(): Deletes groups created 2. enable_granular_heal(): Enables granular heal 3. disable_granular_heal(): Disables granular heal Change-Id: Iffa9a100fddaecae99c384afe3aaeaf13dd37e0d Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Libfix] Add interval_check for monitor_heal_completionBala Konda Reddy M2020-08-211-3/+6
| | | | | | | | | | | | | | | | | | | | | | | Adding a parameter `interval_check` will ease the user and help in the reducing the waiting time for heal in scenarios. By default, ls -l <brickpath> | grep -ve "xattrop-" | wc -l is checked for every 2 minutes. Problem: I have 100 files that needs to be healed, after 2 minutes. suppose there are only 2/3 files that needs to be healed. With the existing approach the next check will wait for whole 2 minutes even though the files would have healed by 10 seconds after previouscheck. Solution: Giving an option for the user to check at which interval to check for the files that needs to healed, we can reduce the unnecssary waiting time. It won't affect the existing cases as the interval_check is defaults to 120. Change-Id: Ib288c75549644b6f6c94b5288f1c07cce7933915 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [LibFix] Monitor heal only on specific bricksLeela Venkaiah G2020-06-241-3/+12
| | | | | | | | | - Add an optional argument (bricks) to monitor_heal_completion - If provides, heal will be monitored on these set of bricks - Useful when dealing with EC volumes Change-Id: I1c3b137e98966e21c52e0e212efc493aca9c5da0 Signed-off-by: Leela Venkaiah G <lgangava@redhat.com>
* [Lib] Add is_shd_daemon_running methodPranav2020-04-231-0/+30
| | | | | | | | | | | Verifies whether the shd daemon is up and running on a particular node. The method verifies whether the shd pid is present or not on the given node. If present, as an additional verification, verifies that the 'self-heal daemon' for the node specified is not there in the get volume status output Change-Id: I4865dc5c493a72ed7334ea998d0a231f4f8c75c8 Signed-off-by: Pranav <prprakas@redhat.com>
* [Libfix] Remove rpyc_get_connection() dependency from codekshithijiyer2020-04-011-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `g.rpyc_get_connection()` has a limitaion where it can't convert python2 calls to python3 calls. Due to this a large number of testcases fail when executed from a python2 machine on a python3 only setup or visa versa with the below stack trace: ``` E ========= Remote Traceback (1) ========= E Traceback (most recent call last): E File "/root/tmp.tL8Eqx7d8l/rpyc/core/protocol.py", line 323, in _dispatch_request E res = self._HANDLERS[handler](self, *args) E File "/root/tmp.tL8Eqx7d8l/rpyc/core/protocol.py", line 591, in _handle_inspect E if hasattr(self._local_objects[id_pack], '____conn__'): E File "/root/tmp.tL8Eqx7d8l/rpyc/lib/colls.py", line 110, in __getitem__ E return self._dict[key][0] E KeyError: (b'rpyc.core.service.SlaveService', 94282642994712, 140067150858560) ``` Solution: The solution here is to modify the code to not use `g.rpyc_get_connection()`. The following changes are done to accomplish it: 1)Remove code which uses g.rpyc_get_connection() and use generic logic in functions: a. do_bricks_exist_in_shd_volfile() b. get_disk_usage() c. mount_volume() d. list_files() f. append_string_to_file() 2)Create files which can be uploaded and executed on clients/servers to avoid rpc calls in functions: a. calculate_hash() b. validate_files_in_dir() 3)Modify setup.py to push the below files to `/usr/share/glustolibs/scripts/`: a.compute_hash.py b.walk_dir.py Change-Id: I00a81a88382bf3f8b366753eebdb2999260788ca Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [py2to3] Change str to list in isinstance()kshithijiyer2020-01-091-3/+3
| | | | | | | | | | | | Use 'list' object type in comparisons instead of 'str' Because it is differently treated in py2 and py3. Example: In py2 isinstance(u'foo', str) is False In py3 isinstance(u'foo', str) is True Change-Id: I7663d42494bf59d74550ff4897379d35cc357db4 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Fix TypeError caused in heal_libs.pyVinayak Papnoi2019-08-071-1/+1
| | | | | | | | | | | | | | | | The line 316 of heal_libs.py library contains a function called 'wait_for_self_heal_daemons_to_be_online' which makes use of the 'volname' and 'timeout' arguements for string formatting. The method used for the string formatting was wrong which causes an error 'TypeError: not enough arguments for format string'. Due to this, all the test cases which make use of heal_libs.py will result in a TypeError scenario. This patch will fix the TypeError for the string formatting. Change-Id: I73abe573d2ccb60b74ccd6ae268b950640d75600 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
* Using a raw strings for fixing flake warningsVitalii Koriakov2018-10-291-1/+1
| | | | | Change-Id: Ie134790ea05919a4b396657c11cbc3fc7a7fc529 Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* Fix spelling mistake across the codebaseNigel Babu2018-08-071-1/+1
| | | | Change-Id: I46fc2feffe6443af6913785d67bf310838532421
* Check if volume type is 'distribute' before checking if self-heal-daemons ↵ShwethaHP2018-01-301-0/+14
| | | | | | | are online Change-Id: I25424dd182c347a0570713ada8d2de611840fef3 Signed-off-by: ShwethaHP <spandura@redhat.com>
* Adding function bring_self_heal_daemon_process_offline to heal_libsVijay Avuthu2018-01-291-0/+44
| | | | | | | | | Description: Bring the self-heal daemon process offline for the nodes Change-Id: I55301fb86a97147920991aa4455e8e5d80b1c5c3 Signed-off-by: Vijay Avuthu <vavuthu@redhat.com>
* Fixing None issue when running multiple volumesVijay Avuthu2018-01-281-2/+3
| | | | | Change-Id: I7a8465a60c8e5d8f84a647ae65dbabcab2184516 Signed-off-by: Vijay Avuthu <vavuthu@redhat.com>
* Fixing Plumbum spawn issue with pgrepVijay Avuthu2018-01-281-1/+1
| | | | | Change-Id: If303d22f52d31e99676a6e97fbe0b9cb7d5a1234 Signed-off-by: Vijay Avuthu <vavuthu@redhat.com>
* Adding AFR self heal daemon test casesVijay Avuthu2018-01-231-0/+149
| | | | | | | | | | | Gave meaningful names to functions Returning -1 if there is no process running Replace numbers with words Rewording the msg "More than 1 or 0 self heal daemon" Review Comments incorporated Change-Id: If424a6f78536279c178ee45d62099fd8f63421dd Signed-off-by: Vijay Avuthu <vavuthu@redhat.com>
* Adding functions for:ShwethaHP2018-01-111-0/+36
| | | | | | | | | 1. Waiting for all bricks to be online 2. Waiting for all self-heal-daemons to be online 3. Waiting for all volume processes to be online Change-Id: I01a8711838227eb167e69710ecbd3abd0fecb9e6 Signed-off-by: ShwethaHP <spandura@redhat.com>
* 1) bring_bricks_online: Wait for bricks to be online for 30 secondsShwethaHP2017-08-281-1/+1
| | | | | | | | | after bringing them online. 2) log all the xml output/error to DEBUG log level. Change-Id: If6bb758ac728f299292def9d72c0ef166a1569ae Signed-off-by: ShwethaHP <spandura@redhat.com>
* Clean up pyflakes and pep8 errorsNigel Babu2016-12-121-2/+1
| | | | | Change-Id: Ibdd092118d3bb912716c46fd278ef3c680a6e742 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* Adding libs for brick ops, volume helpers, mount helpers, gluster baseShwetha Panduranga2016-10-171-0/+272
class, heal related helpers, samba helpers, and windows ops helpers Change-Id: I0ad8fc7548c88e89d2ba6441166b9a38af76cea0 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>