mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
util: add support to configure mirror daemon count
Currently we are assuming that only one rbd mirror daemon running on the ceph cluster but that is not true for many cases and it can be more that one, this PR make this as a configurable parameter. fixes: #4312 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
51d1d46dd2
commit
4c2d2caf9f
@ -553,9 +553,13 @@ func (ri *rbdImage) isInUse() (bool, error) {
|
||||
// because we opened the image, there is at least one watcher
|
||||
defaultWatchers := 1
|
||||
if mirrorInfo.Primary {
|
||||
count, err := util.GetRBDMirrorDaemonCount(util.CsiConfigFile, ri.ClusterID)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
// if rbd mirror daemon is running, a watcher will be added by the rbd
|
||||
// mirror daemon for mirrored images.
|
||||
defaultWatchers++
|
||||
defaultWatchers += count
|
||||
}
|
||||
|
||||
return len(watchers) > defaultWatchers, nil
|
||||
|
Reference in New Issue
Block a user