mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
cephfs: retry subvolumegroup creation
Incase the subvolumegroup is deleted
and recreated we need to restart the
cephcsi provisioner pod to clear cache
that cephcsi maintains. With this PR
if cephcsi sees NotFound error duing
subvolume creation it will reset the cache
for that filesystem so that in next RPC
call cephcsi will try to create the
subvolumegroup again
Ref: https://github.com/rook/rook/issues/10623
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 76064d8e34
)
This commit is contained in:
parent
e08143a88b
commit
4face6a7b3
@ -259,6 +259,12 @@ func (s *subVolumeClient) CreateVolume(ctx context.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorLog(ctx, "failed to create subvolume %s in fs %s: %s", s.VolID, s.FsName, err)
|
log.ErrorLog(ctx, "failed to create subvolume %s in fs %s: %s", s.VolID, s.FsName, err)
|
||||||
|
|
||||||
|
if errors.Is(err, rados.ErrNotFound) {
|
||||||
|
// Reset the subVolumeGroupsCreated so that we can try again to create the
|
||||||
|
// subvolumegroup in next request if the error is Not Found.
|
||||||
|
clusterAdditionalInfo[s.clusterID].subVolumeGroupsCreated[s.FsName] = false
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user