Skip to content

squid: mgr/vol: show progress and stats for the subvolume snapshot clones - #61415

Open
rishabh-d-dave wants to merge 11 commits into
ceph:squidfrom
rishabh-d-dave:wip-69561-squid
Open

rishabh-d-dave wants to merge 11 commits into
ceph:squidfrom
rishabh-d-dave:wip-69561-squid

Conversation

@kotreshhr

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

jenkins test api

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase

@batrick
batrick marked this pull request as draft March 18, 2026 14:26
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)

Conflicts:
src/pybind/mgr/volumes/fs/volume.py
- minor conflict: line where open_subvol_in_group is imported is
  slightly different in squid compared to main.
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)
@rishabh-d-dave
rishabh-d-dave marked this pull request as ready for review April 13, 2026 08:10
@joscollin

Copy link
Copy Markdown
Member

@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Backport Parity Review

⚠️ Multiple Original PRs Detected: PR #54620, PR #59712

Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.


Automated Backport Parity Review - Backport Deviation Alert

A conflict or unapproved deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff below to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.

Affected File(s)

Range Diff

Click to expand
--- Original (d7bc8282)
+++ Backport (53e68717)
@@ -9,3 +9,9 @@
 Signed-off-by: Rishabh Dave <[email protected]>
 
 Signed-off-by: Rishabh Dave <[email protected]>
+(cherry picked from commit d7bc8282c860cc234f9ff0f4c4cadbd453a61c83)
+
+Conflicts:
+src/pybind/mgr/volumes/fs/volume.py
+- minor conflict: line where open_subvol_in_group is imported is
+  slightly different in squid compared to main.

================================================================================
RANGE DIFF
================================================================================

1:  d7bc8282c86 ! 1:  53e68717997 mgr/vol: show progress in "fs clone status" output
    @@ Commit message
         Signed-off-by: Rishabh Dave <[email protected]>
     
         Signed-off-by: Rishabh Dave <[email protected]>
    +    (cherry picked from commit d7bc8282c860cc234f9ff0f4c4cadbd453a61c83)
    +
    +    Conflicts:
    +    src/pybind/mgr/volumes/fs/volume.py
    +    - minor conflict: line where open_subvol_in_group is imported is
    +      slightly different in squid compared to main.
     
      ## src/pybind/mgr/volumes/fs/stats_util.py (new) ##
     @@
    @@ src/pybind/mgr/volumes/fs/stats_util.py (new)
     +    }
     
      ## src/pybind/mgr/volumes/fs/volume.py ##
    -@@ src/pybind/mgr/volumes/fs/volume.py: import cephfs
    +@@ src/pybind/mgr/volumes/fs/volume.py: from ceph.fs.earmarking import CephFSVolumeEarmarking, EarmarkException  # type:
      from mgr_util import CephfsClient
      
      from .fs_util import listdir, has_subdir
    @@ src/pybind/mgr/volumes/fs/volume.py: from .operations.volume import create_volum
          list_volumes, open_volume, get_pool_names, get_pool_ids, \
          get_pending_subvol_deletions_count, get_all_pending_clones_count
      from .operations.subvolume import open_subvol, create_subvol, remove_subvol, \
    --    create_clone
    -+    create_clone, open_subvol_in_group
    +-    create_clone, open_subvol_in_vol
    ++    create_clone, open_subvol_in_group, open_subvol_in_vol
      
      from .vol_spec import VolSpec
      from .exception import VolumeException, ClusterError, ClusterTimeout, \

Automated Redmine Linkage Audit

The following tracking irregularities were found:

  • Missing Backport Tracker: Main tracker #66314 does not have a backport tracker for squid. Please adjust the 'Backports' field on the main tracker appropriately and remove 'backport_processed' from 'Tags (freeform)'.
  • Missing Backport Tracker: Main tracker #66313 does not have a backport tracker for squid. Please adjust the 'Backports' field on the main tracker appropriately and remove 'backport_processed' from 'Tags (freeform)'.

Commit Parity Visualizer

BACKPORT PR #61415 SOURCE PR SOURCE STATUS
90c9bfa mgr/vol: improvements and cleanup for "list_volumes()" PR #54620 9f355b6 mgr/vol: improvements and cleanup for "list_volumes()"
53e6871 mgr/vol: show progress in "fs clone status" output d7bc828 mgr/vol: show progress in "fs clone status" output
179a754 mgr/vol: show clone progress in "ceph status" output 65b789e mgr/vol: show clone progress in "ceph status" output
69423e5 qa/cephfs: improvements for helper methods for clone state 10949bf qa/cephfs: improvements for helper methods for clone state
dde96b4 qa/cephfs: add method to run and get shell cmd stdout 9f60848 qa/cephfs: add method to run and get shell cmd stdout
e74256b qa/cephfs: use safe_while in test_volumes.py db0e736 qa/cephfs: use safe_while in test_volumes.py
c18a993 qa/cephfs: return size of data generated in _do_subvolume_io() 92aecab qa/cephfs: return size of data generated in _do_subvolume_io()
d7e1225 qa/cephfs: add tests for clone progress e0c85b8 qa/cephfs: add tests for clone progress
a6df8ec doc/cephfs: add release notes and docs for clone progress report 645cc6e doc/cephfs: add release notes and docs for clone progress report
612d814 qa/cephfs: update a test in test_volumes.py a6b95a5 qa/cephfs: update a test in test_volumes.py
<<<< MISSING IN BACKPORT >>>> 8c536f7 mgr/vol: move reusable parts from async_cloner
9a5ec16 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...

🛟 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.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

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

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label May 14, 2026
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants