cephfs: add locks for volumegroup

Adding a lock for the volumegroup so
that we can take care of serializing
the same requests to ensure same requests
are not served in parallel.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2024-02-13 14:24:45 +01:00 committed by mergify[bot]
parent b30da094b0
commit ef25a816a7
2 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,10 @@ type ControllerServer struct {
// A map storing all volumes/snapshots with ongoing operations. // A map storing all volumes/snapshots with ongoing operations.
OperationLocks *util.OperationLock OperationLocks *util.OperationLock
// A map storing all volumes with ongoing operations so that additional operations
// for that same volume (as defined by volumegroup ID/volumegroup name) return an Aborted error
VolumeGroupLocks *util.VolumeLocks
// Cluster name // Cluster name
ClusterName string ClusterName string

View File

@ -67,6 +67,7 @@ func NewControllerServer(d *csicommon.CSIDriver) *ControllerServer {
DefaultControllerServer: csicommon.NewDefaultControllerServer(d), DefaultControllerServer: csicommon.NewDefaultControllerServer(d),
VolumeLocks: util.NewVolumeLocks(), VolumeLocks: util.NewVolumeLocks(),
SnapshotLocks: util.NewVolumeLocks(), SnapshotLocks: util.NewVolumeLocks(),
VolumeGroupLocks: util.NewVolumeLocks(),
OperationLocks: util.NewOperationLock(), OperationLocks: util.NewOperationLock(),
} }
} }