Skip to content

mgr/vol: show statistics for progress made by clone - #55389

Closed
rishabh-d-dave wants to merge 17 commits into
ceph:mainfrom
rishabh-d-dave:mgr-vol-clone-stats-rstats-only-at-src
Closed

rishabh-d-dave wants to merge 17 commits into
ceph:mainfrom
rishabh-d-dave:mgr-vol-clone-stats-rstats-only-at-src

Conversation

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Add a helpers to check if config has a section and if section has option
set (or as it is said in codebase, key present section).

This will not only help in reducing typing effort and make code more
readable code but it will also bring more uniformity to the code.

Signed-off-by: Rishabh Dave <[email protected]>
Add helpers that can store collected statistics (size and the number of
regular file, directories and symbolic links) and print, log and return
them.

Signed-off-by: Rishabh Dave <[email protected]>
Right now there is no way for users to figure out how much progress has
been made in cloning a snapshot.

Collect total size of data to be copied along with total number of
regular files and directories before cloning. And then everytime some
progress is made in cloning, show amount of data, regular files and
directories copied.

Also show percentage of progress made in output, where the percentage is
"(data copied)/(total data to be copied) * 100".

Fixes: https://tracker.ceph.com/issues/61904
Signed-off-by: Rishabh Dave <[email protected]>
When multiple clones are in progress, print a progress bar where
progress in the average of progress made by all on-going clones. Also
show average of percentage completed and a total number of on-going
clones.

Fixes: https://tracker.ceph.com/issues/61904
Signed-off-by: Rishabh Dave <[email protected]>
A progress bar for just ongoing clones can confuse users. Let's say,
there are 6 clone jobs and 4 async clone threads are allowed. When one
of the 4 jobs completes, percentange completed will reduce and progress
bar will move back because a new job will be instantly moved from pending
state to ongoing state. This progress for this new job will be 0%
(unlike previous job in its place progress of which was 100%). This can
pontentially confuse users.

Another issue is user will never know when all clones, pending as well
ongoing, will come to an end. For example, when there are total 40
clones, 4 in progress and 36 on-going, the progress bar will move back
36 times roughly. This will confuse as well as frustrate user since it
will never know when cloning will end.

To avoid these issues, add a second progess bar in "ceph -s" output
which show progress for both ongoing as well as pending clones.

Fixes: https://tracker.ceph.com/issues/61904
Signed-off-by: Rishabh Dave <[email protected]>
When a volume is deleted while one or more clones are in progress, make
sure that progress bar(s) are removed from the output of command
"ceph -s".

Signed-off-by: Rishabh Dave <[email protected]>
This config option makes async cloner threads sleep for specified
seconds after a regular file is copied. This option is added so that
progress bar will halt after regular files copied. This allows testing
progress bar for CephFS subvolume snapshot clones.

Signed-off-by: Rishabh Dave <[email protected]>
Update code in this method such that it is easier on eyes. Add an empty
line to separate each logical block, use a helper method since
indentation is very high due for "with" clause.

Signed-off-by: Rishabh Dave <[email protected]>
When one or more clones are cancelled, make sure progress bars are
removed from the output of "ceph status" command.

Signed-off-by: Rishabh Dave <[email protected]>
1. Let caller of these helper method decide the period of sleep.
2. Let caller check for multiple states.

Signed-off-by: Rishabh Dave <[email protected]>
Add a helper method to check if clone is in pending state and add a
separte method to check if clone is in cancelled state.

Signed-off-by: Rishabh Dave <[email protected]>
1. Make method __check_clone_state() raise WrongCloneStatus exception
   instead of raising AssertionError so that it is unique and therefore
   easier to catch it.
2. Rename variable "timo" and "check" to more sensible names.
3. Log expected clone state and curren clone state for easy debugging.

Signed-off-by: Rishabh Dave <[email protected]>
2. Don't produce a new random number everytime, rather let the name be a
   series. This is more predictable and helps while debugging tests.
2. Set default value for "n", the parameter through which we tell the
   number of names to be generated.
3. No need to loop when "n=1", return random generated name directly.
4. Starting numbering the names from one. This way last digit of name is
   1 for first name.

Signed-off-by: Rishabh Dave <[email protected]>
Before returning stdout (which is of type "str"), run str method strip()
on it so that whitspace like space character and newline characters are
deleted. Such whitespace characters are an hinderance when this str is
to be used eventually.

Signed-off-by: Rishabh Dave <[email protected]>
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]>
Clone progress is shown to user through "ceph fs clone status" output
and throught "ceph -s" output. Test both these features.

Signed-off-by: Rishabh Dave <[email protected]>
@github-actions github-actions Bot added cephfs Ceph File System pybind tests labels Jan 31, 2024
@rishabh-d-dave
rishabh-d-dave deleted the mgr-vol-clone-stats-rstats-only-at-src branch January 1, 2025 10:33
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.

1 participant