Commit Graph

10 Commits

Author SHA1 Message Date
yati1998
dbd8462bcc cephfs: correct error code for volumegroupsnapshot
this commit corrects the error code used by
groupvolumelocks to acquire snapshots

Signed-off-by: yati1998 <ypadia@redhat.com>
2024-09-24 15:13:12 +00:00
Praveen M
d376271376 cleanup: append pointer instead of value to avoid copying lock value
This commit resolves the govet issue -
`copylocks: call of append copies lock value ... contains sync.Mutex`

Embedding DoNotCopy in a struct is a convention to signal and prevent
shallow copies, as recommended in Go's best practices. This does not
rely on a language feature but is instead a special case within the vet
checker.

For more details, see https://golang.org/issues/8005

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-07-10 12:18:50 +00:00
Madhu Rajanna
f8fbf2e95a journal: add volumeMap to the group
instead of adding single volumes to the
group journal, support adding multiple
volumeID's map to the group journal
which is required for RBD as well.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-06-20 12:22:35 +00:00
Madhu Rajanna
fc0a7d2542 journal: support removing multiple volumeID
Updating the code to support removing
multiple volumeID's mapping from the
group journal.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-06-20 12:22:35 +00:00
Madhu Rajanna
f346f3d201 journal: remove snapshot specific name from group
Adjusted method names to not have any
specific things to volumesnapshot as
we want to reuse the same journal for
volumegroup as well.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-06-20 12:22:35 +00:00
Madhu Rajanna
a362ef6bd4 cephfs: address golangci-lint issues
address golangci-lint issues in cephfs
related code.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-04-09 06:55:23 +00:00
Niels de Vos
8e57efad98 cleanup: use standard Golang "slices" instead of k8s package
The "slices" package has been introduced in Go 1.21 and can be used
instead of the Kubernetes package that will be replaced by the standard
package at one point too.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-03-29 12:42:24 +00:00
Madhu Rajanna
0f724480f5 cephfs: implement DeleteVolumeGroupSnapshot RPC
implemented DeleteVolumeGroupSnapshot RPC which
does below operations

* Basic request validation
* Get the snapshotId's and volumeId's
mapping reserved for the UUID
* Delete snapshot and remove its mapping
from the omap
* Repeat above steps until all the mapping
are removed
* Remove the reserved uuid from the omap
* Reset the filesystem quiesce, This might be
required as cephfs doesnt provide any options to
remove the quiesce, if we get any request with same
ID again we can reuse the quiesce API for same set-id
* Return success if the received error is
Pool not found or key not found.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-03-21 06:16:42 +00:00
Madhu Rajanna
df770e4139 cephfs: implement CreateVolumeGroupSnapshot RPC
implemented CreateVolumeGroupSnapshot RPC which
does below operations

* Basic request validation
* Reserve the UUID for the group name
* Quiesce the filesystem for all the subvolumes
from the input volumeId's
* Take the snapshot for all the input volumeId's
* Add the mapping between volumeId's and snapshot
Id's in omap
* Release the quiesce for the filesystem for
all the subvolumes from the input volumeId's

Undo all the operations if anything fails.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-03-21 06:16:42 +00:00
Madhu Rajanna
445de7926d cephfs: add validateCreateVolumeGroupSnapshotRequest
added validateCreateVolumeGroupSnapshotRequest
to validate the CreateVolumeGroupSnapshotRequest
request and ensure that all the requirement
options are set. if not, reject the RPC request.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-03-21 06:16:42 +00:00