mgr/volumes: Make number of cloner threads configurable
The number of cloner threads is set to 4 and it can't be
configured. This patch makes the number of cloner threads
configurable via the mgr config option "max_concurrent_clones".
On an increase in number of cloner threads, it will just
spawn the difference of threads between existing number of
cloner threads and the new configuration. It will not cancel
the running cloner threads.
On decrease in number of cloner threads, the cases are as follows.
1. If all cloner threads are waiting for the job:
In this case, all threads are notified and required number
threads are terminated.
2. If all the cloner threads are processing a job:
In this case, the condition is validated for each thread after
the current job is finished and the thread is termianted if the
condition for required number of cloner threads is not satisified.
3. If few cloner threads are processing and others are waiting:
The threads which are waiting are notified to validate the
number of threads required. If terminating those doesn't satisfy the
required number of threads, the remaining threads are terminated
upon completion of existing job.
Fixes: https://tracker.ceph.com/issues/46892
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit
83c4442c765bb64f9d4fbd3edcb4967dfa21cafe)
Conflicts:
src/pybind/mgr/volumes/fs/volume.py
- keep connection_pool because nautilus does not introduce
the CephfsClient
src/pybind/mgr/volumes/module.py
- Remove nfs export related things as nautilus doesn't contains NFSExport, FSExport class
qa/tasks/cephfs/test_volumes.py
- nautilus expects particular 'mgr.id', hence used 'mgr.x' instead of 'mgr'