mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rbd: add volume locks for reclaimspace operations
This commit adds locks on reclaimspace operations to prevent multiple process executing rbd sparsify/fstrim on same volume. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -20,6 +20,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
|
||||
rs "github.com/csi-addons/spec/lib/go/reclaimspace"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@ -30,7 +32,7 @@ import (
|
||||
func TestControllerReclaimSpace(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
controller := NewReclaimSpaceControllerServer()
|
||||
controller := NewReclaimSpaceControllerServer(util.NewVolumeLocks())
|
||||
|
||||
req := &rs.ControllerReclaimSpaceRequest{
|
||||
VolumeId: "",
|
||||
@ -47,7 +49,7 @@ func TestControllerReclaimSpace(t *testing.T) {
|
||||
func TestNodeReclaimSpace(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
node := NewReclaimSpaceNodeServer()
|
||||
node := NewReclaimSpaceNodeServer(&util.VolumeLocks{})
|
||||
|
||||
req := &rs.NodeReclaimSpaceRequest{
|
||||
VolumeId: "",
|
||||
|
Reference in New Issue
Block a user