quincy: mgr/nfs: disallow non-existent paths when creating export#50807
Merged
yuriw merged 14 commits intoceph:quincyfrom Aug 17, 2023
Merged
quincy: mgr/nfs: disallow non-existent paths when creating export#50807yuriw merged 14 commits intoceph:quincyfrom
yuriw merged 14 commits intoceph:quincyfrom
Conversation
this helper instantiates CephfsClient, however this was initially planned in ExportMgr class in export.py but due to make check failure where main python thread experienced a dead lock which after several efforts pointed at instantiation of CephfsClient in ExportMgr was problematic, it was decided in order to achieve singleton behavior, func has been added inside this helper func that restricts instantiation using functool's lru_cache. Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 1356992)
Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 6334e10)
Fixes: https://tracker.ceph.com/issues/58228 Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 992c686)
Fixes: https://tracker.ceph.com/issues/58228 Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit b0bb250)
Fixes: https://tracker.ceph.com/issues/58228 Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit afaf251)
Also adds a function _nfs_complete_cmd() that returns process obj so that stdout/stderr can be used for evaluation(_nfs_cmd() uses raw_cluster_cmd() that returns just stdout and it became difficult to time cluster creation errors in _test_create_cluster()). It takes sometime to update the cluster data, therefore running the command set (check nfs server status -> nfs cluster create test -> check cluster status) in a loop (max six iteration with sleep of 5 secs at each iteration) fixes the issue. Fixes: https://tracker.ceph.com/issues/58744 Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 7cb3e58)
…terid' Fixes: https://tracker.ceph.com/issues/58758 Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 3b3fa71)
Comment in the code says to wait for two minutes as cluster creation takes time but actually it's waiting for thirteen minutes, it's not required to wait this long, i think a minute here is more than enough, also switched to using safe_while(). Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 503f867)
_get_port_ip_info() fails to fetch port and ip due to empty 'backend' key:
2023-02-24T20:49:09.084 DEBUG:teuthology.orchestra.run.smithi042:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph nfs cluster info test
2023-02-24T20:49:09.471 INFO:teuthology.orchestra.run.smithi042.stdout:{
2023-02-24T20:49:09.472 INFO:teuthology.orchestra.run.smithi042.stdout: "test": {
2023-02-24T20:49:09.472 INFO:teuthology.orchestra.run.smithi042.stdout: "backend": [],
2023-02-24T20:49:09.472 INFO:teuthology.orchestra.run.smithi042.stdout: "virtual_ip": null
2023-02-24T20:49:09.472 INFO:teuthology.orchestra.run.smithi042.stdout: }
2023-02-24T20:49:09.472 INFO:teuthology.orchestra.run.smithi042.stdout:}
it then raises:
2023-02-24T20:49:10.323 INFO:tasks.cephfs_test_runner: info_output = json.loads(self._nfs_cmd('cluster', 'info', self.cluster_id))['test']['backend'][0]
2023-02-24T20:49:10.323 INFO:tasks.cephfs_test_runner:IndexError: list index out of range
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 310286f)
14 tasks
- Renamed to cephfs_path_is_dir
- Removed exception handling to prevent redundant log statements like:
"No such file or directory error in stat: b'/mnt/testdir_symlink': No such file or directory [Errno 2]"
Exceptions handled inside caller eliminates this redundancy
- Set modifier flag AT_SYMLINK_NOFOLLOW
- Removed string "{path} is not a dir" when raising NotADirectoryError
Rationale: will be handled in export.py
- change mock to cephfs_path_is_dir
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit f3d7370)
in create_cephfs_export() Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit d759fe4)
It actually didn't test the invalid path but still ended with ENOENT(which is expected in case path is invalid) as the test didn't create a fs, and it failed saying "FS nfs-cephfs not found" which too raises ENOENT and thus it always passed. Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 5cc0857)
- test_nfs_export_creation_at_filepath: ENOTDIR is raised instead of EINVAL which is better aligned with the nature of the failure - test_nfs_export_creation_at_symlink: ENOTDIR is raised instead of ENOENT since the code can now check if the path is symlink but won't follow it. Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 0c89625)
Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 7a6ab31)
Contributor
|
jenkins test make check |
1 similar comment
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check |
1 similar comment
Contributor
|
jenkins test make check |
Contributor
|
jenkins test make check |
batrick
approved these changes
Aug 17, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport tracker: https://tracker.ceph.com/issues/59250, https://tracker.ceph.com/issues/59247 and https://tracker.ceph.com/issues/59244
Backport of: #49460
Parent tracker: https://tracker.ceph.com/issues/58228, https://tracker.ceph.com/issues/58744 and https://tracker.ceph.com/issues/58758
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
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 windows