-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
journal: omap implementation for volumegroup #4415
Conversation
85287fe
to
49d41ce
Compare
49d41ce
to
86b3fd8
Compare
internal/journal/omap.go
Outdated
log.ErrorLog(ctx, "omap not found (pool=%q, namespace=%q, name=%q): %v", | ||
poolName, namespace, oid, err) | ||
|
||
return nil, util.JoinErrors(util.ErrKeyNotFound, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no need to use the custom JoinErrors
anymore. Use
fmt.Errorf("%w: %w", util.ErrKeyNotFound, err)
instead?
86b3fd8
to
44f0c03
Compare
namespace string, | ||
cr *util.Credentials) (*VolumeGroupJournalConfig, error) | ||
Destroy() | ||
setNamespace(ns string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setNamespace()
is not exported, it probably should be?
} | ||
|
||
// VolumeGroupJournalConfig contains the configuration and connection details. | ||
type VolumeGroupJournalConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably not be exported, only the functions of the interface should be available.
} | ||
} | ||
|
||
// SetNamespace sets the namespace for the journal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer comments for the function (if they do not include implementation details) at the interface. Have you considered that?
- If there is a valid reservation, then the corresponding VolumeGroupData for | ||
the snapshot group is returned | ||
- If there is a reservation that is stale (or not fully cleaned up), it is | ||
garbage collected using the UndoReservation call, as appropriate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unclear to me if after garbage collecting, it creates a new reservation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, its undo the reservation, its caller responsibility to create new reservation, or a new reservation is created in the next RPC call as the reservation is deleted.
44f0c03
to
fa86d0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, thanks!
Note that there still is a JoinErrors
call, please clean that one up too.
fa86d0e
to
f540077
Compare
@nixpanic i have tested the changes with cephfs volumegroupsnapshot locally, the library works as expected. |
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
@Mergifyio queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at dd235d8 |
Added a implementation for the listOmapVals which list the object keys and values from the rados omap. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Implement the required function to store/retrieve the details from the omap for the volumegroup. This adds a new omap object that contains the mapping of the RequestName and all the volumeID and its corresponding snapshotID belonging to a group. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
f540077
to
86da3f1
Compare
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/k8s-e2e-external-storage/1.29 |
/test ci/centos/k8s-e2e-external-storage/1.28 |
/test ci/centos/mini-e2e-helm/k8s-1.29 |
/test ci/centos/upgrade-tests-rbd |
/test ci/centos/mini-e2e-helm/k8s-1.28 |
/test ci/centos/k8s-e2e-external-storage/1.27 |
/test ci/centos/k8s-e2e-external-storage/1.26 |
/test ci/centos/mini-e2e/k8s-1.29 |
/test ci/centos/mini-e2e/k8s-1.28 |
/test ci/centos/mini-e2e-helm/k8s-1.27 |
/test ci/centos/mini-e2e-helm/k8s-1.26 |
/test ci/centos/mini-e2e/k8s-1.27 |
/test ci/centos/mini-e2e/k8s-1.26 |
Implement the required function to store/retrieve the details from the omap for the snapshotgroup.
This adds a new omap object that contains the mapping of the RequestName and all the volumeID and its corresponding snapshotID belonging to a group.
Signed-off-by: Madhu Rajanna madhupr007@gmail.com