Skip to content

mgr/vol: handle case where clone index entry goes missing#58101

Merged
rishabh-d-dave merged 1 commit intoceph:mainfrom
rishabh-d-dave:async-clone-race
Jul 12, 2024
Merged

mgr/vol: handle case where clone index entry goes missing#58101
rishabh-d-dave merged 1 commit intoceph:mainfrom
rishabh-d-dave:async-clone-race

Conversation

@rishabh-d-dave
Copy link
Contributor

@rishabh-d-dave rishabh-d-dave commented Jun 17, 2024

In async_cloner.py, clone index entry is fetched to get next clone job
that needs to be executed. It might happen that the clone job was
cancelled just when it was going to be picked for execution (IOW, when
it was about to move from pending state to in-progress state).

Currently, in such a case MGR hangs because the exception ObjectNotFound
from CephFS Python bindings is raised and is left uncaught. To prevent
this issue catch an exception, log it and return None to tell get_job()
of async_job.py to look for next job in the queue.

Fixes: https://tracker.ceph.com/issues/66560

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

@rishabh-d-dave rishabh-d-dave requested review from a team and vshankar June 17, 2024 19:13
@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check

@rishabh-d-dave
Copy link
Contributor Author

jenkins test api

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

@rishabh-d-dave rishabh-d-dave requested a review from vshankar June 20, 2024 10:28
@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

@rishabh-d-dave
Copy link
Contributor Author

jenkins test api

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

otherwise lgtm.

@rishabh-d-dave
Copy link
Contributor Author

@vshankar I've squashed the commits and made the change you had suggested. It's ready for review. PTAL.

@rishabh-d-dave
Copy link
Contributor Author

@vshankar Just a reminder, please re-review.

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check

@rishabh-d-dave rishabh-d-dave force-pushed the async-clone-race branch 2 times, most recently from a67d75c to aa0f6ed Compare June 27, 2024 20:29
@rishabh-d-dave rishabh-d-dave added the wip-rishabh-testing Rishabh's testing label label Jun 28, 2024
Copy link
Contributor Author

@rishabh-d-dave rishabh-d-dave left a comment

Choose a reason for hiding this comment

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

https://tracker.ceph.com/projects/cephfs/wiki/Main#11-JUL-2024

Testing took some time because first there were issues with building testing branch, then there were too many infra failures, there were failures due to one of the PRs in the testing branch and finally last run's rerun had new failures that need to be checked.

There were no failures related to this PR, QA was successful.

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check

@rishabh-d-dave
Copy link
Contributor Author

jenkins test api

rishabh-d-dave added a commit to rishabh-d-dave/ceph that referenced this pull request Jul 11, 2024
* refs/pull/58101/head:
	mgr/vol: handle case where clone index entry goes missing

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Kotresh Hiremath Ravishankar <khiremat@redhat.com>
@rishabh-d-dave
Copy link
Contributor Author

jenkins test api

@rishabh-d-dave
Copy link
Contributor Author

rishabh-d-dave commented Jul 11, 2024

I am seeing make check failures that seem unrelated - https://jenkins.ceph.com/job/ceph-pull-requests/138712/consoleFull#-1640523647e840cee4-f4a4-4183-81dd-42855615f2c1. Copying them below -

Identified `/home/jenkins-build/build/workspace/ceph-pull-requests` as project root containing a .git directory.
Found input source directory: "/home/jenkins-build/build/workspace/ceph-pull-requests/src/cephadm/cephadmlib"

Aborted!
check-black: exit 1 (0.45 seconds) /home/jenkins-build/build/workspace/ceph-pull-requests/src/cephadm> black --check -l78 -t py36 --skip-string-normalization -v cephadmlib/ pid=3832823
check-black: FAIL ✖ in 11.96 seconds
check-black: commands[0] /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr> black --check -q -l78 -t py36 --skip-string-normalization smb

Aborted!
check-black: exit 1 (0.27 seconds) /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr> black --check -q -l78 -t py36 --skip-string-normalization smb pid=3951087
check-black: FAIL ✖ in 4.17 seconds

Rebasing the PR...

In `async_cloner.py`, clone index entry is fetched to get next clone job
that needs to be executed. It might happen that the clone job was
cancelled just when it was going to be picked for execution (IOW, when
it was about to move from pending state to in-progress state).

Currently, MGR hangs in such a case because exception `ObjectNotFound`
from CephFS Python bindings is raised and is left uncaught. To prevent
this issue catch the exception, log it and return None to tell
`get_job()` of `async_job.py` to look for next job in the queue.

Increase the scope of try-except in method `get_oldest_clone_entry()` of
`async_cloner.py` so that when exception `cephfs.Error` or any exception
under it is thrown by `self.fs.lstat()` is not left uncaught.

FS object is also passed to the method `list_one_entry_at_a_time()`, so
increasing scope of try-except is useful as it will not allow exceptions
raised in other calls to CephFS Python binding methods to be left
uncaught.

Fixes: https://tracker.ceph.com/issues/66560
Signed-off-by: Rishabh Dave <ridave@redhat.com>
@rishabh-d-dave
Copy link
Contributor Author

rishabh-d-dave commented Jul 11, 2024

make check passed by rebasing PR branch. But API test keep different error each time it is run.

@rishabh-d-dave
Copy link
Contributor Author

jenkins test api

@rishabh-d-dave
Copy link
Contributor Author

CI passed, proceeding to merge. Leaving link to the comment where QA run reported - #58101 (review)

@rishabh-d-dave rishabh-d-dave merged commit e392142 into ceph:main Jul 12, 2024
@rishabh-d-dave rishabh-d-dave deleted the async-clone-race branch July 12, 2024 06:01
NitzanMordhai pushed a commit to NitzanMordhai/ceph that referenced this pull request Aug 1, 2024
mgr/vol: handle case where clone index entry goes missing

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System needs-review pybind wip-rishabh-testing Rishabh's testing label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants