Repository navigation
squid: qa/cephfs: backport mgr/vol improvements for smooth backports in future - #61416
rishabh-d-dave wants to merge 21 commits into
Conversation
Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 8c536f7)
List volumes returns a list of of 1-member dictionaries where each
member is "{'name': <volname>}". This format is useful printing output
of the command "ceph fs volume ls" but for internal use this format is
hinderance since before using it, this list needs to be resolved from
list of dictionaries to list of strings.
Return a list of strings and move the code for converting it to list of
dictionaries to method "list_fs_volumes()" (which is method run by "ceph
fs volume ls" command).
This triggers change in async_job.py where we need volnames. The code
here converts list of dicts to list of string. This needs to removed.
Second, don't create unnecessary temporary variable "fs_map" in
"list_volumes()" since it is not required. To get fs names we can
directly iterate.
Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit 9f355b6)
Output of command "ceph fs clone status" will now show the progress made by that specific clone. The output will show cloning completed in terms of percentage and amount of bytes that have been cloned and number of files that have been cloned. Fixes: https://tracker.ceph.com/issues/61904 Signed-off-by: Rishabh Dave <[email protected]> Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit d7bc828)
Print a progress bar for ongoing clone job in output of "ceph status". When multiple clones are ongoing, show 1 progress bar in output of "ceph status" shows average of progress made by each clone. When number of clone job is more than number of clone threads, print 2 progress bars in output of "ceph status" command; one for ongoing clone jobs and other for ongoing+pending clone jobs. Fixes: https://tracker.ceph.com/issues/61904 Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 65b789e)
1. Let caller check for multiple states. It might happen that clone
finishes while it is being cancelled, in such cases user might want
to check for both.
2. Add a helper method to check if clone is in pending state and add a
separate method to check if clone is in cancelled state.
Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit 10949bf)
Add a helper method that accepts command arguments (along with rest of paramters accepted by the method run_shell()) and return the stdout of the command. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 9f60848)
Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit db0e736)
TestVolumesHelper._do_subvolume_io() is a helper method that allows users to generate data for testing. mgr/vol code that reports progress made by clone jobs depends on the value set for xattr rbytes. It takes a bit of a time for rbytes to be set. And, therefore, all tests in TestCloneProgressReporter needs to wait for subvolume's rbytes xattr's value to be set to the actual amount of data present on the subvolume before proceeding to actually testing. So that this can be achieved make _do_subvolume_io() return size of the data it has generated. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 92aecab)
Clone progress is shown to user through "ceph fs clone status" output and through "ceph status" output. Test both these features. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit e0c85b8)
Update docs and add release notes about the progress report that is printed in output of "ceph fs clone status" command and progress bars that is/are printed in output of "ceph status" command. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 645cc6e)
Test name is test_subvolume_snapshot_info_if_clone_pending_for_no_group, located in class TestSubvolumeSnapshotClones in test_volumes.py 5 seconds can (sometimes) be insufficient as value of the config option "snapshot_clone_delay" in this. Increase it to avoid unnecessary race conditions which leads to irrelevant failures. Following is an example where 5 seconds was insufficient as waiting period since instead it took 8 seconds - 2024-07-28T18:16:10.088 DEBUG:teuthology.orchestra.run.smithi064:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph config set mgr mgr/volumes/snapshot_clone_no_wait False ... 2024-07-28T18:16:18.694 DEBUG:teuthology.orchestra.run.smithi064:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph fs subvolume snapshot info cephfs subvol79370 subvol_snap40980 This issue was seen during testing of PR to which this commit belongs. This commit has been separated from the commit that adds tests for clone progress reporting so that it's easy to document need for this code patch and also track it. This commit is not being moved to a different PR and been kept on the same PR since it can't be reproduced otherwise. This also ensures that commit is backported to older release along with code that caused this issue, causing no one to need to find this commit while backporting effort. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit a6b95a5)
snapshot is retained despite of deletion (using --retain-snapshots option of "subvolume rm" command). Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 9e34499)
Currently timeout is set to 5. But hardcoding this is unnecessary since the class already defines a attribute for this purpose. Use that instead. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit ccd5878)
Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 7239588)
Also add log messages for in these helper methods to allow tracking when and why more threads were spawned. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit a982495)
In class RTimer in mgr_util.py, "self.finished.set()" is run even though the event self.finished was set just now. If it wasn't set, the while loop the precedes it would've never finished running. Therefore, remove this redundant line of code. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 21cf769)
When an exception occurs in class RTimer of mgr_util.py, only the
exception message is logged but not only this is insufficient for
debugging but also it is hard to spot in logs. This should not be the
case, especially for an occurring exception. Therefore, add code to log
traceback and exception name as well along with exception's message.
Log entry before this patch -
2024-09-27T00:22:38.656+0530 7f05c7e006c0 0 [volumes ERROR mgr_util] task exception: dummy exception for testing
Log entry with this patch -
2024-09-27T00:40:26.509+0530 7f61d64006c0 0 [volumes ERROR mgr_util] exception encountered in RTimer instance "<RTimer(Thread-7, started daemon 140058183075520)>":
Traceback (most recent call last):
File "/home/rishabh/repos/ceph/minor3/src/pybind/mgr/mgr_util.py", line 91, in run
self.function(*self.args, **self.kwargs)
File "/home/rishabh/repos/ceph/minor3/src/pybind/mgr/volumes/fs/stats_util.py", line 232, in _update_progress_bars
raise RuntimeError('dummy exception for testing')
RuntimeError: dummy exception for testing
Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit b96d714)
Orignally, when the feature was in development, IDs for clone progress bars were set to randomly generated UUID strings. But, eventually, it was decided to assign fixed strings to them. Unlike UUIDs, these strings stay the same even when progress bars are destroyed and re-created. Therefore, instead of re-assigning the same strings every time initiate_reporting() is called, move them to __init__() so that both the IDs are defined only once. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 3482ebc)
It is a good practice and a common convention to call base class's __init__() method at the beginning of derived class's __init__(). It ensures proper initialization of base class's attributes and methods. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit ad9ff38)
Add some comment to explains the purpose and details of data structures that are used for queuing of async jobs since right now it's not obvious from initialization. Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit 8f7c5f0)
Signed-off-by: Rishabh Dave <[email protected]> (cherry picked from commit ce5d62d)
|
jenkins test pull_request_target |
|
This PR is under test in https://tracker.ceph.com/issues/71055. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@rishabh-d-dave Ping for rebase. |
This backport depends on #61415, #61415 needs to merge first. I've rebased that PR. |
There was a problem hiding this comment.
Automated PR Review - Rebase Required
This PR currently has merge conflicts with the target base branch. Please rebase and resolve the conflicts.
Automated Backport Parity Review - Multiple PRs Detected
This backport appears to pull commits from multiple main PRs including: PR #54620, PR #59712, PR #59847, PR #59848, PR #60008, PR #60027, PR #60117, PR #60119, PR #60153.
This must be made explicit in the backport PR description. Furthermore, each backport tracker ticket associated with these main PRs must be linked to this PR.
Automated PR Review - Rebase Required
Backport commit 7a557274 failed to apply cleanly to the base branch during simulation. The PR likely has conflicts and needs a rebase.
Commit Parity Visualizer
| BACKPORT PR #61416 | SOURCE PR | SOURCE STATUS |
|---|---|---|
| 7a55727 mgr/vol: move reusable parts from async_cloner | PR #54620 | 8c536f7 mgr/vol: move reusable parts from async_cloner |
| 46b062f mgr/vol: improvements and cleanup for "list_volumes()" | 9f355b6 mgr/vol: improvements and cleanup for "list_volumes()" | |
| d848a21 mgr/vol: show progress in "fs clone status" output | d7bc828 mgr/vol: show progress in "fs clone status" output | |
| 6721c9e mgr/vol: show clone progress in "ceph status" output | 65b789e mgr/vol: show clone progress in "ceph status" output | |
| eb6c891 qa/cephfs: improvements for helper methods for clone state | 10949bf qa/cephfs: improvements for helper methods for clone state | |
| c5420a4 qa/cephfs: add method to run and get shell cmd stdout | 9f60848 qa/cephfs: add method to run and get shell cmd stdout | |
| 5b26463 qa/cephfs: use safe_while in test_volumes.py | db0e736 qa/cephfs: use safe_while in test_volumes.py | |
| f0be82a qa/cephfs: return size of data generated in _do_subvolume_io() | 92aecab qa/cephfs: return size of data generated in _do_subvolume_io() | |
| bcb4c18 qa/cephfs: add tests for clone progress | e0c85b8 qa/cephfs: add tests for clone progress | |
| 0db502d doc/cephfs: add release notes and docs for clone progress report | 645cc6e doc/cephfs: add release notes and docs for clone progress report | |
| 14e83f1 qa/cephfs: update a test in test_volumes.py | a6b95a5 qa/cephfs: update a test in test_volumes.py | |
| f25002e qa/cephfs: test clone progress reporter after subvol is deleted but... | PR #59712 | 9e34499 qa/cephfs: test clone progress reporter after subvol is deleted but... |
| 4a4d91f mgr/vol: use pre-defined timeout period instead of hardcoded value | PR #59848 | ccd5878 mgr/vol: use pre-defined timeout period instead of hardcoded value |
| 2356bd5 mgr/vol: reuse code for spawning threads | PR #59847 | 7239588 mgr/vol: reuse code for spawning threads |
| f8a8a87 mgr/vol: add helpers to spawn all threads and more threads | a982495 mgr/vol: add helpers to spawn all threads and more threads | |
| 2e6cb0e mgr/mgr_util: don't set event when it is already set | PR #60008 | 21cf769 mgr/mgr_util: don't set event when it is already set |
| 55de99f mgr/mgr_util: log traceback when exception occurs in RTimer.run() | b96d714 mgr/mgr_util: log traceback when exception occurs in RTimer.run() | |
| 003162e mgr/vol: don't define progress bar ID repeatedly | PR #60027 | 3482ebc mgr/vol: don't define progress bar ID repeatedly |
| c65f871 mgr/vol: better to call base class init() at beginning | PR #60117 | ad9ff38 mgr/vol: better to call base class init() at beginning |
| 48da8f3 mgr/vol: add comments to explain queuing data structures | PR #60119 | 8f7c5f0 mgr/vol: add comments to explain queuing data structures |
| 846edd3 mgr/vol: remove unused variable | PR #60153 | ce5d62d mgr/vol: remove unused variable |
🛟 Need Help?
If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.
📋 Component Lead / Release Manager
To override the audit failure, apply releng-audit-override label or comment /audit override.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
CI Run Log: View Workflow Details
Fixes: https://tracker.ceph.com/issues/69560
Depends on #61415
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e